@genui-a3/create 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +98 -0
- package/package.json +45 -0
- package/template/README.md +16 -0
- package/template/_gitignore +35 -0
- package/template/app/(pages)/agui/AguiChat.tsx +109 -0
- package/template/app/(pages)/agui/page.tsx +12 -0
- package/template/app/(pages)/chat/page.tsx +12 -0
- package/template/app/(pages)/stream/page.tsx +12 -0
- package/template/app/ThemeProvider.tsx +17 -0
- package/template/app/agents/age.ts +24 -0
- package/template/app/agents/greeting.ts +37 -0
- package/template/app/api/agui/route.ts +69 -0
- package/template/app/api/chat/route.ts +65 -0
- package/template/app/api/stream/route.ts +64 -0
- package/template/app/apple-icon-dark.png +0 -0
- package/template/app/apple-icon.png +0 -0
- package/template/app/components/atoms/AppLogo.tsx +44 -0
- package/template/app/components/atoms/ChatContainer.tsx +13 -0
- package/template/app/components/atoms/ChatHeader.tsx +14 -0
- package/template/app/components/atoms/MessageBubble.tsx +21 -0
- package/template/app/components/atoms/index.ts +4 -0
- package/template/app/components/molecules/ChatInput.tsx +66 -0
- package/template/app/components/molecules/ChatMessage.tsx +41 -0
- package/template/app/components/molecules/index.ts +2 -0
- package/template/app/components/organisms/Chat.tsx +77 -0
- package/template/app/components/organisms/ChatMessageList.tsx +37 -0
- package/template/app/components/organisms/PageLayout.tsx +43 -0
- package/template/app/components/organisms/StreamChat.tsx +149 -0
- package/template/app/components/organisms/index.ts +4 -0
- package/template/app/constants/chat.ts +4 -0
- package/template/app/favicon-dark.ico +0 -0
- package/template/app/favicon.ico +0 -0
- package/template/app/icon.svg +13 -0
- package/template/app/layout.tsx +32 -0
- package/template/app/page.tsx +171 -0
- package/template/app/styled.d.ts +6 -0
- package/template/app/theme.ts +22 -0
- package/template/app/types/index.ts +8 -0
- package/template/next.config.mjs +6 -0
- package/template/package.json +29 -0
- package/template/public/android-chrome-192x192.png +0 -0
- package/template/public/android-chrome-512x512.png +0 -0
- package/template/public/site.webmanifest +11 -0
- package/template/tsconfig.json +41 -0
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
|
|
3
|
+
import { AppLogo } from '@atoms'
|
|
4
|
+
import Link from 'next/link'
|
|
5
|
+
import { Box, Typography, Card, CardActionArea, Container, Stack } from '@mui/material'
|
|
6
|
+
import ChatBubbleOutlineIcon from '@mui/icons-material/ChatBubbleOutline'
|
|
7
|
+
import StreamIcon from '@mui/icons-material/Stream'
|
|
8
|
+
import ExtensionIcon from '@mui/icons-material/Extension'
|
|
9
|
+
import ArrowForwardIcon from '@mui/icons-material/ArrowForward'
|
|
10
|
+
|
|
11
|
+
export default function Home() {
|
|
12
|
+
return (
|
|
13
|
+
<Box sx={{ display: 'flex', flexDirection: 'column', minHeight: '100vh', bgcolor: 'background.default' }}>
|
|
14
|
+
<Box
|
|
15
|
+
component="header"
|
|
16
|
+
sx={{
|
|
17
|
+
p: 2,
|
|
18
|
+
px: 3,
|
|
19
|
+
display: 'flex',
|
|
20
|
+
alignItems: 'center',
|
|
21
|
+
gap: 2,
|
|
22
|
+
borderBottom: 1,
|
|
23
|
+
borderColor: 'divider',
|
|
24
|
+
bgcolor: 'background.paper',
|
|
25
|
+
zIndex: 10,
|
|
26
|
+
}}
|
|
27
|
+
>
|
|
28
|
+
<AppLogo width={32} height={32} />
|
|
29
|
+
<Typography variant="h6" fontWeight="bold">
|
|
30
|
+
A3 Example
|
|
31
|
+
</Typography>
|
|
32
|
+
</Box>
|
|
33
|
+
|
|
34
|
+
<Box sx={{ flex: 1, p: 3, overflowY: 'auto' }}>
|
|
35
|
+
<Container maxWidth="lg" sx={{ mt: 5, mb: 10 }}>
|
|
36
|
+
<Stack spacing={3} alignItems="center" mb={10} textAlign="center">
|
|
37
|
+
<Typography variant="h3" fontWeight={800} color="text.primary">
|
|
38
|
+
Welcome to A3 Core
|
|
39
|
+
</Typography>
|
|
40
|
+
<Typography variant="h6" color="text.secondary" maxWidth="md">
|
|
41
|
+
Explore the different communication protocols and frontend implementations available in the A3
|
|
42
|
+
architecture.
|
|
43
|
+
</Typography>
|
|
44
|
+
</Stack>
|
|
45
|
+
|
|
46
|
+
<Stack direction={{ xs: 'column', md: 'row' }} spacing={4}>
|
|
47
|
+
{/* Blocking Chat Card */}
|
|
48
|
+
<Card
|
|
49
|
+
elevation={0}
|
|
50
|
+
sx={{
|
|
51
|
+
flex: 1,
|
|
52
|
+
border: 1,
|
|
53
|
+
borderColor: 'divider',
|
|
54
|
+
borderRadius: 4,
|
|
55
|
+
transition: '0.2s',
|
|
56
|
+
'&:hover': { borderColor: 'primary.main', transform: 'translateY(-4px)', boxShadow: 4 },
|
|
57
|
+
}}
|
|
58
|
+
>
|
|
59
|
+
<CardActionArea
|
|
60
|
+
component={Link}
|
|
61
|
+
href="/chat"
|
|
62
|
+
sx={{
|
|
63
|
+
p: 4,
|
|
64
|
+
height: '100%',
|
|
65
|
+
display: 'flex',
|
|
66
|
+
flexDirection: 'column',
|
|
67
|
+
alignItems: 'flex-start',
|
|
68
|
+
gap: 2,
|
|
69
|
+
}}
|
|
70
|
+
>
|
|
71
|
+
<Box sx={{ p: 2, bgcolor: 'rgba(37, 99, 235, 0.1)', color: 'primary.main', borderRadius: 2 }}>
|
|
72
|
+
<ChatBubbleOutlineIcon fontSize="large" />
|
|
73
|
+
</Box>
|
|
74
|
+
<Typography variant="h5" fontWeight="bold">
|
|
75
|
+
Blocking Chat
|
|
76
|
+
</Typography>
|
|
77
|
+
<Typography variant="body1" color="text.secondary" sx={{ flexGrow: 1 }}>
|
|
78
|
+
A synchronous (unary) chat implementation. The client waits for the agent to finish processing
|
|
79
|
+
completely before rendering.
|
|
80
|
+
</Typography>
|
|
81
|
+
<Stack direction="row" alignItems="center" gap={1} color="primary.main" fontWeight="bold" mt={2}>
|
|
82
|
+
Try it out <ArrowForwardIcon fontSize="small" />
|
|
83
|
+
</Stack>
|
|
84
|
+
</CardActionArea>
|
|
85
|
+
</Card>
|
|
86
|
+
|
|
87
|
+
{/* Streaming Chat Card */}
|
|
88
|
+
<Card
|
|
89
|
+
elevation={0}
|
|
90
|
+
sx={{
|
|
91
|
+
flex: 1,
|
|
92
|
+
border: 1,
|
|
93
|
+
borderColor: 'divider',
|
|
94
|
+
borderRadius: 4,
|
|
95
|
+
transition: '0.2s',
|
|
96
|
+
'&:hover': { borderColor: '#9c27b0', transform: 'translateY(-4px)', boxShadow: 4 },
|
|
97
|
+
}}
|
|
98
|
+
>
|
|
99
|
+
<CardActionArea
|
|
100
|
+
component={Link}
|
|
101
|
+
href="/stream"
|
|
102
|
+
sx={{
|
|
103
|
+
p: 4,
|
|
104
|
+
height: '100%',
|
|
105
|
+
display: 'flex',
|
|
106
|
+
flexDirection: 'column',
|
|
107
|
+
alignItems: 'flex-start',
|
|
108
|
+
gap: 2,
|
|
109
|
+
}}
|
|
110
|
+
>
|
|
111
|
+
<Box sx={{ p: 2, bgcolor: 'rgba(156, 39, 176, 0.1)', color: '#9c27b0', borderRadius: 2 }}>
|
|
112
|
+
<StreamIcon fontSize="large" />
|
|
113
|
+
</Box>
|
|
114
|
+
<Typography variant="h5" fontWeight="bold">
|
|
115
|
+
Streaming Chat
|
|
116
|
+
</Typography>
|
|
117
|
+
<Typography variant="body1" color="text.secondary" sx={{ flexGrow: 1 }}>
|
|
118
|
+
A streaming response implementation using Server-Sent Events (SSE). The client renders the agent's
|
|
119
|
+
response incrementally as it's being generated.
|
|
120
|
+
</Typography>
|
|
121
|
+
<Stack direction="row" alignItems="center" gap={1} color="#9c27b0" fontWeight="bold" mt={2}>
|
|
122
|
+
Try it out <ArrowForwardIcon fontSize="small" />
|
|
123
|
+
</Stack>
|
|
124
|
+
</CardActionArea>
|
|
125
|
+
</Card>
|
|
126
|
+
|
|
127
|
+
{/* AG-UI Protocol Card */}
|
|
128
|
+
<Card
|
|
129
|
+
elevation={0}
|
|
130
|
+
sx={{
|
|
131
|
+
flex: 1,
|
|
132
|
+
border: 1,
|
|
133
|
+
borderColor: 'divider',
|
|
134
|
+
borderRadius: 4,
|
|
135
|
+
transition: '0.2s',
|
|
136
|
+
'&:hover': { borderColor: '#2e7d32', transform: 'translateY(-4px)', boxShadow: 4 },
|
|
137
|
+
}}
|
|
138
|
+
>
|
|
139
|
+
<CardActionArea
|
|
140
|
+
component={Link}
|
|
141
|
+
href="/agui"
|
|
142
|
+
sx={{
|
|
143
|
+
p: 4,
|
|
144
|
+
height: '100%',
|
|
145
|
+
display: 'flex',
|
|
146
|
+
flexDirection: 'column',
|
|
147
|
+
alignItems: 'flex-start',
|
|
148
|
+
gap: 2,
|
|
149
|
+
}}
|
|
150
|
+
>
|
|
151
|
+
<Box sx={{ p: 2, bgcolor: 'rgba(46, 125, 50, 0.1)', color: '#2e7d32', borderRadius: 2 }}>
|
|
152
|
+
<ExtensionIcon fontSize="large" />
|
|
153
|
+
</Box>
|
|
154
|
+
<Typography variant="h5" fontWeight="bold">
|
|
155
|
+
AG-UI Protocol
|
|
156
|
+
</Typography>
|
|
157
|
+
<Typography variant="body1" color="text.secondary" sx={{ flexGrow: 1 }}>
|
|
158
|
+
Agentic UI implementation. The agent returns structured semantic UI components alongside its state and
|
|
159
|
+
logic, driving the client dynamic interface.
|
|
160
|
+
</Typography>
|
|
161
|
+
<Stack direction="row" alignItems="center" gap={1} color="#2e7d32" fontWeight="bold" mt={2}>
|
|
162
|
+
Try it out <ArrowForwardIcon fontSize="small" />
|
|
163
|
+
</Stack>
|
|
164
|
+
</CardActionArea>
|
|
165
|
+
</Card>
|
|
166
|
+
</Stack>
|
|
167
|
+
</Container>
|
|
168
|
+
</Box>
|
|
169
|
+
</Box>
|
|
170
|
+
)
|
|
171
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { createTheme } from '@mui/material/styles'
|
|
2
|
+
|
|
3
|
+
export const theme = createTheme({
|
|
4
|
+
palette: {
|
|
5
|
+
primary: {
|
|
6
|
+
main: '#2563eb',
|
|
7
|
+
},
|
|
8
|
+
background: {
|
|
9
|
+
default: '#f9fafb',
|
|
10
|
+
paper: '#ffffff',
|
|
11
|
+
},
|
|
12
|
+
},
|
|
13
|
+
components: {
|
|
14
|
+
MuiCssBaseline: {
|
|
15
|
+
styleOverrides: {
|
|
16
|
+
html: { maxWidth: '100vw', overflowX: 'hidden' },
|
|
17
|
+
body: { maxWidth: '100vw', overflowX: 'hidden' },
|
|
18
|
+
a: { color: 'inherit', textDecoration: 'none' },
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
})
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@genui-a3/example",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"scripts": {
|
|
5
|
+
"build": "next build",
|
|
6
|
+
"dev": "next dev",
|
|
7
|
+
"start": "next start"
|
|
8
|
+
},
|
|
9
|
+
"dependencies": {
|
|
10
|
+
"@ag-ui/client": "0.0.45",
|
|
11
|
+
"@ag-ui/encoder": "0.0.45",
|
|
12
|
+
"@emotion/react": "11.14.0",
|
|
13
|
+
"@emotion/styled": "11.14.1",
|
|
14
|
+
"@genui-a3/core": "^0.1.3",
|
|
15
|
+
"@mui/icons-material": "7.3.7",
|
|
16
|
+
"@mui/material": "7.3.7",
|
|
17
|
+
"next": "16.1.6",
|
|
18
|
+
"react": "19.2.4",
|
|
19
|
+
"react-dom": "19.2.4",
|
|
20
|
+
"styled-components": "6.3.8",
|
|
21
|
+
"zod": "4.3.6"
|
|
22
|
+
},
|
|
23
|
+
"devDependencies": {
|
|
24
|
+
"@types/node": "20.19.0",
|
|
25
|
+
"@types/react": "19.2.10",
|
|
26
|
+
"@types/react-dom": "19.2.3",
|
|
27
|
+
"typescript": "5.9.3"
|
|
28
|
+
}
|
|
29
|
+
}
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "A3 Core Example",
|
|
3
|
+
"short_name": "A3 Example",
|
|
4
|
+
"icons": [
|
|
5
|
+
{ "src": "/android-chrome-192x192.png", "sizes": "192x192", "type": "image/png" },
|
|
6
|
+
{ "src": "/android-chrome-512x512.png", "sizes": "512x512", "type": "image/png" }
|
|
7
|
+
],
|
|
8
|
+
"theme_color": "#ffffff",
|
|
9
|
+
"background_color": "#ffffff",
|
|
10
|
+
"display": "standalone"
|
|
11
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "ES2017",
|
|
4
|
+
"lib": ["dom", "dom.iterable", "esnext"],
|
|
5
|
+
"allowJs": true,
|
|
6
|
+
"skipLibCheck": true,
|
|
7
|
+
"strict": true,
|
|
8
|
+
"noEmit": true,
|
|
9
|
+
"esModuleInterop": true,
|
|
10
|
+
"module": "esnext",
|
|
11
|
+
"moduleResolution": "bundler",
|
|
12
|
+
"resolveJsonModule": true,
|
|
13
|
+
"isolatedModules": true,
|
|
14
|
+
"jsx": "react-jsx",
|
|
15
|
+
"incremental": true,
|
|
16
|
+
"baseUrl": ".",
|
|
17
|
+
"plugins": [
|
|
18
|
+
{
|
|
19
|
+
"name": "next"
|
|
20
|
+
}
|
|
21
|
+
],
|
|
22
|
+
"paths": {
|
|
23
|
+
"@atoms": ["./app/components/atoms"],
|
|
24
|
+
"@atoms/*": ["./app/components/atoms/*"],
|
|
25
|
+
"@components": ["./app/components"],
|
|
26
|
+
"@components/*": ["./app/components/*"],
|
|
27
|
+
"@constants": ["./app/constants"],
|
|
28
|
+
"@constants/*": ["./app/constants/*"],
|
|
29
|
+
"@molecules": ["./app/components/molecules"],
|
|
30
|
+
"@molecules/*": ["./app/components/molecules/*"],
|
|
31
|
+
"@organisms": ["./app/components/organisms"],
|
|
32
|
+
"@organisms/*": ["./app/components/organisms/*"],
|
|
33
|
+
"types": ["./app/types"],
|
|
34
|
+
"types/*": ["./app/types/*"],
|
|
35
|
+
"@utils": ["./app/utils"],
|
|
36
|
+
"@utils/*": ["./app/utils/*"]
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts", ".next/dev/types/**/*.ts"],
|
|
40
|
+
"exclude": ["node_modules", "npm_modules"]
|
|
41
|
+
}
|