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
Pre-public cleanup and a clearer path to deploy in the README (#14)
Amal Irgashev23091098f05c
diff --git a/AGENTS.md b/AGENTS.mdindex 395a4ab..46a9c3e 100644--- a/AGENTS.md+++ b/AGENTS.md@@ -28,19 +28,16 @@ For anything else, start from the map of every document, [docs/README.md](docs/Rprint a key, and ask before deploying, connecting accounts or spending money. The rest of this fileis the contract for changing the agent itself.-Code and tests are the source of truth; `SPEC.md` records the product intent behind them.+Code and tests are the source of truth; [docs/spec.md](docs/spec.md) records the product intent+behind them.## Read first (to change the agent)1. [docs/architecture/](docs/architecture/README.md): how the assembly, harness, surfaces andsandbox fit together.-2. [SPEC.md](SPEC.md): product behavior, slices and acceptance criteria.+2. [docs/spec.md](docs/spec.md): product behavior, slices and acceptance criteria.3. [docs/sources/official-links.md](docs/sources/official-links.md): primary documentation forevery external contract; [docs/upstream.md](docs/upstream.md): seams we work around.-4. Pre-release only (removed before the repository goes public):- [docs/prep/extraction-map.md](docs/prep/extraction-map.md),- [docs/prep/source-inventory.md](docs/prep/source-inventory.md) and- [docs/prep/partner-integrations.md](docs/prep/partner-integrations.md).## Folder boundariesdiff --git a/CHANGELOG.md b/CHANGELOG.mdindex 20977e2..6612619 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -4,6 +4,7 @@### Changed+- The product spec moved to `docs/spec.md`.- `langsmith:anthropic/*` and `langsmith:openai/*` models use the LangSmith Gateway's nativeroutes, 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 turndiff --git a/IMPLEMENTATION_PROMPT.md b/IMPLEMENTATION_PROMPT.mddeleted file mode 100644index 2fa6e6f..0000000--- a/IMPLEMENTATION_PROMPT.md+++ /dev/null@@ -1,198 +0,0 @@-# Implementation prompt--Use this prompt from the repository root in a long-running Claude Code session with the most capable-Claude model available (Fable 5.1 or Opus 5.5) at `high` effort. It is written for a multi-day build.-The model should batch independent reads, keep a short plan with one active step, verify each slice-before continuing, and keep the person informed with short progress updates.--```text-<role>-You are the lead engineer for Design Agent, an open-source design and motion agent built on Deep-Agents, deployable with Managed Deep Agents (MDA) in one command or self-hosted with Docker. Work like-a pragmatic senior agent engineer. Read before deciding. Prefer small, boring, typed solutions. Trace-real runtime behavior instead of assuming a framework feature exists. Keep the person informed with-short progress updates; make the final handoff stand on its own.-</role>--<mission>-Implement the product defined in SPEC.md: one portable Deep Agents core that--- runs an offline demo (scripted model, real graph) that renders a brand-checked still set and a short- HyperFrames film without API keys;-- gives the agent a reproducible "designer's computer" sandbox (Chrome Headless Shell, ffmpeg, pinned- HyperFrames CLI, sharp, ECharts, D2, fonts) with workspace staging and bring-your-own licensed fonts;-- carries the full orchestration harness of the internal reference agent — background helpers on the- lead's sandbox, wake-ups and check-ins, durable helper transcripts and resume, pipelines as code- (launch film), parallel looks, render jobs with watchers, the look tool, context and cost controls,- failure boundaries, steering, live progress and footer, the learning loop — on PUBLIC APIs of the- latest stable managed-deepagents and deepagents releases;-- makes HyperFrames (HeyGen) the video engine and Paper the shared canvas, both first-class, pinned,- attributed and tested;-- encodes design and motion taste as small runtime skills plus a validated, swappable brand pack;-- deploys to MDA with one command and self-hosts with Docker compose, from one shared assembly;-- contains no LangChain-specific content, people, infrastructure, licensed fonts or third-party media.-</mission>--<source_precedence>-1. AGENTS.md is the binding repository operating contract.-2. SPEC.md defines behavior, architecture, slices and acceptance criteria.-3. docs/prep/ (internal build notes): extraction-map.md, partner-integrations.md, source-inventory.md.-4. docs/sources/official-links.md and the live official docs for external contracts.-5. Installed package behavior and live probes. The latest stable managed-deepagents (0.9.3 when this- was written; verify) and deepagents (0.7.28; verify). Never pin a .devN build.-6. The internal reference implementation (read-only, private): ~/Desktop/agents/content-studio at- origin/main (read with `git -C ~/Desktop/agents/content-studio show origin/main:<path>`; the local- working tree may lag). Its sandbox base recipe lives in ~/Desktop/agents/langchain-media- (Dockerfile.sandbox). The Paid Media Agent (~/Desktop/agents/paid-media-agent-open-source, public)- is the pattern for repository shape, docs, onboarding, deployment paths and CI.-7. Model memory is never sufficient evidence for a fast-moving API.--When sources conflict, follow the highest current source and record the conflict in-docs/prep/source-inventory.md. If you have access to the private MDA SDK repository-(langchain-ai/managed-deepagents-sdk), you may read it to understand current behavior, but the public-code may depend only on the published package and public docs.-</source_precedence>--<working_rules>-- Start by reading README.md, AGENTS.md, SPEC.md, every file in docs/prep/ and- docs/sources/official-links.md, then the Paid Media Agent's AGENTS.md, SPEC.md, docs/architecture/- and OPERATIONS.md.-- Identify independent reads first and request them together.-- Maintain a short plan with one active step. Save durable decisions in repository files, not in- conversation history.-- Implement the slices in SPEC.md §22 in order. Finish and verify the current slice before widening- scope. Use targeted edits.-- Before generating code, run Corridor's analyzePlan if that tool is available in this session.-- For any agent behavior, prompt, skill, tool, middleware, routing, policy or evaluation change, apply- the agent-engineering skills when available: rightsizing-agent-context, create-agent-skills,- tool-design, validating-agent-behavior, change-verification; use thermo-nuclear-code-quality-review- for reviews.-- If a reversible action clearly follows from this prompt, do it. Stop and ask only for: deploying to a- real LangSmith workspace or Slack workspace, connecting accounts, spending money on providers beyond- small test calls, contacting partners, licensing or legal decisions, publishing anything, creating a- remote repository, or a real product scope change.-- Do not commit, push, deploy, publish, create remote repositories or connect accounts unless the- person asks. Local commits in this repository are allowed only if the person has said so.-- If you find unrelated problems in the internal reference, report them at the end; do not fix them- there and do not fold them into this repository.-</working_rules>--<extraction_contract>-- This is a fresh repository. Never import internal git history.-- Copy from the internal reference only through an allowlist importer that follows- docs/prep/extraction-map.md, rewrites names, and logs source paths and checksums outside the public- tree. Never copy a file wholesale without running the scrub (names, ids, URLs, people, channels,- brand, internal agents) and the license check.-- Never copy: LangChain logos, marks, palettes or token files; the internal brand package; licensed- fonts (TWK Lausanne, Aeonik Mono); the remocn-ported component library; the reference-film contact- sheets, teardowns or case-study frames; the Cyberpunk fan-kit asset; vendored GSAP files; people- rosters, voice profiles, Slack/LangSmith/Paper/Buffer identifiers; MIGRATION notes, research notes or- internal runbooks.-- Re-vendor HyperFrames skills from upstream at a pinned commit (do not copy the internal copies or- their local edits). Keep the MIT notice for code descending from the MDA SDK example.-- Build the sample brand from scratch (original SVG logo, palette, OFL fonts, voice), CC0 or- Apache-2.0, and use it for every example, fixture, test, screenshot and gallery output.-- Keep a ban-list hygiene test (SPEC §18.4) green from Slice 1 onward.-</extraction_contract>--<architecture_contract>-- One shared AgentComponents assembly under src/design_agent/. agent.py stays a thin MDA entry; the- self-hosted and local entries stay thin. Runtime adapters supply storage, identity, sandbox backend,- waker and transport; they never fork tools, prompts, skills or policy.-- The model owns creative judgment and prose. Code owns rendering, export sizes, fonts, gates,- determinism checks, delivery exactly-once, permissions, cost metering and every number reported.-- Keep the root prompt small (target ≤ 8k tokens with the skill list). Workflows in skills, doctrine in- the design wiki, brand facts in the brand pack, large results in files with compact summaries, the- job on disk (BRIEF.md, PLAN.md, run.json, frozen contract files, per-helper progress files,- DELIVERY.json).-- Never cache per-run objects (task tools, runtime handles, sandbox handles) on middleware instances.-- MDA: use only public APIs. Helpers run in-process behind HelperRunner because MDA 0.9.3 does not- build async subagents that share the lead's sandbox; wake-ups and check-ins use public one-time- runtime schedules behind the Waker interface. Do not import private MDA modules (ingress, loopback,- _channels.*, langgraph_api.server). Measure wake latency and document it. Re-check at Slice 0 and- Slice 10 whether upstream async subagents with lead-sandbox sharing have shipped; if so, plan the- migration in docs and open an issue rather than mixing both paths.-- Skills live one level deep under skills/<name>/ (ours and vendored). MDA mounts them read-only from- Context Hub outside the sandbox; the workspace stager copies scripts and assets into- /workspace/skills/<name>/ and stages workspace tools, the brand pack and fonts with a generated- manifest.-- Live Slack progress, status and footer use the Slack Web API with the reserved MDA connection- `mda/slack-bot-token` and ids from the run's raw event; file delivery uses the SDK's upload_files.-- The sandbox recipe is the single source for MDA bake, the published-snapshot path, the Docker sandbox- runner and CI. Pin every download with a checksum; never @latest. Measure the baked size against- MDA's docker_image bake filesystem cap and choose the bake path at Slice 0.-</architecture_contract>--<partner_contract>-HyperFrames: the only video engine. Pin the CLI. Vendor upstream skills unmodified at a pinned commit-with per-file checksums, LICENSE and NOTICE; override in our own sibling skills. Providers (TTS,-audio) go through host tools; the sandbox holds no keys. Port video-gate brand-neutral. Add a-HyperFrames progress parser to render watchers. Render smoke tests in CI.--Paper: Local (stdio `paper mcp` or http://127.0.0.1:29979/mcp) and Bridged (bundled bearer bridge in-front of the user's Paper Desktop over a tunnel they own; MDA's define_mcp supports HTTP/SSE only)-modes; Off mode renders boards in the sandbox and attaches them. Host-enforced allowlist, scheme-refusal after unescaping, protected brand file, default drafts file, export allowed in Local and-Bridged, degrade one missing tool not the whole MCP layer. Verify the real MCP tool-name separator.--Collect partner questions in docs/prep/partner-integrations.md §3. Do not contact partners.-</partner_contract>--<security_contract>-Treat model output, user files, Slack events, Paper canvas content and comments, MCP metadata, web-pages and reference media as untrusted. Credentials stay in environment or deployment secrets, never in-prompts, state, sandbox files, logs, errors, Slack blocks, fixtures, snapshots or tests. Default-deny-sandbox egress at runtime. SSRF-harden user-URL fetches. Selection is not authorization: resolve the-exact tool, validate arguments, apply scope policy, sanitize errors. No outward actions beyond replying-in the thread and editing configured Paper drafts. Automated tests never call live providers unless-DESIGN_AGENT_LIVE_TESTS=1.-</security_contract>--<taste_contract>-Port judgment, not volume. Small skills that teach process and judgment; the brand as hard rules;-taste as observations the agent weighs. Storyboard first for motion. Fewest words on graphics.-Concept first, never generic node wallpaper. The agent looks at its own renders and fixes what is off.-A clear ask gets finished work. Speak in a teammate's words. Every doctrine rule in the public wiki-names its evidence (a measurement on a film this project made, or a public linkable source); rewrite or-drop rules whose only evidence is internal or third-party media. No LLM taste judge.-</taste_contract>--<code_quality>-Python 3.11+, uv, Pydantic v2, Ruff, mypy (strict for new modules; ported harness modules may start on-a documented gradual list that must reach zero before v0.1), pytest, absolute imports, immutable typed-domain objects, constructor injection, narrow provider adapters, sanitized errors, short exact-docstrings, comments only for constraints the code cannot express. No build journals, session handoffs-or audit transcripts in the repository.-</code_quality>--<verification>-For each slice:-1. Name the acceptance requirement and the failure each test prevents.-2. Run the smallest tests first, then Ruff and mypy on touched code, then the full offline suite.-3. For render work, inspect actual outputs (open the PNG/MP4 frames, ffprobe) — not only exit codes.-4. Update the owning architecture page, skill, README/OPERATIONS section and CHANGELOG entry.--Before the final handoff run: clean `uv sync` from the lockfile; full offline suite; scripted demo;-render smoke suite in the sandbox image; real-graph contract suite; ban-list and license inventory;-gitleaks; docs link and command checks; MDA definition import smoke and a clean-checkout `mda build`-(inspect what Context Hub would sync); self-hosted assembly import and Postgres persistence smoke; the-design eval set on the available models with recorded results.--Do not weaken an assertion, widen a tolerance, or regenerate a golden to make a failure pass. Find the-root cause.-</verification>--<completion>-The task is complete only when every slice in SPEC.md §22 is implemented and verified, or an explicit-external blocker prevents it (for example a deploy that needs the person's approval, or a partner-answer). If a part is blocked, finish all independent work and state the exact blocker, evidence and-remaining commands.--End with a concise handoff: what users can do now; the important architecture, security and partner-boundaries; files changed; tests and commands run with results; live or external checks intentionally-not run; open release gates from SPEC.md §24.--Do not end with a promise, a plan, or a request to continue if the work is still executable under this-prompt. Execute it first.-</completion>-```diff --git a/README.md b/README.mdindex 794a071..74e45ae 100644--- a/README.md+++ b/README.md@@ -1,6 +1,6 @@<div align="center"><p>- <a href="https://www.langchain.com/">+ <a href="https://www.langchain.com/?utm_source=github&utm_medium=readme&utm_campaign=design-agent"><picture><source media="(prefers-color-scheme: dark)" srcset="https://github.com/langchain-ai/design-agent/raw/main/docs/assets/readme/logos/langchain-company-dark.svg"><img src="https://github.com/langchain-ai/design-agent/raw/main/docs/assets/readme/logos/langchain-company-light.svg" alt="LangChain" width="152">@@ -15,11 +15,11 @@<a href="LICENSE"><picture><source media="(prefers-color-scheme: dark)" srcset="https://shieldcn.dev/badge/license-Apache%202.0-7FC8FF.svg?variant=outline&logo=lu:Scale&mode=dark"><img src="https://shieldcn.dev/badge/license-Apache%202.0-006DDD.svg?variant=outline&logo=lu:Scale&mode=light" alt="License: Apache 2.0"></picture></a><a href="https://www.python.org"><picture><source media="(prefers-color-scheme: dark)" srcset="https://shieldcn.dev/badge/python-3.11%2B-7FC8FF.svg?variant=outline&logo=python&mode=dark"><img src="https://shieldcn.dev/badge/python-3.11%2B-006DDD.svg?variant=outline&logo=python&mode=light" alt="Python 3.11+"></picture></a><a href="https://github.com/langchain-ai/deepagents"><picture><source media="(prefers-color-scheme: dark)" srcset="https://shieldcn.dev/badge/built%20on-Deep%20Agents-7FC8FF.svg?variant=outline&logo=lu:Layers&mode=dark"><img src="https://shieldcn.dev/badge/built%20on-Deep%20Agents-006DDD.svg?variant=outline&logo=lu:Layers&mode=light" alt="Built on Deep Agents"></picture></a>- <a href="https://docs.langchain.com/langsmith/python/managed-deep-agents-overview"><picture><source media="(prefers-color-scheme: dark)" srcset="https://shieldcn.dev/badge/deploy-Managed%20Deep%20Agents-7FC8FF.svg?variant=outline&logo=lu:Rocket&mode=dark"><img src="https://shieldcn.dev/badge/deploy-Managed%20Deep%20Agents-006DDD.svg?variant=outline&logo=lu:Rocket&mode=light" alt="Deploy with Managed Deep Agents"></picture></a>+ <a href="https://docs.langchain.com/langsmith/python/managed-deep-agents-overview?utm_source=github&utm_medium=readme&utm_campaign=design-agent"><picture><source media="(prefers-color-scheme: dark)" srcset="https://shieldcn.dev/badge/deploy-Managed%20Deep%20Agents-7FC8FF.svg?variant=outline&logo=lu:Rocket&mode=dark"><img src="https://shieldcn.dev/badge/deploy-Managed%20Deep%20Agents-006DDD.svg?variant=outline&logo=lu:Rocket&mode=light" alt="Deploy with Managed Deep Agents"></picture></a></p><p>- <b><a href="#see-it-work">▶ Watch the 2-minute film</a></b> ·- <b><a href="#get-started">Get started in 5 minutes</a></b> ·+ <b><a href="#deploy-it">Put it in your team's Slack →</a></b> ·+ <a href="#get-started">Try the demo, no keys needed</a> ·<a href="docs/README.md">Docs</a></p></div>@@ -53,7 +53,8 @@ https://github.com/user-attachments/assets/0664d09d-2ab2-41fd-b2ba-f91c96121e20[HyperFrames](https://hyperframes.heygen.com), D2 and your fonts, plus a shared[Paper](https://paper.design) canvas for storyboards and layouts. Keys stay outside it.- **Slack that holds up on long jobs:** a lead that plans and gives an ETA, takes notes mid-job,- hands long work to helpers running in parallel, and asks before anything goes public.+ hands long work to helpers (subagents) running in parallel, and asks before anything goes+ public.- **Everything to run it:** one-command deploy to Managed Deep Agents or self-hosting with Docker,evals built from real requests, and every run traced in LangSmith.@@ -116,21 +117,26 @@ Everything on this page uses LangChain's brand, because that's the one we run. L## Deploy it+Open the repo in Claude Code, Codex or Cursor and say "Deploy it to our Slack." The+[deploy skill](.agents/skills/design-agent-deploy/SKILL.md) publishes the sandbox, shows you exactly+what will ship and deploys after your yes. It's how we run ours at LangChain.+| | Managed Deep Agents (recommended) | Self-hosted || --- | --- | --- || Start | `uv run design-agent sandbox publish`, then `uv run design-agent deploy` | `docker compose -f deploy/self-host/compose.yaml up -d --build` |-| Who runs it | LangSmith | you: the API, Postgres and a Docker host |-| Slack | a managed app you authorize | your own Slack app |+| Who runs it | LangSmith: the agent, a sandbox per thread, the Slack app and the schedules, with secrets and tracing | you: the API, Postgres, a Docker host for the sandboxes and your own Slack app || Guide | [Deploy with MDA](docs/deploy-mda.md) | [Self-hosting](docs/self-hosting.md) |-`deploy` shows exactly what it will ship and asks first. `deploy --name design-agent-test` gives you-a separate copy to try changes on.+Try it before your team depends on it: the demo needs no keys, and `deploy --name design-agent-test`+gives you a separate copy to try changes on. It's Apache 2.0, so you can move to self-hosting at any+time.## Questions**What does it cost?** The code is free (Apache 2.0). You pay your model provider: at LangChain themedian request costs about 50 cents in model spend, and long films and decks cost more. Managed Deep-Agents [hosting is paid](https://www.langchain.com/pricing).+Agents [hosting is paid](https://www.langchain.com/pricing?utm_source=github&utm_medium=readme&utm_campaign=design-agent); it runs the agent, the sandboxes,+the Slack app and the schedules that you'd otherwise build and operate yourself.**Will it use my brand?** Yes. Add your brand pack and every file follows it. The[brand-onboarding skill](.agents/skills/brand-onboarding/SKILL.md) builds the pack with you from@@ -156,7 +162,7 @@ the work only they can do, and their judgment lives on in its skills and checks.The model makes the creative calls. Code does everything that has to be exactly right: rendering,measuring, checking, delivering files and holding your keys. It's built on the[Deep Agents](https://github.com/langchain-ai/deepagents) harness and runs on-[Managed Deep Agents](https://docs.langchain.com/langsmith/python/managed-deep-agents-overview) or+[Managed Deep Agents](https://docs.langchain.com/langsmith/python/managed-deep-agents-overview?utm_source=github&utm_medium=readme&utm_campaign=design-agent) oryour own infrastructure.Read the [architecture](docs/architecture/README.md), or start changing it:@@ -164,21 +170,21 @@ Read the [architecture](docs/architecture/README.md), or start changing it:[Evals](docs/evals.md) · [Operations](OPERATIONS.md) · [Contributing](CONTRIBUTING.md).**Build your own.** Fork it, add your brand tokens, fonts and skills, and deploy it to your team's-Slack. [Get started](#get-started).+Slack. [Get started](#get-started). If it's useful, a star helps other teams find it.## Built with<p><a href="https://github.com/langchain-ai/deepagents"><picture><source media="(prefers-color-scheme: dark)" srcset="https://github.com/langchain-ai/design-agent/raw/main/docs/assets/readme/logos/deep-agents-dark.svg"><img src="https://github.com/langchain-ai/design-agent/raw/main/docs/assets/readme/logos/deep-agents-light.svg" alt="Deep Agents" height="28"></picture></a> - <a href="https://docs.langchain.com/langsmith/python/managed-deep-agents-overview"><picture><source media="(prefers-color-scheme: dark)" srcset="https://github.com/langchain-ai/design-agent/raw/main/docs/assets/readme/logos/langsmith-deployment-dark.svg"><img src="https://github.com/langchain-ai/design-agent/raw/main/docs/assets/readme/logos/langsmith-deployment-light.svg" alt="LangSmith Deployment" height="28"></picture></a>+ <a href="https://docs.langchain.com/langsmith/python/managed-deep-agents-overview?utm_source=github&utm_medium=readme&utm_campaign=design-agent"><picture><source media="(prefers-color-scheme: dark)" srcset="https://github.com/langchain-ai/design-agent/raw/main/docs/assets/readme/logos/langsmith-deployment-dark.svg"><img src="https://github.com/langchain-ai/design-agent/raw/main/docs/assets/readme/logos/langsmith-deployment-light.svg" alt="LangSmith Deployment" height="28"></picture></a> <a href="https://hyperframes.heygen.com"><picture><source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/heygen-com/hyperframes/main/docs/logo/dark.svg"><img src="https://raw.githubusercontent.com/heygen-com/hyperframes/main/docs/logo/light.svg" alt="HyperFrames" height="28"></picture></a> <a href="https://paper.design"><img src="https://avatars.githubusercontent.com/u/178361271?s=56" alt="Paper" height="28" align="absmiddle"> <b>Paper</b></a></p>-Also: [LangSmith](https://smith.langchain.com) ·+Also: [LangSmith](https://smith.langchain.com/?utm_source=github&utm_medium=readme&utm_campaign=design-agent) ·[Chrome Headless Shell](https://developer.chrome.com/blog/chrome-headless-shell) ·[FFmpeg](https://ffmpeg.org) · [D2](https://d2lang.com) · [Apache ECharts](https://echarts.apache.org) ·[sharp](https://sharp.pixelplumbing.com). Logos belong to their owners. HyperFrames and Paper arediff --git a/docs/README.md b/docs/README.mdindex 3fb25ab..ea03936 100644--- a/docs/README.md+++ b/docs/README.md@@ -34,6 +34,7 @@ which one fits.| Guide | Covers || --- | --- |+| [Product spec](spec.md) | what it's for, how it should behave, and the acceptance criteria || [Architecture](architecture/README.md) | the assembly, the lead and helpers, context, the sandbox, checks, keys || [Orchestration](architecture/orchestration.md) | background helpers, wake-ups, restarts, pipelines || [Context and failures](architecture/context-and-failures.md) | what the model sees, caching, cost, failure boundaries |diff --git a/docs/prep/extraction-map.md b/docs/prep/extraction-map.mddeleted file mode 100644index 18cfd0b..0000000--- a/docs/prep/extraction-map.md+++ /dev/null@@ -1,145 +0,0 @@-# Extraction map: internal agent → Design Agent--> Internal build note. Paths on the left refer to the private source repository-> (`content-studio` @ `f87d644`, read with `git show origin/main:<path>`). Never copy a file-> wholesale without passing it through the scrub and license checks in SPEC §17. Delete-> `docs/prep/` before the first public push.--Actions:--- **KEEP**: port with light edits (names, config, imports). Behavior unchanged.-- **GENERALIZE**: port the mechanism; remove company content; move constants to config or the brand- pack; rewrite examples against the sample brand.-- **REWRITE**: the idea survives, the code or text does not (written fresh for the public repo).-- **REPLACE**: superseded by a public upstream feature (latest MDA, Deep Agents, HyperFrames, Paper).-- **EXCLUDE**: not part of the open-source product. Never copied.-- **DEFER**: valuable, out of v1 scope; listed as a roadmap item with its extension point.--Target paths are relative to the new repository root.--## 1. Agent definition and assembly--| Source | Action | Target | Notes |-| --- | --- | --- | --- |-| `agent.py` (245) | REWRITE | `agent.py` (thin, ≤40 lines) + `src/design_agent/assembly.py` | One `build_agent_components(settings, runtime)` shared by MDA, self-host and CLI, as in the Paid Media Agent. Social, quote, LinkedIn, Notion, Webflow, handoff wiring and card-action maps are removed. Feature flags become typed `Settings` fields. |-| `subagents.py` (188) | GENERALIZE | `src/design_agent/assembly.py` (`build_subagents`) | Keep one worker declared at three effort levels plus `general-purpose`. Rewrite `WORKER_PROMPT` without the internal name, cost figures or knowledge paths; keep its contracts (read named files first, own only assigned files, progress file, `report_progress`, image budget, stop at time or quality bar, reviewers do not fix, never deliver). Effort levels must map to whatever the configured model supports (capability registry). |-| `models.py` (544) | GENERALIZE | `src/design_agent/models/` | Direct providers by default (`provider:model`), LangSmith gateway as an optional preset (`langsmith:provider/model`), as in the Paid Media Agent. Remove the hard-coded gateway origin. Keep: exact-id capability registry (vision, tool search, effort levels, output ceilings, thinking/cache behavior), the Opus fallback profile logic, stall timeout, SDK retries at 0 with our retry middleware, cache TTL per role. Prune the internal model list to verified public ids. |-| `instructions.md` (76) | REWRITE | `instructions.md` | Generic identity ("a design agent for your team"), delegation contract, delivery contract, approval rules, translation rule (speak in a teammate's words, never tool names), storyboard-first rule, brand source precedence. No peer agents, no Slack ids, no people roster, no internal deployment notes. Keep under ~80 lines; everything else lives in skills. |-| `identity.py` | KEEP | `identity.py` | `define_identity(auth=auth.langsmith_api_key())`; document MDA's Supabase identity for private per-user conversations. |-| `memory.py` (48) | GENERALIZE | `memory.py.example` (off by default) | Per-user memory off by default (privacy); shared agent memory opt-in. Document the trade-offs as the Paid Media Agent does. |-| `NOTICE.md`, `licenses/managed-deepagents-sdk-MIT.txt` | REWRITE / KEEP | `NOTICE.md`, `licenses/` | Provenance for code descending from the MIT SDK example; HyperFrames skills (Apache-2.0); OFL fonts; ECharts (Apache-2.0); vtake-skills (MIT) if graphic-overlays ships; D2 (MPL-2.0, binary in image only). |--## 2. Harness (orchestration core)--The internal `harness/` package (18 files, 6,438 lines) imports only the standard library,-langchain, langchain_core and langgraph. It is the main value to carry.--| Source | Action | Target | Notes |-| --- | --- | --- | --- |-| `harness/events.py`, `policy.py`, `inbox.py`, `notices.py` | KEEP | `src/design_agent/harness/` | Event bus, attention policy (wake now / next turn / log only), coalesced wake-up inbox with retries, notice text. |-| `harness/tasks.py`, `ledger.py`, `wakeups.py`, `protocols.py` | KEEP | same | Background task records and heartbeats, self-scheduled check-ins, `HelperRunner`/`SandboxExec` protocols. Add a `Waker` protocol (SPEC §7.4). |-| `harness/durable.py` | KEEP | same | Helper transcript checkpoints and `resume_task`. Re-verify against the latest Deep Agents: if it now checkpoints background subagents natively, REPLACE and delete ours (SPEC §7.3). |-| `harness/workflow.py` | KEEP | same | Pipelines as code (memoized steps, `ask` operator questions, resume). |-| `harness/branches.py` | KEEP | same | Parallel creative "looks" (folders per look, pick and merge with backup). |-| `harness/offload.py`, `watch.py` | KEEP | same | Detached render jobs and log watchers. Add a HyperFrames progress parser and make the default parser `heartbeat`, not `remotion`. |-| `harness/cache.py`, `context.py` | KEEP | same | Cache TTL, tools breakpoint, prefix watch, stagger gate; server-side tool-result clearing; image-aware token counts. Re-verify against current provider APIs and Deep Agents summarization. |-| `harness/meter.py` | GENERALIZE | same | Move the price table to `config/prices.toml` with a date and source link; cost is an estimate. |-| `harness/learning.py` | KEEP | same | Per-skill observation store (save, read, rate, merge, decay). Optional feature, on by default once the store exists. |-| `docs/harness/*.md` | GENERALIZE | `docs/architecture/orchestration.md` and siblings | Public explanations of each primitive, with the upstream mapping table. |-| `tests/harness/*`, `tests/test_{background,look,looks,learning,watch,pipeline,harness_surface,subagents}.py` (244 tests) | KEEP | `tests/unit/harness/`, `tests/contract/` | Rewrite fixtures that mention internal names. |--## 3. Middleware--| Source | Action | Target | Notes |-| --- | --- | --- | --- |-| `middleware/background.py`, `watch_tools.py`, `pipeline_tools.py`, `looks_tools.py`, `learning_tools.py`, `look.py`, `meter.py` | GENERALIZE | `src/design_agent/middleware/` | Type against a runtime adapter interface, not `ManagedDeepAgentRuntime` directly. `LOOK_MODEL` from config. Wake-ups go through `Waker` (MDA adapter on public APIs; self-host adapter in-process). |-| `middleware/boundary.py` (484) | REWRITE | `src/design_agent/assembly.py` + `runtime/mda.py` | Assembly of guards and parent-only middleware, subagent construction. Remove every private MDA import (`_channels.slack.middleware`, `_ingress`, `_ingress_runs`, `_loopback`, `langgraph_api.server`). |-| `middleware/model_retry.py`, `step_budget.py`, `image_clamp.py`, `tool_error_boundary.py`, `tool_history.py`, `drop_base_prompt.py`, `today.py` | KEEP | same | Model failure boundary (errors never end a run silently), step budget wrap-up, image MIME and size clamp, tool error boundaries, stale `tool_reference` repair, base prompt drop, date note. |-| `tools/disclosure.py` | GENERALIZE / REPLACE | `src/design_agent/middleware/tool_disclosure.py` | Provider-native deferred tool search for verified Anthropic/OpenAI models; `LLMToolSelectorMiddleware` otherwise (Paid Media pattern). Keep the search-header trick for deferred MCP tools. `ALWAYS_SHOWN_SERVERS` from config. Prefer the upstream middleware where it now covers this. |-| `middleware/progress.py`, `phrasebook.py`, `footer.py`, `agent_session.py`, `steering.py` | GENERALIZE | `src/design_agent/middleware/` (+ self-host Slack adapter) | Streaming progress per agent, plain-language step names, reply footer (agents running, time, cost, trace link host from config), Slack agent status, mid-job steering. Phrasebook loses Notion/Hex/Webflow/GTM/Buffer entries. Prefer native MDA Slack streaming/status APIs where the latest SDK provides them (SPEC §12). |-| `middleware/workspace.py` (467) | GENERALIZE | `src/design_agent/middleware/workspace.py` | Stage workspace tools, the active brand pack and fonts into the sandbox with a manifest and sha check; licensed-font setup becomes data-driven from `brand/fonts.toml` (no hard-coded families, no woff2 sha constants). managed-deepagents 0.9.3 has no `deployment_files` or declarative sandbox file sync; keep the stager and upload through `runtime.backend.upload_files`. Skills are mounted read-only from Context Hub outside the sandbox, so the stager must also copy skill scripts into `/workspace/skills/<name>/`. |-| `middleware/paper_scope.py` | GENERALIZE | `src/design_agent/middleware/paper_scope.py` | See partner-integrations §2.4. |-| `middleware/memory_policy.py`, `memory_hot_cap.py`, `memory_learnings.py`, `owner_memory.py` | GENERALIZE | `src/design_agent/middleware/memory/` | Layout allowlist and preference-file shape become config; hot cap stays (200 lines / 12k chars). Only installed when memory is enabled. |-| `middleware/tracing.py`, `trace_labels.py` | GENERALIZE | `src/design_agent/middleware/tracing.py` | Generic run tags (`trigger`, `surface`, `delivered`); no user ids in tags by default. |-| `middleware/slack_actions.py` | DEFER | — | Code-drawn cards are only needed for approvals in the excluded publishing module. |-| `middleware/routines.py` | DEFER (v0.2) | `src/design_agent/routines/` | Housekeeping sweep stays in v1 (§5); user-owned routines are a v0.2 slice with generic sources only. |-| `middleware/asked_only.py`, `bot_callers.py`, `agent_requests.py`, `card_replies.py`, `lazy_connection.py`, `publish_ledger.py`, `notion_scope.py`, `webflow_scope.py` | EXCLUDE (v1) | — | Internal channels, peer agents, quote cards, Managed Tools, company publishing. The exactly-once publish ledger is a documented pattern for a future publishing plugin. |--## 4. Tools--| Source | Action | Target | Notes |-| --- | --- | --- | --- |-| `tools/media.py` (707) | GENERALIZE | `src/design_agent/tools/media.py` | `generate_image` (OpenAI direct by default; model id configurable and passed through, never allowlisted; transparency reported), `generate_voiceover` / `generate_sound_effect` / `generate_music` (ElevenLabs, optional), `transcribe_audio` (local `hyperframes transcribe` default; Groq optional). Remove `fetch_epidemic_asset` (Epidemic excluded in v1). Host-side only; results dropped into `/workspace/...` as files. |-| `tools/files.py`, `projects.py`, `flags.py` | KEEP | `src/design_agent/tools/` | Binary I/O, `list_recent_projects`, `get_render_status`, flag parsing (typed settings replace most flags). |-| `tools/mcp.py` | GENERALIZE | `src/design_agent/tools/mcp.py` + `config/mcp.example.toml` | Config-driven servers. Zero servers is valid (the internal import raised "No MCP server is configured"). Ships: Paper (modes per partner doc), optional Exa (web research for references), optional GitHub read-only (for `pr-to-video`). One failing server never removes the others. |-| `tools/paper.py`, `scripts/paper_mcp_bridge.py` | GENERALIZE | `src/design_agent/tools/paper.py`, `src/design_agent/paper_bridge/` | Local and Bridged modes; the cloud-worker auth flow is not wired by default. |-| `scripts/paper_cloud_worker.py`, `paper_oauth_bootstrap.py`, `paper_oauth_macos.swift`, `docs/runbooks/paper.md` | REWRITE (docs only) | `docs/partners/paper-hosted-worker.md` | Recipe and caveats, no operator identities, no sign-in hand-off app. |-| `tools/slack.py`, `slack_read.py`, `slack_ui.py` | GENERALIZE | `src/design_agent/tools/slack.py`, `surfaces/slack/` | Thread and file reads as the asker could, file fetch; remove `ASKED_ONLY` constants. Cards deferred. |-| `tools/grounding.py` (Drive/Docs) | DEFER | — | Optional host tool later; document how to add a read-only grounding tool to the assembly. |-| `tools/agents.py`, `connect.py`, `managed_tools.py` (+ catalog), `hosted_assets.py`, `person_memory.py`, `voices.py`, `compose_quote.py`, `draft_quote.py`, `quote_card.py`, `trace_flag.py`, `ledger/*`, `social/*`, `routines.py`, `routine_options.py`, `routine_tick.py`, `schedule_run.py` | EXCLUDE (v1) / DEFER | — | Peer handoffs, Managed Tools, public asset hosting, quote copilot, launch ledger, social publishing. Routines DEFER to v0.2 with generic sources (RSS/Atom, web page, Slack links). |--## 5. MDA project declarations--| Source | Action | Target | Notes |-| --- | --- | --- | --- |-| `channels/slack.py` | GENERALIZE | `channels/slack.py` | Name, description, icon, color from settings (Paid Media pattern). Keep the @mention-only trigger option as a setting, default to the platform's default behavior. |-| `channels/reactions.py` | EXCLUDE | — | Keep only the platform's default acknowledgement (eyes). |-| `sandbox/__init__.py` | REWRITE | `sandbox/__init__.py` | Public base image (`docker_image=` a pinned public base) plus `setup.sh` bake; size from settings (default 8 vCPU / 16 GiB for motion; document smaller sizes for stills-only use); idle TTL; default timeout. No snapshot names. |-| `sandbox/setup.sh` | GENERALIZE | `sandbox/setup.sh`, `sandbox/Dockerfile` | Fold in the public parts of the internal base image (Node, ffmpeg, Chrome Headless Shell via `hyperframes browser ensure`, sharp, ECharts, D2, open fonts, fontconfig) so the whole computer is reproducible from the repository. Pin every download with a sha256. Drop `yt-dlp` (third-party video download is not a product feature), Playwright's second Chromium (point renderers at one browser), licensed fonts, brand assets and video-kit. Fail the bake on a lint + draft-render smoke test. |-| `schedules/housekeeping.py` | KEEP | `schedules/housekeeping.py` | Sweep helpers, watches and wake-ups killed by a restart; ends in code before any model call. |-| `pipelines/__init__.py`, `pipelines/launch_film.py` | GENERALIZE | `src/design_agent/pipelines/` | Keep the launch-film pipeline; paths point at the public `launch-film` skill. |-| `asset-manifest.json`, `base-image-assets.json`, `scripts/check_deploy_tree.py`, `scripts/refresh_base_assets.py` | REWRITE | `scripts/build_manifest.py`, `scripts/check_deploy_tree.py` | Generated manifest (no hand-pinning), private fonts declared in the brand pack, check that required inputs exist before deploy. No base-image upload optimization in v1 (the public recipe does not bake project files). |--## 6. Runtime skills--| Source skill | Action | Target skill | Notes |-| --- | --- | --- | --- |-| 16 HyperFrames skills (`hyperframes`, `-core`, `-cli`, `-animation`, `-creative`, `-media`, `-registry`, `faceless-explainer`, `slideshow`, `website-to-video`, `pr-to-video`, `music-to-video`, `embedded-captions`, `graphic-overlays`, `general-video`, `remotion-to-hyperframes`) | REPLACE | `skills/<upstream-name>/` (top level, listed in `skills-lock.json`) | Re-vendor from upstream at a pinned commit, unmodified, with LICENSE and NOTICE. Do not carry the 93 local edits. Remove the CDPR fan-kit asset if upstream still ships it (non-commercial terms) and any vendored GSAP file (load GSAP from the image instead). |-| `motion-studio` (engine + wiki) | GENERALIZE (wiki) / EXCLUDE (engine) | `motion-direction` (+ `references/` pages) | Port the wiki doctrine (directing, craft, techniques, sound, review) as HyperFrames-oriented guidance. Drop the canvas engine, `brand.js` palettes, mark loaders and font gates. Re-evidence rules (SPEC §11.3). |-| `launch-film` | GENERALIZE | `launch-film` | Keep phases, sizing tables, decomposition rules, effort-per-role table, every brief template, `orchestration.md`, `storyboard.md`. Remove `case-studies/agent-platform/` and `case-studies/engine-teaser/` and every line citing them; replace with a case study the agent makes for the sample brand during Slice 9. |-| `film-breakdown` | KEEP | `film-breakdown` | Measure any film the user supplies (cuts, contact sheets, motion energy, beat grid, audio). |-| `video-references` | REWRITE | `reference-study` | The method, not the library: study a user-supplied film frame by frame, write a teardown into Git-ignored `workspace/references/`, and propose observations or skill edits for a person to approve. |-| `video-storyboard` | GENERALIZE | `storyboard` | Brand paths → brand pack. |-| `ad-creative` | GENERALIZE | `stills` (or keep name `ad-creative`) | `html2png.mjs` must read fonts from the brand pack and render with open fonts when no licensed fonts are configured. |-| `data-viz` | GENERALIZE | `data-viz` | Move the hard-coded token object into brand-pack reads; replace examples that name people or LangChain diagrams. |-| `image-ops`, `gif-edit`, `visual-verify`, `film-breakdown` | KEEP | same | Generic. |-| `gpt-image` | GENERALIZE | `image-generation` | Keep craft; remove gallery entries without a clear license; brand rubric reads the brand pack. |-| `score-video` | GENERALIZE | `sound` | ElevenLabs adapters optional; synthesized cue library kept; remove Epidemic and Gemini paths. |-| `brand-design` | GENERALIZE | `brand-design` | Keep the concept gate, ground/accent/type framework; brand facts come from the brand pack. |-| `media-production` | GENERALIZE | `media-production` (router) | Request routing, storyboard-to-render process, delivery contract, Paper routing rule. |-| `content-brief` | GENERALIZE | `content-brief` | Intake for vague requests; no Notion campaign docs. |-| `youtube-thumbnail` | GENERALIZE | `thumbnails` | Craft and gates kept; `channel-today.md` (internal channel and people) removed. |-| `youtube-upload`, `youtube-workflow` | DEFER | — | Upload needs OAuth and publishing policy (v0.2 publishing plugin). |-| `paper-design` | GENERALIZE | `paper-design` | Connection-mode aware; no team/brand-book ids. |-| `routines` | DEFER (v0.2) | `routines` | Ships with the routines slice. |-| `social-learning`, `social-onboarding`, `compose-post`, `technical-blog` | EXCLUDE (v1) | — | Copy and social are outside the design scope; `compose-post`'s human-voice protocol may inform `brand/voice.md` guidance. |-| `analytics`, `community-publishing`, `draft-queue`, `social-amplification`, `quote-ideas`, `langchain-media-render`, `langchain-brand-guidelines`, `video-component-library` | EXCLUDE | — | Internal, trademarked or unlicensed. |--## 7. Workspace--| Source | Action | Target | Notes |-| --- | --- | --- | --- |-| `workspace/tools/video-gate.mjs`, `artifact-contract.mjs`, `text-fidelity.mjs`, `audio-lint.mjs`, `fetch-asset.mjs` (SSRF-hardened), `html2pdf.mjs`, `review-thumb.mjs`, `film-analysis.mjs`, `film-probe.mjs`, `video-score.mjs` | KEEP / GENERALIZE | `workspace/tools/` | Rename the `--lc-*` token prefix to a neutral `--brand-*`; remove the font name in `html2pdf.mjs`. `video-gate` stops calling brand-lint implicitly. |-| `workspace/tools/brand-lint.mjs` (1,141) | GENERALIZE | `workspace/tools/brand-lint.mjs` | Add `--tokens <path>` (default the active brand pack); move font-stack, casing and replacement-color rules into the token JSON; delete LangChain product casing rules. |-| `workspace/knowledge/brand/*`, `langchain-tokens.*`, `paper-reference.json` | REWRITE | `examples/brands/example-studio/`, `workspace/brand/README.md`, `src/design_agent/brand/schema.py` | Keep the token *schema* (`design.allowedColors`, `extendedPalette`, `officialAssetColors`, `bannedColors`, `allowedFontTokens`, `knownOffBrandFonts`, `maxRectRadiusPx`, `creativeTypography`, `diagramConstruction`, `copy.*`) as a documented, validated JSON schema. |-| `workspace/knowledge/platforms/platforms-and-content-types.md`, `brand-applications.md` | GENERALIZE | `skills/design-wiki/platforms.md` | Platform sizes and specs are generic; drop the internal email footer. |-| `workspace/knowledge/references/design-tooling-figma-paper.md` | GENERALIZE | `docs/partners/paper.md` | Public facts only. |-| `workspace/knowledge/strategy/*` | GENERALIZE (frameworks) / EXCLUDE (examples, voice corpus) | `skills/design-wiki/` | Intake framework and quality rubric survive; internal examples do not. |-| `workspace/knowledge/campaigns/*`, `references/langchain-products-glossary.md`, `hex-analytics-workspace.md`, `analytics-and-self-optimization.md`, `team/people.json` | EXCLUDE | — | Internal. |-| `workspace/video-kit/r/` (115 remocn ports), `references/` (70 films), `case-studies/` | EXCLUDE | — | Unlicensed or third-party media. `video-kit/tools/ref-analyze.py` → KEEP as `skills/film-breakdown/scripts/`. |-| `workspace/video-kit/VIDEO-DIRECTION.md`, `VIDEO-DESIGN-LANGUAGE.md`, `motion/` presets | GENERALIZE | `skills/motion-direction/` | Grammar kept; brand-correctness layer reads the brand pack; motion presets renamed off `LCMotion`. |-| `workspace/skills-lock.json` | REWRITE | `skills-lock.json` | Add `commit`, `license`, per-file `sha256`; CI verifies. |-| `fonts/*` (OFL) | KEEP | `fonts/` | Keep `LICENSES.md` and `OFL-1.1.txt`; rewrite `README.md` and `MDA-BUILD.md`. |--## 8. Tests, scripts and docs--| Source | Action | Target |-| --- | --- | --- |-| Harness, guards, Slack surface, media, memory tests (≈770 tests) | KEEP / GENERALIZE | `tests/unit`, `tests/contract` |-| MCP and Paper scope tests | GENERALIZE | `tests/unit/test_paper_scope.py`, `tests/unit/test_paper_bridge.py` |-| Workspace and assets tests (snapshot name, font pins) | REWRITE | `tests/unit/test_workspace_stager.py`, `tests/render/` |-| Social, quote, ledger, voice, handoff tests (~25 files, ~420 tests) and `tests/fixtures/ledger/*` | EXCLUDE | — |-| `scripts/evals/routines_eval.py` | DEFER | v0.2 routines slice (remove its private MDA import) |-| `scripts/traces.py`, `local_probe.py`, `reactions_eval.py`, `voice/*`, `ledger/*`, `probe_managed_tools.py` | EXCLUDE | — |-| `docs/design/tool-disclosure.md`, `docs/design/memory.md`, `docs/harness/*`, `docs/local-testing.md` | GENERALIZE | `docs/architecture/*`, `docs/development.md` |-| `docs/design/social-*`, `qt-copilot.md`, `personal-posting.md`, `scheduling-migration.md`, `docs/research/*`, `docs/runbooks/social-rollout.md`, `MIGRATION.md`, `migration-notes/*`, `.claude/skills/content-studio-traces`, `.cursor/rules/*` | EXCLUDE | — |diff --git a/docs/prep/partner-integrations.md b/docs/prep/partner-integrations.mddeleted file mode 100644index c6ddfe1..0000000--- a/docs/prep/partner-integrations.md+++ /dev/null@@ -1,195 +0,0 @@-# Partner integrations: HyperFrames and Paper--> Internal build note. It references the internal source agent for extraction purposes. Delete-> `docs/prep/` (or move its surviving facts into public docs) before the first public push.--Design Agent is co-launched with two partners. HyperFrames (HeyGen) is the video engine and Paper is-the shared design canvas. Both integrations must be first-class, attributed, pinned, testable without-private infrastructure, and degrade gracefully when the user has not connected them.--## 1. HyperFrames (HeyGen)--### 1.1 What it is to this agent--HyperFrames turns HTML into video: a composition is a web page with timing in `data-*` attributes and-motion on a paused GSAP timeline, rendered frame by frame in Chrome Headless Shell and encoded with-ffmpeg, so the same file always renders the same video. The CLI is the agent's timeline panel:--| Command | Agent use |-| --- | --- |-| `hyperframes init --non-interactive [--example …]` | scaffold a project in `/workspace/projects/<slug>/` |-| `hyperframes lint [--json]` | catch broken timing and contract violations before a render |-| `hyperframes validate` | composition contract check |-| `hyperframes inspect [--json --samples N --at t]` | overflowing text, layout drift |-| `hyperframes snapshot --at <t>` | one frame to look at (the preview server is unreachable from Slack) |-| `hyperframes render --quality draft\|standard\|high --fps 24\|30\|60 --output <file> [--variables-file …]` | final and draft renders |-| `hyperframes add <block>` | registry blocks |-| `hyperframes capture <url>` | website-to-video source capture |-| `hyperframes transcribe --model …`, `tts`, `remove-background` | media helpers |-| `hyperframes browser ensure`, `doctor` | bake-time Chrome Headless Shell install and warm-up |--Verify every flag against the pinned CLI's `--help` during Slice 0. The internal agent used a-`--resolution square-4k` flag that is not in the CLI reference; do not carry undocumented flags.--### 1.2 v1 decisions--- **HyperFrames is the only video engine in v1.** The internal agent also has a bespoke 2D canvas- engine ("motion-studio") that is tied to its own brand palette, fonts and logos and never calls- HyperFrames. Do not port the engine. Port its *judgment* (the motion wiki's directing, craft,- techniques, sound and review doctrine, scrubbed and re-evidenced) as runtime skills that drive- HyperFrames compositions.-- **Pin, do not float.** The internal sandbox installed `hyperframes@latest` at bake time and the- skills were a June pull with no commit pin. The open-source recipe pins an exact CLI version and an- exact upstream skills commit; a scheduled compatibility job proposes upgrades.-- **Vendor the skills unmodified.** Pull the current upstream skill set from- `heygen-com/hyperframes` at a pinned commit into top-level `skills/<upstream-name>/` folders (MDA- discovers skills only one level deep), with the upstream LICENSE and a NOTICE, and record each in- `skills-lock.json` with the commit and per-file sha256. Do not reapply the internal agent's 93 local edits: they were routing and- brand text. Put local routing, provider overrides and brand-neutral guidance in our own skills- that sit beside the vendored ones (for example `motion-direction`, `storyboard`, `launch-film`).- If an override needs a vendored file changed, upstream it.-- **Use the current upstream layout.** Upstream split skills since the internal June pull- (`hyperframes-audio`, `hyperframes-keyframes`, `media-use`). Vendor what upstream ships at the- pinned commit; do not resurrect retired internal skills.-- **Providers stay host-side.** Upstream skills can call HeyGen TTS or audio APIs with- `$HEYGEN_API_KEY` from inside the sandbox. The sandbox never holds keys. Route voice and music- through host tools (`generate_voiceover`, `generate_music`, `generate_sound_effect`) and, if HeyGen- offers an open-source key or a host-side API, add a host-tool adapter for it.-- **Render watching.** Long renders run detached (`start_render_job`) with a watcher that wakes the- lead on exit, failure or stall. Add a HyperFrames progress parser (the internal watcher had parsers- for remotion, ffmpeg, json and regex, but none for HyperFrames, and defaulted to `remotion`).- Ask HeyGen for machine-readable render progress (see questions).-- **Determinism gate.** Keep `video-gate` (rejects `Math.random(`, `Date.now(`, `new Date()`,- timers, `requestAnimationFrame`, unpaused timelines and other seek-breaking patterns) and make it- brand-neutral: it must not call a brand linter with hard-coded tokens.-- **Attribution.** README "Built with" section, NOTICE entry, the HyperFrames skills LICENSE, and a- pull request to add Design Agent to HyperFrames' `ADOPTERS.md` once the repository is public and- HeyGen agrees.--### 1.3 Sandbox recipe (HyperFrames parts)--Node 22 LTS (verify HyperFrames' supported range), ffmpeg, Chrome Headless Shell via-`hyperframes browser ensure` into a fixed cache dir, the pinned `hyperframes` CLI on PATH, fonts-registered with fontconfig, `text-rendering: geometricPrecision` defaults in templates. The recipe-fails the bake if `hyperframes lint` and a 1-second draft `render` of the bundled fixture composition-do not succeed and produce a non-empty MP4 with the expected duration and dimensions (ffprobe).-Do not install two Chromiums unless a renderer needs both (the internal image carried Playwright's-Chromium and HyperFrames' headless shell); prefer one and point other renderers at it.--### 1.4 HyperFrames acceptance tests--- Vendored skills match `skills-lock.json` (upstream repo, commit, path, sha256 per file).-- Fixture composition lints, validates, snapshots at t=1.0s, and renders a 2 s 1920x1080 MP4 in the- sandbox; ffprobe confirms duration within one frame and a non-blank first and last frame.-- `video-gate` rejects each banned pattern with a fixture and passes the clean fixture.-- Watcher parses HyperFrames progress (or a heartbeat when none is emitted) and wakes the lead on- exit 0, non-zero exit, and a stall.-- A source-blind eval: asked for a 15 s teaser, the agent lints and snapshots before rendering and- delivers one final MP4.--## 2. Paper--### 2.1 What it is to this agent--Paper is a design canvas people and the agent both edit. The agent writes HTML onto the canvas, where-it becomes layers a designer can grab and move, and reads boards, tokens, comments and screenshots-back. It is the default surface for new visual work that people will want to point at and nudge-(layouts, storyboards, thumbnails, campaign graphics), while renders still happen in the sandbox.--### 2.2 Transport facts--- Paper's MCP server runs inside Paper Desktop. Desktop installs a `paper` CLI; the recommended- transport is the stdio server `paper mcp`. The legacy HTTP endpoint `http://127.0.0.1:29979/mcp`- is served only while a file is open.-- There is no documented hosted or token-based remote MCP. Free plans have MCP call limits that Pro- lifts.-- The internal agent ran Linux Paper Desktop under Xvfb on an always-on cloud sandbox, signed in- once as an operator through a custom sign-in hand-off app, fronted by a team-scoped bearer bridge.- That works but is heavy, depends on undocumented Linux Desktop support, and is not a reasonable- default for open-source users.--### 2.3 Connection modes (v1)--| Mode | When | How |-| --- | --- | --- |-| **Local** (default for the CLI and Studio) | the agent runs on the same machine as Paper Desktop | stdio `paper mcp` (preferred) or `http://127.0.0.1:29979/mcp`; host-side MCP client; no bridge |-| **Bridged** (self-host or MDA, advanced) | the agent runs elsewhere and the user runs Paper Desktop on a machine they control | the bundled `paper-bridge` (Starlette MCP proxy) in front of the local MCP, reachable over a tunnel the user owns, with a ≥32-byte bearer token, DNS-rebinding allowlist, team check and tool allowlist; the token is an MDA connection or self-host secret |-| **Hosted worker** (experimental, documented recipe only) | a team wants an always-on shared Paper session | the Linux-Desktop-under-Xvfb worker pattern, documented as a recipe with its caveats, not wired by default; replace with a partner-hosted endpoint when Paper ships one |-| **Off** | Paper not configured | boards render as PNG/PDF in the sandbox and are attached to the thread; the agent says Paper is not connected once and continues |--### 2.4 Tool policy (host-enforced)--Port the internal scope middleware, generalized:--- Allowlist reads (`get_basic_info`, `get_selection`, `get_node_info`, `get_children`,- `get_screenshot`, `get_jsx`, `get_tree_summary`, `get_computed_styles`, `get_fill_image`,- `find_nodes`, comment-thread reads, `get_tokens`, `get_font_family_info`, `get_guide`), edits- (`create_artboard`, `create_page`, `write_html`, `set_text_content`, `rename_nodes`,- `update_styles`, `duplicate_nodes`, `move_nodes`, `finish_working_on_nodes`), files (`list_resources`- or its current name, `open_file`, `create_file`) and, in Local and Bridged modes, `export` and- `export_combined_pdf` (the internal "Paper can't export" limit was a property of the cloud bridge,- not of Paper).-- Deny deletes, token writes and page/file reorganization by default; they are opt-in per- deployment and still never touch the protected brand file.-- Deny `paper-gen:` (AI image generation billed to the user's Paper plan) unless the operator- enables it; deny `paper-asset:` and `file:` schemes after HTML-unescaping arguments.-- `PAPER_BRAND_FILE_ID` (optional) is read-only. `PAPER_DRAFTS_FILE_ID` (optional) is the default- target when a call omits `fileId`.-- Re-check the allowlist against the server's advertised tools at connect time and degrade one- missing tool, not the whole MCP layer. Do not pin `include_tools` in a way that turns a Paper-side- rename into a total MCP outage. Paper renamed `list_files` to `list_resources` and made- `get_font_family_info` file-scoped in October 2026; tool names are not yet a stable contract.-- One failing MCP server must never remove the others or the agent's other tools.--### 2.5 Workflow contracts--- Storyboards: frames go to a Paper page (editable twin) and the sign-off board is exported (Local or- Bridged) or rendered in the sandbox (Off or Hosted) and attached to the thread. The thread always- gets an image people can approve.-- Brand import: the brand-onboarding coding-agent skill can read a Paper file's tokens, palette and- type nodes (`get_tokens`, `get_computed_styles`, `get_jsx`) to draft `workspace/brand/tokens.json`- and `graphic-language.md`. A person reviews the result.-- Receipts: record Paper file id, page id and link in the project's `run.json`; never store tokens.-- Always call `get_guide(topic="paper-mcp-instructions")` once per session, pass `fileId`- explicitly, check with `get_screenshot`, and call `finish_working_on_nodes` when done.--### 2.6 Paper acceptance tests--- Scope middleware: allowlist, denied tools, scheme refusal after unescaping, brand-file write and- clone refusal, default file fill, missing-tool degradation (unit tests against a fake MCP server).-- Bridge: bearer compare, rebinding allowlist, path guard, team check (unit tests).-- Contract test with a fake Paper MCP through the real graph: storyboard written to a page, export- attached, receipt recorded.-- Opt-in live test (developer machine with Paper Desktop open): read `get_basic_info`, write one- artboard to a scratch file, screenshot it, export a PNG, clean up.--## 3. Partner questions--### For HeyGen (HyperFrames)--1. Confirm the license covering the skills folder (the package and repository are Apache-2.0).-2. Versioned skill releases or a recommended commit pin; is `hyperframes skills check` the supported- drift check?-3. Recommended way to override routing or providers (host-side TTS) without forking skill files.-4. Where bundled SFX audio and the matting model live (the internal pull lacked the binaries).-5. Machine-readable render progress for watchers (JSON lines on stderr or a progress file).-6. Is `@latest` plus `--docker` the recommended reproducibility path, or a pinned CLI?-7. Registry pinning: should the agent pin the registry to a tag instead of `main`?-8. An open-source key or free tier for HeyGen TTS/audio, and the status of cloud render targets.-9. Telemetry defaults inside sandboxes and how to disable them.-10. GSAP licensing guidance: the upstream graphic-overlays skill vendors GSAP (GSAP Standard License);- should open-source users load it from a CDN at render time instead?-11. Co-marketing: ADOPTERS listing, a joint example in their catalog, and a quote for the launch post.--### For Paper--1. A hosted or remote MCP, or a headless/service-account mode, for agents that run in the cloud.-2. Multi-user authorization and team scoping for a shared agent.-3. How `export` and `export_combined_pdf` bytes should reach a remote agent.-4. A supported raster import path without `paper-asset:` or `file:` URLs.-5. Tool-name stability and a version or capability endpoint.-6. Pagination for files and directories beyond 200 entries.-7. Targeting a file without changing the user's active Desktop file.-8. Agent call limits per plan and `paper-gen:` pricing.-9. Official Linux Desktop support (needed only for the hosted-worker recipe).-10. Co-marketing: a Paper integration page, a template file for the sample brand, and a quote.diff --git a/docs/prep/source-inventory.md b/docs/prep/source-inventory.mddeleted file mode 100644index 18f6846..0000000--- a/docs/prep/source-inventory.md+++ /dev/null@@ -1,137 +0,0 @@-# Source inventory--> Internal build note. Lists the private and public sources this build extracts from and the-> versions it targets. Delete `docs/prep/` before the first public push; move surviving version-> facts into `CHANGELOG.md` and `docs/architecture/`.--## Sources to extract from--| Source | Revision | Role | Access |-| --- | --- | --- | --- |-| Internal design agent ("Content Studio"), MDA app | `origin/main` @ `f87d644` (2026-10-16) | primary source for harness, middleware, tools, skills, sandbox recipe, tests | private repo `content-studio` on the builder's machine (`~/Desktop/agents/content-studio`). Read committed code with `git show origin/main:<path>`; the local working tree can lag `origin/main` |-| Internal source assets (pre-MDA app) | `origin/main` @ `ccc0eec`; asset snapshot `a94f68e` | `Dockerfile.sandbox` base-image recipe, original renderers and skills | private repo `langchain-media` (`~/Desktop/agents/langchain-media`) |-| MDA SDK example lineage | `managed-deepagents-sdk` `examples/content-studio` @ `18a218a` (MIT) | origin of the internal MDA app; its MIT notice must be preserved for any code that descends from it | private SDK repo (LangChain staff); the published package is public |-| Paid Media Agent (open source) | `4b47399` | the pattern to follow: repository shape, docs, onboarding, two deploy paths, CI, release discipline | public `github.com/langchain-ai/paid-media-agent`; local `~/Desktop/agents/paid-media-agent-open-source` |-| HyperFrames | release `v0.8.169` (2026-10-17); Apache-2.0 | video engine CLI and agent skills | public `github.com/heygen-com/hyperframes`, npm `hyperframes` |-| Paper Desktop MCP | current Desktop release | shared canvas | `paper mcp` stdio CLI or `http://127.0.0.1:29979/mcp` |--The internal agent was the subject of the "How we built our Design Agent" launch post. The public-name is **Design Agent**; "Content Studio" is the internal codename and may appear only in-`NOTICE.md` provenance.--## Baseline health of the source (measured 2026-10-17)--- `origin/main` exported with `git archive`, `uv sync --frozen --all-extras --dev`, then- `uv run --frozen pytest -q`: **2,441 passed** in 106 s, offline, no `.env`.-- 2,190 tracked files: skills 977, workspace 868, tests 140 (122 Python files, 44,822 lines,- 1,589 test functions before parametrization), tools 57, middleware 39, docs 26, scripts 24,- harness 18 (6,438 lines, no MDA imports), fonts 10.-- No `Makefile`, `langgraph.json`, Dockerfile, CI workflow or top-level `LICENSE` on `main`. Gates- are listed in its `AGENTS.md` (`ruff check`, `ruff format --check`, `basedpyright`, `pytest`,- `scripts/check_deploy_tree.py`).-- The sandbox base snapshot is built outside the repo (from `langchain-media/Dockerfile.sandbox`)- and carries licensed fonts, the internal brand package, the video-kit and June copies of the- HyperFrames skills. The open-source build must replace it with a public, reproducible recipe.--## Target framework versions (verify on Slice 0)--| Package | Latest stable on 2026-10-17 | Internal pin | Paid Media pin | Target |-| --- | --- | --- | --- | --- |-| `managed-deepagents` | **0.9.3** (dev: 0.10.0.dev9) | `==0.9.0.dev2` (dev build) | `>=0.6.1,<0.7` | latest stable at build time, `>=0.9.3,<0.10`; never a `.devN` pin in a release |-| `deepagents` | **0.7.28** | `>=0.7.5,<0.8` | `>=0.7.12,<0.8` | `>=0.7.28,<0.8` |-| `langchain`, `langgraph`, `langchain-anthropic`, `langchain-openai`, `langchain-mcp-adapters`, `mcp` | resolve at build | | | current compatible, explicit upper bounds on pre-1.0 packages |-| `hyperframes` (npm) | `0.8.169` | `@latest` at bake | n/a | exact pin in `sandbox/setup.sh`, upgrade through the weekly compatibility job |-| HyperFrames skills | upstream `main` at a pinned commit | June 2026 pull, hash-only lock, 93 local edits | n/a | pinned commit + per-file sha256 in `skills-lock.json`, unmodified |--The internal agent depends on private MDA modules in two places (`middleware/boundary.py` for-background wake-ups through MDA's private ingress and loopback, and `tools/connect.py` for Agent-Auth). The open-source build must use only public APIs from the latest stable release; see SPEC §7.--## Slice 0 compatibility table (verified 2026-10-17)--Installed and resolved by `uv lock` (Python 3.13.15): managed-deepagents 0.9.3, deepagents 0.7.28,-langchain 1.4.6, langchain-core 1.6.12, langgraph 1.2.16, langchain-anthropic 1.7.6,-langchain-openai 1.7.2, langsmith 0.14.11, fastmcp 4.1.0, mcp 2.3.0. Evidence is the installed-package source unless noted; "SDK source" means the private SDK repository at tag `v0.9.3`, read-for behavior only.--| Contract | Verified behavior | Design consequence |-| --- | --- | --- |-| `define_deep_agent` | keyword surface of `create_deep_agent` minus `backend`, `store`, `checkpointer`, `system_prompt`, `state_schema`; accepts `SubAgent`, `CompiledSubAgent`, `AsyncSubAgent`; `instructions`/`mcp`/`sandbox`/`skills`/`memory` selections only from a factory entry; `metadata` lands on the root run | `agent.py` stays a static definition; the static prompt is `instructions.md` |-| `define_sandbox` | typed `idle_ttl_seconds`, `default_timeout`, `snapshot_name`/`snapshot_id`/`docker_image` (mutually exclusive), `registry`, `proxy_config`; unmodeled keys pass through as LangSmith create options; `scope` must be `thread` | `vcpus`, `mem_bytes`, `fs_capacity_bytes` pass through (they are `langsmith.sandbox` create parameters) |-| `docker_image` bake | SDK source `deploy/bake.rs`: a snapshot built from a Docker image gets a fixed 1 GiB filesystem; `setup.sh` runs in a builder sandbox, then the snapshot is captured | the recipe unpacks to 1,351 MB (below), so `docker_image` cannot hold it: publish a snapshot with `--fs-gib` and declare it as the bake base |-| Declaring a sandbox | MDA sets `permissions=[]` when a sandbox backend is present (deepagents drops route prefixes at `execute` time); skills mount read-only at `/skills/` from Context Hub | read-only enforcement relies on the mount; the stager copies runnable skill files into `/workspace/skills/` |-| Slack file delivery | `SlackFileTransferMiddleware` (installed by MDA on the parent when the Slack channel is declared) adds `upload_files(paths)` (1-10 files, 200 MiB each, `/workspace` paths only) and stages inbound files to `/workspace/attachments/`; hidden when the run has no Slack destination | the agent delivers with `upload_files`; a declared subagent does not inherit it (deliver from the lead) |-| `connections.get` | public; `connections.get("mda/slack-bot-token", {"type": "agent"})` is how MDA's own file transfer reads the bot token | live progress and footer use the Slack Web API with that reserved connection |-| `runtime.channel` | `RuntimeChannel(name, provider, event, raw_event, post)`; `post` sends one extra message; no update or streaming | progress messages need the Web API (`chat.update`/streaming) |-| `runtime.schedules.create` | needs an active run's runtime (reads `assistant_id`, `thread_id`); `at` is rounded **up** to the next whole minute and must be ≥ 1 minute ahead (`_schedule_time.py`); agent-owned same-thread schedules need a channel binding, otherwise use `new_thread=True` or a user owner; per-owner cap 20 via `MDA_MAX_AGENT_SCHEDULES` / `MDA_MAX_USER_SCHEDULES`; a one-time schedule expires 5 minutes after `at` | MDA wake latency is 60-120 s plus scheduler lag by construction: the coalescing inbox batches into one schedule; documented, upstream ask recorded (SPEC §24 #1) |-| `define_mcp` | HTTP/SSE only (stdio rejected); `prefix_tool_name_with_server_name` removed in 0.9: native names are `{server}_{tool}` | the internal `{server}__{tool}` rules would silently miss; scope and deferral rules use `{server}_` |-| MCP client (local, self-host) | `langchain.mcp.MCPAdapter` (FastMCP 4, MCP 2) is the client MDA uses and names tools `{server}_{tool}`; `langchain-mcp-adapters` 0.3.2 still requires `mcp<2` | use `langchain[mcp]` everywhere; do not add `langchain-mcp-adapters` |-| `define_memory` | `define_memory(agent=MemoryLayer(), user=MemoryLayer())`; `scope=` raises in 0.9.3 | `memory.py.example` uses layers |-| Async subagents | deepagents `AsyncSubAgent` specs (`graph_id`) pass through MDA unwrapped; MDA builds one graph per deployment and does not run them against the lead's sandbox | `HelperRunner` runs helpers in-process (SPEC §7.2); re-check at Slice 10 |-| Model profiles | langchain-anthropic 1.7.6 ships a `claude-opus-5-5` profile (1M input, 128k output, effort low/medium/high/xhigh/max); `ChatAnthropic(model="claude-opus-5-5").max_tokens == 128000`. deepagents 0.7.28 harness profiles stop at Opus 4.7 | the local Opus 5.5 fallback profile is no longer needed (SPEC §6.2 retire rule); the registry keeps effort and output-floor rules |-| Gateway | `init_chat_model("langsmith:provider/model")` builds `ChatOpenAI` (Responses API) against the LangSmith Gateway with `LANGSMITH_GATEWAY_API_KEY` or `LANGSMITH_API_KEY` | `langsmith:` is the optional preset; never required |-| `mda` CLI | `init`, `build`, `dev`, `chat`, `deploy` (`--no-wait`, `--push-to`, `--deployment-type`), `connections`, `channels`, `logs`, `delete`, `evals`; hidden `prepare` for GitHub-sourced builds; `mda dev` also bakes the recipe and needs `LANGSMITH_API_KEY`; `[tool.mda] python-version` is read from `pyproject.toml` | `design-agent deploy` wraps `mda deploy .` |--HyperFrames 0.8.169 (npm `hyperframes`, Apache-2.0, `gitHead` = upstream release commit-`7735338b49ed6e11c227b0710da3bd35c3366b9c`, Node ≥ 22):--| Item | Verified |-| --- | --- |-| Commands | `init --example <name> --non-interactive [--resolution]`, `lint [--json]`, `check` (lint + runtime + layout + motion + WCAG contrast; replaces the deprecated `validate` and `inspect`), `snapshot --at t[,t…] [--frames N] [-o dir]`, `render [-o file] [--fps] [--quality draft|looks|delivery|standard|high] [--format mp4|webm|mov|gif|png-sequence|hls] [--variables-file] [--batch] [--workers] [--strict]`, `transcribe`, `tts` (local Kokoro), `remove-background`, `browser ensure|path|clear`, `doctor`, `telemetry enable|disable|status`, `skills check|update` |-| Not present | `--resolution square-4k` on render (the internal flag); use `--resolution` presets listed by `render --help` |-| Browser | pins Chrome Headless Shell 152.0.7977.30 for linux64; honors `HYPERFRAMES_BROWSER_PATH`; Chrome for Testing has no linux-arm64 build, and the amd64 build crashes (SIGTRAP) under emulation on Apple Silicon unless run single-process |-| Environment | `HYPERFRAMES_NO_TELEMETRY`/`DO_NOT_TRACK`, `HYPERFRAMES_NO_UPDATE_CHECK`, `HYPERFRAMES_NO_AUTO_INSTALL`, `HYPERFRAMES_SKIP_SKILLS`; the sandbox wrapper sets all of them |-| `init` default | loads GSAP from a CDN; sandbox egress is default-deny, so compositions use the GSAP the image installs (copied into the project) |-| Upstream skills at the release commit | 21 skills, 944 files, ~16.5 MB; `music-to-video` and `talking-head-recut` each vendor `gsap.min.js`; `embedded-captions` ships 57 woff2 fonts (license to confirm, partner question) |--Paper: Paper Desktop installs `~/.paper/bin/paper`; `paper mcp` is the stdio relay; the legacy HTTP-endpoint `http://127.0.0.1:29979/mcp` answers MCP POSTs while a file is open (a bare GET returns-404). The live tool list on 2026-10-17 has 37 tools, including `list_resources` (formerly-`list_files`), `get_font_family_info`, `export`, `export_combined_pdf`, `write_html`,-`delete_nodes`, `set_tokens`, `create_tokens`, `rename_resource`, `arrange_pages`, `update_pages`.--### Sandbox recipe measurement--`sandbox/setup.sh` on `node:22.23.3-bookworm-slim@sha256:c3de60bf…` (Debian 12.15, Node 22.23.3):-ffmpeg 5.1.9 (Debian), D2 0.9.0, HyperFrames 0.8.169 with sharp 0.35.5, ECharts 6.1.0, GSAP 3.15.0-and puppeteer-core 25.14.0 from a lockfile, nine OFL fonts from `google/fonts@47d54ca`.--| Build | Result |-| --- | --- |-| linux/arm64, native (Apple Silicon, Docker Desktop 29.7) | 88 s; probe passes (fonts resolve, Chrome screenshot, `hyperframes lint`, 2 s 1920×1080 draft render with ffprobe duration and size, D2 SVG, sharp and ECharts load); Chromium 149.0.7827 (Playwright build 1228) |-| linux/amd64, emulated on the same host | installs in 197 s; probe fails: Chrome Headless Shell 152 SIGTRAPs under emulation. Verified in CI on native amd64 instead |-| Unpacked root filesystem | 1,351 MB (`/usr` 723 MB, Chrome 334 MB, render `node_modules` 214 MB) |--Decision: MDA's `docker_image` bake (1 GiB) cannot hold the computer, before any render scratch-space. Ship `design-agent sandbox publish --fs-gib 16` (LangSmith SDK `create_snapshot`, as the Paid-Media Agent does) and declare the published snapshot as the bake base; MDA then re-runs-`setup.sh`, which only re-probes because the recipe stamp matches. A live MDA bake is not run in-this build: it needs a LangSmith workspace and the person's approval.--### Conflicts recorded--- SPEC §21.1 asks for the LangChain OSS mark in the README; AGENTS.md (higher precedence) bans- LangChain brand assets. The README ships without it; marketing and legal decide at release.-- SPEC §8.1 lists `hyperframes validate`; 0.8.169 deprecates it and `inspect` in favor of `check`.-- SPEC §13 and the internal code assume `{server}__{tool}`; MDA 0.9.3 produces `{server}_{tool}`.-- SPEC §6.2 asks the registry to supply an Opus 5.5 profile; langchain-anthropic 1.7.6 already does.--## Identifiers that must never reach the public repository--Scrub by category, enforced by a CI ban-list scan (SPEC §18.4):--- LangChain brand: logos, icons, marks, palettes, the token files, construction specs, graphic- language images, brand-book Paper file ids, the internal brand package.-- People: employee names, Slack user ids, emails, voice profiles, the people roster, approver- principals.-- Workspace and infrastructure: Slack channel and team ids, LangSmith workspace, project and- deployment ids and URLs, snapshot names, Paper team id, Okta and sign-in hand-off details,- managed-tool server ids, Buffer channel ids, S3/R2 hosts.-- Internal agents and programs: peer agents and their bot ids, the quote-post copilot, the launch- ledger and its guards, internal campaigns, product glossaries, analytics workspaces.-- Licensed or third-party media: TWK Lausanne and Aeonik Mono fonts, the remocn-ported component- library, the 70 reference-film contact sheets and teardowns, frames of LangChain films, the- Cyberpunk fan-kit asset and terms, vendored GSAP files, third-party brand imagery in examples,- externally sourced image galleries without a clear license.-- History: `MIGRATION.md`, `migration-notes/`, internal runbooks, trace skills, research notes.diff --git a/docs/sources/official-links.md b/docs/sources/official-links.mdindex 64f5e03..0d60e4b 100644--- a/docs/sources/official-links.md+++ b/docs/sources/official-links.md@@ -48,8 +48,7 @@ declares MCP servers in `tools/mcp.py` as a module-level `mcp` (passing `mcp=` t`define_deep_agent` is refused); connector tools are named `{server}_{tool}`; schedule delivery isan `after_agent` hook installed ahead of authored middleware.-Confirm each URL resolves during Slice 0; the docs site renames pages. Record the verified set and-the package versions in `docs/prep/source-inventory.md`.+Confirm each URL still resolves when you move a pin forward; the docs site renames pages.## HyperFrames (HeyGen) — video enginediff --git a/SPEC.md b/docs/spec.mdsimilarity index 98%rename from SPEC.mdrename to docs/spec.mdindex 5069aa6..87d17c1 100644--- a/SPEC.md+++ b/docs/spec.md@@ -42,8 +42,7 @@ taste encoded as skills. The internal reference deployment taught every rule inopen-source Paid Media Agent. Follow the Paid Media Agent's repository shape, documentation voice,onboarding, deployment paths, CI and release discipline unless this spec says otherwise.- Partners: HeyGen (HyperFrames, the video engine) and Paper (the shared canvas). Both integrations- are first-class, attributed, pinned and tested. See `docs/prep/partner-integrations.md` (internal)- and, after release, `docs/partners/`.+ are first-class, attributed, pinned and tested. See [docs/partners/](partners/).## 3. Users and core journeys@@ -588,7 +587,7 @@ owner; the CLI writes to `workspace/out/` and prints paths.## 10. HyperFrames integration-See `docs/prep/partner-integrations.md` §1 (moves to `docs/partners/hyperframes.md`). Summary:+See [HyperFrames](partners/hyperframes.md). Summary:- HyperFrames is the only video engine in v0.1; the CLI is pinned; the upstream agent skills arevendored unmodified at a pinned commit with per-file checksums, LICENSE and NOTICE.@@ -693,7 +692,7 @@ edit the brand.## 13. Paper integration-See `docs/prep/partner-integrations.md` §2 (moves to `docs/partners/paper.md`). Summary:+See [Paper](partners/paper.md). Summary:- Modes: Local (stdio `paper mcp` or `http://127.0.0.1:29979/mcp`; default for CLI and Studio),Bridged (the bundled bearer-authenticated bridge in front of a user's Paper Desktop, reachable over@@ -799,9 +798,8 @@ LangSmith-free path, following the Paid Media Agent.## 17. Extraction and scrub process (from the internal reference)1. Start a fresh repository; never import the internal git history.-2. Port through an allowlist copier (`scripts/import_from_reference.py`, internal-only, deleted before- release) that copies only paths listed in `docs/prep/extraction-map.md`, rewrites names, and writes- an import log with source paths and checksums (kept out of the public tree).+2. Port through an allowlist copier (internal-only, deleted before release) that copies only+ allowlisted paths, rewrites names, and writes an import log with source paths and checksums (kept out of the public tree).3. Re-vendor HyperFrames skills from upstream; do not copy the internal vendored copies.4. Run the ban-list scan (§18.4), gitleaks over the full history, and a license inventory (everythird-party file has a license and a NOTICE line, or it is removed).@@ -826,7 +824,7 @@ examples/{brands/example-studio/,prompts/,README.md}fonts/ (OFL) · private-fonts/ (ignored) · config/*.example.* · docs/ · tests/.agents/skills/{design-agent-onboarding,brand-onboarding,vendor-sync,release-check}/.github/{workflows/{ci,compatibility,release}.yml,ISSUE_TEMPLATE/,PULL_REQUEST_TEMPLATE.md,dependabot.yml}-README.md · AGENTS.md · CLAUDE.md · OPERATIONS.md · SPEC.md · CONTRIBUTING.md · SECURITY.md+README.md · AGENTS.md · CLAUDE.md · OPERATIONS.md · CONTRIBUTING.md · SECURITY.mdCODE_OF_CONDUCT.md · LICENSE (Apache-2.0) · NOTICE.md · CHANGELOG.md · Makefile · pyproject.tomluv.lock · Dockerfile · docker-compose.yml · .env.example · skills-lock.json · .gitleaks.toml.pre-commit-config.yaml@@ -1025,7 +1023,7 @@ pull request (not in the repository).`runtime.schedules`, `runtime.channel`, `connections.get`, `define_mcp` naming, memory layers),HyperFrames CLI flags at the pinned version, Paper transports. Bake the recipe once with MDA andmeasure size and time; decide `docker_image` bake versus published snapshot. Record results in- `docs/prep/source-inventory.md`. Acceptance: a written compatibility table; a baked sandbox that+ `docs/sources/official-links.md`. Acceptance: a written compatibility table; a baked sandbox thatpasses the probe.1. **Skeleton and computer.** Repository scaffold, settings, capability registry, assembly with oneagent and no helpers, sandbox recipe and Docker runner, workspace stager, brand schema and samplediff --git a/scripts/import_from_reference.py b/scripts/import_from_reference.pydeleted file mode 100644index e4f3dd1..0000000--- a/scripts/import_from_reference.py+++ /dev/null@@ -1,427 +0,0 @@-"""Allowlist importer from the private reference agent. Internal-only: deleted before release.--Copies only the paths listed in ALLOWLIST (docs/prep/extraction-map.md), from one pinned commit,-through name rewrites and the public-hygiene scan. Every import is logged with source path and-checksums to a file outside the repository, never in the public tree.-- uv run python scripts/import_from_reference.py list- uv run python scripts/import_from_reference.py import harness/events.py [...] [--force]- uv run python scripts/import_from_reference.py show harness/events.py # scrubbed text, no write--A scrubbed file that still trips the hygiene scan is refused unless `--allow-findings`, which-writes it and records the findings; tests/unit/test_public_hygiene.py stays red until it is fixed.-"""--from __future__ import annotations--import argparse-import datetime as dt-import functools-import hashlib-import importlib.util-import json-import os-import re-import subprocess-import sys-from dataclasses import dataclass-from pathlib import Path-from types import ModuleType--ROOT = Path(__file__).resolve().parents[1]-REFERENCE = Path(- os.environ.get("DESIGN_AGENT_REFERENCE_REPO", "~/Desktop/agents/content-studio")-).expanduser()-REVISION = "f87d6449f4cd5300ed5d3219178fec11e9aaa5d7"-LOG = (- Path(os.environ.get("XDG_STATE_HOME", "~/.local/state")).expanduser()- / "design-agent"- / "reference-import.jsonl"-)---@dataclass(frozen=True)-class Entry:- target: str- action: (- str # KEEP or GENERALIZE (extraction-map.md); REWRITE work is written fresh, not imported- )- mit_lineage: bool = False---def _harness(name: str) -> tuple[str, Entry]:- return f"harness/{name}.py", Entry(f"src/design_agent/harness/{name}.py", "KEEP")---ALLOWLIST: dict[str, Entry] = dict(- [- *(- _harness(n)- for n in (- "__init__",- "events",- "policy",- "inbox",- "notices",- "tasks",- "ledger",- "wakeups",- "protocols",- "durable",- "workflow",- "branches",- "offload",- "watch",- "cache",- "context",- "learning",- )- ),- ("harness/meter.py", Entry("src/design_agent/harness/meter.py", "GENERALIZE")),- *(- (f"tests/harness/test_{n}.py", Entry(f"tests/unit/harness/test_{n}.py", "KEEP"))- for n in (- "branches",- "cache",- "context",- "durable",- "inbox",- "learning",- "meter",- "offload",- "watch",- "workflow",- )- ),- *(- (f"middleware/{n}.py", Entry(f"src/design_agent/middleware/{n}.py", "KEEP"))- for n in (- "model_retry",- "step_budget",- "image_clamp",- "tool_error_boundary",- "tool_history",- "drop_base_prompt",- "today",- )- ),- *(- (f"middleware/{n}.py", Entry(f"src/design_agent/middleware/{n}.py", "GENERALIZE"))- for n in (- "background",- "watch_tools",- "pipeline_tools",- "looks_tools",- "learning_tools",- "look",- "meter",- "progress",- "phrasebook",- "footer",- "agent_session",- "steering",- "workspace",- "paper_scope",- "memory_policy",- "memory_hot_cap",- "memory_learnings",- "owner_memory",- "tracing",- )- ),- (- "tools/disclosure.py",- Entry("src/design_agent/middleware/tool_disclosure.py", "GENERALIZE"),- ),- ("tools/media.py", Entry("src/design_agent/tools/media.py", "GENERALIZE")),- ("tools/files.py", Entry("src/design_agent/tools/files.py", "KEEP")),- ("tools/projects.py", Entry("src/design_agent/tools/projects.py", "KEEP")),- ("tools/mcp.py", Entry("src/design_agent/tools/mcp.py", "GENERALIZE")),- ("tools/paper.py", Entry("src/design_agent/tools/paper.py", "GENERALIZE")),- (- "scripts/paper_mcp_bridge.py",- Entry("src/design_agent/paper_bridge/app.py", "GENERALIZE"),- ),- ("tools/slack.py", Entry("src/design_agent/tools/slack.py", "GENERALIZE")),- ("tools/slack_read.py", Entry("src/design_agent/surfaces/slack/read.py", "GENERALIZE")),- ("tools/slack_ui.py", Entry("src/design_agent/surfaces/slack/ui.py", "GENERALIZE")),- ("pipelines/__init__.py", Entry("src/design_agent/pipelines/__init__.py", "GENERALIZE")),- (- "pipelines/launch_film.py",- Entry("src/design_agent/pipelines/launch_film.py", "GENERALIZE"),- ),- ("schedules/housekeeping.py", Entry("schedules/housekeeping.py", "KEEP", mit_lineage=True)),- ("identity.py", Entry("identity.py", "KEEP", mit_lineage=True)),- ("subagents.py", Entry("src/design_agent/subagents.py", "GENERALIZE")),- *(- (f"workspace/tools/{n}.mjs", Entry(f"workspace/tools/{n}.mjs", "GENERALIZE"))- for n in (- "video-gate",- "artifact-contract",- "text-fidelity",- "audio-lint",- "fetch-asset",- "html2pdf",- "review-thumb",- "film-analysis",- "film-probe",- "video-score",- "brand-lint",- )- ),- *(- (f"tests/{n}.py", Entry(f"tests/unit/{n}.py", "GENERALIZE"))- for n in (- "test_background",- "test_look",- "test_looks_tools",- "test_learning_tools",- "test_watch_tools",- "test_pipeline_launch_film",- "test_harness_surface",- "test_subagents",- "test_middleware_retry",- "test_middleware_step_budget",- "test_middleware_tool_history",- "test_middleware_task_boundary",- "test_middleware_drop_base_prompt",- "test_paper_scope",- "test_paper_mcp_bridge",- "test_phrasebook",- "test_progress",- "test_footer",- "test_steering",- "test_workspace",- "test_media",- "test_mcp",- "test_memory_policy",- "test_memory_hot_cap",- "test_projects",- )- ),- ]-)--#: Whole skill folders, source prefix -> (target prefix, action, excluded source paths). A file-#: under an excluded prefix is never importable: internal channels, unlicensed galleries,-#: excluded providers, vendored libraries and examples about real people or company diagrams.-SKILL_DIRECTORIES: dict[str, tuple[str, str, tuple[str, ...]]] = {- "skills/image-ops/": ("skills/image-ops/", "KEEP", ()),- "skills/gif-edit/": ("skills/gif-edit/", "KEEP", ()),- "skills/visual-verify/": ("skills/visual-verify/", "KEEP", ()),- "skills/film-breakdown/": ("skills/film-breakdown/", "KEEP", ()),- "skills/data-viz/": (- "skills/data-viz/",- "GENERALIZE",- ("skills/data-viz/vendor/", "skills/data-viz/examples/"),- ),- "skills/ad-creative/": (- "skills/stills/",- "GENERALIZE",- ("skills/ad-creative/scripts/html2png.mjs",),- ),- "skills/youtube-thumbnail/": (- "skills/thumbnails/",- "GENERALIZE",- (- "skills/youtube-thumbnail/references/channel-today.md",- "skills/youtube-thumbnail/references/reference-library.md",- ),- ),- "skills/gpt-image/": (- "skills/image-generation/",- "GENERALIZE",- ("skills/gpt-image/references/gallery",),- ),- "skills/score-video/": (- "skills/sound/",- "GENERALIZE",- ("skills/score-video/lib/epidemic-mcp.mjs", "skills/score-video/lib/gemini-critique.mjs"),- ),- "skills/video-storyboard/": ("skills/storyboard/", "GENERALIZE", ()),-}---def _directory_entry(path: str) -> Entry | None:- for prefix, (target, action, excluded) in SKILL_DIRECTORIES.items():- if path.startswith(prefix):- if any(path.startswith(e) for e in excluded):- return None- return Entry(target + path[len(prefix) :], action)- return None---#: Ordered rewrites applied to every imported file. Each is a public rename of an internal name.-REWRITES: tuple[tuple[re.Pattern[str], str], ...] = tuple(- (re.compile(p, re.MULTILINE), r)- for p, r in (- (r"\bContent Studio's\b", "Design Agent's"),- (r"\bContent Studio\b", "Design Agent"),- (r"\bcontent_studio\b", "design_agent"),- (r"\bcontent-studio\b", "design-agent"),- (r"\bCONTENT_STUDIO_", "DESIGN_AGENT_"),- (r"\bMEDIA_MODEL", "DESIGN_AGENT_MODEL"),- (r"\bMEDIA_CACHE_TTL\b", "DESIGN_AGENT_CACHE_TTL"),- (r"--lc-", "--brand-"),- (r"langchain-tokens", "tokens"),- (- r"^(\s*)from (harness|middleware|tools|pipelines)(\.| import)",- r"\1from design_agent.\2\3",- ),- (r"^(\s*)import (harness|middleware|tools|pipelines)\b", r"\1import design_agent.\2"),- (r"^(\s*)from (models|subagents) import", r"\1from design_agent.\2 import"),- )-)---def _hygiene() -> ModuleType:- spec = importlib.util.spec_from_file_location(- "hygiene", ROOT / "tests/unit/test_public_hygiene.py"- )- if spec is None or spec.loader is None:- raise SystemExit("tests/unit/test_public_hygiene.py is missing")- module = importlib.util.module_from_spec(spec)- sys.modules[spec.name] = module # dataclasses resolve annotations through sys.modules- spec.loader.exec_module(module)- return module---def entry_for(path: str) -> Entry:- entry = ALLOWLIST.get(path) or _directory_entry(path)- if entry is None:- raise SystemExit(f"not on the allowlist: {path}")- return entry---def read_source(path: str) -> bytes:- entry_for(path)- return subprocess.run(- ["git", "-C", str(REFERENCE), "show", f"{REVISION}:{path}"], capture_output=True, check=True- ).stdout---def allowlisted_under(prefix: str) -> list[str]:- """Every file at the pinned revision under `prefix` that the allowlist admits."""- listed = subprocess.run(- ["git", "-C", str(REFERENCE), "ls-tree", "-r", "--name-only", REVISION, "--", prefix],- capture_output=True,- check=True,- text=True,- ).stdout.splitlines()- return [path for path in listed if path in ALLOWLIST or _directory_entry(path) is not None]---def scrub(text: str) -> str:- for pattern, replacement in REWRITES:- text = pattern.sub(replacement, text)- return text---def findings_for(text: str, target: str) -> list[str]:- hygiene = _hygiene()- found: list[str] = []- for number, line in enumerate(text.splitlines(), start=1):- for rule in hygiene.RULES:- if rule.pattern.search(line) and not hygiene._matches(target, rule.allowed):- found.append(f"{target}:{number}: {rule.category}")- found.extend(f"{target}:{number}: {hit}" for hit in hygiene._identity_hits(line))- return found---def log(record: dict[str, object]) -> None:- LOG.parent.mkdir(parents=True, exist_ok=True)- with LOG.open("a", encoding="utf-8") as handle:- handle.write(json.dumps(record, sort_keys=True) + "\n")---def import_one(path: str, *, force: bool, allow_findings: bool) -> int:- entry = entry_for(path)- raw = read_source(path)- target = ROOT / entry.target- if b"\0" in raw[:8192]:- found = [] # binary: copied as is after the allowlist and path checks- if target.exists() and not force:- print(f"skip {path}: {entry.target} exists (use --force)")- return 0- target.parent.mkdir(parents=True, exist_ok=True)- target.write_bytes(raw)- log(- {- "at": dt.datetime.now(dt.UTC).isoformat(timespec="seconds"),- "source": path,- "revision": REVISION,- "source_sha256": hashlib.sha256(raw).hexdigest(),- "target": entry.target,- "action": entry.action,- "binary": True,- }- )- print(f"imported {path} -> {entry.target} (binary)")- return 0- text = scrub(raw.decode("utf-8"))- if target.exists() and not force:- print(f"skip {path}: {entry.target} exists (use --force)")- return 0- found = findings_for(text, entry.target)- if found and not allow_findings:- print(f"refused {path}: the scrubbed text still trips the hygiene scan:", file=sys.stderr)- print("\n".join(f" {f}" for f in found), file=sys.stderr)- return 1- target.parent.mkdir(parents=True, exist_ok=True)- target.write_text(text, encoding="utf-8")- log(- {- "at": dt.datetime.now(dt.UTC).isoformat(timespec="seconds"),- "source": path,- "revision": REVISION,- "source_sha256": hashlib.sha256(raw).hexdigest(),- "target": entry.target,- "target_sha256": hashlib.sha256(text.encode()).hexdigest(),- "action": entry.action,- "mit_lineage": entry.mit_lineage,- "findings": found,- }- )- print(- f"imported {path} -> {entry.target} ({entry.action}{', findings recorded' if found else ''})"- )- return 0---def main() -> int:- parser = argparse.ArgumentParser(description=__doc__.splitlines()[0])- sub = parser.add_subparsers(dest="command", required=True)- sub.add_parser("list")- show = sub.add_parser("show")- show.add_argument("path")- run = sub.add_parser("import")- run.add_argument("paths", nargs="+")- run.add_argument("--force", action="store_true")- run.add_argument("--allow-findings", action="store_true")- tree = sub.add_parser("import-dir", help="import every allowlisted file under a skill folder")- tree.add_argument("prefix")- tree.add_argument("--force", action="store_true")- tree.add_argument("--allow-findings", action="store_true")- args = parser.parse_args()- if args.command == "list":- for path, entry in sorted(ALLOWLIST.items()):- state = "present" if (ROOT / entry.target).exists() else "-"- print(f"{entry.action:10} {state:8} {path} -> {entry.target}")- for prefix, (target, action, excluded) in sorted(SKILL_DIRECTORIES.items()):- print(- f"{action:10} {'dir':8} {prefix} -> {target} (excluding {', '.join(excluded) or 'nothing'})"- )- return 0- if args.command == "show":- sys.stdout.write(scrub(read_source(args.path).decode("utf-8")))- return 0- paths = allowlisted_under(args.prefix) if args.command == "import-dir" else args.paths- if not paths:- print(f"nothing allowlisted under {args.prefix}", file=sys.stderr)- return 1- return max(import_one(p, force=args.force, allow_findings=args.allow_findings) for p in paths)---if __name__ == "__main__":- raise SystemExit(main())diff --git a/src/design_agent/skills_lock.py b/src/design_agent/skills_lock.pyindex 35607b3..28ed625 100644--- a/src/design_agent/skills_lock.py+++ b/src/design_agent/skills_lock.py@@ -48,7 +48,7 @@ VENDORED_SKILLS = ()#: Upstream files not vendored, with the reason. Third-party assets whose license is not-#: recorded beside them stay out until the partner confirms terms (docs/prep partner questions).+#: recorded beside them stay out until the partner confirms terms.EXCLUDED: tuple[tuple[str, str], ...] = (("*/gsap*.js", "vendored GSAP: the sandbox installs GSAP; compositions copy it from there"),(diff --git a/tests/unit/test_deploy.py b/tests/unit/test_deploy.pyindex e0037c6..85f90d3 100644--- a/tests/unit/test_deploy.py+++ b/tests/unit/test_deploy.py@@ -60,8 +60,6 @@ def test_staging_ships_only_what_the_deployment_needs(tmp_path: Path) -> None:for left_out in ("tests","docs",- "SPEC.md",- "IMPLEMENTATION_PROMPT.md","workspace/out","workspace/state",".venv",diff --git a/tests/unit/test_docs_links.py b/tests/unit/test_docs_links.pyindex 27deca8..38a8147 100644--- a/tests/unit/test_docs_links.py+++ b/tests/unit/test_docs_links.py@@ -8,8 +8,6 @@ from pathlib import PathROOT = Path(__file__).resolve().parents[2]LINK = re.compile(r"\[[^\]]*\]\(([^)\s]+)\)|(?:src|href)=\"([^\"]+)\"")-#: Pre-release build notes may point at files that do not exist yet; they are deleted at release.-SKIPPED = ("docs/prep/", "IMPLEMENTATION_PROMPT.md", "SPEC.md")def documents() -> list[Path]:@@ -32,7 +30,7 @@ def documents() -> list[Path]:for p in sorted((ROOT / "skills").rglob("*.md"))if p.relative_to(ROOT / "skills").parts[0] not in vendored]- return [p for p in found if p.is_file() and not str(p.relative_to(ROOT)).startswith(SKIPPED)]+ return [p for p in found if p.is_file()]def test_relative_links_resolve() -> None:diff --git a/tests/unit/test_public_hygiene.py b/tests/unit/test_public_hygiene.pyindex 5e082c2..5e5d88f 100644--- a/tests/unit/test_public_hygiene.py+++ b/tests/unit/test_public_hygiene.py@@ -45,7 +45,7 @@ def _rule(category: str, pattern: str, *allowed: str) -> Rule:#: Mentions of a licensed font, a third-party asset or a component library are allowed in the#: binding spec documents, which explain why they are excluded. Their files never are.-SPEC_DOCS = ("SPEC.md", "AGENTS.md", "docs/*.md", "docs/**/*.md")+SPEC_DOCS = ("AGENTS.md", "docs/*.md", "docs/**/*.md")RULES: tuple[Rule, ...] = (_rule("internal codename", r"(?i)content[\s_-]?studio", "NOTICE.md"),