@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.
Files changed (80) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/README.md +9 -3
  3. package/compose/CHANGELOG.md +22 -22
  4. package/compose/README.md +3 -3
  5. package/compose/evals/harness.mjs +1 -1
  6. package/compose/strategies/_shared/chunk-loader.js +2 -2
  7. package/compose/strategies/monolithic/_shared.js +18 -5
  8. package/compose/strategies/monolithic/generate-pro.js +1 -1
  9. package/compose/strategies/zettel/composition-library.js +2 -2
  10. package/compose/strategies/zettel/issue-reporter.js +1 -1
  11. package/compose/transpiler/transpiler-maps.js +2 -2
  12. package/compose/transpiler/transpiler.js +1 -1
  13. package/corpus/CHANGELOG.md +17 -17
  14. package/corpus/README.md +2 -2
  15. package/corpus/chunks/_index.json +177 -1
  16. package/corpus/chunks/_source-hashes.json +20 -15
  17. package/corpus/chunks/access-denied-with-request.json +6 -2
  18. package/corpus/chunks/admin-page-header-with-actions.json +6 -2
  19. package/corpus/chunks/admin-topbar-breadcrumb-actions.json +6 -2
  20. package/corpus/chunks/agent-memory-list.json +6 -2
  21. package/corpus/chunks/agent-reasoning-collapsed.json +6 -2
  22. package/corpus/chunks/agent-tool-call-accordion.json +6 -2
  23. package/corpus/chunks/alert-dialog-unsaved.json +6 -2
  24. package/corpus/chunks/analytics-chart.json +6 -2
  25. package/corpus/chunks/api-keys-list.json +6 -2
  26. package/corpus/chunks/app-nav-groups.json +6 -2
  27. package/corpus/chunks/auth-signin-card-otp.json +6 -2
  28. package/corpus/chunks/avatar-group-overflow.json +6 -2
  29. package/corpus/chunks/banner-system-maintenance.json +6 -2
  30. package/corpus/chunks/bell-menu-empty.json +6 -2
  31. package/corpus/chunks/bulk-action-toolbar-swap.json +1 -1
  32. package/corpus/chunks/chart-in-card-full-chart.json +6 -2
  33. package/corpus/chunks/checkout-order-summary-card.json +6 -2
  34. package/corpus/chunks/code-snippet.json +6 -2
  35. package/corpus/chunks/comments-composer.json +6 -2
  36. package/corpus/chunks/contact-form-card.json +6 -2
  37. package/corpus/chunks/data-export-history.json +6 -2
  38. package/corpus/chunks/destructive-confirm-modal.json +6 -2
  39. package/corpus/chunks/export-flow-delivery.json +6 -2
  40. package/corpus/chunks/faq-accordion.json +6 -2
  41. package/corpus/chunks/feature-grid-three-cards.json +6 -2
  42. package/corpus/chunks/filter-popover-form.json +6 -2
  43. package/corpus/chunks/hero-cta-simple.json +6 -2
  44. package/corpus/chunks/image-caption-tile.json +6 -2
  45. package/corpus/chunks/inline-dialog-rename.json +6 -2
  46. package/corpus/chunks/login-form-card.json +6 -2
  47. package/corpus/chunks/onb-persona-picker.json +6 -2
  48. package/corpus/chunks/order-tracking-timeline.json +6 -2
  49. package/corpus/chunks/permissions-role-picker-radio.json +6 -2
  50. package/corpus/chunks/product-tour.json +6 -2
  51. package/corpus/chunks/retention-cohort-with-legend.json +6 -2
  52. package/corpus/chunks/search-results-list.json +6 -2
  53. package/corpus/chunks/signup-form-card.json +6 -2
  54. package/corpus/chunks/stat-cards-kpi-dashboard.json +6 -2
  55. package/corpus/chunks/tabs-with-panels.json +6 -2
  56. package/corpus/chunks/testimonial-pull-quote.json +6 -2
  57. package/corpus/chunks/toolbar-icons.json +6 -2
  58. package/corpus/chunks/usage-quota-meter-card.json +6 -2
  59. package/corpus/chunks/user-profile-card.json +6 -2
  60. package/corpus/chunks/verification-stepper.json +6 -2
  61. package/corpus/chunks/webhooks-list.json +6 -2
  62. package/corpus/manifest.json +2 -2
  63. package/corpus/scripts/chunk-library.js +3 -3
  64. package/node-shims.d.ts +1 -1
  65. package/package.json +2 -9
  66. package/retrieval/CHANGELOG.md +21 -21
  67. package/retrieval/catalog.js +8 -5
  68. package/retrieval/component-catalog.js +9 -7
  69. package/retrieval/feedback/dialog-recorder.js +1 -1
  70. package/retrieval/feedback/feedback-analyzer.js +1 -1
  71. package/retrieval/feedback/feedback-store.js +1 -1
  72. package/retrieval/feedback/gap-registry.js +1 -1
  73. package/retrieval/intent/prompt-analyzer.js +12 -2
  74. package/retrieval/wiring-catalog.js +1 -1
  75. package/validate/catalog-validator.js +22 -20
  76. package/validate/semantic/cache.js +1 -1
  77. package/validate/semantic/index.js +1 -1
  78. package/corpus/catalog-a2ui_0_9.d.ts +0 -4
  79. package/corpus/catalog-a2ui_0_9.json +0 -29571
  80. 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 gen-ui/corpus/catalog-a2ui_0_9.json is a freestanding
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/gen-ui/corpus` bare specifier first — that
13
- * package IS the catalog and is a declared dependency, so it resolves for a
14
- * plain npm consumer then the in-repo/browser fallbacks (fetch, JSON import
15
- * attributes, node fs) against the workspace-relative path.
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 = '../corpus/catalog-a2ui_0_9.json';
30
- // `@adia-ai/gen-ui/corpus`'s "." export IS the catalog JSON, and this package
31
- // depends on it — so the bare specifier is the ONLY path that resolves for a
32
- // published-tarball consumer (gh#748); the relative paths below only work in
33
- // this repo, where workspace symlinks put corpus/ next to validator/. Held in
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 CORPUS_PACKAGE = '@adia-ai/gen-ui/corpus';
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/gen-ui/corpus` is a real dependency of this package and its "."
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/a2ui-validator` install with no repo layout, no
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 */ CORPUS_PACKAGE, { with: { type: 'json' } });
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(`${CORPUS_PACKAGE} import produced no catalog object`);
85
+ reasons.push(`${CATALOG_PACKAGE} import produced no catalog object`);
84
86
  } catch (e) {
85
- reasons.push(`${CORPUS_PACKAGE} import failed: ${e?.message || e}`);
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(CORPUS_PACKAGE);
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(`${CORPUS_PACKAGE} resolved file is not a catalog`);
100
+ reasons.push(`${CATALOG_PACKAGE} resolved file is not a catalog`);
99
101
  } catch (e) {
100
- reasons.push(`${CORPUS_PACKAGE} resolve+read failed: ${e?.message || e}`);
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/corpus/catalog-a2ui_0_9.json
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';
@@ -1,4 +0,0 @@
1
- // v0.5.21 hotfix stub — TS-migration Phase 1 (568bb998d) declared this
2
- // types: export but Phase 2 hasn't generated real declarations yet.
3
- // Replace with real type declarations when Phase 2 lands.
4
- export {};