@adia-ai/a2ui 0.8.39 → 0.8.41
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/CHANGELOG.md +17 -0
- package/README.md +2 -2
- package/catalog/catalog-a2ui_0_9.json +1461 -490
- package/catalog/catalog-a2ui_0_9_rules.txt +41 -30
- package/catalog/common_types.json +1 -0
- package/catalog/tier-index.json +274 -71
- package/catalog/tiers/README.md +19 -1
- package/catalog/tiers/l1-widgets.json +6 -6
- package/package.json +1 -1
- package/registry.js +6 -0
- package/renderer.d.ts +77 -0
- package/renderer.js +420 -11
- package/stream.js +11 -3
- package/wiring-engine.d.ts +7 -0
- package/wiring-engine.js +15 -0
package/catalog/tiers/README.md
CHANGED
|
@@ -2,7 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
The authoring home for the upper rungs of the catalog ladder (ADR-0050,
|
|
4
4
|
gh#1243). **L0 is not authored here** — it derives from the assembled catalog
|
|
5
|
-
(`../catalog-a2ui_0_9.json`, itself derived from component YAML
|
|
5
|
+
(`../catalog-a2ui_0_9.json`, itself derived from component YAML sourced from
|
|
6
|
+
BOTH `packages/web-components/components` (primitives) and
|
|
7
|
+
`packages/web-modules` (composite modules) — one shared YAML contract, one
|
|
8
|
+
catalog. Every L0 entry in `../tier-index.json` carries `origin: "primitive"
|
|
9
|
+
| "module"` recording which (ADR-0066 §2) — a module's component API sits at
|
|
10
|
+
L0 same as a primitive's; its *assembled* composition is separately an L3
|
|
11
|
+
unit (see ADR-0066 for the full component/module/pattern tier model).
|
|
6
12
|
|
|
7
13
|
l1-<set>.json widgets — chat-scale functional units, composed of L0 entries
|
|
8
14
|
l2-<set>.json layouts — composed of L1 entries
|
|
@@ -27,6 +33,18 @@ that resolves to neither — a native element (`FormContainer`,
|
|
|
27
33
|
`DescriptionTerm`), a sub-descriptor (`ColDef`), or an upper-rung unit
|
|
28
34
|
(`AdminShell`) — has no L0 entry and fails the build.
|
|
29
35
|
|
|
36
|
+
The **emitted** index speaks the standard's vocabulary, not this authoring
|
|
37
|
+
one: genui-system SPEC R-C13 rules that `composes` edges carry component
|
|
38
|
+
TYPE names — the R-C7 catalogs' `components` keys, the same identifiers a
|
|
39
|
+
wire node's `component` field carries (gh#1478, genui-system#16). After both
|
|
40
|
+
law checks pass in catalog names, the derivation re-spells every
|
|
41
|
+
L0-composing entry's `composes` into type names through
|
|
42
|
+
`derive-genui-catalog.mjs`'s `canonicalTagTypeNames()` — the exact mapping
|
|
43
|
+
that keys `base.json`/`adia-pack.json` — so `Col`/`Check`/`Select`/
|
|
44
|
+
`Textarea` land in `tier-index.json` as `Column`/`CheckBox`/`ChoicePicker`/
|
|
45
|
+
`TextArea`. Authored sources here stay in catalog names; only the artifact
|
|
46
|
+
re-spells.
|
|
47
|
+
|
|
30
48
|
## File shape
|
|
31
49
|
|
|
32
50
|
```jsonc
|
|
@@ -123,7 +123,7 @@
|
|
|
123
123
|
"Timeline",
|
|
124
124
|
"TimelineItem"
|
|
125
125
|
],
|
|
126
|
-
"version": "1.0.
|
|
126
|
+
"version": "1.0.1",
|
|
127
127
|
"domain": "agent",
|
|
128
128
|
"description": "Agent reasoning trace — thought process, tool calls, and interim results rendered as a timeline-ui of timeline-item rows. (agent-reasoning-ui is JS-property-driven and can't be authored statically — gh#916/gh#938; this is the documented static equivalent.)",
|
|
129
129
|
"keywords": [
|
|
@@ -166,7 +166,7 @@
|
|
|
166
166
|
"component": "TimelineItem",
|
|
167
167
|
"description": "Detected intent: summarize churn risk for accounts renewing next month",
|
|
168
168
|
"icon": "chat-circle-text",
|
|
169
|
-
"status": "
|
|
169
|
+
"status": "completed",
|
|
170
170
|
"text": "Interpreted request"
|
|
171
171
|
},
|
|
172
172
|
{
|
|
@@ -175,7 +175,7 @@
|
|
|
175
175
|
"description": "warehouse.accounts_renewals · 214 rows · filtered to next-30-days",
|
|
176
176
|
"duration": "480ms",
|
|
177
177
|
"icon": "database",
|
|
178
|
-
"status": "
|
|
178
|
+
"status": "completed",
|
|
179
179
|
"text": "Queried account data"
|
|
180
180
|
},
|
|
181
181
|
{
|
|
@@ -184,7 +184,7 @@
|
|
|
184
184
|
"description": "scoring_model.churn_v3(account_ids=214) → 214 scores",
|
|
185
185
|
"duration": "1.1s",
|
|
186
186
|
"icon": "function",
|
|
187
|
-
"status": "
|
|
187
|
+
"status": "completed",
|
|
188
188
|
"text": "Called risk-scoring tool"
|
|
189
189
|
},
|
|
190
190
|
{
|
|
@@ -192,7 +192,7 @@
|
|
|
192
192
|
"component": "TimelineItem",
|
|
193
193
|
"description": "Kept scores > 0.6 · 18 accounts flagged high-risk",
|
|
194
194
|
"icon": "funnel",
|
|
195
|
-
"status": "
|
|
195
|
+
"status": "completed",
|
|
196
196
|
"text": "Ranked and filtered results"
|
|
197
197
|
},
|
|
198
198
|
{
|
|
@@ -200,7 +200,7 @@
|
|
|
200
200
|
"component": "TimelineItem",
|
|
201
201
|
"description": "Grouped by risk tier · drafted the response below",
|
|
202
202
|
"icon": "pencil-simple",
|
|
203
|
-
"status": "
|
|
203
|
+
"status": "completed",
|
|
204
204
|
"text": "Composed summary"
|
|
205
205
|
},
|
|
206
206
|
{
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adia-ai/a2ui",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.41",
|
|
4
4
|
"description": "The A2UI protocol — runtime (renderer, registry, streams, surface manifest, wiring primitives, dockable base classes) plus protocol-side validation. Framework-agnostic and dependency-free; pairs with any A2UI-conformant component set. Folded from @adia-ai/a2ui-runtime + the protocol half of @adia-ai/a2ui-validator (ADR-0048).",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
package/registry.js
CHANGED
|
@@ -231,6 +231,12 @@ export const registry = new Map([
|
|
|
231
231
|
// returning no real callers). Was a §175 baseline orphan; removing
|
|
232
232
|
// the registry entry closes it cleanly.
|
|
233
233
|
['ChatThread', 'chat-thread'], // §49 — re-routed to the chat web-module (was: chat-thread-ui primitive). The module owns scroll-to-bottom + streaming; primitive remains accessible via bare `chat-thread-ui` tag.
|
|
234
|
+
// gh#1427 — the primitive's own yaml `component:` field was still
|
|
235
|
+
// `ChatThread`, colliding with the module above at the catalog-build
|
|
236
|
+
// key (same defect class as the AppShell/admin-shell collision this
|
|
237
|
+
// ticket fixed); renamed to `UIChatThread` (matching its own `name:`)
|
|
238
|
+
// so it has a unique catalog key, mapped here to its existing bare tag.
|
|
239
|
+
['UIChatThread', 'chat-thread-ui'],
|
|
234
240
|
['ChatInput', 'chat-input-ui'],
|
|
235
241
|
['OptionCard', 'option-card-ui'],
|
|
236
242
|
['Option', 'option-card-ui'], // bare Option → option-card-ui
|
package/renderer.d.ts
CHANGED
|
@@ -17,6 +17,43 @@ export interface SurfaceState {
|
|
|
17
17
|
elements: Map<string, HTMLElement>;
|
|
18
18
|
dataModel: Record<string, unknown>;
|
|
19
19
|
bindings: Map<string, unknown>;
|
|
20
|
+
/** False for a synthetic surface (updateComponents with no prior createSurface) — see `lifecycle`. */
|
|
21
|
+
synthetic: boolean;
|
|
22
|
+
/** Null for a synthetic surface — outside the lifecycle contract (spec-a2ui-surface-lifecycle.md). This is the LIVE internal record, not a copy — mutating it is undefined behavior; use the renderer's own API (beginSurfaceUpdate/commitSurfaceUpdate/abortSurfaceUpdate) to change it. */
|
|
23
|
+
lifecycle: Readonly<SurfaceLifecycle> | null;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/** Surface lifecycle state (spec-a2ui-surface-lifecycle.md, ADR-0061, gh#1364). */
|
|
27
|
+
export type SurfaceLifecycleState =
|
|
28
|
+
| 'empty' | 'pending-first' | 'live' | 'pending-stale' | 'error-empty' | 'error-stale';
|
|
29
|
+
|
|
30
|
+
/** Per-surface lifecycle record, stored alongside elements/dataModel/bindings. */
|
|
31
|
+
export interface SurfaceLifecycle {
|
|
32
|
+
state: SurfaceLifecycleState;
|
|
33
|
+
/** Current in-flight generation id, or null when not pending. */
|
|
34
|
+
generationId: string | null;
|
|
35
|
+
/** Messages buffered since the last begin, applied atomically at commit. */
|
|
36
|
+
buffer: (A2UIMessage | Record<string, unknown>)[] | null;
|
|
37
|
+
mode: 'replace' | 'patch';
|
|
38
|
+
/** Advisory reason recorded by the currently (or most recently) open bracket, or null. */
|
|
39
|
+
reason: 'refine' | 'revalidate' | 'regenerate' | null;
|
|
40
|
+
/** True while the surface carries an unhealed abort (error-empty/error-stale); the next successful commit clears it (REQ-007). */
|
|
41
|
+
hadError: boolean;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export interface BeginSurfaceUpdateOptions {
|
|
45
|
+
/** Caller-supplied generation id; minted when omitted. */
|
|
46
|
+
generationId?: string;
|
|
47
|
+
/** Advisory — why this bracket opened. */
|
|
48
|
+
reason?: 'refine' | 'revalidate' | 'regenerate';
|
|
49
|
+
/** `replace` (default) sweeps components the new answer no longer declares; `patch` is upsert-only. */
|
|
50
|
+
mode?: 'replace' | 'patch';
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export interface SurfaceLifecycleError {
|
|
54
|
+
code?: string;
|
|
55
|
+
message?: string;
|
|
56
|
+
[key: string]: unknown;
|
|
20
57
|
}
|
|
21
58
|
|
|
22
59
|
export declare class A2UIRenderer {
|
|
@@ -64,4 +101,44 @@ export declare class A2UIRenderer {
|
|
|
64
101
|
|
|
65
102
|
/** Enable or disable RAF batching at runtime. */
|
|
66
103
|
batching: boolean;
|
|
104
|
+
|
|
105
|
+
// ── Surface lifecycle (spec-a2ui-surface-lifecycle.md, ADR-0061, gh#1364) ──
|
|
106
|
+
|
|
107
|
+
/**
|
|
108
|
+
* Begin a regeneration bracket for `surfaceId`. Returns the minted/echoed
|
|
109
|
+
* generationId, or null (no-op) for a missing or synthetic surface.
|
|
110
|
+
*/
|
|
111
|
+
beginSurfaceUpdate(surfaceId: string, opts?: BeginSurfaceUpdateOptions): string | null;
|
|
112
|
+
|
|
113
|
+
/**
|
|
114
|
+
* Apply messages targeting `surfaceId` — buffers while pending, applies
|
|
115
|
+
* immediately otherwise (identical to process() per message).
|
|
116
|
+
*/
|
|
117
|
+
applyTo(surfaceId: string, messages: (A2UIMessage | Record<string, unknown>) | (A2UIMessage | Record<string, unknown>)[]): void;
|
|
118
|
+
|
|
119
|
+
/**
|
|
120
|
+
* Commit the in-flight generation — applies the buffered bracket
|
|
121
|
+
* atomically. Returns false when there was nothing to commit or the
|
|
122
|
+
* generationId was superseded (ignored, not an error). `async`: awaits
|
|
123
|
+
* any buffered `wireComponents` (and the dynamic import + docking it
|
|
124
|
+
* may trigger) before the replace-mode sweep runs, so swept ids that
|
|
125
|
+
* were also freshly wired this same bracket are correctly undocked.
|
|
126
|
+
*/
|
|
127
|
+
commitSurfaceUpdate(surfaceId: string, generationId?: string): Promise<boolean>;
|
|
128
|
+
|
|
129
|
+
/**
|
|
130
|
+
* Abort the in-flight generation — stale content (if any) stays visible.
|
|
131
|
+
* Returns false when there was nothing to abort or the generationId was
|
|
132
|
+
* superseded.
|
|
133
|
+
*/
|
|
134
|
+
abortSurfaceUpdate(surfaceId: string, generationId?: string, error?: SurfaceLifecycleError): boolean;
|
|
135
|
+
|
|
136
|
+
/** Read-only lifecycle snapshot for `surfaceId`, or null (missing/synthetic). Live internal record — see SurfaceState.lifecycle. */
|
|
137
|
+
getLifecycle(surfaceId: string): Readonly<SurfaceLifecycle> | null;
|
|
138
|
+
|
|
139
|
+
/** True while `surfaceId` has an in-flight generation. */
|
|
140
|
+
isPending(surfaceId: string): boolean;
|
|
141
|
+
|
|
142
|
+
/** IDs of every surface currently pending. */
|
|
143
|
+
readonly pendingSurfaces: string[];
|
|
67
144
|
}
|