@adia-ai/a2ui-mcp 0.4.3 → 0.4.4
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/package.json +1 -1
- package/scripts/test-chunks.mjs +1 -1
- package/server.js +14 -32
- package/scripts/smoke-zettel.mjs +0 -37
package/CHANGELOG.md
CHANGED
|
@@ -11,6 +11,16 @@ zettel strategies.
|
|
|
11
11
|
|
|
12
12
|
_No pending changes._
|
|
13
13
|
|
|
14
|
+
## [0.4.4] - 2026-05-12
|
|
15
|
+
|
|
16
|
+
### Changed — fragment-retirement follow-through (§37, 2026-05-12)
|
|
17
|
+
|
|
18
|
+
- **`mcp/server.js` — `get_fragment` tool removed; `zettel_stats` simplified.** Companion to `@adia-ai/a2ui-compose@[Unreleased]` retiring `corpus/fragments/`. Removed imports, boot logs, and the engine description block that referenced fragments. Net: -31 lines across server.js.
|
|
19
|
+
- **`mcp/scripts/smoke-zettel.mjs` — retired (37 lines).** Smoke depended on the removed fragment library; replaced functionally by `mcp/scripts/smoke-engine-registry.mjs` (engine path) and `scripts/test-chunks.mjs` (zettel composition path).
|
|
20
|
+
- **`mcp/scripts/test-chunks.mjs` — 1-line tweak.** Threshold adjustment for the post-§40 annotated-chunk world.
|
|
21
|
+
|
|
22
|
+
See root [CHANGELOG.md `[Unreleased]`](../../../CHANGELOG.md) for the cross-cutting arc narrative.
|
|
23
|
+
|
|
14
24
|
## [0.4.3] - 2026-05-11
|
|
15
25
|
|
|
16
26
|
### Ride-along (no source changes)
|
package/package.json
CHANGED
package/scripts/test-chunks.mjs
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Smoke test for the gen-UI chunk MCP tools.
|
|
4
4
|
*
|
|
5
5
|
* Tests search_chunks / get_chunk / lookup_chunk against known chunks
|
|
6
|
-
* harvested from site/pages
|
|
6
|
+
* harvested from site/pages/*, apps/*, playgrounds/*, and catalog/*.
|
|
7
7
|
*
|
|
8
8
|
* Wired into:
|
|
9
9
|
* - npm run smoke:chunks
|
package/server.js
CHANGED
|
@@ -43,16 +43,13 @@ import { getPattern, searchPatterns, getAllPatterns } from '../retrieval/pattern
|
|
|
43
43
|
import { getAntiPatterns, checkAllAntiPatterns } from '../retrieval/anti-patterns.js';
|
|
44
44
|
import { assembleContext } from '../retrieval/context-assembler.js';
|
|
45
45
|
|
|
46
|
-
// ── Zettel (
|
|
46
|
+
// ── Zettel (composition) engine ──
|
|
47
47
|
import {
|
|
48
48
|
loadAll as loadZettelCorpus,
|
|
49
|
-
getFragment as getZettelFragment,
|
|
50
49
|
getComposition as getZettelComposition,
|
|
51
|
-
getAllFragments as getAllZettelFragments,
|
|
52
50
|
getAllCompositions as getAllZettelCompositions,
|
|
53
|
-
searchAll as searchZettelAll,
|
|
54
51
|
getGraph as getZettelGraph,
|
|
55
|
-
} from '../compose/strategies/zettel/
|
|
52
|
+
} from '../compose/strategies/zettel/composition-library.js';
|
|
56
53
|
import {
|
|
57
54
|
resolveComposition as resolveZettelComposition,
|
|
58
55
|
templateToMessages as zettelTemplateToMessages,
|
|
@@ -63,7 +60,7 @@ import {
|
|
|
63
60
|
// Bootstrap zettel corpus alongside the monolithic pattern library
|
|
64
61
|
const _zettelBoot = loadZettelCorpus();
|
|
65
62
|
console.error(
|
|
66
|
-
`[adiaui-mcp] zettel corpus: ${_zettelBoot.
|
|
63
|
+
`[adiaui-mcp] zettel corpus: ${_zettelBoot.compositionCount} compositions`,
|
|
67
64
|
);
|
|
68
65
|
|
|
69
66
|
// ── Gen-UI training-chunk corpus ──
|
|
@@ -491,22 +488,13 @@ server.resource(
|
|
|
491
488
|
}
|
|
492
489
|
);
|
|
493
490
|
|
|
494
|
-
// ── Zettel-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
'get_fragment',
|
|
498
|
-
'Fetch a fragment (A2UI chunk + metadata + slots + backlinks) by name. Zettel-only.',
|
|
499
|
-
{ name: z.string() },
|
|
500
|
-
async ({ name }) => {
|
|
501
|
-
const f = getZettelFragment(name);
|
|
502
|
-
if (!f) return { content: [{ type: 'text', text: `Fragment not found: ${name}` }], isError: true };
|
|
503
|
-
return { content: [{ type: 'text', text: JSON.stringify(f, null, 2) }] };
|
|
504
|
-
},
|
|
505
|
-
);
|
|
491
|
+
// ── Zettel composition-inspection tools ────────────────────────────────
|
|
492
|
+
// (Fragment-inspection tools retired in §37; fragments no longer exist as
|
|
493
|
+
// a separate corpus class. Compositions are now flat A2UI templates.)
|
|
506
494
|
|
|
507
495
|
server.tool(
|
|
508
496
|
'get_composition',
|
|
509
|
-
'Fetch a composition by name. Returns the
|
|
497
|
+
'Fetch a composition by name. Returns the flat A2UI template (compositions are pre-inlined; no $fragment refs). Zettel-only.',
|
|
510
498
|
{ name: z.string() },
|
|
511
499
|
async ({ name }) => {
|
|
512
500
|
const c = getZettelComposition(name);
|
|
@@ -517,7 +505,7 @@ server.tool(
|
|
|
517
505
|
|
|
518
506
|
server.tool(
|
|
519
507
|
'resolve_composition',
|
|
520
|
-
'
|
|
508
|
+
'Return the flat A2UI template + updateComponents messages for a composition. Zettel-only. (Pre-inlined since §37 — `resolve` is now a defensive copy + strip pass.)',
|
|
521
509
|
{ name: z.string() },
|
|
522
510
|
async ({ name }) => {
|
|
523
511
|
const c = getZettelComposition(name);
|
|
@@ -535,31 +523,25 @@ server.tool(
|
|
|
535
523
|
|
|
536
524
|
server.tool(
|
|
537
525
|
'get_graph',
|
|
538
|
-
'Return the
|
|
526
|
+
'Return the composition catalog. Zettel-only. (Backlinks to fragments retired in §37; only composition nodes remain.)',
|
|
539
527
|
{},
|
|
540
528
|
async () => ({ content: [{ type: 'text', text: JSON.stringify(getZettelGraph(), null, 2) }] }),
|
|
541
529
|
);
|
|
542
530
|
|
|
543
531
|
server.tool(
|
|
544
532
|
'zettel_stats',
|
|
545
|
-
'Zettel corpus stats —
|
|
533
|
+
'Zettel corpus stats — composition count + average node count. (Fragment stats retired in §37.)',
|
|
546
534
|
{},
|
|
547
535
|
async () => {
|
|
548
|
-
const frags = getAllZettelFragments();
|
|
549
536
|
const comps = getAllZettelCompositions();
|
|
550
|
-
const
|
|
551
|
-
.sort((a, b) => (b.metrics?.leverage || 0) - (a.metrics?.leverage || 0))
|
|
552
|
-
.slice(0, 10)
|
|
553
|
-
.map((f) => ({ name: f.name, leverage: f.metrics?.leverage || 0, used_by: (f.links?.used_by || []).length }));
|
|
554
|
-
const orphans = frags.filter((f) => !(f.links?.used_by || []).length).map((f) => f.name);
|
|
537
|
+
const totalNodes = comps.reduce((s, c) => s + (c.template?.length || 0), 0);
|
|
555
538
|
return {
|
|
556
539
|
content: [{
|
|
557
540
|
type: 'text',
|
|
558
541
|
text: JSON.stringify({
|
|
559
|
-
fragments: frags.length,
|
|
560
542
|
compositions: comps.length,
|
|
561
|
-
|
|
562
|
-
|
|
543
|
+
avg_nodes_per_composition: comps.length ? Math.round(totalNodes / comps.length) : 0,
|
|
544
|
+
total_nodes: totalNodes,
|
|
563
545
|
}, null, 2),
|
|
564
546
|
}],
|
|
565
547
|
};
|
|
@@ -683,7 +665,7 @@ async function main() {
|
|
|
683
665
|
const catalog = await getCatalog();
|
|
684
666
|
const patterns = getAllPatterns();
|
|
685
667
|
const traits = getTraits();
|
|
686
|
-
console.error(`AdiaUI MCP Server running (${catalog.totalTypes} components, ${patterns.length} patterns, ${traits.length} traits, ${_zettelBoot.
|
|
668
|
+
console.error(`AdiaUI MCP Server running (${catalog.totalTypes} components, ${patterns.length} patterns, ${traits.length} traits, ${_zettelBoot.compositionCount} compositions)`);
|
|
687
669
|
}
|
|
688
670
|
|
|
689
671
|
main().catch(console.error);
|
package/scripts/smoke-zettel.mjs
DELETED
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
/** Smoke test: load library, resolve login-form, print resolved template. */
|
|
3
|
-
import { loadAll, getAllFragments, getAllCompositions, searchAll, getGraph, getComposition } from './fragment-library.js';
|
|
4
|
-
import { resolveComposition } from './composer.js';
|
|
5
|
-
|
|
6
|
-
const boot = loadAll();
|
|
7
|
-
console.log('boot:', boot);
|
|
8
|
-
|
|
9
|
-
console.log('\n=== Fragments ===');
|
|
10
|
-
for (const f of getAllFragments()) console.log(` - ${f.name} [${f.semantic_role}]`);
|
|
11
|
-
|
|
12
|
-
console.log('\n=== Compositions ===');
|
|
13
|
-
for (const c of getAllCompositions()) console.log(` - ${c.name} (${c.domain})`);
|
|
14
|
-
|
|
15
|
-
console.log('\n=== Search: "login" ===');
|
|
16
|
-
console.log(searchAll('login form password', { limit: 5 }));
|
|
17
|
-
|
|
18
|
-
console.log('\n=== Search: "card header title" ===');
|
|
19
|
-
console.log(searchAll('card header title', { limit: 5 }));
|
|
20
|
-
|
|
21
|
-
console.log('\n=== Resolve login-form ===');
|
|
22
|
-
const comp = getComposition('login-form');
|
|
23
|
-
const resolved = resolveComposition(comp);
|
|
24
|
-
console.log(`resolved ${resolved.length} nodes:`);
|
|
25
|
-
for (const n of resolved) {
|
|
26
|
-
const kids = n.children ? `→[${n.children.join(',')}]` : '';
|
|
27
|
-
const text = n.textContent ? ` "${n.textContent}"` : '';
|
|
28
|
-
const label = n.label ? ` label="${n.label}"` : '';
|
|
29
|
-
console.log(` ${n.id.padEnd(20)} ${n.component}${label}${text} ${kids}`);
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
console.log('\n=== Graph ===');
|
|
33
|
-
const g = getGraph();
|
|
34
|
-
console.log('fragments with usage:');
|
|
35
|
-
for (const f of g.fragments) {
|
|
36
|
-
if (f.used_by.length) console.log(` ${f.name} ← ${f.used_by.map(u => u.name).join(', ')}`);
|
|
37
|
-
}
|