@adia-ai/a2ui-retrieval 0.2.0 → 0.2.1
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 +18 -3
- package/catalog.js +51 -46
- package/embedding/chunk-embedding-retriever.js +14 -3
- package/embedding/embedding-retriever.js +14 -3
- package/package.json +4 -1
package/CHANGELOG.md
CHANGED
|
@@ -9,13 +9,30 @@ _Nothing yet._
|
|
|
9
9
|
|
|
10
10
|
---
|
|
11
11
|
|
|
12
|
+
## [0.2.1] - 2026-05-02
|
|
13
|
+
|
|
14
|
+
**Lockstep cut.** All 8 published `@adia-ai/*` packages bump 0.2.0 → 0.2.1 per [`docs/specs/package-architecture.md` § 15](../../../docs/specs/package-architecture.md#15-versioning-policy). Patch cut — no breaking changes.
|
|
15
|
+
|
|
16
|
+
### Changed
|
|
17
|
+
|
|
18
|
+
- `version`: `0.2.0` → `0.2.1`.
|
|
19
|
+
- `dependencies["@adia-ai/a2ui-corpus"]`: `^0.2.0` (covers `0.2.1`).
|
|
20
|
+
- `dependencies["@adia-ai/a2ui-utils"]`: `^0.2.0` (covers `0.2.1`).
|
|
21
|
+
- `embedding/chunk-embedding-retriever.js` + `embedding/embedding-retriever.js` — defensive resolution path: when the `chunk-embeddings.json` / `pattern-embeddings.json` indexes aren't reachable (e.g. inside a `node_modules/@adia-ai/a2ui-corpus/` install layout where the `files:` array now excludes them), the retriever falls back to keyword-only retrieval gracefully instead of throwing on `ENOENT`. Aligns with the `@adia-ai/a2ui-corpus` 0.2.0 tarball-trim decision.
|
|
22
|
+
|
|
23
|
+
### No source-behavior changes
|
|
24
|
+
|
|
25
|
+
Public API of `a2ui-retrieval` is byte-identical to `0.2.0`. The above embedding-retriever updates only affect the failure path (`ENOENT` graceful fallback) and don't change the contract for callers passing valid index files. The cut bumps version + tracks dep ranges + softens the embedding-index-missing failure mode.
|
|
26
|
+
|
|
27
|
+
---
|
|
28
|
+
|
|
12
29
|
## [0.2.0] - 2026-05-02
|
|
13
30
|
|
|
14
31
|
**Lockstep cut + boundary reorganization.** All 8 published
|
|
15
32
|
`@adia-ai/*` packages now share one version, governed by
|
|
16
33
|
[`docs/specs/package-architecture.md` § 15 (Versioning Policy)](../../../docs/specs/package-architecture.md#15-versioning-policy).
|
|
17
34
|
This release also lands the boundary cleanup from T4 of the
|
|
18
|
-
[`docs/plans/packages-architecture-fixes-2026-05-02.md`](
|
|
35
|
+
[`docs/plans/packages-architecture-fixes-2026-05-02.md`](../../../.brain/archive/2026-Q2/PLAN-packages-architecture-fixes-2026-05-02.md)
|
|
19
36
|
plan.
|
|
20
37
|
|
|
21
38
|
### Changed
|
|
@@ -71,8 +88,6 @@ The top-level `index.js` still re-exports the previously-public surface
|
|
|
71
88
|
|
|
72
89
|
---
|
|
73
90
|
|
|
74
|
-
---
|
|
75
|
-
|
|
76
91
|
## [0.0.1] - 2026-04-24
|
|
77
92
|
|
|
78
93
|
First public release. Extracted from
|
package/catalog.js
CHANGED
|
@@ -89,52 +89,57 @@ const categoryMap = {
|
|
|
89
89
|
};
|
|
90
90
|
|
|
91
91
|
// ── Trait registry ──
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
92
|
+
//
|
|
93
|
+
// Loaded from packages/web-components/traits/_catalog.json — generated
|
|
94
|
+
// by `node scripts/build/traits-catalog.mjs` from the live defineTrait()
|
|
95
|
+
// metadata. Hand-edits here will be overwritten. Treat the trait file
|
|
96
|
+
// itself as the single source of truth.
|
|
97
|
+
let traitRegistry = [];
|
|
98
|
+
|
|
99
|
+
async function loadTraitRegistry() {
|
|
100
|
+
if (typeof process !== 'undefined' && process.versions?.node) {
|
|
101
|
+
try {
|
|
102
|
+
const { readFile } = await import(/* @vite-ignore */ 'node:fs/promises');
|
|
103
|
+
const { fileURLToPath } = await import(/* @vite-ignore */ 'node:url');
|
|
104
|
+
const { dirname, join } = await import(/* @vite-ignore */ 'node:path');
|
|
105
|
+
const path = join(dirname(fileURLToPath(import.meta.url)), '../../web-components/traits/_catalog.json');
|
|
106
|
+
const raw = await readFile(path, 'utf8');
|
|
107
|
+
const data = JSON.parse(raw);
|
|
108
|
+
traitRegistry = data.traits.map(t => ({
|
|
109
|
+
name: t.name,
|
|
110
|
+
category: t.category,
|
|
111
|
+
description: t.description,
|
|
112
|
+
attributes: [...t.attributes],
|
|
113
|
+
events: [...t.events],
|
|
114
|
+
config: [...t.config],
|
|
115
|
+
}));
|
|
116
|
+
} catch (err) {
|
|
117
|
+
console.warn('[a2ui-corpus] could not load trait catalog:', err.message);
|
|
118
|
+
}
|
|
119
|
+
} else {
|
|
120
|
+
// Browser branch — fetch via HTTP, not `import('… .json', { with: { type: 'json' } })`.
|
|
121
|
+
// Vite's dev server transforms JSON imports into JS modules and serves them
|
|
122
|
+
// with `Content-Type: text/javascript`; Chrome's strict MIME check rejects
|
|
123
|
+
// that when the spec-correct `with: { type: 'json' }` attribute is present.
|
|
124
|
+
// (Site pages already use fetch() for the same file — see
|
|
125
|
+
// site/pages/traits/_api-table.js + site/pages/traits/catalog/index.setup.js.)
|
|
126
|
+
try {
|
|
127
|
+
const res = await fetch('/packages/web-components/traits/_catalog.json');
|
|
128
|
+
if (!res.ok) throw new Error(`HTTP ${res.status}`);
|
|
129
|
+
const data = await res.json();
|
|
130
|
+
traitRegistry = data.traits.map(t => ({
|
|
131
|
+
name: t.name,
|
|
132
|
+
category: t.category,
|
|
133
|
+
description: t.description,
|
|
134
|
+
attributes: [...t.attributes],
|
|
135
|
+
events: [...t.events],
|
|
136
|
+
config: [...t.config],
|
|
137
|
+
}));
|
|
138
|
+
} catch { /* trait catalog not present in this build context */ }
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
await loadTraitRegistry();
|
|
138
143
|
|
|
139
144
|
// ── Alias tracking ──
|
|
140
145
|
const aliases = new Set([
|
|
@@ -32,9 +32,20 @@ async function _loadIndex() {
|
|
|
32
32
|
const fs = await import(/* @vite-ignore */ 'node:fs/promises');
|
|
33
33
|
const path = await import(/* @vite-ignore */ 'node:path');
|
|
34
34
|
const url = await import(/* @vite-ignore */ 'node:url');
|
|
35
|
-
//
|
|
36
|
-
|
|
37
|
-
|
|
35
|
+
// Try the package-import path first (works under node_modules
|
|
36
|
+
// install layout — `@adia-ai/a2ui-corpus` exports
|
|
37
|
+
// `./chunk-embeddings`). Fall back to the relative source-tree
|
|
38
|
+
// path so a source-checkout monorepo without symlinked deps
|
|
39
|
+
// still resolves.
|
|
40
|
+
let p = null;
|
|
41
|
+
try {
|
|
42
|
+
const { createRequire } = await import(/* @vite-ignore */ 'node:module');
|
|
43
|
+
const require = createRequire(import.meta.url);
|
|
44
|
+
p = require.resolve('@adia-ai/a2ui-corpus/chunk-embeddings');
|
|
45
|
+
} catch {
|
|
46
|
+
const here = path.dirname(url.fileURLToPath(import.meta.url));
|
|
47
|
+
p = path.resolve(here, '../../corpus/chunk-embeddings.json');
|
|
48
|
+
}
|
|
38
49
|
const raw = await fs.readFile(p, 'utf8');
|
|
39
50
|
_index = JSON.parse(raw);
|
|
40
51
|
} else {
|
|
@@ -32,9 +32,20 @@ async function _loadIndex() {
|
|
|
32
32
|
const fs = await import(/* @vite-ignore */ 'node:fs/promises');
|
|
33
33
|
const path = await import(/* @vite-ignore */ 'node:path');
|
|
34
34
|
const url = await import(/* @vite-ignore */ 'node:url');
|
|
35
|
-
//
|
|
36
|
-
|
|
37
|
-
|
|
35
|
+
// Try the package-import path first (works under node_modules
|
|
36
|
+
// install layout — `@adia-ai/a2ui-corpus` exports
|
|
37
|
+
// `./pattern-embeddings`). Fall back to the relative source-tree
|
|
38
|
+
// path so a source-checkout monorepo without symlinked deps
|
|
39
|
+
// still resolves.
|
|
40
|
+
let p = null;
|
|
41
|
+
try {
|
|
42
|
+
const { createRequire } = await import(/* @vite-ignore */ 'node:module');
|
|
43
|
+
const require = createRequire(import.meta.url);
|
|
44
|
+
p = require.resolve('@adia-ai/a2ui-corpus/pattern-embeddings');
|
|
45
|
+
} catch {
|
|
46
|
+
const here = path.dirname(url.fileURLToPath(import.meta.url));
|
|
47
|
+
p = path.resolve(here, '../../corpus/pattern-embeddings.json');
|
|
48
|
+
}
|
|
38
49
|
const raw = await fs.readFile(p, 'utf8');
|
|
39
50
|
_index = JSON.parse(raw);
|
|
40
51
|
} else {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adia-ai/a2ui-retrieval",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.1",
|
|
4
4
|
"description": "AdiaUI A2UI retrieval layer — catalog lookup, intent classification, domain routing, pattern + anti-pattern matching, clarity + context assembly. Consumed by the compose engine and any A2UI-protocol tooling that needs to reason about user intent against the catalog.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./index.js",
|
|
@@ -37,5 +37,8 @@
|
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
39
|
"@adia-ai/a2ui-utils": "^0.2.0"
|
|
40
|
+
},
|
|
41
|
+
"optionalDependencies": {
|
|
42
|
+
"@adia-ai/a2ui-corpus": "^0.2.0"
|
|
40
43
|
}
|
|
41
44
|
}
|