@adia-ai/a2ui-compose 0.0.1 → 0.2.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/CHANGELOG.md +143 -1
- package/README.md +17 -14
- package/{engine → core}/generator.js +13 -13
- package/{engine → core}/state.js +2 -2
- package/index.js +4 -4
- package/package.json +17 -14
- package/{engines → strategies}/monolithic/_shared.js +9 -9
- package/{engines → strategies}/monolithic/generate-instant.js +8 -8
- package/{engines → strategies}/monolithic/generate-pro.js +10 -10
- package/{engines → strategies}/monolithic/generate-thinking.js +8 -8
- package/{engines → strategies}/registry.js +6 -6
- package/strategies/zettel/chunk-composer.js +182 -0
- package/strategies/zettel/chunk-refiner.js +514 -0
- package/strategies/zettel/chunk-synthesizer.js +235 -0
- package/{engines → strategies}/zettel/generate.js +1 -1
- package/strategies/zettel/issue-reporter.js +380 -0
- package/{engines → strategies}/zettel/session-store.js +1 -1
- package/strategies/zettel/state-cache.js +153 -0
- package/transpiler/transpiler.js +1 -1
- package/engine/constitution.md +0 -78
- /package/{engine → core}/artifacts.js +0 -0
- /package/{engine → core}/context-store.js +0 -0
- /package/{engine → core}/pattern-export.js +0 -0
- /package/{engine → core}/pipeline/engine.js +0 -0
- /package/{engine → core}/pipeline/types.js +0 -0
- /package/{engine → core}/reference.js +0 -0
- /package/{engines → strategies}/zettel/_smoke.js +0 -0
- /package/{engines → strategies}/zettel/composer.js +0 -0
- /package/{engines → strategies}/zettel/fragment-library.js +0 -0
- /package/{engines → strategies}/zettel/generator-adapter.js +0 -0
- /package/{engines → strategies}/zettel/synthesizer.js +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -10,7 +10,149 @@ generator graph.
|
|
|
10
10
|
|
|
11
11
|
## [Unreleased]
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
_No pending changes._
|
|
14
|
+
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
## [0.2.0] - 2026-05-02
|
|
18
|
+
|
|
19
|
+
**Lockstep cut + boundary cleanup.** All 8 published `@adia-ai/*`
|
|
20
|
+
packages now share one version, governed by
|
|
21
|
+
[`docs/specs/package-architecture.md` § 15 (Versioning Policy)](../../../docs/specs/package-architecture.md#15-versioning-policy).
|
|
22
|
+
This release also lands the `engine/` ↔ `engines/` collision fix from
|
|
23
|
+
T3 of the
|
|
24
|
+
[`docs/plans/packages-architecture-fixes-2026-05-02.md`](../../../docs/plans/packages-architecture-fixes-2026-05-02.md)
|
|
25
|
+
plan.
|
|
26
|
+
|
|
27
|
+
### Changed
|
|
28
|
+
|
|
29
|
+
- `version`: `0.1.0` → `0.2.0`.
|
|
30
|
+
- `dependencies["@adia-ai/a2ui-utils"]`: `^0.0.2` → `^0.2.0`.
|
|
31
|
+
- `dependencies["@adia-ai/a2ui-retrieval"]`: `^0.0.1` → `^0.2.0`.
|
|
32
|
+
- `dependencies["@adia-ai/a2ui-validator"]`: `^0.0.1` → `^0.2.0`.
|
|
33
|
+
|
|
34
|
+
- **Directory renames — `engine/` → `core/`, `engines/` → `strategies/`**
|
|
35
|
+
to remove the singular/plural collision that read as a typo. The
|
|
36
|
+
orchestrator (`generator.js`, `state.js`, `context-store.js`,
|
|
37
|
+
`artifacts.js`, `pattern-export.js`, `reference.js`, `pipeline/`) now
|
|
38
|
+
lives at `core/`; the pluggable strategies (`monolithic/`, `zettel/`,
|
|
39
|
+
`registry.js`) live at `strategies/`. The `transpiler/` directory's
|
|
40
|
+
internal imports were also rewritten by the same sweep (no behavior
|
|
41
|
+
change). All internal imports updated in one sweep.
|
|
42
|
+
- **`constitution.md` moved out of the package source** to
|
|
43
|
+
[`docs/specs/compose-constitution.md`](../../../docs/specs/compose-constitution.md)
|
|
44
|
+
so it doesn't ship in the published tarball. Pointer added in
|
|
45
|
+
README.
|
|
46
|
+
- **`package.json` `exports` map updated** with new keys (`./core`,
|
|
47
|
+
`./strategies/registry`, `./strategies/zettel`); old keys
|
|
48
|
+
(`./engine`, `./engines/registry`, `./engines/zettel`) retained as
|
|
49
|
+
aliases for one release cycle and removed in the next major.
|
|
50
|
+
- Spec [`docs/specs/package-architecture.md`](../../../docs/specs/package-architecture.md)
|
|
51
|
+
bumped 0.5.0 → 0.6.0 with the directory tree updated to reflect the
|
|
52
|
+
new layout; new § 15 documents the lockstep versioning policy.
|
|
53
|
+
|
|
54
|
+
### Migration
|
|
55
|
+
|
|
56
|
+
Consumers importing from the old paths still work for one release
|
|
57
|
+
cycle, but should update on next touch:
|
|
58
|
+
|
|
59
|
+
```diff
|
|
60
|
+
- import { generateUI } from '@adia-ai/a2ui-compose/engine';
|
|
61
|
+
+ import { generateUI } from '@adia-ai/a2ui-compose/core';
|
|
62
|
+
|
|
63
|
+
- import { pick, registerEngine } from '@adia-ai/a2ui-compose/engines/registry';
|
|
64
|
+
+ import { pick, registerEngine } from '@adia-ai/a2ui-compose/strategies/registry';
|
|
65
|
+
|
|
66
|
+
- import { generateZettel } from '@adia-ai/a2ui-compose/engines/zettel';
|
|
67
|
+
+ import { generateZettel } from '@adia-ai/a2ui-compose/strategies/zettel';
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
---
|
|
71
|
+
|
|
72
|
+
## [0.1.0] - 2026-04-28
|
|
73
|
+
|
|
74
|
+
**Multi-turn refinement engine (Phase A).** Adds three new modules to the
|
|
75
|
+
zettel engine that turn `compose_from_chunks` from single-shot into a
|
|
76
|
+
multi-turn surface, plus a first-class telemetry surface that auto-fires
|
|
77
|
+
issue tickets on engine failure paths.
|
|
78
|
+
|
|
79
|
+
Spec: [`docs/specs/genui-multiturn-architecture.md`](../../../docs/specs/genui-multiturn-architecture.md) (Active v0.1.0).
|
|
80
|
+
Plan: [`docs/plans/genui-multiturn-rollout-2026-04-28.md`](../../../docs/plans/genui-multiturn-rollout-2026-04-28.md) (Phase A scoped).
|
|
81
|
+
ADR: [`0008-multiturn-genui-architecture.md`](../../../.brain/adrs/0008-multiturn-genui-architecture.md).
|
|
82
|
+
|
|
83
|
+
### Added (engine modules)
|
|
84
|
+
|
|
85
|
+
- **`engines/zettel/state-cache.js`** — bounded LRU cache for multi-turn
|
|
86
|
+
compositions (default 64 entries; configurable via
|
|
87
|
+
`A2UI_STATE_CACHE_SIZE`). API: `set / get / peek / has / evict / list /
|
|
88
|
+
size / clear`. State-id minting helpers `mintStateId(intent, version)`
|
|
89
|
+
and `mintNextStateId(parent, version)` produce stems of the form
|
|
90
|
+
`<intent-prefix>-<rand4>-v<N>-<unix-min>` so refinement chains keep a
|
|
91
|
+
visible lineage. Module-level singleton via `getStateCache() /
|
|
92
|
+
resetStateCache()`. Pure data structure; no I/O, no async.
|
|
93
|
+
- **`engines/zettel/issue-reporter.js`** — first-class telemetry surface.
|
|
94
|
+
`reportIssue(input, ctx)` writes immutable JSON to
|
|
95
|
+
`.brain/audit-history/issues/<issue_id>.json` (matches the existing
|
|
96
|
+
audit-ledger convention). `autoReport(reason, autoCtx, ctx)` looks up
|
|
97
|
+
a 6-row policy table for engine-side auto-fires (`synthesizer-exhausted`,
|
|
98
|
+
`validator-exhausted`, `locator-empty-targets`,
|
|
99
|
+
`retrieval-zero-then-synthesis-fail`, `cache-miss-on-known-state`,
|
|
100
|
+
`ops-failed-after-apply`) and threads severity / type / suggested-owner
|
|
101
|
+
defaults. `attachTrace(state_id, depth, cache)` pulls from the
|
|
102
|
+
state-cache via `peek` (no recency disturbance). Sidecar trace files
|
|
103
|
+
for traces > 200 KB. Three reporter kinds: `auto | user | llm`.
|
|
104
|
+
`evalMode: true` in ctx suppresses auto-fire (manual `reportIssue`
|
|
105
|
+
calls still write). Per-tool-call `IssueAccumulator` coalesces
|
|
106
|
+
multiple auto-fires into a single issue with the highest-severity
|
|
107
|
+
policy as primary; reasons listed in body + tags.
|
|
108
|
+
- **`engines/zettel/chunk-refiner.js`** — sibling to `chunk-synthesizer.js`.
|
|
109
|
+
Two-pass synthesis (locator → modifier) for refinement intents.
|
|
110
|
+
`refineFromIntent({ priorState, intent, llmAdapter, maxAttempts,
|
|
111
|
+
issueAccumulator, catalog })` runs a locator pass to identify which
|
|
112
|
+
slots to modify, then a modifier pass to emit chunk-plan ops on the
|
|
113
|
+
targeted slice. Validator-driven retry loop with feedback-on-error
|
|
114
|
+
(default `maxAttempts: 2`, mirrors `chunk-synthesizer`). `validateOps`
|
|
115
|
+
checks op shape, slot references, chunk references, page-kind
|
|
116
|
+
contracts. `applyOps({ priorState, ops })` mutates a deep-cloned
|
|
117
|
+
plan and re-materializes HTML via `composeFromPlan`. `opsToA2UI(ops,
|
|
118
|
+
newState)` translates chunk-plan ops to wire-format `updateComponents`
|
|
119
|
+
A2UI messages (Phase A simplification: `components[].html` carries
|
|
120
|
+
the materialized payload; Phase B will upgrade to component-tree shape).
|
|
121
|
+
|
|
122
|
+
### Phase A op format
|
|
123
|
+
|
|
124
|
+
Internal: `rebindSlot | appendToSlot | removeFromSlot | replacePage`.
|
|
125
|
+
Wire: standard `updateComponents` messages targeting `slot-<name>` ids
|
|
126
|
+
(or `main` for `replacePage`). Documented as a Phase A simplification —
|
|
127
|
+
the chunk pipeline emits HTML, so the wire-format wrapper is intentionally
|
|
128
|
+
thin until Phase B introduces typed component-tree refinements.
|
|
129
|
+
|
|
130
|
+
### Smoke + eval
|
|
131
|
+
|
|
132
|
+
- `npm run smoke:state-cache` — 34/34 (LRU recency, peek, env-driven sizing,
|
|
133
|
+
state-id minting + chain).
|
|
134
|
+
- `npm run smoke:issues` — 62/62 (write, validation, trace attach, sidecar
|
|
135
|
+
spill, auto-fire policy lookup, evalMode suppression, coalescing).
|
|
136
|
+
- `npm run smoke:refine` — 51/51 (validateOps, applyOps × 4 op types,
|
|
137
|
+
opsToA2UI, two-pass with stub LLM, retries, exhaustion auto-fire,
|
|
138
|
+
end-to-end refine → apply → wire).
|
|
139
|
+
- **`npm run eval:refine-synthesis`** — **15/15 PASS** real-LLM eval.
|
|
140
|
+
Ops rate 100%, validate rate 100%, 0 auto-fires, 67 s. All 15
|
|
141
|
+
refinements completed on the first attempt.
|
|
142
|
+
|
|
143
|
+
### Out of scope (Phase B / C)
|
|
144
|
+
|
|
145
|
+
- Persistent state across server restarts (filesystem-JSON-backed cache at `.brain/state-cache/`; mirrors the existing audit-ledger convention; design in plan §2).
|
|
146
|
+
- Branching / version trees.
|
|
147
|
+
- LLM-streamed op emission.
|
|
148
|
+
- Multi-user concurrent refinement (CRDT / OT).
|
|
149
|
+
- A2UI `updateDataModel` + `wireComponents` synthesis (current scope is
|
|
150
|
+
`updateComponents` + `deleteSurface` only).
|
|
151
|
+
|
|
152
|
+
### Migration
|
|
153
|
+
|
|
154
|
+
Additive surface; no breaking changes. Existing consumers calling
|
|
155
|
+
`composeFromIntent` continue to work unchanged.
|
|
14
156
|
|
|
15
157
|
---
|
|
16
158
|
|
package/README.md
CHANGED
|
@@ -1,19 +1,20 @@
|
|
|
1
1
|
# @adia-ai/a2ui-compose
|
|
2
2
|
|
|
3
|
-
Framework-agnostic UI generation engine.
|
|
3
|
+
Framework-agnostic UI generation engine. Constitution doc:
|
|
4
|
+
[`docs/specs/compose-constitution.md`](../../../docs/specs/compose-constitution.md).
|
|
5
|
+
Takes a natural-language intent +
|
|
4
6
|
an A2UI component catalog and produces a tree of A2UI protocol messages
|
|
5
7
|
ready for a renderer.
|
|
6
8
|
|
|
7
9
|
> This package is pipeline runtime only. UI components live in
|
|
8
|
-
> [`@adia-ai/web-components`](
|
|
9
|
-
> registry, streams, wiring) in [`@adia-ai/a2ui-utils`](../
|
|
10
|
+
> [`@adia-ai/web-components`](../../web-components); the A2UI runtime (renderer,
|
|
11
|
+
> registry, streams, wiring) in [`@adia-ai/a2ui-utils`](../utils);
|
|
10
12
|
> the pattern corpus in [`@adia-ai/a2ui-corpus`](../corpus);
|
|
11
13
|
> the MCP server in [`@adia-ai/a2ui-mcp`](../mcp).
|
|
12
14
|
>
|
|
13
|
-
>
|
|
14
|
-
>
|
|
15
|
-
>
|
|
16
|
-
> published).
|
|
15
|
+
> Published to the public `@adia-ai` scope on 2026-04-24 alongside
|
|
16
|
+
> `a2ui-corpus`, `a2ui-mcp`, `a2ui-retrieval`, and `a2ui-validator`.
|
|
17
|
+
> Install with `npm i @adia-ai/a2ui-compose`.
|
|
17
18
|
|
|
18
19
|
## What it does
|
|
19
20
|
|
|
@@ -25,7 +26,7 @@ intent ─▶ classify ─▶ retrieve ─▶ compose / adapt ─▶ val
|
|
|
25
26
|
One entry point, two generation strategies, pluggable LLM back-end.
|
|
26
27
|
|
|
27
28
|
```javascript
|
|
28
|
-
import { generateUI } from '@adia-ai/a2ui-compose/
|
|
29
|
+
import { generateUI } from '@adia-ai/a2ui-compose/core';
|
|
29
30
|
|
|
30
31
|
const result = await generateUI({
|
|
31
32
|
intent: 'login form with email, password, and remember-me',
|
|
@@ -42,11 +43,13 @@ const result = await generateUI({
|
|
|
42
43
|
## Layout
|
|
43
44
|
|
|
44
45
|
```
|
|
45
|
-
|
|
46
|
-
├── engine/
|
|
47
|
-
│
|
|
46
|
+
a2ui-compose/
|
|
47
|
+
├── core/ orchestrator — state, dispatch, pipeline (formerly engine/)
|
|
48
|
+
│ ├── generator.js generateUI() — the one public entry point
|
|
49
|
+
│ ├── state.js ArtifactStore + PipelineEngine singletons
|
|
50
|
+
│ └── pipeline/ 6-stage pipeline engine
|
|
48
51
|
│
|
|
49
|
-
├──
|
|
52
|
+
├── strategies/ pluggable engines via registerEngine() (formerly engines/)
|
|
50
53
|
│ ├── registry.js engine selector + reserved-name guard
|
|
51
54
|
│ ├── monolithic/ pattern-match + LLM-adapt (3 modes)
|
|
52
55
|
│ │ ├── generate-instant.js no LLM — pattern-match only
|
|
@@ -55,7 +58,7 @@ gen-ui/
|
|
|
55
58
|
│ └── zettel/ fragment-graph composition
|
|
56
59
|
│ ├── generator-adapter.js entry point
|
|
57
60
|
│ ├── composer.js assembles fragments → compositions
|
|
58
|
-
│ └── session.js
|
|
61
|
+
│ └── session-store.js multi-turn state (Phase A)
|
|
59
62
|
│
|
|
60
63
|
├── retrieval/
|
|
61
64
|
│ ├── catalog.js loads component schemas from sibling .a2ui.json
|
|
@@ -99,7 +102,7 @@ and assembles them into compositions. Verbatim retrieval above a threshold
|
|
|
99
102
|
across multi-turn iterations.
|
|
100
103
|
|
|
101
104
|
```javascript
|
|
102
|
-
import { registerEngine } from '@adia-ai/a2ui-compose/
|
|
105
|
+
import { registerEngine } from '@adia-ai/a2ui-compose/strategies/registry';
|
|
103
106
|
|
|
104
107
|
registerEngine('my-engine', async (ctx) => {
|
|
105
108
|
// ctx: intent, catalog, patterns, concepts, session, llm, …
|
|
@@ -14,21 +14,21 @@
|
|
|
14
14
|
import { validateSchema } from '../../validator/validator.js';
|
|
15
15
|
import { getContext, searchBlocks, searchBlocksSemantic, lookupDomain, listPatterns } from './reference.js';
|
|
16
16
|
import { store, engine } from './state.js';
|
|
17
|
-
import { checkIntentAlignment } from '../../retrieval/intent-alignment.js';
|
|
18
|
-
import { decomposeIntent, composeSubtasks } from '../../retrieval/decomposer.js';
|
|
17
|
+
import { checkIntentAlignment } from '../../retrieval/intent/intent-alignment.js';
|
|
18
|
+
import { decomposeIntent, composeSubtasks } from '../../retrieval/intent/decomposer.js';
|
|
19
19
|
import { getWiringCatalog } from '../../retrieval/wiring-catalog.js';
|
|
20
20
|
import { getComponentData } from '../../retrieval/pattern-library.js';
|
|
21
21
|
|
|
22
22
|
import { StubLLMAdapter } from '../llm/llm-stub.js';
|
|
23
23
|
import { createAdapter } from '../llm/llm-bridge.js';
|
|
24
|
-
import { assessClarity } from '../../retrieval/clarity.js';
|
|
25
|
-
import { isConversational } from '../../retrieval/intent-gate.js';
|
|
24
|
+
import { assessClarity } from '../../retrieval/intent/clarity.js';
|
|
25
|
+
import { isConversational } from '../../retrieval/intent/intent-gate.js';
|
|
26
26
|
import { classifyIntent } from '../../retrieval/domain-router.js';
|
|
27
|
-
import { researchIntent, detectReferences } from '../../retrieval/web-research.js';
|
|
28
|
-
import { feedbackStore } from '../../retrieval/feedback-store.js';
|
|
29
|
-
import { pick as pickEngine, registerMonolithicEngines } from '../
|
|
30
|
-
import { analyzePrompt } from '../../retrieval/prompt-analyzer.js';
|
|
31
|
-
import { recordTurn, isRecording } from '../../retrieval/dialog-recorder.js';
|
|
27
|
+
import { researchIntent, detectReferences } from '../../retrieval/authoring/web-research.js';
|
|
28
|
+
import { feedbackStore } from '../../retrieval/feedback/feedback-store.js';
|
|
29
|
+
import { pick as pickEngine, registerMonolithicEngines } from '../strategies/registry.js';
|
|
30
|
+
import { analyzePrompt } from '../../retrieval/intent/prompt-analyzer.js';
|
|
31
|
+
import { recordTurn, isRecording } from '../../retrieval/feedback/dialog-recorder.js';
|
|
32
32
|
import {
|
|
33
33
|
buildSystemPrompt,
|
|
34
34
|
buildChatMessages,
|
|
@@ -38,10 +38,10 @@ import {
|
|
|
38
38
|
parseA2UIResponse,
|
|
39
39
|
buildRepairPrompt,
|
|
40
40
|
generateSuggestions,
|
|
41
|
-
} from '../
|
|
42
|
-
import { generateInstant } from '../
|
|
43
|
-
import { generatePro } from '../
|
|
44
|
-
import { generateThinking } from '../
|
|
41
|
+
} from '../strategies/monolithic/_shared.js';
|
|
42
|
+
import { generateInstant } from '../strategies/monolithic/generate-instant.js';
|
|
43
|
+
import { generatePro } from '../strategies/monolithic/generate-pro.js';
|
|
44
|
+
import { generateThinking } from '../strategies/monolithic/generate-thinking.js';
|
|
45
45
|
|
|
46
46
|
|
|
47
47
|
/**
|
package/{engine → core}/state.js
RENAMED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Shared module-level singletons for the monolithic engine.
|
|
3
3
|
*
|
|
4
|
-
* These were previously private to
|
|
5
|
-
*
|
|
4
|
+
* These were previously private to core/generator.js. Extracted so that
|
|
5
|
+
* strategies/monolithic/generate-{instant,pro,thinking}.js can share the same
|
|
6
6
|
* artifact store and pipeline engine without going through the dispatcher.
|
|
7
7
|
*
|
|
8
8
|
* Same instances, imported by reference — do NOT re-instantiate per-call.
|
package/index.js
CHANGED
|
@@ -5,12 +5,12 @@
|
|
|
5
5
|
* via subpaths:
|
|
6
6
|
*
|
|
7
7
|
* import { generateUI } from '@adia-ai/a2ui-compose';
|
|
8
|
-
* import { pick, registerEngine } from '@adia-ai/a2ui-compose/
|
|
9
|
-
* import { generateZettel } from '@adia-ai/a2ui-compose/
|
|
8
|
+
* import { pick, registerEngine } from '@adia-ai/a2ui-compose/strategies/registry';
|
|
9
|
+
* import { generateZettel } from '@adia-ai/a2ui-compose/strategies/zettel';
|
|
10
10
|
* import { llmBridge } from '@adia-ai/a2ui-compose/llm';
|
|
11
11
|
*
|
|
12
12
|
* See README for the full public surface.
|
|
13
13
|
*/
|
|
14
14
|
|
|
15
|
-
export { generateUI, generateUIStream } from './
|
|
16
|
-
export { pick, listEngines, registerEngine, unregisterEngine, ENGINES } from './
|
|
15
|
+
export { generateUI, generateUIStream } from './core/generator.js';
|
|
16
|
+
export { pick, listEngines, registerEngine, unregisterEngine, ENGINES } from './strategies/registry.js';
|
package/package.json
CHANGED
|
@@ -1,21 +1,24 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adia-ai/a2ui-compose",
|
|
3
|
-
"version": "0.0
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "AdiaUI A2UI compose engine — framework-agnostic. Takes natural-language intents + a catalog and produces A2UI protocol messages. Pairs with `@adia-ai/a2ui-retrieval` (intent classification, catalog lookup) and `@adia-ai/a2ui-validator` (schema + semantic checks).",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
7
|
-
".":
|
|
8
|
-
"./
|
|
9
|
-
"./
|
|
10
|
-
"./
|
|
11
|
-
"./llm":
|
|
12
|
-
"./llm/*":
|
|
13
|
-
"./transpiler":
|
|
14
|
-
"./evals":
|
|
7
|
+
".": "./index.js",
|
|
8
|
+
"./core": "./core/generator.js",
|
|
9
|
+
"./strategies/zettel": "./strategies/zettel/generator-adapter.js",
|
|
10
|
+
"./strategies/registry": "./strategies/registry.js",
|
|
11
|
+
"./llm": "./llm/llm-bridge.js",
|
|
12
|
+
"./llm/*": "./llm/*.js",
|
|
13
|
+
"./transpiler": "./transpiler/transpiler.js",
|
|
14
|
+
"./evals": "./evals/harness.mjs",
|
|
15
|
+
"./engine": "./core/generator.js",
|
|
16
|
+
"./engines/zettel": "./strategies/zettel/generator-adapter.js",
|
|
17
|
+
"./engines/registry": "./strategies/registry.js"
|
|
15
18
|
},
|
|
16
19
|
"files": [
|
|
17
|
-
"
|
|
18
|
-
"
|
|
20
|
+
"core/",
|
|
21
|
+
"strategies/",
|
|
19
22
|
"llm/",
|
|
20
23
|
"evals/",
|
|
21
24
|
"transpiler/",
|
|
@@ -34,8 +37,8 @@
|
|
|
34
37
|
"directory": "packages/a2ui/compose"
|
|
35
38
|
},
|
|
36
39
|
"dependencies": {
|
|
37
|
-
"@adia-ai/a2ui-utils": "^0.0
|
|
38
|
-
"@adia-ai/a2ui-retrieval": "^0.0
|
|
39
|
-
"@adia-ai/a2ui-validator": "^0.0
|
|
40
|
+
"@adia-ai/a2ui-utils": "^0.2.0",
|
|
41
|
+
"@adia-ai/a2ui-retrieval": "^0.2.0",
|
|
42
|
+
"@adia-ai/a2ui-validator": "^0.2.0"
|
|
40
43
|
}
|
|
41
44
|
}
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @adia-ai/a2ui-compose — monolithic engine, shared helpers.
|
|
3
3
|
*
|
|
4
|
-
* Pure helpers extracted from
|
|
4
|
+
* Pure helpers extracted from core/generator.js per spec §11 Phase 2:
|
|
5
5
|
* prompt builders, JSON parsers, canvas diff utilities, suggestion
|
|
6
6
|
* generators. All stateless (the only module-level state is the lazy
|
|
7
7
|
* component-catalog cache inside getComponentCatalog).
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
import { listPatterns } from '../../
|
|
11
|
-
import { store } from '../../
|
|
12
|
-
import { checkIntentAlignment } from '../../../retrieval/intent-alignment.js';
|
|
13
|
-
import { composeSubtasks } from '../../../retrieval/decomposer.js';
|
|
10
|
+
import { listPatterns } from '../../core/reference.js';
|
|
11
|
+
import { store } from '../../core/state.js';
|
|
12
|
+
import { checkIntentAlignment } from '../../../retrieval/intent/intent-alignment.js';
|
|
13
|
+
import { composeSubtasks } from '../../../retrieval/intent/decomposer.js';
|
|
14
14
|
import { getWiringCatalog } from '../../../retrieval/wiring-catalog.js';
|
|
15
15
|
import { getComponentData } from '../../../retrieval/pattern-library.js';
|
|
16
16
|
|
|
@@ -412,10 +412,10 @@ STATE LAYER:
|
|
|
412
412
|
Controllers: ${wc.controllers.map(c => c.type).join(', ')} (extensible via registerController)
|
|
413
413
|
"bind" maps controller state ↔ model paths for two-way sync.
|
|
414
414
|
|
|
415
|
-
ACTIONS LAYER —
|
|
416
|
-
Each action binds a
|
|
415
|
+
ACTIONS LAYER — UIEvent → handler chains:
|
|
416
|
+
Each action binds a UIEvent to a handler. The event is a typed object, not a string.
|
|
417
417
|
|
|
418
|
-
|
|
418
|
+
UIEvent types: ${wc.adiaEvents.map(e => e.event).join(', ')}
|
|
419
419
|
Each carries a typed payload:
|
|
420
420
|
${wc.adiaEvents.filter(e => e.payload).map(e => ` ${e.event} → ${e.payload}`).join('\n')}
|
|
421
421
|
|
|
@@ -434,7 +434,7 @@ ${wc.adiaEvents.filter(e => e.payload).map(e => ` ${e.event} → ${e.payload}
|
|
|
434
434
|
}
|
|
435
435
|
]
|
|
436
436
|
|
|
437
|
-
|
|
437
|
+
UIEvent shape: { "event": "<type>", "target": "<componentId>", "debounce"?: ms, "throttle"?: ms, "condition"?: { "path", "equals"|"notEquals"|"exists" } }
|
|
438
438
|
"target" scopes to a component id. Omit for surface-level events (mount, unmount).
|
|
439
439
|
"onSuccess" / "onError" are follow-up action arrays — NOT separate entries.
|
|
440
440
|
Handlers: ${wc.handlers.map(h => h.name).join(', ')} (extensible via registerHandler)
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @adia-ai/a2ui-compose — monolithic engine, instant mode.
|
|
3
3
|
*
|
|
4
|
-
* Extracted from
|
|
5
|
-
* (ArtifactStore, PipelineEngine) via
|
|
6
|
-
* in
|
|
4
|
+
* Extracted from core/generator.js per spec §11 Phase 2. Shares state
|
|
5
|
+
* (ArtifactStore, PipelineEngine) via core/state.js. Pure helpers live
|
|
6
|
+
* in strategies/monolithic/_shared.js.
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
import { validateSchema } from '../../../validator/validator.js';
|
|
10
|
-
import { getContext, searchBlocks, lookupDomain } from '../../
|
|
11
|
-
import { assessClarity } from '../../../retrieval/clarity.js';
|
|
12
|
-
import { feedbackStore } from '../../../retrieval/feedback-store.js';
|
|
13
|
-
import { store, engine } from '../../
|
|
14
|
-
import { isRecording } from '../../../retrieval/dialog-recorder.js';
|
|
10
|
+
import { getContext, searchBlocks, lookupDomain } from '../../core/reference.js';
|
|
11
|
+
import { assessClarity } from '../../../retrieval/intent/clarity.js';
|
|
12
|
+
import { feedbackStore } from '../../../retrieval/feedback/feedback-store.js';
|
|
13
|
+
import { store, engine } from '../../core/state.js';
|
|
14
|
+
import { isRecording } from '../../../retrieval/feedback/dialog-recorder.js';
|
|
15
15
|
import {
|
|
16
16
|
generateSuggestions,
|
|
17
17
|
} from './_shared.js';
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @adia-ai/a2ui-compose — monolithic engine, pro mode.
|
|
3
3
|
*
|
|
4
|
-
* Extracted from
|
|
5
|
-
* (ArtifactStore, PipelineEngine) via
|
|
6
|
-
* in
|
|
4
|
+
* Extracted from core/generator.js per spec §11 Phase 2. Shares state
|
|
5
|
+
* (ArtifactStore, PipelineEngine) via core/state.js. Pure helpers live
|
|
6
|
+
* in strategies/monolithic/_shared.js.
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
import { validateSchema } from '../../../validator/validator.js';
|
|
10
|
-
import { getContext, searchBlocks, lookupDomain } from '../../
|
|
11
|
-
import { decomposeIntent } from '../../../retrieval/decomposer.js';
|
|
12
|
-
import { assessClarity } from '../../../retrieval/clarity.js';
|
|
13
|
-
import { isConversational } from '../../../retrieval/intent-gate.js';
|
|
14
|
-
import { feedbackStore } from '../../../retrieval/feedback-store.js';
|
|
15
|
-
import { store, engine } from '../../
|
|
16
|
-
import { isRecording } from '../../../retrieval/dialog-recorder.js';
|
|
10
|
+
import { getContext, searchBlocks, lookupDomain } from '../../core/reference.js';
|
|
11
|
+
import { decomposeIntent } from '../../../retrieval/intent/decomposer.js';
|
|
12
|
+
import { assessClarity } from '../../../retrieval/intent/clarity.js';
|
|
13
|
+
import { isConversational } from '../../../retrieval/intent/intent-gate.js';
|
|
14
|
+
import { feedbackStore } from '../../../retrieval/feedback/feedback-store.js';
|
|
15
|
+
import { store, engine } from '../../core/state.js';
|
|
16
|
+
import { isRecording } from '../../../retrieval/feedback/dialog-recorder.js';
|
|
17
17
|
import {
|
|
18
18
|
buildSystemPrompt,
|
|
19
19
|
buildChatMessages,
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @adia-ai/a2ui-compose — monolithic engine, thinking mode.
|
|
3
3
|
*
|
|
4
|
-
* Extracted from
|
|
5
|
-
* (ArtifactStore, PipelineEngine) via
|
|
6
|
-
* in
|
|
4
|
+
* Extracted from core/generator.js per spec §11 Phase 2. Shares state
|
|
5
|
+
* (ArtifactStore, PipelineEngine) via core/state.js. Pure helpers live
|
|
6
|
+
* in strategies/monolithic/_shared.js.
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
import { validateSchema } from '../../../validator/validator.js';
|
|
10
10
|
import { validateMessages as validateCatalog } from '../../../validator/catalog-validator.js';
|
|
11
|
-
import { getContext, searchBlocksSemantic, lookupDomain } from '../../
|
|
12
|
-
import { assessClarity } from '../../../retrieval/clarity.js';
|
|
13
|
-
import { feedbackStore } from '../../../retrieval/feedback-store.js';
|
|
14
|
-
import { store, engine } from '../../
|
|
15
|
-
import { isRecording } from '../../../retrieval/dialog-recorder.js';
|
|
11
|
+
import { getContext, searchBlocksSemantic, lookupDomain } from '../../core/reference.js';
|
|
12
|
+
import { assessClarity } from '../../../retrieval/intent/clarity.js';
|
|
13
|
+
import { feedbackStore } from '../../../retrieval/feedback/feedback-store.js';
|
|
14
|
+
import { store, engine } from '../../core/state.js';
|
|
15
|
+
import { isRecording } from '../../../retrieval/feedback/dialog-recorder.js';
|
|
16
16
|
import {
|
|
17
17
|
buildSystemPrompt,
|
|
18
18
|
buildChatMessages,
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* - zettel → fragment-graph composition (single mode: instant)
|
|
8
8
|
*
|
|
9
9
|
* The registry deliberately does NOT own intent-gating, clarity assessment, or
|
|
10
|
-
* execution lifecycle — the public `generateUI()` in
|
|
10
|
+
* execution lifecycle — the public `generateUI()` in core/generator.js does
|
|
11
11
|
* that, then delegates the actual work through `pick()`.
|
|
12
12
|
*
|
|
13
13
|
* Shape invariant: every engine function returns
|
|
@@ -15,8 +15,8 @@
|
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
17
|
// Zettel is lazy-loaded — it transitively imports node:fs / node:path / node:url
|
|
18
|
-
// (
|
|
19
|
-
// Static-importing it here would break browser loads of
|
|
18
|
+
// (strategies/zettel/fragment-library.js), which Vite externalizes in the browser.
|
|
19
|
+
// Static-importing it here would break browser loads of core/generator.js.
|
|
20
20
|
// In-browser callers reach zettel via POST /api/generate (server-side), never
|
|
21
21
|
// through this registry, so lazy-loading is safe and incurs only a one-time
|
|
22
22
|
// import on first server-side invocation.
|
|
@@ -33,15 +33,15 @@ async function getGenerateZettel() {
|
|
|
33
33
|
let _isRecording = null;
|
|
34
34
|
async function getIsRecording() {
|
|
35
35
|
if (!_isRecording) {
|
|
36
|
-
const mod = await import('../../retrieval/dialog-recorder.js');
|
|
36
|
+
const mod = await import('../../retrieval/feedback/dialog-recorder.js');
|
|
37
37
|
_isRecording = mod.isRecording;
|
|
38
38
|
}
|
|
39
39
|
return _isRecording;
|
|
40
40
|
}
|
|
41
41
|
|
|
42
|
-
// The three monolithic paths live inside
|
|
42
|
+
// The three monolithic paths live inside core/generator.js as internal
|
|
43
43
|
// functions. They're injected at boot via `registerMonolithicEngines()` to
|
|
44
|
-
// avoid a circular import (
|
|
44
|
+
// avoid a circular import (core/generator.js owns the registry caller).
|
|
45
45
|
let _monolithicInstant = null;
|
|
46
46
|
let _monolithicPro = null;
|
|
47
47
|
let _monolithicThinking = null;
|