Skip to content

Commit 48a4a98

Browse files
bloveclaude
andauthored
feat(examples/ag-ui): local-runnable standalone ag-ui chat example (Part 2a) (#613)
* docs(plan): examples/ag-ui local-runnable example (Part 2a) * feat(examples/ag-ui): python backend — duplicated a2ui graph served over ag-ui (uvicorn) * feat(examples/ag-ui): angular scaffold (project.json, env, proxy, index/main) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * feat(examples/ag-ui): provideAgent config + single-conversation chat host * feat(examples/ag-ui): umbrella project + local run verified (uvicorn /ok + a2ui run) The standalone ag-ui-langgraph endpoint calls graph.aget_state, which requires a checkpointer; the copied chat graph compiles without one (Platform manages persistence). Compile a local MemorySaver-backed copy in server.py for the standalone uvicorn path, leaving the deployed graph export untouched. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent f14c57b commit 48a4a98

34 files changed

Lines changed: 4439 additions & 0 deletions

docs/superpowers/plans/2026-06-07-examples-ag-ui-local.md

Lines changed: 542 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
{
2+
"name": "examples-ag-ui-angular",
3+
"$schema": "../../../node_modules/nx/schemas/project-schema.json",
4+
"sourceRoot": "examples/ag-ui/angular/src",
5+
"projectType": "application",
6+
"prefix": "app",
7+
"targets": {
8+
"build": {
9+
"executor": "@angular/build:application",
10+
"outputs": [
11+
"{options.outputPath.base}"
12+
],
13+
"options": {
14+
"outputPath": {
15+
"base": "dist/examples/ag-ui/angular",
16+
"browser": ""
17+
},
18+
"index": "examples/ag-ui/angular/src/index.html",
19+
"browser": "examples/ag-ui/angular/src/main.ts",
20+
"tsConfig": "examples/ag-ui/angular/tsconfig.app.json",
21+
"assets": [
22+
{
23+
"glob": "**/*",
24+
"input": "examples/ag-ui/angular/public"
25+
}
26+
],
27+
"styles": [
28+
"examples/ag-ui/angular/src/styles.css"
29+
]
30+
},
31+
"configurations": {
32+
"production": {
33+
"budgets": [
34+
{
35+
"type": "initial",
36+
"maximumWarning": "500kb",
37+
"maximumError": "1.5mb"
38+
},
39+
{
40+
"type": "anyComponentStyle",
41+
"maximumWarning": "10kb",
42+
"maximumError": "16kb"
43+
}
44+
],
45+
"outputHashing": "all"
46+
},
47+
"development": {
48+
"optimization": false,
49+
"extractLicenses": false,
50+
"sourceMap": true,
51+
"fileReplacements": [
52+
{
53+
"replace": "examples/ag-ui/angular/src/environments/environment.ts",
54+
"with": "examples/ag-ui/angular/src/environments/environment.development.ts"
55+
}
56+
]
57+
}
58+
},
59+
"defaultConfiguration": "development"
60+
},
61+
"serve": {
62+
"continuous": true,
63+
"executor": "@angular/build:dev-server",
64+
"options": {
65+
"port": 4201,
66+
"proxyConfig": "examples/ag-ui/angular/proxy.conf.mjs"
67+
},
68+
"configurations": {
69+
"production": {
70+
"buildTarget": "examples-ag-ui-angular:build:production"
71+
},
72+
"development": {
73+
"buildTarget": "examples-ag-ui-angular:build:development"
74+
}
75+
},
76+
"defaultConfiguration": "development"
77+
},
78+
"test": {
79+
"executor": "@nx/vitest:test",
80+
"options": {
81+
"configFile": "examples/ag-ui/angular/vite.config.mts"
82+
}
83+
},
84+
"lint": {
85+
"executor": "@nx/eslint:lint"
86+
}
87+
},
88+
"tags": [
89+
"scope:examples",
90+
"scope:examples-ag-ui",
91+
"type:app"
92+
]
93+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
// SPDX-License-Identifier: MIT
2+
// Dev only: routes the relative /agent calls to the local uvicorn ag-ui server.
3+
export default {
4+
'/agent': { target: 'http://localhost:8000', secure: false, changeOrigin: true, ws: true },
5+
};
14.7 KB
Binary file not shown.
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
// SPDX-License-Identifier: MIT
2+
import {
3+
ApplicationConfig,
4+
provideBrowserGlobalErrorListeners,
5+
provideZonelessChangeDetection,
6+
} from '@angular/core';
7+
import { provideThreadplaneTelemetry } from '@threadplane/telemetry/browser';
8+
import { provideChat } from '@threadplane/chat';
9+
import { provideAgent } from '@threadplane/ag-ui';
10+
import { environment } from '../environments/environment';
11+
12+
export const appConfig: ApplicationConfig = {
13+
providers: [
14+
provideBrowserGlobalErrorListeners(),
15+
provideZonelessChangeDetection(),
16+
provideThreadplaneTelemetry(environment.telemetry),
17+
provideAgent({ url: environment.agentUrl }),
18+
provideChat({ license: environment.license }),
19+
],
20+
};
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<main class="ag-ui-demo">
2+
<header class="ag-ui-demo__header">
3+
<h1>AG-UI Chat</h1>
4+
<p>The Threadplane chat UI over the AG-UI transport.</p>
5+
</header>
6+
<chat main [agent]="agent" class="ag-ui-demo__chat" />
7+
</main>
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// SPDX-License-Identifier: MIT
2+
import { ChangeDetectionStrategy, Component } from '@angular/core';
3+
import { injectAgent } from '@threadplane/ag-ui';
4+
import { ChatComponent } from '@threadplane/chat';
5+
6+
@Component({
7+
selector: 'app-root',
8+
standalone: true,
9+
changeDetection: ChangeDetectionStrategy.OnPush,
10+
imports: [ChatComponent],
11+
templateUrl: './app.html',
12+
})
13+
export class App {
14+
protected readonly agent = injectAgent();
15+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
// SPDX-License-Identifier: MIT
2+
export const environment = {
3+
production: false,
4+
agentUrl: '/agent',
5+
telemetry: { enabled: false, sampleRate: 1 },
6+
license: undefined as string | undefined,
7+
};
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
// SPDX-License-Identifier: MIT
2+
export const environment = {
3+
production: true,
4+
agentUrl: '/agent',
5+
telemetry: { enabled: false, sampleRate: 1 },
6+
license: undefined as string | undefined,
7+
};
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<!doctype html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="utf-8" />
5+
<title>AG-UI Chat — Threadplane Example</title>
6+
<base href="/" />
7+
<meta name="viewport" content="width=device-width, initial-scale=1" />
8+
<link rel="icon" type="image/x-icon" href="favicon.ico" />
9+
</head>
10+
<body>
11+
<app-root></app-root>
12+
</body>
13+
</html>

0 commit comments

Comments
 (0)