From 2871de2bf20ea25b803d27bdcb48e80e26b3fbb6 Mon Sep 17 00:00:00 2001 From: Brian Love Date: Sun, 7 Jun 2026 18:18:43 -0700 Subject: [PATCH] fix(examples): derive assemble-examples list from the capability registry MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The examples deploy (threadplane-examples) hardcoded which apps to stage, and drifted from the registry — tool-views/json-render/a2ui were added to the registry but never to this list, so they 404'd in production. Derive the staged-example list from the capability registry (the documented single source of truth, already used by the Railway deploy generator) so a new cap can never be silently dropped from the frontend deploy again. Verified: derives all 36 caps incl. the 3 new ag-ui examples; import resolves and the script runs. Co-Authored-By: Claude Opus 4.8 (1M context) --- scripts/assemble-examples.ts | 50 +++++++++--------------------------- 1 file changed, 12 insertions(+), 38 deletions(-) diff --git a/scripts/assemble-examples.ts b/scripts/assemble-examples.ts index e1c4e2b5..3a7c3157 100644 --- a/scripts/assemble-examples.ts +++ b/scripts/assemble-examples.ts @@ -11,49 +11,23 @@ import { execSync } from 'child_process'; import { cpSync, mkdirSync, rmSync, existsSync, writeFileSync, readFileSync } from 'fs'; import { resolve } from 'path'; +import { capabilities as registryCapabilities } from '../apps/cockpit/scripts/capability-registry'; const root = resolve(__dirname, '..'); const deployDir = resolve(root, 'deploy/examples'); const skipBuild = process.argv.includes('--skip-build'); -const capabilities = [ - { product: 'langgraph', topic: 'streaming' }, - { product: 'langgraph', topic: 'persistence' }, - { product: 'langgraph', topic: 'interrupts' }, - { product: 'langgraph', topic: 'memory' }, - { product: 'langgraph', topic: 'durable-execution' }, - { product: 'langgraph', topic: 'subgraphs' }, - { product: 'langgraph', topic: 'time-travel' }, - { product: 'langgraph', topic: 'deployment-runtime' }, - { product: 'deep-agents', topic: 'planning' }, - { product: 'deep-agents', topic: 'filesystem' }, - { product: 'deep-agents', topic: 'subagents' }, - { product: 'deep-agents', topic: 'memory' }, - { product: 'deep-agents', topic: 'skills' }, - { product: 'deep-agents', topic: 'sandboxes' }, - { product: 'render', topic: 'spec-rendering' }, - { product: 'render', topic: 'element-rendering' }, - { product: 'render', topic: 'state-management' }, - { product: 'render', topic: 'registry' }, - { product: 'render', topic: 'repeat-loops' }, - { product: 'render', topic: 'computed-functions' }, - { product: 'chat', topic: 'messages' }, - { product: 'chat', topic: 'input' }, - { product: 'chat', topic: 'interrupts' }, - { product: 'chat', topic: 'tool-calls' }, - { product: 'chat', topic: 'subagents' }, - { product: 'chat', topic: 'threads' }, - { product: 'chat', topic: 'timeline' }, - { product: 'chat', topic: 'generative-ui' }, - { product: 'chat', topic: 'debug' }, - { product: 'chat', topic: 'theming' }, - { product: 'chat', topic: 'a2ui' }, - { product: 'ag-ui', topic: 'interrupts' }, - { product: 'ag-ui', topic: 'streaming' }, - { product: 'ag-ui', topic: 'tool-views' }, - { product: 'ag-ui', topic: 'json-render' }, - { product: 'ag-ui', topic: 'a2ui' }, -]; +// Derive the staged-example list from the capability registry — the single +// source of truth (every entry has an `angularProject` that builds to +// `dist/cockpit///angular`). Hardcoding it previously let new +// caps (tool-views, json-render, a2ui) silently 404 in production because they +// were added to the registry but never to this list. The Railway deploy +// generator already derives from the registry; this keeps the frontend deploy +// in lockstep so a registry cap can never be missed again. +const capabilities = registryCapabilities.map((c) => ({ + product: c.product, + topic: c.topic, +})); if (!skipBuild) { console.log(`Building all ${capabilities.length} Angular apps...`);