@adia-ai/a2ui-compose 0.4.2 → 0.4.3
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 +10 -0
- package/README.md +12 -1
- package/core/generator.js +8 -1
- package/package.json +1 -1
- package/strategies/zettel/state-cache.js +6 -1
package/CHANGELOG.md
CHANGED
|
@@ -12,6 +12,16 @@ generator graph.
|
|
|
12
12
|
|
|
13
13
|
_No pending changes._
|
|
14
14
|
|
|
15
|
+
## [0.4.3] - 2026-05-11
|
|
16
|
+
|
|
17
|
+
### Fixed
|
|
18
|
+
|
|
19
|
+
- **`process.env` browser-compat guard** — `core/generator.js` and `strategies/zettel/state-cache.js` were accessing `process.env` directly, which throws `ReferenceError: process is not defined` in browser execution paths (e.g. the gen-ui playground importing compose directly). Both sites now guard via `const IS_NODE = typeof process !== 'undefined' && process.versions?.node;` before reading `process.env`. The `A2UI_COMPOSE_TRACE` debug-trace and `STATE_CACHE_DIR` env-lookup paths are Node-only by design; the dynamic `node:fs/promises` + `node:path` imports also short-circuit when `IS_NODE` is false.
|
|
20
|
+
|
|
21
|
+
### Lockstep
|
|
22
|
+
|
|
23
|
+
9-package coordinated PATCH cut to v0.4.3 (per [`docs/specs/package-architecture.md` § 15](../../../docs/specs/package-architecture.md#15-versioning-policy)). Internal `@adia-ai/*` dep ranges stay at `^0.4.0` (patch-cut asymmetry — `^0.4.0` covers `0.4.x` under semver). Source change scoped to `core/generator.js` + `strategies/zettel/state-cache.js`. Rides alongside `@adia-ai/web-components` v0.4.3 (input-ui locale + thousands grouping + hold-to-repeat). See root [CHANGELOG.md `## [0.4.3]`](../../../CHANGELOG.md) for the cut narrative.
|
|
24
|
+
|
|
15
25
|
## [0.4.2] - 2026-05-11
|
|
16
26
|
|
|
17
27
|
### Ride-along (no source changes)
|
package/README.md
CHANGED
|
@@ -14,7 +14,18 @@ ready for a renderer.
|
|
|
14
14
|
>
|
|
15
15
|
> Published to the public `@adia-ai` scope on 2026-04-24 alongside
|
|
16
16
|
> `a2ui-corpus`, `a2ui-mcp`, `a2ui-retrieval`, and `a2ui-validator`.
|
|
17
|
-
|
|
17
|
+
|
|
18
|
+
## Install
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
npm install @adia-ai/a2ui-compose
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
Typically paired with `@adia-ai/a2ui-corpus` (the pattern corpus the engine reads from) and `@adia-ai/llm` (the LLM client; runtime peer-dep):
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
npm install @adia-ai/a2ui-compose @adia-ai/a2ui-corpus @adia-ai/llm
|
|
28
|
+
```
|
|
18
29
|
|
|
19
30
|
## What it does
|
|
20
31
|
|
package/core/generator.js
CHANGED
|
@@ -191,7 +191,14 @@ export async function generateUI({ intent, engine: engineName = 'monolithic', mo
|
|
|
191
191
|
// a per-request JSON file BEFORE the strip. Useful for debugging
|
|
192
192
|
// strategy-label decisions or reproducing eval failures. Off by default;
|
|
193
193
|
// file writes happen synchronously and add ~1-5ms per request.
|
|
194
|
-
|
|
194
|
+
//
|
|
195
|
+
// Node-only: `process` is undefined in the browser. Guard the env lookup
|
|
196
|
+
// so the post-await codepath doesn't throw `ReferenceError: process is
|
|
197
|
+
// not defined` when generator.js runs in the gen-ui playground. The
|
|
198
|
+
// dynamic node:fs/path imports below would also fail in the browser, but
|
|
199
|
+
// the guard short-circuits before we get there.
|
|
200
|
+
const IS_NODE = typeof process !== 'undefined' && process.versions?.node;
|
|
201
|
+
const traceDir = IS_NODE ? process.env.A2UI_COMPOSE_TRACE : null;
|
|
195
202
|
if (traceDir && result._debug) {
|
|
196
203
|
try {
|
|
197
204
|
const { writeFile, mkdir } = await import('node:fs/promises');
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adia-ai/a2ui-compose",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.3",
|
|
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": {
|
|
@@ -27,7 +27,12 @@
|
|
|
27
27
|
const DEFAULT_MAX_SIZE = 64;
|
|
28
28
|
|
|
29
29
|
function envMaxSize() {
|
|
30
|
-
|
|
30
|
+
// Node-only: `process` is undefined in the browser. Without this guard the
|
|
31
|
+
// StateCache constructor throws `ReferenceError: process is not defined`
|
|
32
|
+
// the moment the zettel engine is selected in the gen-ui playground.
|
|
33
|
+
// Matches the convention used in retrieval/* and compose/core/generator.js.
|
|
34
|
+
const IS_NODE = typeof process !== 'undefined' && process.versions?.node;
|
|
35
|
+
const v = IS_NODE ? process.env.A2UI_STATE_CACHE_SIZE : null;
|
|
31
36
|
if (!v) return null;
|
|
32
37
|
const n = parseInt(v, 10);
|
|
33
38
|
return Number.isFinite(n) && n > 0 ? n : null;
|