@adia-ai/web-components 0.0.27 → 0.0.29
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/README.md +4 -8
- package/a2ui/index.js +1 -1
- package/components/agent-questions/agent-questions.css +20 -1
- package/components/agent-trace/agent-trace.css +17 -12
- package/components/badge/badge.js +9 -1
- package/components/breadcrumb/breadcrumb.a2ui.json +16 -1
- package/components/breadcrumb/breadcrumb.css +27 -0
- package/components/breadcrumb/breadcrumb.js +95 -17
- package/components/breadcrumb/breadcrumb.yaml +15 -1
- package/components/canvas/canvas.js +1 -1
- package/components/chart/chart.css +20 -13
- package/components/chart/chart.js +49 -17
- package/components/chart-legend/chart-legend.css +30 -54
- package/components/chart-legend/chart-legend.js +48 -30
- package/components/command/command.js +52 -1
- package/components/feed/feed-item.yaml +50 -0
- package/components/feed/feed.a2ui.json +59 -0
- package/components/feed/feed.css +150 -0
- package/components/feed/feed.js +385 -0
- package/components/feed/feed.yaml +33 -0
- package/components/index.js +2 -0
- package/components/swatch/swatch.a2ui.json +116 -0
- package/components/swatch/swatch.css +141 -0
- package/components/swatch/swatch.js +121 -0
- package/components/swatch/swatch.yaml +101 -0
- package/components/timeline/timeline.css +5 -1
- package/components/toast/toast.js +48 -178
- package/components/tooltip/tooltip.css +3 -3
- package/core/provider.js +1 -0
- package/index.css +3 -2
- package/index.js +15 -7
- package/package.json +1 -5
- package/styles/components.css +1 -0
- package/patterns/a2ui-root/a2ui-root.a2ui.json +0 -125
- package/patterns/a2ui-root/a2ui-root.js +0 -191
- package/patterns/a2ui-root/a2ui-root.yaml +0 -87
- package/patterns/adia-chat/adia-chat.a2ui.json +0 -149
- package/patterns/adia-chat/adia-chat.css +0 -10
- package/patterns/adia-chat/adia-chat.js +0 -297
- package/patterns/adia-chat/adia-chat.yaml +0 -118
- package/patterns/adia-chat/css/adia-chat.empty.css +0 -12
- package/patterns/adia-chat/css/adia-chat.layout.css +0 -60
- package/patterns/adia-chat/css/adia-chat.markdown.css +0 -74
- package/patterns/adia-chat/css/adia-chat.messages.css +0 -87
- package/patterns/adia-chat/css/adia-chat.streaming.css +0 -30
- package/patterns/adia-chat/css/adia-chat.tokens.css +0 -95
- package/patterns/adia-editor/adia-editor.a2ui.json +0 -73
- package/patterns/adia-editor/adia-editor.css +0 -6
- package/patterns/adia-editor/adia-editor.js +0 -56
- package/patterns/adia-editor/adia-editor.yaml +0 -59
- package/patterns/adia-editor/css/adia-editor.layout.css +0 -171
- package/patterns/adia-editor/css/adia-editor.tokens.css +0 -28
- package/patterns/app-nav/app-nav.a2ui.json +0 -89
- package/patterns/app-nav/app-nav.css +0 -92
- package/patterns/app-nav/app-nav.js +0 -112
- package/patterns/app-nav/app-nav.yaml +0 -54
- package/patterns/app-nav-group/app-nav-group.a2ui.json +0 -82
- package/patterns/app-nav-group/app-nav-group.css +0 -264
- package/patterns/app-nav-group/app-nav-group.js +0 -116
- package/patterns/app-nav-group/app-nav-group.yaml +0 -59
- package/patterns/app-nav-item/app-nav-item.a2ui.json +0 -83
- package/patterns/app-nav-item/app-nav-item.css +0 -162
- package/patterns/app-nav-item/app-nav-item.js +0 -42
- package/patterns/app-nav-item/app-nav-item.yaml +0 -62
- package/patterns/app-shell/app-shell.a2ui.json +0 -129
- package/patterns/app-shell/app-shell.css +0 -14
- package/patterns/app-shell/app-shell.js +0 -251
- package/patterns/app-shell/app-shell.yaml +0 -89
- package/patterns/app-shell/css/app-shell.collapsed.css +0 -86
- package/patterns/app-shell/css/app-shell.helpers.css +0 -42
- package/patterns/app-shell/css/app-shell.main.css +0 -172
- package/patterns/app-shell/css/app-shell.shell.css +0 -44
- package/patterns/app-shell/css/app-shell.sidebar.css +0 -161
- package/patterns/app-shell/css/app-shell.templates.css +0 -214
- package/patterns/app-shell/css/app-shell.tokens.css +0 -119
- package/patterns/gen-ui/gen-ui.a2ui.json +0 -72
- package/patterns/gen-ui/gen-ui.css +0 -83
- package/patterns/gen-ui/gen-ui.js +0 -136
- package/patterns/gen-ui/gen-ui.yaml +0 -43
- package/patterns/index.js +0 -11
- package/patterns/section-nav/section-nav.a2ui.json +0 -91
- package/patterns/section-nav/section-nav.css +0 -60
- package/patterns/section-nav/section-nav.js +0 -42
- package/patterns/section-nav/section-nav.yaml +0 -58
- package/patterns/section-nav-group/section-nav-group.a2ui.json +0 -95
- package/patterns/section-nav-group/section-nav-group.css +0 -74
- package/patterns/section-nav-group/section-nav-group.js +0 -84
- package/patterns/section-nav-group/section-nav-group.yaml +0 -66
- package/patterns/section-nav-item/section-nav-item.a2ui.json +0 -97
- package/patterns/section-nav-item/section-nav-item.css +0 -106
- package/patterns/section-nav-item/section-nav-item.js +0 -66
- package/patterns/section-nav-item/section-nav-item.yaml +0 -70
- package/styles/layouts/admin.css +0 -7
|
@@ -1,125 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
-
"$id": "https://adiaui.dev/a2ui/v0_9/components/A2UIRoot.json",
|
|
4
|
-
"title": "A2UIRoot",
|
|
5
|
-
"description": "A2UI protocol surface. Connects to a stream source (SSE, WebSocket, JSONL, MCP) and renders A2UI messages as AdiaUI components via the `@adia-ai/a2ui-utils` renderer.",
|
|
6
|
-
"type": "object",
|
|
7
|
-
"allOf": [
|
|
8
|
-
{
|
|
9
|
-
"$ref": "common_types.json#/$defs/ComponentCommon"
|
|
10
|
-
},
|
|
11
|
-
{
|
|
12
|
-
"$ref": "common_types.json#/$defs/CatalogComponentCommon"
|
|
13
|
-
}
|
|
14
|
-
],
|
|
15
|
-
"properties": {
|
|
16
|
-
"active": {
|
|
17
|
-
"description": "True while the stream is connected and receiving messages.",
|
|
18
|
-
"type": "boolean",
|
|
19
|
-
"default": false
|
|
20
|
-
},
|
|
21
|
-
"batch": {
|
|
22
|
-
"description": "Batch renderer updates via requestAnimationFrame for large fan-in.",
|
|
23
|
-
"type": "boolean",
|
|
24
|
-
"default": false
|
|
25
|
-
},
|
|
26
|
-
"component": {
|
|
27
|
-
"const": "A2UIRoot"
|
|
28
|
-
},
|
|
29
|
-
"doc": {
|
|
30
|
-
"description": "Author-driven mode — set to an array of A2UI messages and the renderer resets + replays them. No network/transport involvement. Setting to a new array triggers a full re-render. Use this for editors, previews, tests, and any static-doc authoring loop. When both `src` and `doc` are set, `doc` wins (the stream is not opened). Pass as a JS property; not reflected to an attribute.",
|
|
31
|
-
"type": "array"
|
|
32
|
-
},
|
|
33
|
-
"loading": {
|
|
34
|
-
"description": "True while the stream is connecting.",
|
|
35
|
-
"type": "boolean",
|
|
36
|
-
"default": false
|
|
37
|
-
},
|
|
38
|
-
"src": {
|
|
39
|
-
"description": "Stream source URL (endpoint for SSE/WebSocket, file path for JSONL, tool-call target for MCP).",
|
|
40
|
-
"type": "string",
|
|
41
|
-
"default": ""
|
|
42
|
-
},
|
|
43
|
-
"transport": {
|
|
44
|
-
"description": "Stream transport to use.",
|
|
45
|
-
"type": "string",
|
|
46
|
-
"enum": [
|
|
47
|
-
"sse",
|
|
48
|
-
"ws",
|
|
49
|
-
"websocket",
|
|
50
|
-
"jsonl",
|
|
51
|
-
"mcp"
|
|
52
|
-
],
|
|
53
|
-
"default": "sse"
|
|
54
|
-
}
|
|
55
|
-
},
|
|
56
|
-
"required": [
|
|
57
|
-
"component"
|
|
58
|
-
],
|
|
59
|
-
"unevaluatedProperties": false,
|
|
60
|
-
"x-adiaui": {
|
|
61
|
-
"anti_patterns": [],
|
|
62
|
-
"category": "container",
|
|
63
|
-
"events": {
|
|
64
|
-
"a2ui-action": {
|
|
65
|
-
"description": "Fired when a child element with [data-action] is clicked. detail: { name, sourceComponentId, context }"
|
|
66
|
-
},
|
|
67
|
-
"a2ui-closed": {
|
|
68
|
-
"description": "Fired when the stream ends."
|
|
69
|
-
},
|
|
70
|
-
"a2ui-connected": {
|
|
71
|
-
"description": "Fired when the stream is established."
|
|
72
|
-
},
|
|
73
|
-
"a2ui-error": {
|
|
74
|
-
"description": "Fired when the stream errors. detail: { error }"
|
|
75
|
-
},
|
|
76
|
-
"a2ui-message": {
|
|
77
|
-
"description": "Fired for each A2UI message received. detail: { message }"
|
|
78
|
-
},
|
|
79
|
-
"doc-replaced": {
|
|
80
|
-
"description": "Fired after a full doc reset + replay in author-driven mode. detail: { count }"
|
|
81
|
-
}
|
|
82
|
-
},
|
|
83
|
-
"examples": [],
|
|
84
|
-
"keywords": [
|
|
85
|
-
"a2ui",
|
|
86
|
-
"protocol",
|
|
87
|
-
"renderer",
|
|
88
|
-
"stream",
|
|
89
|
-
"surface",
|
|
90
|
-
"sse",
|
|
91
|
-
"websocket",
|
|
92
|
-
"jsonl",
|
|
93
|
-
"mcp"
|
|
94
|
-
],
|
|
95
|
-
"name": "AdiaA2UIRoot",
|
|
96
|
-
"related": [
|
|
97
|
-
"canvas",
|
|
98
|
-
"inspector"
|
|
99
|
-
],
|
|
100
|
-
"slots": {
|
|
101
|
-
"default": {
|
|
102
|
-
"description": "The rendered surface. Children are stamped by the A2UI renderer."
|
|
103
|
-
}
|
|
104
|
-
},
|
|
105
|
-
"states": [
|
|
106
|
-
{
|
|
107
|
-
"description": "Default, ready to connect.",
|
|
108
|
-
"name": "idle"
|
|
109
|
-
},
|
|
110
|
-
{
|
|
111
|
-
"description": "Stream is connecting.",
|
|
112
|
-
"name": "loading"
|
|
113
|
-
},
|
|
114
|
-
{
|
|
115
|
-
"description": "Stream is connected and receiving messages.",
|
|
116
|
-
"name": "active"
|
|
117
|
-
}
|
|
118
|
-
],
|
|
119
|
-
"synonyms": {},
|
|
120
|
-
"tag": "a2ui-root",
|
|
121
|
-
"tokens": {},
|
|
122
|
-
"traits": [],
|
|
123
|
-
"version": 1
|
|
124
|
-
}
|
|
125
|
-
}
|
|
@@ -1,191 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* <a2ui-root> — A2UI protocol surface.
|
|
3
|
-
* Connects to a stream source and renders A2UI messages as AdiaUI components.
|
|
4
|
-
*
|
|
5
|
-
* <a2ui-root src="/api/agent" transport="sse"></a2ui-root>
|
|
6
|
-
* <a2ui-root src="ws://localhost:8080" transport="ws"></a2ui-root>
|
|
7
|
-
*
|
|
8
|
-
* Static / author-driven mode — set the `doc` property (array of A2UI messages)
|
|
9
|
-
* and the renderer resets + replays them. Editors and previews can drive the
|
|
10
|
-
* surface without opening a transport. Setting `doc` to a new array re-renders
|
|
11
|
-
* from scratch (reset() + processAll()).
|
|
12
|
-
*
|
|
13
|
-
* const root = document.querySelector('a2ui-root');
|
|
14
|
-
* root.doc = [
|
|
15
|
-
* { type: 'createSurface', surfaceId: 'root', root: 'c-1' },
|
|
16
|
-
* { type: 'updateComponents', components: [{ id: 'c-1', component: 'Heading', text: 'Hi' }] },
|
|
17
|
-
* ];
|
|
18
|
-
*
|
|
19
|
-
* Events:
|
|
20
|
-
* a2ui-connected — stream connected
|
|
21
|
-
* a2ui-message — each message received (detail: { message })
|
|
22
|
-
* a2ui-error — stream error (detail: { error })
|
|
23
|
-
* a2ui-closed — stream ended
|
|
24
|
-
* a2ui-action — user interaction (detail: { name, sourceComponentId, context })
|
|
25
|
-
* doc-replaced — fired after a full doc reset + replay (author-driven mode)
|
|
26
|
-
*/
|
|
27
|
-
|
|
28
|
-
import { AdiaElement } from '../../core/element.js';
|
|
29
|
-
import {
|
|
30
|
-
A2UIRenderer,
|
|
31
|
-
registry,
|
|
32
|
-
sseStream,
|
|
33
|
-
wsStream,
|
|
34
|
-
jsonlStream,
|
|
35
|
-
mcpStream,
|
|
36
|
-
} from '@adia-ai/a2ui-utils';
|
|
37
|
-
|
|
38
|
-
class AdiaA2UIRoot extends AdiaElement {
|
|
39
|
-
static properties = {
|
|
40
|
-
src: { type: String, default: '', reflect: true },
|
|
41
|
-
transport: { type: String, default: 'sse', reflect: true },
|
|
42
|
-
loading: { type: Boolean, default: false, reflect: true },
|
|
43
|
-
active: { type: Boolean, default: false, reflect: true },
|
|
44
|
-
batch: { type: Boolean, default: false, reflect: true },
|
|
45
|
-
};
|
|
46
|
-
|
|
47
|
-
static template = () => null;
|
|
48
|
-
|
|
49
|
-
#renderer = null;
|
|
50
|
-
#abortCtrl = null;
|
|
51
|
-
#doc = null;
|
|
52
|
-
#bound = false;
|
|
53
|
-
|
|
54
|
-
#onClick = (e) => {
|
|
55
|
-
const actionEl = e.target.closest('[data-action]');
|
|
56
|
-
if (!actionEl) return;
|
|
57
|
-
this.dispatchEvent(new CustomEvent('a2ui-action', {
|
|
58
|
-
bubbles: true,
|
|
59
|
-
detail: {
|
|
60
|
-
name: actionEl.getAttribute('data-action'),
|
|
61
|
-
sourceComponentId: actionEl.getAttribute('data-a2ui-id') || '',
|
|
62
|
-
timestamp: Date.now(),
|
|
63
|
-
context: {},
|
|
64
|
-
},
|
|
65
|
-
}));
|
|
66
|
-
};
|
|
67
|
-
|
|
68
|
-
connected() {
|
|
69
|
-
this.#renderer = new A2UIRenderer(this, registry, { batch: this.batch });
|
|
70
|
-
|
|
71
|
-
if (!this.#bound) {
|
|
72
|
-
this.#bound = true;
|
|
73
|
-
this.addEventListener('click', this.#onClick);
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
render() {
|
|
78
|
-
if (this.src && !this.active) this.#connect();
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
async #connect() {
|
|
82
|
-
this.#abortCtrl?.abort();
|
|
83
|
-
this.#abortCtrl = new AbortController();
|
|
84
|
-
const signal = this.#abortCtrl.signal;
|
|
85
|
-
|
|
86
|
-
this.loading = true;
|
|
87
|
-
this.active = false;
|
|
88
|
-
|
|
89
|
-
let stream;
|
|
90
|
-
try {
|
|
91
|
-
switch (this.transport) {
|
|
92
|
-
case 'sse':
|
|
93
|
-
stream = sseStream(this.src, { signal, catalog: registry });
|
|
94
|
-
break;
|
|
95
|
-
case 'ws':
|
|
96
|
-
case 'websocket':
|
|
97
|
-
stream = wsStream(this.src, { signal, catalog: registry });
|
|
98
|
-
break;
|
|
99
|
-
case 'jsonl':
|
|
100
|
-
stream = jsonlStream(this.src, { signal, catalog: registry });
|
|
101
|
-
break;
|
|
102
|
-
case 'mcp':
|
|
103
|
-
stream = mcpStream(this.src, {
|
|
104
|
-
signal,
|
|
105
|
-
catalog: registry,
|
|
106
|
-
onAction: (name, params) => {
|
|
107
|
-
this.dispatchEvent(new CustomEvent('a2ui-action', {
|
|
108
|
-
bubbles: true,
|
|
109
|
-
detail: { name, params, timestamp: Date.now() },
|
|
110
|
-
}));
|
|
111
|
-
return Promise.resolve({ status: 'dispatched' });
|
|
112
|
-
},
|
|
113
|
-
});
|
|
114
|
-
break;
|
|
115
|
-
default:
|
|
116
|
-
console.warn(`a2ui-root: unknown transport "${this.transport}"`);
|
|
117
|
-
return;
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
this.active = true;
|
|
121
|
-
this.loading = false;
|
|
122
|
-
this.dispatchEvent(new Event('a2ui-connected', { bubbles: true }));
|
|
123
|
-
|
|
124
|
-
for await (const message of stream) {
|
|
125
|
-
if (signal.aborted) break;
|
|
126
|
-
this.#renderer.process(message);
|
|
127
|
-
this.dispatchEvent(new CustomEvent('a2ui-message', {
|
|
128
|
-
bubbles: true,
|
|
129
|
-
detail: { message },
|
|
130
|
-
}));
|
|
131
|
-
}
|
|
132
|
-
} catch (err) {
|
|
133
|
-
if (!signal.aborted) {
|
|
134
|
-
this.dispatchEvent(new CustomEvent('a2ui-error', {
|
|
135
|
-
bubbles: true,
|
|
136
|
-
detail: { error: err },
|
|
137
|
-
}));
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
this.active = false;
|
|
142
|
-
this.loading = false;
|
|
143
|
-
this.dispatchEvent(new Event('a2ui-closed', { bubbles: true }));
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
process(message) {
|
|
147
|
-
if (!this.#renderer) {
|
|
148
|
-
this.#renderer = new A2UIRenderer(this, registry);
|
|
149
|
-
}
|
|
150
|
-
this.#renderer.process(message);
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
processAll(messages) {
|
|
154
|
-
for (const msg of messages) this.process(msg);
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
get doc() { return this.#doc; }
|
|
158
|
-
set doc(messages) {
|
|
159
|
-
this.#doc = Array.isArray(messages) ? messages : [];
|
|
160
|
-
if (!this.#renderer) {
|
|
161
|
-
this.#renderer = new A2UIRenderer(this, registry);
|
|
162
|
-
}
|
|
163
|
-
this.#renderer.reset();
|
|
164
|
-
for (const msg of this.#doc) this.#renderer.process(msg);
|
|
165
|
-
this.dispatchEvent(new CustomEvent('doc-replaced', {
|
|
166
|
-
bubbles: true,
|
|
167
|
-
detail: { count: this.#doc.length },
|
|
168
|
-
}));
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
reset() {
|
|
172
|
-
this.#renderer?.reset();
|
|
173
|
-
}
|
|
174
|
-
|
|
175
|
-
disconnect() {
|
|
176
|
-
this.#abortCtrl?.abort();
|
|
177
|
-
this.active = false;
|
|
178
|
-
}
|
|
179
|
-
|
|
180
|
-
disconnected() {
|
|
181
|
-
this.#abortCtrl?.abort();
|
|
182
|
-
this.removeEventListener('click', this.#onClick);
|
|
183
|
-
this.#bound = false;
|
|
184
|
-
this.active = false;
|
|
185
|
-
}
|
|
186
|
-
|
|
187
|
-
get renderer() { return this.#renderer; }
|
|
188
|
-
}
|
|
189
|
-
customElements.define('a2ui-root', AdiaA2UIRoot);
|
|
190
|
-
|
|
191
|
-
export { AdiaA2UIRoot };
|
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
# Edit this file; run `npm run build:components` to regenerate a2ui.json.
|
|
2
|
-
$schema: ../../../../scripts/schemas/component.yaml.schema.json
|
|
3
|
-
name: AdiaA2UIRoot
|
|
4
|
-
tag: a2ui-root
|
|
5
|
-
component: A2UIRoot
|
|
6
|
-
category: container
|
|
7
|
-
version: 1
|
|
8
|
-
description: A2UI protocol surface. Connects to a stream source (SSE, WebSocket, JSONL, MCP) and renders A2UI messages as AdiaUI components via the `@adia-ai/a2ui-utils` renderer.
|
|
9
|
-
props:
|
|
10
|
-
src:
|
|
11
|
-
description: Stream source URL (endpoint for SSE/WebSocket, file path for JSONL, tool-call target for MCP).
|
|
12
|
-
type: string
|
|
13
|
-
default: ""
|
|
14
|
-
transport:
|
|
15
|
-
description: Stream transport to use.
|
|
16
|
-
type: string
|
|
17
|
-
default: sse
|
|
18
|
-
enum:
|
|
19
|
-
- sse
|
|
20
|
-
- ws
|
|
21
|
-
- websocket
|
|
22
|
-
- jsonl
|
|
23
|
-
- mcp
|
|
24
|
-
loading:
|
|
25
|
-
description: True while the stream is connecting.
|
|
26
|
-
type: boolean
|
|
27
|
-
default: false
|
|
28
|
-
reflect: true
|
|
29
|
-
active:
|
|
30
|
-
description: True while the stream is connected and receiving messages.
|
|
31
|
-
type: boolean
|
|
32
|
-
default: false
|
|
33
|
-
reflect: true
|
|
34
|
-
batch:
|
|
35
|
-
description: Batch renderer updates via requestAnimationFrame for large fan-in.
|
|
36
|
-
type: boolean
|
|
37
|
-
default: false
|
|
38
|
-
doc:
|
|
39
|
-
description: >-
|
|
40
|
-
Author-driven mode — set to an array of A2UI messages and the renderer
|
|
41
|
-
resets + replays them. No network/transport involvement. Setting to a
|
|
42
|
-
new array triggers a full re-render. Use this for editors, previews,
|
|
43
|
-
tests, and any static-doc authoring loop. When both `src` and `doc` are
|
|
44
|
-
set, `doc` wins (the stream is not opened). Pass as a JS property; not
|
|
45
|
-
reflected to an attribute.
|
|
46
|
-
type: array
|
|
47
|
-
events:
|
|
48
|
-
a2ui-connected:
|
|
49
|
-
description: Fired when the stream is established.
|
|
50
|
-
a2ui-message:
|
|
51
|
-
description: "Fired for each A2UI message received. detail: { message }"
|
|
52
|
-
a2ui-action:
|
|
53
|
-
description: "Fired when a child element with [data-action] is clicked. detail: { name, sourceComponentId, context }"
|
|
54
|
-
a2ui-error:
|
|
55
|
-
description: "Fired when the stream errors. detail: { error }"
|
|
56
|
-
a2ui-closed:
|
|
57
|
-
description: Fired when the stream ends.
|
|
58
|
-
doc-replaced:
|
|
59
|
-
description: "Fired after a full doc reset + replay in author-driven mode. detail: { count }"
|
|
60
|
-
slots:
|
|
61
|
-
default:
|
|
62
|
-
description: The rendered surface. Children are stamped by the A2UI renderer.
|
|
63
|
-
states:
|
|
64
|
-
- name: idle
|
|
65
|
-
description: Default, ready to connect.
|
|
66
|
-
- name: loading
|
|
67
|
-
description: Stream is connecting.
|
|
68
|
-
- name: active
|
|
69
|
-
description: Stream is connected and receiving messages.
|
|
70
|
-
traits: []
|
|
71
|
-
tokens: {}
|
|
72
|
-
a2ui:
|
|
73
|
-
rules: []
|
|
74
|
-
anti_patterns: []
|
|
75
|
-
keywords:
|
|
76
|
-
- a2ui
|
|
77
|
-
- protocol
|
|
78
|
-
- renderer
|
|
79
|
-
- stream
|
|
80
|
-
- surface
|
|
81
|
-
- sse
|
|
82
|
-
- websocket
|
|
83
|
-
- jsonl
|
|
84
|
-
- mcp
|
|
85
|
-
related:
|
|
86
|
-
- canvas
|
|
87
|
-
- inspector
|
|
@@ -1,149 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
-
"$id": "https://adiaui.dev/a2ui/v0_9/components/Chat.json",
|
|
4
|
-
"title": "Chat",
|
|
5
|
-
"description": "Behavior-only chat orchestrator. Author supplies the DOM structure via\n[data-chat-messages], [data-chat-input], [data-chat-empty], [data-chat-status]\nelements; adia-chat wires message streaming, markdown rendering, code-block\nupgrades, and an LLM integration path via proxy-url (or via external submit).\n",
|
|
6
|
-
"type": "object",
|
|
7
|
-
"allOf": [
|
|
8
|
-
{
|
|
9
|
-
"$ref": "common_types.json#/$defs/ComponentCommon"
|
|
10
|
-
},
|
|
11
|
-
{
|
|
12
|
-
"$ref": "common_types.json#/$defs/CatalogComponentCommon"
|
|
13
|
-
}
|
|
14
|
-
],
|
|
15
|
-
"properties": {
|
|
16
|
-
"component": {
|
|
17
|
-
"const": "Chat"
|
|
18
|
-
},
|
|
19
|
-
"model": {
|
|
20
|
-
"description": "Model identifier.",
|
|
21
|
-
"type": "string",
|
|
22
|
-
"default": ""
|
|
23
|
-
},
|
|
24
|
-
"provider": {
|
|
25
|
-
"description": "LLM provider name (anthropic | openai | google | stub).",
|
|
26
|
-
"type": "string",
|
|
27
|
-
"default": ""
|
|
28
|
-
},
|
|
29
|
-
"proxyUrl": {
|
|
30
|
-
"description": "API proxy endpoint for LLM calls; enables self-contained chat without external wiring.",
|
|
31
|
-
"type": "string",
|
|
32
|
-
"default": ""
|
|
33
|
-
},
|
|
34
|
-
"streaming": {
|
|
35
|
-
"description": "Active streaming indicator; toggled while a response is being received.",
|
|
36
|
-
"type": "boolean",
|
|
37
|
-
"default": false
|
|
38
|
-
},
|
|
39
|
-
"system": {
|
|
40
|
-
"description": "System prompt prepended to conversations.",
|
|
41
|
-
"type": "string",
|
|
42
|
-
"default": ""
|
|
43
|
-
},
|
|
44
|
-
"thinking": {
|
|
45
|
-
"description": "Enable Anthropic extended-thinking mode.",
|
|
46
|
-
"type": "boolean",
|
|
47
|
-
"default": false
|
|
48
|
-
}
|
|
49
|
-
},
|
|
50
|
-
"required": [
|
|
51
|
-
"component"
|
|
52
|
-
],
|
|
53
|
-
"unevaluatedProperties": false,
|
|
54
|
-
"x-adiaui": {
|
|
55
|
-
"anti_patterns": [],
|
|
56
|
-
"category": "container",
|
|
57
|
-
"events": {
|
|
58
|
-
"abort": {
|
|
59
|
-
"description": "Fired when the user aborts an in-flight request."
|
|
60
|
-
},
|
|
61
|
-
"chunk": {
|
|
62
|
-
"description": "Fired for each streaming chunk.",
|
|
63
|
-
"detail": {
|
|
64
|
-
"snapshot": "string",
|
|
65
|
-
"text": "string"
|
|
66
|
-
}
|
|
67
|
-
},
|
|
68
|
-
"clear": {
|
|
69
|
-
"description": "Fired when the conversation is cleared."
|
|
70
|
-
},
|
|
71
|
-
"done": {
|
|
72
|
-
"description": "Fired when a response completes.",
|
|
73
|
-
"detail": {
|
|
74
|
-
"stopReason": "string",
|
|
75
|
-
"text": "string",
|
|
76
|
-
"usage": "object"
|
|
77
|
-
}
|
|
78
|
-
},
|
|
79
|
-
"error": {
|
|
80
|
-
"description": "Fired on any LLM / network error.",
|
|
81
|
-
"detail": {
|
|
82
|
-
"error": "Error"
|
|
83
|
-
}
|
|
84
|
-
},
|
|
85
|
-
"message": {
|
|
86
|
-
"description": "Fired after each message (user or assistant) is appended.",
|
|
87
|
-
"detail": {
|
|
88
|
-
"content": "string",
|
|
89
|
-
"id": "string",
|
|
90
|
-
"role": "string"
|
|
91
|
-
}
|
|
92
|
-
},
|
|
93
|
-
"submit": {
|
|
94
|
-
"description": "Fired on user message submit (before LLM call begins).",
|
|
95
|
-
"detail": {
|
|
96
|
-
"model": "string",
|
|
97
|
-
"text": "string"
|
|
98
|
-
}
|
|
99
|
-
},
|
|
100
|
-
"thinking": {
|
|
101
|
-
"description": "Fired when the model emits extended-thinking content.",
|
|
102
|
-
"detail": {
|
|
103
|
-
"text": "string"
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
},
|
|
107
|
-
"examples": [],
|
|
108
|
-
"keywords": [
|
|
109
|
-
"adia-chat",
|
|
110
|
-
"chat",
|
|
111
|
-
"llm",
|
|
112
|
-
"streaming",
|
|
113
|
-
"conversation",
|
|
114
|
-
"agent"
|
|
115
|
-
],
|
|
116
|
-
"name": "AdiaChatElement",
|
|
117
|
-
"related": [
|
|
118
|
-
"ChatInput",
|
|
119
|
-
"Code"
|
|
120
|
-
],
|
|
121
|
-
"slots": {
|
|
122
|
-
"default": {
|
|
123
|
-
"description": "Author provides the structural DOM. Expected markers — [data-chat-messages] (message list), [data-chat-input] (input surface), [data-chat-empty] (empty state), [data-chat-status] (streaming indicator)."
|
|
124
|
-
}
|
|
125
|
-
},
|
|
126
|
-
"states": [
|
|
127
|
-
{
|
|
128
|
-
"description": "No active request.",
|
|
129
|
-
"name": "idle"
|
|
130
|
-
},
|
|
131
|
-
{
|
|
132
|
-
"description": "An LLM request is in-flight; [data-chat-status] visible.",
|
|
133
|
-
"attribute": "streaming",
|
|
134
|
-
"name": "streaming"
|
|
135
|
-
}
|
|
136
|
-
],
|
|
137
|
-
"synonyms": {
|
|
138
|
-
"chat": [
|
|
139
|
-
"conversation",
|
|
140
|
-
"messages",
|
|
141
|
-
"thread"
|
|
142
|
-
]
|
|
143
|
-
},
|
|
144
|
-
"tag": "adia-chat-ui",
|
|
145
|
-
"tokens": {},
|
|
146
|
-
"traits": [],
|
|
147
|
-
"version": 1
|
|
148
|
-
}
|
|
149
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/* ═══════════════════════════════════════════════════════════════
|
|
2
|
-
adia-chat — Pattern component CSS
|
|
3
|
-
═══════════════════════════════════════════════════════════════ */
|
|
4
|
-
|
|
5
|
-
@import "./css/adia-chat.tokens.css";
|
|
6
|
-
@import "./css/adia-chat.layout.css";
|
|
7
|
-
@import "./css/adia-chat.messages.css";
|
|
8
|
-
@import "./css/adia-chat.streaming.css";
|
|
9
|
-
@import "./css/adia-chat.markdown.css";
|
|
10
|
-
@import "./css/adia-chat.empty.css";
|