@tanrei/mcp 0.0.0-stage → 0.1.0-next.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/LICENSE +202 -0
- package/NOTICE +57 -0
- package/README.md +150 -2
- package/bin/tanrei-mcp.js +15 -0
- package/dist/server.js +4515 -0
- package/dist/vocabulary/docs/governance/mimicry-gaps.json +666 -0
- package/dist/vocabulary/packages/tokens-build/generated/component-catalog.json +1825 -0
- package/dist/vocabulary/specs/accordion.spec.json +1 -0
- package/dist/vocabulary/specs/app-bar.spec.json +1 -0
- package/dist/vocabulary/specs/app-shell.spec.json +1 -0
- package/dist/vocabulary/specs/avatar.spec.json +1 -0
- package/dist/vocabulary/specs/badge.spec.json +1 -0
- package/dist/vocabulary/specs/bottom-sheet.spec.json +1 -0
- package/dist/vocabulary/specs/breadcrumbs.spec.json +1 -0
- package/dist/vocabulary/specs/button-group.spec.json +1 -0
- package/dist/vocabulary/specs/button-with-menu.spec.json +1 -0
- package/dist/vocabulary/specs/button.spec.json +1 -0
- package/dist/vocabulary/specs/calendar.spec.json +1 -0
- package/dist/vocabulary/specs/callout.spec.json +1 -0
- package/dist/vocabulary/specs/card.spec.json +1 -0
- package/dist/vocabulary/specs/carousel.spec.json +1 -0
- package/dist/vocabulary/specs/chat-composer.spec.json +1 -0
- package/dist/vocabulary/specs/checkbox-group.spec.json +1 -0
- package/dist/vocabulary/specs/checkbox.spec.json +1 -0
- package/dist/vocabulary/specs/chip-field.spec.json +1 -0
- package/dist/vocabulary/specs/chip.spec.json +1 -0
- package/dist/vocabulary/specs/code-block.spec.json +1 -0
- package/dist/vocabulary/specs/color-field.spec.json +1 -0
- package/dist/vocabulary/specs/color-input.spec.json +1 -0
- package/dist/vocabulary/specs/combobox-field.spec.json +1 -0
- package/dist/vocabulary/specs/combobox.spec.json +1 -0
- package/dist/vocabulary/specs/component.schema.json +1 -0
- package/dist/vocabulary/specs/copy-button.spec.json +1 -0
- package/dist/vocabulary/specs/date-time-picker.spec.json +1 -0
- package/dist/vocabulary/specs/description-list.spec.json +1 -0
- package/dist/vocabulary/specs/dialog.spec.json +1 -0
- package/dist/vocabulary/specs/divider.spec.json +1 -0
- package/dist/vocabulary/specs/drop-zone.spec.json +1 -0
- package/dist/vocabulary/specs/embedded-text-input.spec.json +1 -0
- package/dist/vocabulary/specs/empty-state.spec.json +1 -0
- package/dist/vocabulary/specs/fab-menu.spec.json +1 -0
- package/dist/vocabulary/specs/field-group.spec.json +1 -0
- package/dist/vocabulary/specs/field.spec.json +1 -0
- package/dist/vocabulary/specs/figure.spec.json +1 -0
- package/dist/vocabulary/specs/file-item.spec.json +1 -0
- package/dist/vocabulary/specs/file-picker.spec.json +1 -0
- package/dist/vocabulary/specs/file-upload.spec.json +1 -0
- package/dist/vocabulary/specs/handle.spec.json +1 -0
- package/dist/vocabulary/specs/image-preview.spec.json +1 -0
- package/dist/vocabulary/specs/inline-code.spec.json +1 -0
- package/dist/vocabulary/specs/inventory.json +1 -0
- package/dist/vocabulary/specs/keyboard-shortcut.spec.json +1 -0
- package/dist/vocabulary/specs/link-card.spec.json +1 -0
- package/dist/vocabulary/specs/link.spec.json +1 -0
- package/dist/vocabulary/specs/list-row.spec.json +1 -0
- package/dist/vocabulary/specs/list.spec.json +1 -0
- package/dist/vocabulary/specs/loading-indicator.spec.json +1 -0
- package/dist/vocabulary/specs/main-action-button.spec.json +1 -0
- package/dist/vocabulary/specs/marquee-text.spec.json +1 -0
- package/dist/vocabulary/specs/menu.spec.json +1 -0
- package/dist/vocabulary/specs/menubar.spec.json +1 -0
- package/dist/vocabulary/specs/meter.spec.json +1 -0
- package/dist/vocabulary/specs/modal-layer.spec.json +1 -0
- package/dist/vocabulary/specs/navigation-bar.spec.json +1 -0
- package/dist/vocabulary/specs/navigation-drawer.spec.json +1 -0
- package/dist/vocabulary/specs/number-field.spec.json +1 -0
- package/dist/vocabulary/specs/number-input.spec.json +1 -0
- package/dist/vocabulary/specs/number-ticker.spec.json +1 -0
- package/dist/vocabulary/specs/one-time-code-field.spec.json +1 -0
- package/dist/vocabulary/specs/one-time-code-input.spec.json +1 -0
- package/dist/vocabulary/specs/page-header.spec.json +1 -0
- package/dist/vocabulary/specs/pagination.spec.json +1 -0
- package/dist/vocabulary/specs/popover.spec.json +1 -0
- package/dist/vocabulary/specs/previous-next-links.spec.json +1 -0
- package/dist/vocabulary/specs/progress-indicator.spec.json +1 -0
- package/dist/vocabulary/specs/prose.spec.json +1 -0
- package/dist/vocabulary/specs/radio-button.spec.json +1 -0
- package/dist/vocabulary/specs/radio-group.spec.json +1 -0
- package/dist/vocabulary/specs/rating.spec.json +1 -0
- package/dist/vocabulary/specs/resizable-frame.spec.json +1 -0
- package/dist/vocabulary/specs/scroll-area.spec.json +1 -0
- package/dist/vocabulary/specs/search.spec.json +1 -0
- package/dist/vocabulary/specs/segmented-button.spec.json +1 -0
- package/dist/vocabulary/specs/select-field.spec.json +1 -0
- package/dist/vocabulary/specs/select.spec.json +1 -0
- package/dist/vocabulary/specs/side-sheet.spec.json +1 -0
- package/dist/vocabulary/specs/size-transition.spec.json +1 -0
- package/dist/vocabulary/specs/skeleton.spec.json +1 -0
- package/dist/vocabulary/specs/slider-field.spec.json +1 -0
- package/dist/vocabulary/specs/slider.spec.json +1 -0
- package/dist/vocabulary/specs/snackbar.spec.json +1 -0
- package/dist/vocabulary/specs/split-view.spec.json +1 -0
- package/dist/vocabulary/specs/stepper.spec.json +1 -0
- package/dist/vocabulary/specs/steps.spec.json +1 -0
- package/dist/vocabulary/specs/swatch.spec.json +1 -0
- package/dist/vocabulary/specs/switch.spec.json +1 -0
- package/dist/vocabulary/specs/tab-view.spec.json +1 -0
- package/dist/vocabulary/specs/table-of-contents.spec.json +1 -0
- package/dist/vocabulary/specs/table.spec.json +1 -0
- package/dist/vocabulary/specs/tabs.spec.json +1 -0
- package/dist/vocabulary/specs/tag-group.spec.json +1 -0
- package/dist/vocabulary/specs/tag.spec.json +1 -0
- package/dist/vocabulary/specs/text-field.spec.json +1 -0
- package/dist/vocabulary/specs/text-input.spec.json +1 -0
- package/dist/vocabulary/specs/timeline.spec.json +1 -0
- package/dist/vocabulary/specs/toolbar.spec.json +1 -0
- package/dist/vocabulary/specs/tooltip.spec.json +1 -0
- package/dist/vocabulary/specs/tree-view.spec.json +1 -0
- package/dist/vocabulary/tanrei.config.json +24 -0
- package/dist/vocabulary/tokens/comp/accordion.tokens.json +459 -0
- package/dist/vocabulary/tokens/comp/app-bar.tokens.json +308 -0
- package/dist/vocabulary/tokens/comp/app-shell.tokens.json +248 -0
- package/dist/vocabulary/tokens/comp/avatar.tokens.json +199 -0
- package/dist/vocabulary/tokens/comp/badge.tokens.json +101 -0
- package/dist/vocabulary/tokens/comp/bottom-sheet.tokens.json +326 -0
- package/dist/vocabulary/tokens/comp/breadcrumbs.tokens.json +253 -0
- package/dist/vocabulary/tokens/comp/button-group.tokens.json +140 -0
- package/dist/vocabulary/tokens/comp/button-with-menu.tokens.json +810 -0
- package/dist/vocabulary/tokens/comp/button.tokens.json +1355 -0
- package/dist/vocabulary/tokens/comp/calendar.tokens.json +500 -0
- package/dist/vocabulary/tokens/comp/callout.tokens.json +510 -0
- package/dist/vocabulary/tokens/comp/card.tokens.json +204 -0
- package/dist/vocabulary/tokens/comp/carousel.tokens.json +469 -0
- package/dist/vocabulary/tokens/comp/chat-composer.tokens.json +343 -0
- package/dist/vocabulary/tokens/comp/checkbox.tokens.json +587 -0
- package/dist/vocabulary/tokens/comp/chip.tokens.json +716 -0
- package/dist/vocabulary/tokens/comp/code-block.tokens.json +473 -0
- package/dist/vocabulary/tokens/comp/color-input.tokens.json +49 -0
- package/dist/vocabulary/tokens/comp/combobox.tokens.json +756 -0
- package/dist/vocabulary/tokens/comp/copy-button.tokens.json +56 -0
- package/dist/vocabulary/tokens/comp/date-time-picker.tokens.json +797 -0
- package/dist/vocabulary/tokens/comp/description-list.tokens.json +203 -0
- package/dist/vocabulary/tokens/comp/dialog.tokens.json +340 -0
- package/dist/vocabulary/tokens/comp/divider.tokens.json +139 -0
- package/dist/vocabulary/tokens/comp/drop-zone.tokens.json +151 -0
- package/dist/vocabulary/tokens/comp/embedded-text-input.tokens.json +103 -0
- package/dist/vocabulary/tokens/comp/empty-state.tokens.json +154 -0
- package/dist/vocabulary/tokens/comp/field-group.tokens.json +211 -0
- package/dist/vocabulary/tokens/comp/field.tokens.json +308 -0
- package/dist/vocabulary/tokens/comp/figure.tokens.json +269 -0
- package/dist/vocabulary/tokens/comp/file-item.tokens.json +445 -0
- package/dist/vocabulary/tokens/comp/file-picker.tokens.json +282 -0
- package/dist/vocabulary/tokens/comp/file-upload.tokens.json +30 -0
- package/dist/vocabulary/tokens/comp/handle.tokens.json +343 -0
- package/dist/vocabulary/tokens/comp/image-preview.tokens.json +327 -0
- package/dist/vocabulary/tokens/comp/inline-code.tokens.json +86 -0
- package/dist/vocabulary/tokens/comp/input-box.tokens.json +1073 -0
- package/dist/vocabulary/tokens/comp/keyboard-shortcut.tokens.json +194 -0
- package/dist/vocabulary/tokens/comp/link-card.tokens.json +321 -0
- package/dist/vocabulary/tokens/comp/link.tokens.json +321 -0
- package/dist/vocabulary/tokens/comp/list-row.tokens.json +249 -0
- package/dist/vocabulary/tokens/comp/list.tokens.json +328 -0
- package/dist/vocabulary/tokens/comp/loading-indicator.tokens.json +218 -0
- package/dist/vocabulary/tokens/comp/main-action-button.tokens.json +418 -0
- package/dist/vocabulary/tokens/comp/marquee-text.tokens.json +110 -0
- package/dist/vocabulary/tokens/comp/menu.tokens.json +1124 -0
- package/dist/vocabulary/tokens/comp/menubar.tokens.json +279 -0
- package/dist/vocabulary/tokens/comp/meter.tokens.json +173 -0
- package/dist/vocabulary/tokens/comp/modal-layer.tokens.json +69 -0
- package/dist/vocabulary/tokens/comp/navigation-bar.tokens.json +448 -0
- package/dist/vocabulary/tokens/comp/navigation-drawer.tokens.json +1126 -0
- package/dist/vocabulary/tokens/comp/number-input.tokens.json +75 -0
- package/dist/vocabulary/tokens/comp/number-ticker.tokens.json +77 -0
- package/dist/vocabulary/tokens/comp/one-time-code-input.tokens.json +246 -0
- package/dist/vocabulary/tokens/comp/page-header.tokens.json +247 -0
- package/dist/vocabulary/tokens/comp/pagination.tokens.json +233 -0
- package/dist/vocabulary/tokens/comp/popover.tokens.json +363 -0
- package/dist/vocabulary/tokens/comp/previous-next-links.tokens.json +194 -0
- package/dist/vocabulary/tokens/comp/progress-indicator.tokens.json +218 -0
- package/dist/vocabulary/tokens/comp/prose.tokens.json +283 -0
- package/dist/vocabulary/tokens/comp/radio-button.tokens.json +413 -0
- package/dist/vocabulary/tokens/comp/rating.tokens.json +230 -0
- package/dist/vocabulary/tokens/comp/resizable-frame.tokens.json +166 -0
- package/dist/vocabulary/tokens/comp/scroll-area.tokens.json +99 -0
- package/dist/vocabulary/tokens/comp/search.tokens.json +761 -0
- package/dist/vocabulary/tokens/comp/segmented-button.tokens.json +414 -0
- package/dist/vocabulary/tokens/comp/select.tokens.json +687 -0
- package/dist/vocabulary/tokens/comp/side-sheet.tokens.json +332 -0
- package/dist/vocabulary/tokens/comp/size-transition.tokens.json +49 -0
- package/dist/vocabulary/tokens/comp/skeleton.tokens.json +114 -0
- package/dist/vocabulary/tokens/comp/slider.tokens.json +436 -0
- package/dist/vocabulary/tokens/comp/snackbar.tokens.json +1160 -0
- package/dist/vocabulary/tokens/comp/split-view.tokens.json +52 -0
- package/dist/vocabulary/tokens/comp/stepper.tokens.json +538 -0
- package/dist/vocabulary/tokens/comp/steps.tokens.json +190 -0
- package/dist/vocabulary/tokens/comp/swatch.tokens.json +208 -0
- package/dist/vocabulary/tokens/comp/switch.tokens.json +350 -0
- package/dist/vocabulary/tokens/comp/tab-view.tokens.json +142 -0
- package/dist/vocabulary/tokens/comp/table-of-contents.tokens.json +429 -0
- package/dist/vocabulary/tokens/comp/table.tokens.json +553 -0
- package/dist/vocabulary/tokens/comp/tabs.tokens.json +1058 -0
- package/dist/vocabulary/tokens/comp/tag-group.tokens.json +68 -0
- package/dist/vocabulary/tokens/comp/tag.tokens.json +551 -0
- package/dist/vocabulary/tokens/comp/text-input.tokens.json +96 -0
- package/dist/vocabulary/tokens/comp/timeline.tokens.json +239 -0
- package/dist/vocabulary/tokens/comp/toolbar.tokens.json +270 -0
- package/dist/vocabulary/tokens/comp/tooltip.tokens.json +391 -0
- package/dist/vocabulary/tokens/comp/tree-view.tokens.json +478 -0
- package/dist/vocabulary/tokens/dial/dial.tokens.json +137 -0
- package/dist/vocabulary/tokens/fidelity/cupertino.fidelity.json +165 -0
- package/dist/vocabulary/tokens/fidelity/m3-like.fidelity.json +388 -0
- package/dist/vocabulary/tokens/fidelity/reference/androidx-material3.json +144 -0
- package/dist/vocabulary/tokens/fidelity/reference/apple-hig.json +196 -0
- package/dist/vocabulary/tokens/fidelity/reference/material-web.json +802 -0
- package/dist/vocabulary/tokens/generated/cupertino/components.json +1749 -0
- package/dist/vocabulary/tokens/generated/cupertino/fidelity.json +162 -0
- package/dist/vocabulary/tokens/generated/m3-like/components.json +1761 -0
- package/dist/vocabulary/tokens/generated/m3-like/fidelity.json +194 -0
- package/dist/vocabulary/tokens/generated/tanrei/components.json +1764 -0
- package/dist/vocabulary/tokens/icon-sets/material-symbols.icon-set.json +279 -0
- package/dist/vocabulary/tokens/ref/typeface.tokens.json +116 -0
- package/dist/vocabulary/tokens/schema/icon-set.schema.json +82 -0
- package/dist/vocabulary/tokens/schema/system.schema.json +859 -0
- package/dist/vocabulary/tokens/sys/behavior.tokens.json +184 -0
- package/dist/vocabulary/tokens/sys/color.vocabulary.json +58 -0
- package/dist/vocabulary/tokens/sys/elevation.tokens.json +362 -0
- package/dist/vocabulary/tokens/sys/measure.tokens.json +442 -0
- package/dist/vocabulary/tokens/sys/motion.tokens.json +1421 -0
- package/dist/vocabulary/tokens/sys/scroll-edge.tokens.json +50 -0
- package/dist/vocabulary/tokens/sys/shape.tokens.json +169 -0
- package/dist/vocabulary/tokens/sys/space.tokens.json +256 -0
- package/dist/vocabulary/tokens/sys/state.tokens.json +83 -0
- package/dist/vocabulary/tokens/sys/typescale.tokens.json +551 -0
- package/dist/vocabulary/tokens/systems/core.system.json +1889 -0
- package/dist/vocabulary/tokens/systems/cupertino.system.json +859 -0
- package/dist/vocabulary/tokens/systems/m3-like/comp/fab-menu.tokens.json +499 -0
- package/dist/vocabulary/tokens/systems/m3-like.system.json +1181 -0
- package/dist/vocabulary/tokens/systems/tanrei.system.json +707 -0
- package/dist/vocabulary/tokens/tanrei.resolver.json +400 -0
- package/package.json +52 -3
package/LICENSE
ADDED
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright [yyyy] [name of copyright owner]
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|
|
202
|
+
|
package/NOTICE
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
Tanrei
|
|
2
|
+
Copyright 2026 The Tanrei Authors
|
|
3
|
+
|
|
4
|
+
This product includes data derived from the following works, each licensed
|
|
5
|
+
under the Apache License, Version 2.0:
|
|
6
|
+
|
|
7
|
+
material-design-icons
|
|
8
|
+
Copyright Google LLC
|
|
9
|
+
https://github.com/google/material-design-icons
|
|
10
|
+
The list of glyph names that are mirrored in a right-to-left layout
|
|
11
|
+
(tokens/icon-sets/material-symbols.icon-set.json and the files generated
|
|
12
|
+
from it) is taken from the android:autoMirrored flag of the vector
|
|
13
|
+
drawables at revision 737e3324305806514d7909874fa1818ae1808232.
|
|
14
|
+
|
|
15
|
+
material-web
|
|
16
|
+
Copyright Google LLC
|
|
17
|
+
https://github.com/material-components/material-web
|
|
18
|
+
The token names and resolved values in
|
|
19
|
+
tokens/fidelity/reference/material-web.json are taken from the published
|
|
20
|
+
token files, version v0_192. Values of the m3-like preset
|
|
21
|
+
(tokens/systems/m3-like.system.json and the files generated from it) are
|
|
22
|
+
taken from the same token files.
|
|
23
|
+
|
|
24
|
+
androidx.compose.material3
|
|
25
|
+
Copyright The Android Open Source Project
|
|
26
|
+
https://github.com/androidx/androidx
|
|
27
|
+
The token names and values in
|
|
28
|
+
tokens/fidelity/reference/androidx-material3.json are taken from the
|
|
29
|
+
published token files, versions v0_11_0, v0_7_0 and 14_1_0. Values of the
|
|
30
|
+
m3-like preset (tokens/systems/m3-like.system.json and the files generated
|
|
31
|
+
from it) are taken from the same token files.
|
|
32
|
+
|
|
33
|
+
The source repository also contains the Gradle wrapper
|
|
34
|
+
(packages/compose/gradlew, gradlew.bat and gradle/wrapper/) — Copyright 2015
|
|
35
|
+
the original authors. Apache License, Version 2.0.
|
|
36
|
+
https://github.com/gradle/gradle
|
|
37
|
+
|
|
38
|
+
Tanrei's libraries reference fonts by name and include no font file. Two
|
|
39
|
+
build outputs include third-party code or fonts, and carry the copyright
|
|
40
|
+
notice and licence of each beside them in THIRD_PARTY_LICENSES.md: the
|
|
41
|
+
self-contained bundle of @tanrei/web (dist/tanrei.bundle.js), and the Theme
|
|
42
|
+
Studio app that @tanrei/cli serves (dist/studio/), which includes font files
|
|
43
|
+
licensed under the SIL Open Font License, Version 1.1.
|
|
44
|
+
|
|
45
|
+
The design system presets other than tanrei (tokens/systems/) are independent
|
|
46
|
+
approximations, named for what they resemble:
|
|
47
|
+
|
|
48
|
+
m3-like — resembles Material Design 3.
|
|
49
|
+
cupertino — resembles what the Apple Human Interface Guidelines describe.
|
|
50
|
+
|
|
51
|
+
Tanrei is not affiliated with, endorsed by, or sponsored by Google LLC,
|
|
52
|
+
Apple Inc., or any other owner of what a preset resembles.
|
|
53
|
+
|
|
54
|
+
Material Design is a trademark of Google LLC. Apple, iOS and Apple Human
|
|
55
|
+
Interface Guidelines are trademarks of Apple Inc. They are used only to name
|
|
56
|
+
what a preset approximates; Tanrei does not claim to follow them and includes
|
|
57
|
+
none of their logos, and none of Apple's typefaces or symbols.
|
package/README.md
CHANGED
|
@@ -1,3 +1,151 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @tanrei/mcp
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
<!-- tanrei:status -->
|
|
4
|
+
<!-- Written by `pnpm generate` (packages/tools/src/readme.js) from the specs and tanrei.config.json: edit those, not this block. -->
|
|
5
|
+
> **Prerelease.** `0.1.0-next.1` is published under the npm dist-tag `next`: until `0.1.0`, install `@tanrei/mcp@next`. During the 0.x prereleases backward compatibility is not kept: any prerelease may break anything, with no deprecation period first, and its changeset says what broke.
|
|
6
|
+
|
|
7
|
+
<!-- /tanrei:status -->
|
|
8
|
+
|
|
9
|
+
A [Model Context Protocol](https://modelcontextprotocol.io) server for [Tanrei](https://github.com/chnotchy/tanrei). It lets an AI agent working in **your product's repository** write UI with **only the components your design system has**, discover the token vocabulary, see where a value comes from, and write a **valid** edit to your design system's layer file — a changed value, or an extension of the vocabulary. It works from the two ideals Tanrei holds together:
|
|
10
|
+
|
|
11
|
+
> **A small core** — Tanrei's own tokens are a necessary and sufficient set, simply named, fitted to no one design system.
|
|
12
|
+
> **Exact reproduction** — by customizing Tanrei, any design system can be matched exactly.
|
|
13
|
+
> Both hold because the core stays small and **any layer may extend it**.
|
|
14
|
+
|
|
15
|
+
Every tool is read-only. The server computes values with the same pipeline `tanrei build` runs, and carries its own copy of the vocabulary, so it needs nothing else checked out.
|
|
16
|
+
|
|
17
|
+
## Install
|
|
18
|
+
|
|
19
|
+
Claude Code:
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
claude mcp add tanrei -- npx -y @tanrei/mcp
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
Any MCP client (Claude Desktop, Cursor, VS Code, …) — stdio transport:
|
|
26
|
+
|
|
27
|
+
```json
|
|
28
|
+
{
|
|
29
|
+
"mcpServers": {
|
|
30
|
+
"tanrei": {
|
|
31
|
+
"command": "npx",
|
|
32
|
+
"args": ["-y", "@tanrei/mcp"]
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
Node.js 20 or newer. Relative `layerFile` paths are resolved from the server's working directory (normally your project root). Keep `@tanrei/mcp`, `@tanrei/cli` and the Tanrei libraries on the same version: they share one vocabulary.
|
|
39
|
+
|
|
40
|
+
## Tools
|
|
41
|
+
|
|
42
|
+
| Tool | What it answers |
|
|
43
|
+
|---|---|
|
|
44
|
+
| `list_systems` | The shipped systems — the default `tanrei` and the presets `m3-like` (which adds the button sizes `xlarge` and `xxlarge`) and `cupertino` — and, with `layerFile`, your product's chain (every chain starts at the root layer `core`, which values the vocabulary for all of them and is not listed itself; `root` and `default` name the two): id, name, `extends`, description, declared palettes, number of value changes and pattern rules, **the extensions that exist in it** (count, by kind, the first few, each with `declaredBy`), and the accessibility findings: a warning count for the default system and a product (none for the default system, whose violations fail its build), and for an imitation preset `accessibility: { criteria: "not-applied", measurements, because }` — its contrast measured with the fixed ruler and shown as information, since Tanrei's accessibility criteria do not apply to a preset in any contrast scheme. A preset that is measured against the published system it reproduces also carries **`fidelity`**: `{ equal, measured, different, unmapped, reference: { name, version, source } }` — of `measured` reference tokens, `equal` have exactly the reference's value, `different` do not, and `unmapped` have no counterpart in Tanrei yet (see `mimicry_gaps`). It is the report of the preset's last build (`tokens/generated/<id>/fidelity.json`), read as it is; a system without one claims nothing. |
|
|
45
|
+
| `list_components` | The components a system ships, from its **components manifest** (`tokens/generated/<id>/components.json`; for a `layerFile`, the product's own, worked out as `tanrei build` works it out): name, title, category, level, listing (`advanced`: a building block a composed component wraps), a short summary, the web element with the module that registers it, the React wrapper with the entry to import it from, the `variant` values the system offers and the status on one platform (`platform`, default web). `omitted` lists what the system does not have — the layer that left it out and why, or the layer it lives in — with `insteadUse` (what the system ships for the same job), `availableIn` (the shipped systems that have it) and `howToInclude` (the line of a product's layer that takes it); `omittedVariants` the variant values it leaves out. Filters: `listing`, `category`, `level`, `status`. Paginated. Call it first. |
|
|
46
|
+
| `get_component` | One component, from its spec, for one system: props (`variant` narrowed to the values the system offers; a composed component's props are its members', written out), events, slots, the elements it holds (`items`), states, the behaviour as **EARS rules with their stable ids**, accessibility, and one fixture as an example. `name` is the component's name, its element (`tanrei-text-field`) or its React wrapper (`TextField`). `sections` narrows the answer or adds `anatomy`, `tokens`, `platforms`, `fixtures`. A component the system does not have answers `available: false` with what to use instead. |
|
|
47
|
+
| `find_component` | `need` in plain words ("pick a date") → the components of the system whose name, summary and props meet those words, best first; one that matches but the system does not have is listed apart (`notInThisSystem`), with what to use instead. |
|
|
48
|
+
| `check_usage` | `code` (with a `path` whose extension says how to read it) or `files` + a system → the check `tanrei audit` runs: every element (`<tanrei-…>`, a tag in a string, an imported React wrapper) and CSS selector of a component the system does not have, every import of an entry that does not fit the system (another system's, or `@tanrei/react/all`) or of a module or wrapper it does not have, and every literal `variant` it leaves out, with file, line, column and what to write instead; an unknown `tanrei-` element with the nearest components. Comments are skipped. Reads, never writes. |
|
|
49
|
+
| `search_tokens` | Find tokens by id: substring, or a glob (`tanrei.comp.button.*.hovered.*`, `sys.color.on-*`, `**.opacity`, `acme.comp.*` for a layer's own tokens). Filters: `tier` (dial, ref, sys, comp), `type`, `kind`, `extensions` (only / no vocabulary added by a layer). Returns id, `$type`, kind (derived, fixed, alias, dial), `extension: true` + `declaredBy` where a layer added the token, and a short description. Paginated. |
|
|
50
|
+
| `resolve` | Token id(s) + system + scheme → the resolved value (a choice of kind — `sys.behavior.*` — as its **name**, with `choice: { name, index, of }`), the alias chain, the derive rule with the current value of its inputs, the layer that set it (and, for an extension, the layer that declared it), and the CSS custom property name — `--tanrei-…`, or `--<namespace>-…` for a layer's own tokens. A palette tone that the palette states exactly (`source.tones`) says so: `rule.exact`. |
|
|
51
|
+
| `explain_token` | One token in one system: why it exists (the core's one-product rationale — or, for an extension, `declaredBy` and its `rationale`), usage guidance (`dev.tanrei.llm`, when the vocabulary carries it), which layers and pattern rules touch it, root first — every matching pattern rule says whether it `wins` and `because` (an explicit entry beats patterns, fewer wildcards beat more, the later layer wins a tie), and `winningRule` names the one that values the token — **what follows it** (`followers`: every token that moves when this token or dial does), **the operations a layer may legally write for it** (`howToChange`; a choice of kind offers **choose** with its names, a typeface **set the font stack**) and **how to add vocabulary next to it** (`howToExtend`: one more step of its series, one more size/variant of its axis, a token of your own). Every `write` is a ready-to-edit fragment of a layer. |
|
|
52
|
+
| `diff_systems` | Two systems → the tokens whose resolved value differs in a scheme. Counts by tier and group first; details paginated, narrowed with `group`. Ids that exist on one side only are reported apart: extensions (with `declaredBy`), and what declared palettes bring. |
|
|
53
|
+
| `validate_layer` | A layer (object or file; with an object, `parents` — other layers of the request it extends — and `dir` — where the product's other layer files live) → JSON Schema problems of every layer of the chain; then every problem at once, with the way out: `vocabulary` declarations as the engine judges them (rationale, own namespace, declared once, an existing axis and `from`, never an interaction state), ids under `tokens`/`rules` that are neither core nor declared, a pinned literal without `reason`, a `$type` change, leftover placeholders; then the real build, which is the final authority, and what it refuses in every layer, a product layer's too: `tanrei.sys.target.pointer` or `.touch` under `tanrei.sys.target.minimum`. Ids declared under `vocabulary` — including the member tokens a new size generates and a new variant's state tokens — are valid targets. If valid: the accessibility/structure warnings `tanrei build` would print — a target (`sys.target.minimum`, `.pointer`, `.touch`) under 24px (WCAG 2.5.8) or a pressable height under `sys.target.minimum` among them. Writes nothing. |
|
|
54
|
+
| `propose_extension` | `{ kind: "step" \| "axis-value" \| "own-token", … }` → a ready `vocabulary` fragment for the layer, checked (the id is new, names are valid, an own token uses the layer's namespace, the axis and `from` exist, it is not a state) and **verified by a trial build**: the new token ids with their values, and any new warnings. The `rationale` is a placeholder the agent must fill — `validate_layer` rejects it as it stands. Writes nothing. |
|
|
55
|
+
| `mimicry_gaps` | Tanrei's registry of traits it cannot reproduce yet — behaviours and mechanisms no token can express. A shipped preset's accessibility measurements are not gaps. Missing vocabulary is not a gap: a layer declares it. Filter by `status`, `kind`, `system`. |
|
|
56
|
+
|
|
57
|
+
Wherever a tool takes a system, pass `system` (a shipped id, default `tanrei`) or `layerFile` (the path of your `<id>.system.json`). `scheme` is one of `light`, `light-medium`, `light-high`, `dark`, `dark-medium`, `dark-high`. In a glob, `*` stays inside one id segment (as in a layer's pattern rules); `**`, or a `*` that ends the glob, takes the rest of the id. Lists return `total`, `offset`, `limit` and `nextOffset`.
|
|
58
|
+
|
|
59
|
+
Systems are built once and cached; a layer file is rebuilt when it, or a layer it extends, changes on disk, and every system is rebuilt when a hand-authored file under `tokens/` (the vocabulary) changes — no restart needed.
|
|
60
|
+
|
|
61
|
+
## Resources
|
|
62
|
+
|
|
63
|
+
| URI | |
|
|
64
|
+
|---|---|
|
|
65
|
+
| `tanrei://philosophy` | One page: the two ideals, the one-product test for the core, tiers and kinds, the eight dials and the minimum target, the layer operations, the three kinds of extension, accessibility severity. Read once. |
|
|
66
|
+
| `tanrei://schema/system` | The JSON Schema of a layer file. |
|
|
67
|
+
| `tanrei://systems/<id>` | Each shipped layer file as authored — worked examples of every operation. |
|
|
68
|
+
| `tanrei://components/<id>` | Each shipped system's components manifest, as the repository generates it. |
|
|
69
|
+
|
|
70
|
+
The server's `instructions` give the agent the hard rules up front — the same ones the tools enforce:
|
|
71
|
+
|
|
72
|
+
- **Components: settle the system first.** Call `list_components` and use no component it does not list (`omitted` says what to use instead); to rebuild a product with Tanrei, use the default system, `tanrei`. `check_usage` checks code before it is kept.
|
|
73
|
+
|
|
74
|
+
- **Values first.** Find the token that exists and change it in the layer: set a dial, `scale`, re-point an alias, replace `derive`, and only then pin a literal `$value`, which needs a `reason`. Color families are `palettes`.
|
|
75
|
+
- **If the word is missing, add it — in the layer, under `vocabulary`, with a `rationale`** (8+ characters). Three kinds: a step in a series inside Tanrei's tree (`tanrei.sys.space.space1200`, or a single color role with its `onRole`); a value on a component axis (`tanrei.comp.button.size.3x`, `tanrei.comp.button.variant.danger` — one line values every member; a variant's state tokens come from the system's pattern rules); the layer's own tokens in its own namespace, which is the layer's id (`acme.comp.rating.star.size` → `--acme-comp-rating-star-size`). They may reference `tanrei.*`; nothing in `tanrei.*` may reference them.
|
|
76
|
+
- **Additive only.** Extensions are inherited down `extends` and stay attributed to the layer that declared them. Nothing is removed or retyped; re-declaring what core or an ancestor declared is an error — change its value under `tokens`. Interaction states (hovered, focused, pressed, disabled) are not extensible.
|
|
77
|
+
- **Accessibility thresholds are constants**, for extensions too; a violation in a product layer is a warning every build prints.
|
|
78
|
+
- Never edit generated files; run `tanrei build` after editing the layer.
|
|
79
|
+
|
|
80
|
+
## Size and targets
|
|
81
|
+
|
|
82
|
+
Three values decide how big things are. `tanrei.dial.control.height` (40px) is the height controls and rows are drawn at in their default size; `tanrei.dial.size.unit` (4px) is the distance between the sizes: small is two size units below the control height and large four above it. `tanrei.sys.target.minimum` (36px) is the least height anything a person presses is drawn at: no dial scales it, every pressable height is derived with `"min": "{tanrei.sys.target.minimum}"`, and `tanrei.sys.target.pointer` and `.touch`, the least areas a press is taken from, alias it — a layer that follows a platform guideline sets them higher. `validate_layer` and `tanrei build` refuse a pointer or touch target under the minimum, and a minimum above the control height, in every layer; a target under 24px or a pressable height under the minimum is a warning in a product layer.
|
|
83
|
+
|
|
84
|
+
## An example session
|
|
85
|
+
|
|
86
|
+
> **You:** Our buttons should be rounder, and links should use the brand red `#e60012`.
|
|
87
|
+
|
|
88
|
+
1. `search_tokens { "query": "button.container.shape" }` → `tanrei.comp.button.container.shape` — alias.
|
|
89
|
+
2. `explain_token { "token": "tanrei.comp.button.container.shape", "layerFile": "design/acme.system.json" }` → aliases `{tanrei.sys.shape.corner.small}` (6px = `dial.shape.unit` × 3); legal operations: **re-point alias**, **scale**, derive, pin `$value` (needs `reason`).
|
|
90
|
+
3. `explain_token { "token": "tanrei.sys.color.link", … }` → a color role: change the palette it reads, give it a `tone` rule, alias another role, or **declare a palette**. A literal hex on a role is not accepted.
|
|
91
|
+
4. The agent edits `design/acme.system.json`:
|
|
92
|
+
|
|
93
|
+
```json
|
|
94
|
+
{
|
|
95
|
+
"id": "acme",
|
|
96
|
+
"extends": "tanrei",
|
|
97
|
+
"palettes": {
|
|
98
|
+
"brand": { "description": "Acme red is fixed by the brand guideline.", "source": { "seed": "#e60012" }, "roles": "intent" }
|
|
99
|
+
},
|
|
100
|
+
"tokens": {
|
|
101
|
+
"tanrei.comp.button.container.shape": { "$value": "{tanrei.sys.shape.corner.large}" },
|
|
102
|
+
"tanrei.sys.color.link": { "$value": "{tanrei.sys.color.brand}" }
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
5. `validate_layer { "layerFile": "design/acme.system.json" }` → `valid: true`, plus any contrast warnings the brand red causes — the same ones the build prints.
|
|
108
|
+
6. `npx tanrei build` → CSS, SwiftUI, Compose, Flutter and React Native values change together.
|
|
109
|
+
|
|
110
|
+
> **You:** The landing page needs a much bigger call-to-action button than `large`.
|
|
111
|
+
|
|
112
|
+
7. `search_tokens { "query": "comp.button.container.height.*" }` → `small`, `medium`, `large`. Nothing bigger exists, and scaling `large` would change every large button. The word is missing.
|
|
113
|
+
8. `explain_token { "token": "tanrei.comp.button.container.height.large", … }` → `howToExtend`: **add a size** — `"tanrei.comp.button.size.<new-value>": { "from": "large", "scale": 1.5, "rationale": … }`.
|
|
114
|
+
9. `propose_extension { "kind": "axis-value", "component": "button", "axis": "size", "value": "3x", "from": "large", "scale": 1.5, "layerFile": "design/acme.system.json" }` →
|
|
115
|
+
|
|
116
|
+
```json
|
|
117
|
+
{
|
|
118
|
+
"declares": "tanrei.comp.button.size.3x",
|
|
119
|
+
"write": { "vocabulary": { "tanrei.comp.button.size.3x": { "from": "large", "scale": 1.5, "rationale": "<why this design system or product needs it — 8+ characters>" } } },
|
|
120
|
+
"verified": {
|
|
121
|
+
"built": true,
|
|
122
|
+
"newTokens": { "total": 9, "values": {
|
|
123
|
+
"tanrei.comp.button.container.height.3x": "60px",
|
|
124
|
+
"tanrei.comp.button.container.padding-inline-start.3x": "24px",
|
|
125
|
+
"tanrei.comp.button.container.padding-inline-end.3x": "24px",
|
|
126
|
+
"tanrei.comp.button.container.gap.3x": "12px",
|
|
127
|
+
"tanrei.comp.button.outline.width.3x": "1.5px",
|
|
128
|
+
"…": "…" } },
|
|
129
|
+
"newWarnings": []
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
10. The agent merges `write` into the layer and writes the rationale itself — one line values every member of the size axis (nine: height, the paddings, text style, icon size, icon-to-label gap, outline width), still following the dials:
|
|
135
|
+
|
|
136
|
+
```json
|
|
137
|
+
"vocabulary": {
|
|
138
|
+
"tanrei.comp.button.size.3x": { "from": "large", "scale": 1.5, "rationale": "The hero call-to-action on the landing page." }
|
|
139
|
+
}
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
11. `validate_layer` → `valid: true, extensions: 1`. (With the placeholder left in, it answers *the "rationale" is still the placeholder*.) A single member can still be changed under `tokens` — `"tanrei.comp.button.container.padding-block.3x": { "$value": "{tanrei.sys.space.space200}" }` — like any core token.
|
|
143
|
+
12. `npx tanrei build` → the generated values of every platform gain the size; platforms keep named fields for the core sizes and reach `3x` as an open key.
|
|
144
|
+
|
|
145
|
+
Had the agent written `"tanrei.comp.button.container.height.3x": { … }` under `tokens` without declaring the size, `validate_layer` would have answered *not a token of this system*, with the way out: use the token that exists, or declare it under `vocabulary` — `propose_extension` writes the declaration.
|
|
146
|
+
|
|
147
|
+
## Inside the Tanrei monorepo
|
|
148
|
+
|
|
149
|
+
`bin/tanrei-mcp.js` runs the bundled `dist/server.js` with its copy of the vocabulary (`dist/vocabulary`: the sources under `tokens/` plus the presets' `fidelity.json` reports and each system's `components.json` — no other build output —, the component catalog, the specs, `tanrei.config.json`, the mimicry-gaps registry; only what the server reads, so a spec leaves out what no tool returns, such as each rule's `verify`) when `dist/` exists. Set `TANREI_MCP_FROM_SOURCE=1` to run `src/` against the repository's own `tokens/`. `pnpm --filter @tanrei/mcp build` produces `dist/`; `node --test` covers both modes over stdio.
|
|
150
|
+
|
|
151
|
+
License: Apache-2.0.
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// The published package carries a bundled server and its own copy of the vocabulary (dist/vocabulary): tokens/, the
|
|
3
|
+
// component specs and catalog, tanrei.config.json and the mimicry-gaps registry. Inside the Tanrei monorepo the
|
|
4
|
+
// sources are used directly when there is no dist/, or when TANREI_MCP_FROM_SOURCE is set.
|
|
5
|
+
import fs from 'node:fs';
|
|
6
|
+
import path from 'node:path';
|
|
7
|
+
import { fileURLToPath } from 'node:url';
|
|
8
|
+
|
|
9
|
+
const here = path.dirname(fileURLToPath(import.meta.url));
|
|
10
|
+
const vocabulary = path.join(here, '../dist/vocabulary');
|
|
11
|
+
const bundled = path.join(here, '../dist/server.js');
|
|
12
|
+
const packaged = fs.existsSync(bundled) && !process.env.TANREI_MCP_FROM_SOURCE;
|
|
13
|
+
if (packaged) process.env.TANREI_VOCABULARY_ROOT ??= vocabulary;
|
|
14
|
+
const { main } = await import(packaged ? bundled : '../src/server.js');
|
|
15
|
+
await main();
|