Skip to content

Commit c6168d3

Browse files
bloveclaude
andauthored
fix(examples): derive assemble-examples list from the capability registry (#626)
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) <noreply@anthropic.com>
1 parent 1696568 commit c6168d3

1 file changed

Lines changed: 12 additions & 38 deletions

File tree

scripts/assemble-examples.ts

Lines changed: 12 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -11,49 +11,23 @@
1111
import { execSync } from 'child_process';
1212
import { cpSync, mkdirSync, rmSync, existsSync, writeFileSync, readFileSync } from 'fs';
1313
import { resolve } from 'path';
14+
import { capabilities as registryCapabilities } from '../apps/cockpit/scripts/capability-registry';
1415

1516
const root = resolve(__dirname, '..');
1617
const deployDir = resolve(root, 'deploy/examples');
1718
const skipBuild = process.argv.includes('--skip-build');
1819

19-
const capabilities = [
20-
{ product: 'langgraph', topic: 'streaming' },
21-
{ product: 'langgraph', topic: 'persistence' },
22-
{ product: 'langgraph', topic: 'interrupts' },
23-
{ product: 'langgraph', topic: 'memory' },
24-
{ product: 'langgraph', topic: 'durable-execution' },
25-
{ product: 'langgraph', topic: 'subgraphs' },
26-
{ product: 'langgraph', topic: 'time-travel' },
27-
{ product: 'langgraph', topic: 'deployment-runtime' },
28-
{ product: 'deep-agents', topic: 'planning' },
29-
{ product: 'deep-agents', topic: 'filesystem' },
30-
{ product: 'deep-agents', topic: 'subagents' },
31-
{ product: 'deep-agents', topic: 'memory' },
32-
{ product: 'deep-agents', topic: 'skills' },
33-
{ product: 'deep-agents', topic: 'sandboxes' },
34-
{ product: 'render', topic: 'spec-rendering' },
35-
{ product: 'render', topic: 'element-rendering' },
36-
{ product: 'render', topic: 'state-management' },
37-
{ product: 'render', topic: 'registry' },
38-
{ product: 'render', topic: 'repeat-loops' },
39-
{ product: 'render', topic: 'computed-functions' },
40-
{ product: 'chat', topic: 'messages' },
41-
{ product: 'chat', topic: 'input' },
42-
{ product: 'chat', topic: 'interrupts' },
43-
{ product: 'chat', topic: 'tool-calls' },
44-
{ product: 'chat', topic: 'subagents' },
45-
{ product: 'chat', topic: 'threads' },
46-
{ product: 'chat', topic: 'timeline' },
47-
{ product: 'chat', topic: 'generative-ui' },
48-
{ product: 'chat', topic: 'debug' },
49-
{ product: 'chat', topic: 'theming' },
50-
{ product: 'chat', topic: 'a2ui' },
51-
{ product: 'ag-ui', topic: 'interrupts' },
52-
{ product: 'ag-ui', topic: 'streaming' },
53-
{ product: 'ag-ui', topic: 'tool-views' },
54-
{ product: 'ag-ui', topic: 'json-render' },
55-
{ product: 'ag-ui', topic: 'a2ui' },
56-
];
20+
// Derive the staged-example list from the capability registry — the single
21+
// source of truth (every entry has an `angularProject` that builds to
22+
// `dist/cockpit/<product>/<topic>/angular`). Hardcoding it previously let new
23+
// caps (tool-views, json-render, a2ui) silently 404 in production because they
24+
// were added to the registry but never to this list. The Railway deploy
25+
// generator already derives from the registry; this keeps the frontend deploy
26+
// in lockstep so a registry cap can never be missed again.
27+
const capabilities = registryCapabilities.map((c) => ({
28+
product: c.product,
29+
topic: c.topic,
30+
}));
5731

5832
if (!skipBuild) {
5933
console.log(`Building all ${capabilities.length} Angular apps...`);

0 commit comments

Comments
 (0)