From cf3afa8b969d2e0a95752d9dcf1716fb75eb9bf3 Mon Sep 17 00:00:00 2001 From: Brian Love Date: Fri, 5 Jun 2026 10:14:37 -0700 Subject: [PATCH] feat(cockpit): register ag-ui examples in sidebar + capability modules MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PR #567 added the ag-ui section to the cockpit-registry manifest and shipped two examples (interrupts, streaming), but the cockpit app itself never picked them up. Two hardcoded spots in apps/cockpit/src/lib/route-resolution.ts: - `capabilityModules` is a static import-and-array list. Without entries for the ag-ui descriptors, `capabilityModules.find(... product === 'ag-ui' ...)` returned undefined, so RunMode rendered "No runtime available" even when the route resolved. - `buildNavigationTree` hardcoded the products array to the original four (deep-agents, langgraph, render, chat), so ag-ui examples were filtered out of the sidebar entirely. This PR adds both: imports + array entries for agUi{Interrupts,Streaming}PythonModule, and inserts 'ag-ui' between 'langgraph' and 'render' to match APPROVED_TOPICS ordering. After this lands + cockpit redeploys, the AG-UI section appears in the sidebar and the Code/Docs/API tabs work. The Run tab still says "No runtime available" — that depends on a hosted ag-ui runtime, which is Phase 2 (a real infra brainstorm for hosting uvicorn ag-ui-langgraph apps). Spec test for buildNavigationTree updated to expect 5 products with ag-ui in position 3. --- apps/cockpit/src/lib/route-resolution.spec.ts | 7 +++++-- apps/cockpit/src/lib/route-resolution.ts | 6 +++++- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/apps/cockpit/src/lib/route-resolution.spec.ts b/apps/cockpit/src/lib/route-resolution.spec.ts index 5d77fff7..5a5e65dd 100644 --- a/apps/cockpit/src/lib/route-resolution.spec.ts +++ b/apps/cockpit/src/lib/route-resolution.spec.ts @@ -47,7 +47,7 @@ describe('buildNavigationTree', () => { it('groups manifest entries by product and section', () => { const tree = buildNavigationTree(cockpitManifest); - expect(tree).toHaveLength(4); + expect(tree).toHaveLength(5); expect(tree[0]).toMatchObject({ product: 'deep-agents', }); @@ -55,9 +55,12 @@ describe('buildNavigationTree', () => { product: 'langgraph', }); expect(tree[2]).toMatchObject({ - product: 'render', + product: 'ag-ui', }); expect(tree[3]).toMatchObject({ + product: 'render', + }); + expect(tree[4]).toMatchObject({ product: 'chat', }); }); diff --git a/apps/cockpit/src/lib/route-resolution.ts b/apps/cockpit/src/lib/route-resolution.ts index f8d78834..d57c0cb1 100644 --- a/apps/cockpit/src/lib/route-resolution.ts +++ b/apps/cockpit/src/lib/route-resolution.ts @@ -11,6 +11,8 @@ import { langgraphDurableExecutionPythonModule } from '../../../../cockpit/langg import { langgraphSubgraphsPythonModule } from '../../../../cockpit/langgraph/subgraphs/python/src/index'; import { langgraphTimeTravelPythonModule } from '../../../../cockpit/langgraph/time-travel/python/src/index'; import { langgraphDeploymentRuntimePythonModule } from '../../../../cockpit/langgraph/deployment-runtime/python/src/index'; +import { agUiInterruptsPythonModule } from '../../../../cockpit/ag-ui/interrupts/python/src/index'; +import { agUiStreamingPythonModule } from '../../../../cockpit/ag-ui/streaming/python/src/index'; import { deepAgentsMemoryPythonModule } from '../../../../cockpit/deep-agents/memory/python/src/index'; import { deepAgentsPlanningPythonModule } from '../../../../cockpit/deep-agents/planning/python/src/index'; import { deepAgentsFilesystemPythonModule } from '../../../../cockpit/deep-agents/filesystem/python/src/index'; @@ -81,6 +83,8 @@ const capabilityModules = [ langgraphSubgraphsPythonModule, langgraphTimeTravelPythonModule, langgraphDeploymentRuntimePythonModule, + agUiInterruptsPythonModule, + agUiStreamingPythonModule, deepAgentsMemoryPythonModule, deepAgentsPlanningPythonModule, deepAgentsFilesystemPythonModule, @@ -169,7 +173,7 @@ export const resolveCockpitEntry = ({ export const buildNavigationTree = ( manifest: CockpitManifestEntry[] ): NavigationProduct[] => { - const products: CockpitManifestEntry['product'][] = ['deep-agents', 'langgraph', 'render', 'chat']; + const products: CockpitManifestEntry['product'][] = ['deep-agents', 'langgraph', 'ag-ui', 'render', 'chat']; const sections: CockpitManifestEntry['section'][] = [ 'getting-started', 'core-capabilities',