@adia-ai/gen-ui 0.8.37 → 0.8.39
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 +9 -3
- package/compose/CHANGELOG.md +22 -22
- package/compose/README.md +3 -3
- package/compose/evals/harness.mjs +1 -1
- package/compose/strategies/_shared/chunk-loader.js +2 -2
- package/compose/strategies/monolithic/_shared.js +18 -5
- package/compose/strategies/monolithic/generate-pro.js +1 -1
- package/compose/strategies/zettel/composition-library.js +2 -2
- package/compose/strategies/zettel/issue-reporter.js +1 -1
- package/compose/transpiler/transpiler-maps.js +2 -2
- package/compose/transpiler/transpiler.js +1 -1
- package/corpus/CHANGELOG.md +17 -17
- package/corpus/README.md +2 -2
- package/corpus/chunks/_index.json +177 -1
- package/corpus/chunks/_source-hashes.json +20 -15
- package/corpus/chunks/access-denied-with-request.json +6 -2
- package/corpus/chunks/admin-page-header-with-actions.json +6 -2
- package/corpus/chunks/admin-topbar-breadcrumb-actions.json +6 -2
- package/corpus/chunks/agent-memory-list.json +6 -2
- package/corpus/chunks/agent-reasoning-collapsed.json +6 -2
- package/corpus/chunks/agent-tool-call-accordion.json +6 -2
- package/corpus/chunks/alert-dialog-unsaved.json +6 -2
- package/corpus/chunks/analytics-chart.json +6 -2
- package/corpus/chunks/api-keys-list.json +6 -2
- package/corpus/chunks/app-nav-groups.json +6 -2
- package/corpus/chunks/auth-signin-card-otp.json +6 -2
- package/corpus/chunks/avatar-group-overflow.json +6 -2
- package/corpus/chunks/banner-system-maintenance.json +6 -2
- package/corpus/chunks/bell-menu-empty.json +6 -2
- package/corpus/chunks/bulk-action-toolbar-swap.json +1 -1
- package/corpus/chunks/chart-in-card-full-chart.json +6 -2
- package/corpus/chunks/checkout-order-summary-card.json +6 -2
- package/corpus/chunks/code-snippet.json +6 -2
- package/corpus/chunks/comments-composer.json +6 -2
- package/corpus/chunks/contact-form-card.json +6 -2
- package/corpus/chunks/data-export-history.json +6 -2
- package/corpus/chunks/destructive-confirm-modal.json +6 -2
- package/corpus/chunks/export-flow-delivery.json +6 -2
- package/corpus/chunks/faq-accordion.json +6 -2
- package/corpus/chunks/feature-grid-three-cards.json +6 -2
- package/corpus/chunks/filter-popover-form.json +6 -2
- package/corpus/chunks/hero-cta-simple.json +6 -2
- package/corpus/chunks/image-caption-tile.json +6 -2
- package/corpus/chunks/inline-dialog-rename.json +6 -2
- package/corpus/chunks/login-form-card.json +6 -2
- package/corpus/chunks/onb-persona-picker.json +6 -2
- package/corpus/chunks/order-tracking-timeline.json +6 -2
- package/corpus/chunks/permissions-role-picker-radio.json +6 -2
- package/corpus/chunks/product-tour.json +6 -2
- package/corpus/chunks/retention-cohort-with-legend.json +6 -2
- package/corpus/chunks/search-results-list.json +6 -2
- package/corpus/chunks/signup-form-card.json +6 -2
- package/corpus/chunks/stat-cards-kpi-dashboard.json +6 -2
- package/corpus/chunks/tabs-with-panels.json +6 -2
- package/corpus/chunks/testimonial-pull-quote.json +6 -2
- package/corpus/chunks/toolbar-icons.json +6 -2
- package/corpus/chunks/usage-quota-meter-card.json +6 -2
- package/corpus/chunks/user-profile-card.json +6 -2
- package/corpus/chunks/verification-stepper.json +6 -2
- package/corpus/chunks/webhooks-list.json +6 -2
- package/corpus/manifest.json +2 -2
- package/corpus/scripts/chunk-library.js +3 -3
- package/node-shims.d.ts +1 -1
- package/package.json +2 -9
- package/retrieval/CHANGELOG.md +21 -21
- package/retrieval/catalog.js +8 -5
- package/retrieval/component-catalog.js +9 -7
- package/retrieval/feedback/dialog-recorder.js +1 -1
- package/retrieval/feedback/feedback-analyzer.js +1 -1
- package/retrieval/feedback/feedback-store.js +1 -1
- package/retrieval/feedback/gap-registry.js +1 -1
- package/retrieval/intent/prompt-analyzer.js +12 -2
- package/retrieval/wiring-catalog.js +1 -1
- package/validate/catalog-validator.js +22 -20
- package/validate/semantic/cache.js +1 -1
- package/validate/semantic/index.js +1 -1
- package/corpus/catalog-a2ui_0_9.d.ts +0 -4
- package/corpus/catalog-a2ui_0_9.json +0 -29571
- package/corpus/catalog-a2ui_0_9_rules.txt +0 -1215
|
@@ -4,15 +4,16 @@
|
|
|
4
4
|
* CatalogComponentCommon + component-specific props, with
|
|
5
5
|
* unevaluatedProperties: false so unknown props are rejected).
|
|
6
6
|
*
|
|
7
|
-
* The catalog at
|
|
7
|
+
* The catalog at a2ui/catalog/catalog-a2ui_0_9.json is a freestanding
|
|
8
8
|
* JSON Schema draft-2020-12 document produced by scripts/build-components.mjs.
|
|
9
9
|
* At first use we compile one validator per component type and cache them,
|
|
10
10
|
* then dispatch per-component by the `component` discriminator.
|
|
11
11
|
*
|
|
12
|
-
* Load order (gh#748): the `@adia-ai/
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
12
|
+
* Load order (gh#748, home per ADR-0050): the `@adia-ai/a2ui/catalog` bare
|
|
13
|
+
* specifier first — that subpath IS the catalog and `@adia-ai/a2ui` is a
|
|
14
|
+
* declared dependency of this package, so it resolves for a plain npm
|
|
15
|
+
* consumer — then the in-repo/browser fallbacks (fetch, JSON import
|
|
16
|
+
* attributes, node fs) against the sibling-package-relative path.
|
|
16
17
|
*
|
|
17
18
|
* When the catalog genuinely can't load we degrade LOUDLY — one console.warn
|
|
18
19
|
* per session naming the lost coverage — and expose the state via
|
|
@@ -26,13 +27,14 @@ import Ajv2020 from 'ajv/dist/2020.js';
|
|
|
26
27
|
import addFormats from 'ajv-formats';
|
|
27
28
|
|
|
28
29
|
const IS_NODE = typeof process !== 'undefined' && !!process.versions?.node;
|
|
29
|
-
const CATALOG_FILE = '
|
|
30
|
-
// `@adia-ai/
|
|
31
|
-
//
|
|
32
|
-
//
|
|
33
|
-
//
|
|
30
|
+
const CATALOG_FILE = '../../a2ui/catalog/catalog-a2ui_0_9.json';
|
|
31
|
+
// `@adia-ai/a2ui/catalog` IS the catalog JSON (ADR-0050) and `@adia-ai/a2ui`
|
|
32
|
+
// is a declared dependency of this package — so the bare specifier is the
|
|
33
|
+
// path that resolves for a published-tarball consumer under any install
|
|
34
|
+
// layout (gh#748); the relative path above is the in-repo / static-deploy
|
|
35
|
+
// fallback, and happens to resolve in a flat node_modules tree too. Held in
|
|
34
36
|
// a const so bundlers see a dynamic specifier and leave resolution to runtime.
|
|
35
|
-
const
|
|
37
|
+
const CATALOG_PACKAGE = '@adia-ai/a2ui/catalog';
|
|
36
38
|
|
|
37
39
|
let _catalog = null;
|
|
38
40
|
let _ajv = null;
|
|
@@ -66,9 +68,9 @@ function _looksLikeCatalog(json) {
|
|
|
66
68
|
/**
|
|
67
69
|
* Package catalog load — the published-consumer path (gh#748).
|
|
68
70
|
*
|
|
69
|
-
* `@adia-ai/
|
|
71
|
+
* `@adia-ai/a2ui` is a real dependency of this package and its `./catalog`
|
|
70
72
|
* export resolves straight to catalog-a2ui_0_9.json, so this works from a
|
|
71
|
-
* plain `npm i @adia-ai/
|
|
73
|
+
* plain `npm i @adia-ai/gen-ui` install with no repo layout, no
|
|
72
74
|
* static asset server and no bundler config. Tried FIRST; the relative-path
|
|
73
75
|
* chain below stays as the in-repo / browser fallback.
|
|
74
76
|
*
|
|
@@ -77,12 +79,12 @@ function _looksLikeCatalog(json) {
|
|
|
77
79
|
*/
|
|
78
80
|
async function _loadPackageCatalog(reasons) {
|
|
79
81
|
try {
|
|
80
|
-
const mod = await import(/* @vite-ignore */
|
|
82
|
+
const mod = await import(/* @vite-ignore */ CATALOG_PACKAGE, { with: { type: 'json' } });
|
|
81
83
|
const json = mod?.default ?? mod;
|
|
82
84
|
if (_looksLikeCatalog(json)) return { json, source: 'package' };
|
|
83
|
-
reasons.push(`${
|
|
85
|
+
reasons.push(`${CATALOG_PACKAGE} import produced no catalog object`);
|
|
84
86
|
} catch (e) {
|
|
85
|
-
reasons.push(`${
|
|
87
|
+
reasons.push(`${CATALOG_PACKAGE} import failed: ${e?.message || e}`);
|
|
86
88
|
}
|
|
87
89
|
|
|
88
90
|
if (!IS_NODE) return null;
|
|
@@ -92,12 +94,12 @@ async function _loadPackageCatalog(reasons) {
|
|
|
92
94
|
try {
|
|
93
95
|
const { createRequire } = await import(/* @vite-ignore */ 'node:module');
|
|
94
96
|
const fs = await import(/* @vite-ignore */ 'node:fs/promises');
|
|
95
|
-
const resolved = createRequire(import.meta.url).resolve(
|
|
97
|
+
const resolved = createRequire(import.meta.url).resolve(CATALOG_PACKAGE);
|
|
96
98
|
const json = JSON.parse(await fs.readFile(resolved, 'utf8'));
|
|
97
99
|
if (_looksLikeCatalog(json)) return { json, source: 'package-fs' };
|
|
98
|
-
reasons.push(`${
|
|
100
|
+
reasons.push(`${CATALOG_PACKAGE} resolved file is not a catalog`);
|
|
99
101
|
} catch (e) {
|
|
100
|
-
reasons.push(`${
|
|
102
|
+
reasons.push(`${CATALOG_PACKAGE} resolve+read failed: ${e?.message || e}`);
|
|
101
103
|
}
|
|
102
104
|
return null;
|
|
103
105
|
}
|
|
@@ -107,7 +109,7 @@ async function _loadNodeCatalog() {
|
|
|
107
109
|
const path = await import(/* @vite-ignore */ 'node:path');
|
|
108
110
|
const url = await import(/* @vite-ignore */ 'node:url');
|
|
109
111
|
const here = path.dirname(url.fileURLToPath(import.meta.url));
|
|
110
|
-
// gen-ui/validate → gen-ui/
|
|
112
|
+
// gen-ui/engine/validate → gen-ui/a2ui/catalog/catalog-a2ui_0_9.json
|
|
111
113
|
const raw = await fs.readFile(path.resolve(here, CATALOG_FILE), 'utf8');
|
|
112
114
|
return JSON.parse(raw);
|
|
113
115
|
}
|
|
@@ -13,7 +13,7 @@ import { dirname, join } from 'node:path';
|
|
|
13
13
|
import { fileURLToPath } from 'node:url';
|
|
14
14
|
|
|
15
15
|
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
16
|
-
const repoRoot = join(__dirname, '..', '..', '..', '..');
|
|
16
|
+
const repoRoot = join(__dirname, '..', '..', '..', '..', '..');
|
|
17
17
|
const DEFAULT_DIR = join(repoRoot, 'evals', 'mcp', 'runs', '.semantic-cache');
|
|
18
18
|
|
|
19
19
|
export function hashA2UI(messages) {
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* Phase 1: LLM-judge only. Hybrid rule path is Phase 3.
|
|
6
6
|
*
|
|
7
7
|
* Usage:
|
|
8
|
-
* import { validateSemantics } from 'packages/gen-ui/validate/semantic/index.js';
|
|
8
|
+
* import { validateSemantics } from 'packages/gen-ui/engine/validate/semantic/index.js';
|
|
9
9
|
* const v = await validateSemantics({ intent, messages }, { cache: true });
|
|
10
10
|
*/
|
|
11
11
|
import { cacheKey, makeCache } from './cache.js';
|