@unoverse-platform/studio 0.1.90 → 0.1.92

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 (132) hide show
  1. package/local/plugin.ts +21 -65
  2. package/package.json +13 -3
  3. package/vendor/base/src/agent-mcp/discovery.ts +203 -0
  4. package/vendor/base/src/agent-mcp/handoff.ts +56 -0
  5. package/vendor/base/src/agent-mcp/index.ts +44 -0
  6. package/vendor/base/src/agent-mcp/invoke.ts +153 -0
  7. package/vendor/base/src/agent-mcp/lean.ts +114 -0
  8. package/vendor/base/src/agent-mcp/memoryContext.ts +104 -0
  9. package/vendor/base/src/agent-mcp/memoryIngest.ts +88 -0
  10. package/vendor/base/src/agent-mcp/rowComponents.ts +234 -0
  11. package/vendor/base/src/agent-mcp/tools.ts +134 -0
  12. package/vendor/base/src/agent-mcp/types.ts +138 -0
  13. package/vendor/base/src/auth/auth.ts +307 -0
  14. package/vendor/base/src/auth/authConfig.ts +73 -0
  15. package/vendor/base/src/boot.ts +245 -0
  16. package/vendor/base/src/definitions/definitions.ts +18 -0
  17. package/vendor/base/src/definitions/dsPackage.ts +45 -0
  18. package/vendor/base/src/definitions/fsCache.ts +155 -0
  19. package/vendor/base/src/definitions/index.ts +19 -0
  20. package/vendor/base/src/definitions/inputs.ts +30 -0
  21. package/vendor/base/src/definitions/load/compile/component.ts +80 -0
  22. package/vendor/base/src/definitions/load/compile/index.ts +12 -0
  23. package/vendor/base/src/definitions/load/compile/sections.ts +132 -0
  24. package/vendor/base/src/definitions/load/compile/template.ts +153 -0
  25. package/vendor/base/src/definitions/load/expand/includes.ts +27 -0
  26. package/vendor/base/src/definitions/load/expand/index.ts +17 -0
  27. package/vendor/base/src/definitions/load/expand/inherit.ts +169 -0
  28. package/vendor/base/src/definitions/load/expand/referenced.ts +164 -0
  29. package/vendor/base/src/definitions/load/expand/refs.ts +106 -0
  30. package/vendor/base/src/definitions/load/expand/walk.ts +91 -0
  31. package/vendor/base/src/definitions/load/load.ts +487 -0
  32. package/vendor/base/src/definitions/model.ts +238 -0
  33. package/vendor/base/src/definitions/registry/catalog.ts +659 -0
  34. package/vendor/base/src/definitions/registry/homes.ts +252 -0
  35. package/vendor/base/src/definitions/theme.ts +383 -0
  36. package/vendor/base/src/executor.ts +284 -0
  37. package/vendor/base/src/http/uwsFetchAdapter.ts +397 -0
  38. package/vendor/base/src/items/baseVersion.ts +96 -0
  39. package/vendor/base/src/items/collect.ts +246 -0
  40. package/vendor/base/src/items/fingerprint.ts +34 -0
  41. package/vendor/base/src/items/publish.ts +212 -0
  42. package/vendor/base/src/lint/context.mjs +56 -0
  43. package/vendor/base/src/lint/design/defs.mjs +46 -0
  44. package/vendor/base/src/lint/design/file.mjs +737 -0
  45. package/vendor/base/src/lint/design/index.d.mts +30 -0
  46. package/vendor/base/src/lint/design/index.mjs +996 -0
  47. package/vendor/base/src/lint/design/tokens.mjs +128 -0
  48. package/vendor/base/src/lint/design/vocabulary.mjs +181 -0
  49. package/vendor/base/src/lint/design/walk.mjs +444 -0
  50. package/vendor/base/src/lint/index.mjs +28 -0
  51. package/vendor/base/src/lint/nodes/blocks.mjs +63 -0
  52. package/vendor/base/src/lint/nodes/index.d.mts +28 -0
  53. package/vendor/base/src/lint/nodes/index.mjs +82 -0
  54. package/vendor/base/src/lint/nodes/load.mjs +126 -0
  55. package/vendor/base/src/lint/nodes/node.mjs +764 -0
  56. package/vendor/base/src/lint/nodes/package.mjs +112 -0
  57. package/vendor/base/src/lint/nodes/schema.mjs +75 -0
  58. package/vendor/base/src/logger.ts +33 -0
  59. package/vendor/base/src/manifests/compose.ts +539 -0
  60. package/vendor/base/src/manifests/executor/callback.ts +107 -0
  61. package/vendor/base/src/manifests/executor/context.ts +110 -0
  62. package/vendor/base/src/manifests/executor/index.ts +47 -0
  63. package/vendor/base/src/manifests/executor/lookup.ts +21 -0
  64. package/vendor/base/src/manifests/executor/memory.ts +62 -0
  65. package/vendor/base/src/manifests/executor/promise.ts +71 -0
  66. package/vendor/base/src/manifests/executor/refire.ts +34 -0
  67. package/vendor/base/src/manifests/executor/send.ts +65 -0
  68. package/vendor/base/src/manifests/executor/session.ts +46 -0
  69. package/vendor/base/src/manifests/executor/toolBridge.ts +266 -0
  70. package/vendor/base/src/manifests/index.ts +280 -0
  71. package/vendor/base/src/manifests/integrity.ts +93 -0
  72. package/vendor/base/src/manifests/rows.ts +33 -0
  73. package/vendor/base/src/manifests/runtime/auth/aws.ts +240 -0
  74. package/vendor/base/src/manifests/runtime/auth/oauth.ts +76 -0
  75. package/vendor/base/src/manifests/runtime/authorize.ts +159 -0
  76. package/vendor/base/src/manifests/runtime/channels/final.ts +171 -0
  77. package/vendor/base/src/manifests/runtime/channels/service.ts +138 -0
  78. package/vendor/base/src/manifests/runtime/channels/workflow.ts +310 -0
  79. package/vendor/base/src/manifests/runtime/context.ts +156 -0
  80. package/vendor/base/src/manifests/runtime/docstore/handlers.ts +547 -0
  81. package/vendor/base/src/manifests/runtime/docstore/index.ts +135 -0
  82. package/vendor/base/src/manifests/runtime/docstore/sectionizer.ts +184 -0
  83. package/vendor/base/src/manifests/runtime/docstore/store.ts +172 -0
  84. package/vendor/base/src/manifests/runtime/docstore/types.ts +60 -0
  85. package/vendor/base/src/manifests/runtime/duplex/audioLane.ts +165 -0
  86. package/vendor/base/src/manifests/runtime/duplex/session.ts +511 -0
  87. package/vendor/base/src/manifests/runtime/events.ts +223 -0
  88. package/vendor/base/src/manifests/runtime/helpers.ts +53 -0
  89. package/vendor/base/src/manifests/runtime/http/allowedHosts.ts +118 -0
  90. package/vendor/base/src/manifests/runtime/http/request.ts +637 -0
  91. package/vendor/base/src/manifests/runtime/http/response.ts +162 -0
  92. package/vendor/base/src/manifests/runtime/index.ts +57 -0
  93. package/vendor/base/src/manifests/runtime/loops/chunk.ts +98 -0
  94. package/vendor/base/src/manifests/runtime/loops/loop.ts +191 -0
  95. package/vendor/base/src/manifests/runtime/loops/paginate.ts +143 -0
  96. package/vendor/base/src/manifests/runtime/loops/poll.ts +169 -0
  97. package/vendor/base/src/manifests/runtime/narrate.ts +53 -0
  98. package/vendor/base/src/manifests/runtime/state.ts +171 -0
  99. package/vendor/base/src/manifests/runtime/templating.ts +110 -0
  100. package/vendor/base/src/manifests/runtime/tools/regionSkills.ts +125 -0
  101. package/vendor/base/src/manifests/runtime/tools/toolloop.ts +550 -0
  102. package/vendor/base/src/manifests/runtime/usage.ts +87 -0
  103. package/vendor/base/src/manifests/source.ts +196 -0
  104. package/vendor/base/src/manifests/watch.ts +67 -0
  105. package/vendor/base/src/markdown/document.ts +141 -0
  106. package/vendor/base/src/paths.ts +180 -0
  107. package/vendor/base/src/platform/audioManager.ts +100 -0
  108. package/vendor/base/src/platform/clientTransport.ts +65 -0
  109. package/vendor/base/src/platform/executionContext.ts +157 -0
  110. package/vendor/base/src/platform/index.ts +10 -0
  111. package/vendor/base/src/platform/pluginAPI.ts +146 -0
  112. package/vendor/base/src/platform/redis.ts +54 -0
  113. package/vendor/base/src/platform/serviceCalls.ts +222 -0
  114. package/vendor/base/src/pluginBase.ts +248 -0
  115. package/vendor/base/src/plugins/README.md +57 -0
  116. package/vendor/base/src/plugins/discovery.ts +87 -0
  117. package/vendor/base/src/plugins/index.ts +16 -0
  118. package/vendor/base/src/plugins/loader.ts +179 -0
  119. package/vendor/base/src/plugins/redis.ts +36 -0
  120. package/vendor/base/src/plugins/state.ts +53 -0
  121. package/vendor/base/src/registry.ts +95 -0
  122. package/vendor/base/src/security/permissions.ts +93 -0
  123. package/vendor/base/src/security/rules.ts +73 -0
  124. package/vendor/base/src/template/SafeExpression.ts +556 -0
  125. package/vendor/base/src/template/StringTemplateResolver.ts +75 -0
  126. package/vendor/base/src/template/index.ts +22 -0
  127. package/vendor/base/src/types.ts +50 -0
  128. package/vendor/base/src/workflow/GetMemoryService.ts +158 -0
  129. package/vendor/base/src/workflow/PlatformMemoryCore.ts +449 -0
  130. package/vendor/base/src/workflow/routing.ts +122 -0
  131. package/vendor/sdk/lib/core/store.ts +26 -6
  132. package/local/mcp.ts +0 -265
@@ -0,0 +1,128 @@
1
+ /**
2
+ * THE TOKEN REGISTRY — does the name a definition writes actually resolve?
3
+ *
4
+ * LAW 1 (file.mjs) bans a RAW value: `#ff0000`, `12px`. It says nothing about a name that
5
+ * looks like a token and is not one, and that is the half that fails silently. The SDK's
6
+ * interpreter resolves every style value as `theme.<bucket>[name] ?? name` (sdk/style.ts),
7
+ * so an unknown name is not an error anywhere in the stack — it is handed to CSS verbatim,
8
+ * CSS discards the declaration, and the element renders with that property simply absent.
9
+ * `radius: lgg` is a square corner with a green lint run behind it. `font: headline.enormous`
10
+ * is worse still: `font` is applied only when the lookup HITS, so an invented text style
11
+ * applies nothing at all and the text falls back to whatever it inherits.
12
+ *
13
+ * One namespace was already covered — the space scale, via `checkDimension` — and that is
14
+ * the shape this generalises: every other bucket the interpreter reads gets the same
15
+ * treatment, from the same files the server resolves at serve time.
16
+ *
17
+ * THE REGISTRY IS BUILT THE WAY THE SERVER BUILDS IT (definitions/theme.ts `buildTheme`):
18
+ * the marketplace foundation's `base` + `semantic` first, then the org's ON TOP, per token
19
+ * — an org omits a token to inherit it. Themes are UNIONED rather than resolved one at a
20
+ * time, because a name that resolves under `dark` is legitimate work; per-theme parity is
21
+ * a different rule with its own guard (apps/unoverse/server/tests/design/theme-contract.test.ts).
22
+ *
23
+ * UNREADABLE IS NOT EMPTY. A developer's project has no design system on disk — it is
24
+ * installed, not authored — so the foundation half cannot be read and only the org's own
25
+ * names are left. Judging real work against half the answer rejects it, and publishing
26
+ * lints first, so that reads as "you cannot publish". `null` = abstain, exactly as
27
+ * `appSizesForFile` abstains, and for the same reason.
28
+ */
29
+ import { readdirSync, existsSync } from "node:fs";
30
+ import { join, sep } from "node:path";
31
+ import { isDefFile, readDef } from "./defs.mjs";
32
+
33
+ /** Flatten a token file into { "dotted.path": rawValue } — mirrors theme.ts `collect`. */
34
+ function collect(obj, prefix, out) {
35
+ if (!obj || typeof obj !== "object") return;
36
+ for (const [k, v] of Object.entries(obj)) {
37
+ if (k.startsWith("$")) continue;
38
+ if (v && typeof v === "object" && "$value" in v) out[prefix ? `${prefix}.${k}` : k] = v.$value;
39
+ else if (v && typeof v === "object") collect(v, prefix ? `${prefix}.${k}` : k, out);
40
+ }
41
+ }
42
+
43
+ /** Read every token file in a dir into the flat registry. A malformed file lints on its own. */
44
+ function readTokenDir(dir, into) {
45
+ if (!existsSync(dir)) return;
46
+ for (const f of readdirSync(dir).filter(isDefFile)) {
47
+ try {
48
+ collect(readDef(join(dir, f)), "", into);
49
+ } catch {
50
+ /* the file has its own findings */
51
+ }
52
+ }
53
+ }
54
+
55
+ /** Every theme in a folder, merged into one registry — see the union note in buildTokens. */
56
+ function readThemes(dir, into) {
57
+ if (!existsSync(dir)) return;
58
+ for (const f of readdirSync(dir).filter(isDefFile)) {
59
+ try {
60
+ collect(readDef(join(dir, f)), "", into);
61
+ } catch {
62
+ /* the file has its own findings */
63
+ }
64
+ }
65
+ }
66
+
67
+ /** The leaf names under a dotted prefix: `color.` → { "text.primary", "border.strong", … }. */
68
+ const names = (reg, prefix) =>
69
+ new Set(Object.keys(reg).filter((k) => k.startsWith(prefix)).map((k) => k.slice(prefix.length)));
70
+
71
+ /**
72
+ * Build the name sets one home (the design system, or an org) resolves against.
73
+ * Returns null when the foundation cannot be read — see the header.
74
+ */
75
+ function buildTokens(dsStyles, homeStyles) {
76
+ const reg = {};
77
+ const foundation = existsSync(join(dsStyles, "base")) || existsSync(join(dsStyles, "semantic"));
78
+ const ownFoundation = homeStyles === dsStyles;
79
+ if (!foundation && !ownFoundation) return null; // abstain: half an answer judges nothing
80
+ if (!ownFoundation) {
81
+ readTokenDir(join(dsStyles, "base"), reg);
82
+ readTokenDir(join(dsStyles, "semantic"), reg);
83
+ }
84
+ readTokenDir(join(homeStyles, "base"), reg);
85
+ readTokenDir(join(homeStyles, "semantic"), reg);
86
+ /**
87
+ * Colours live in the THEMES, and a home has several. Union them, foundation first:
88
+ *
89
+ * - across a home's own themes, because a name only `dark` defines is real work, not a
90
+ * typo (whether every theme defines every name is a DIFFERENT rule, guarded by
91
+ * apps/unoverse/server/tests/design/theme-contract.test.ts — this one must not double as a weaker copy);
92
+ * - the foundation's underneath, because the colour contract is the shared one every
93
+ * org is written against. An org that has no themes folder of its own would otherwise
94
+ * read as "no colours exist", and the rule would report every colour it uses.
95
+ */
96
+ if (!ownFoundation) readThemes(join(dsStyles, "themes"), reg);
97
+ readThemes(join(homeStyles, "themes"), reg);
98
+ // A styles set with no colour at all is not a set — treat it as unreadable rather than
99
+ // reporting every colour in the org as invented.
100
+ const color = names(reg, "color.");
101
+ if (color.size === 0) return null;
102
+ return {
103
+ color,
104
+ radius: names(reg, "radius."),
105
+ shadow: names(reg, "shadow."),
106
+ borderWidth: names(reg, "border.width."),
107
+ weight: names(reg, "font.weight."),
108
+ lineHeight: names(reg, "font.lineHeight."),
109
+ text: names(reg, "text."),
110
+ icons: names(reg, "icons."),
111
+ keyframes: names(reg, "keyframes."),
112
+ };
113
+ }
114
+
115
+ /**
116
+ * `tokensForFile(file)` → the name sets that file's home resolves against, or null to
117
+ * abstain. Cached per home; the cache lives for the run, like `appSizesCache`.
118
+ */
119
+ export function makeTokensForFile({ DS, orgDirs }) {
120
+ const cache = new Map();
121
+ const dsStyles = join(DS, "styles");
122
+ return function tokensForFile(file) {
123
+ const home = orgDirs.find((d) => file.startsWith(d + sep)) ?? (file.startsWith(DS + sep) ? DS : null);
124
+ if (!home) return null;
125
+ if (!cache.has(home)) cache.set(home, buildTokens(dsStyles, join(home, "styles")));
126
+ return cache.get(home);
127
+ };
128
+ }
@@ -0,0 +1,181 @@
1
+ /**
2
+ * The CLOSED SETS. This file is the linter's ground truth.
3
+ *
4
+ * Mirrors apps/unoverse/design/_schema/unoverse.schema.json and the server guards, and UNOVERSE_CONFORMANCE
5
+ * §5 makes keeping them equal a maintenance rule: "One source for each closed set... Keep
6
+ * them equal or they disagree silently."
7
+ *
8
+ * They are closed on purpose. An invented primitive has no renderer; an invented style key
9
+ * is silently dropped cross-platform. Compose from what exists, do not extend these
10
+ * without extending the schema and the SDK in the same change.
11
+ */
12
+
13
+ // ── ground truth (mirrors design/_schema/unoverse.schema.json + server guards) ──
14
+ export const PRIMITIVES = new Set([
15
+ "Box", "Stack", "Row", "Column", "Each", "Switch", "ComponentSlot", "Timeline",
16
+ "Text", "Image", "Button", "Input", "Select", "Markdown", "Skeleton", "Icon", "Ref", "Orb", "Template",
17
+ ]);
18
+ export const CONDITION_KEYS = new Set(["field", "eq", "ne", "in"]);
19
+
20
+ /**
21
+ * WHAT EACH PRIMITIVE IS (UNOVERSE_CONFORMANCE §2a, UNOVERSE_PRIMITIVE_CONTRACT.md).
22
+ *
23
+ * Until 2026-08-23 nothing stated this. Every node shared one bag of 36 optional properties,
24
+ * so `{ type: "Image", bind: { value: photo } }` saved, linted, published and drew nothing —
25
+ * the silent class behind "the card streams its title but keeps its mock image".
26
+ *
27
+ * Merged from three sources: `core/types.ts` JSDoc (25 of 32 properties already named their
28
+ * owner in prose, where no tool could read it), the renderer (the only authority on which
29
+ * `bind` keys are consumed), and what shipped definitions actually use — types.ts was
30
+ * missing nine properties in live use, because YAML never meets a TypeScript interface.
31
+ *
32
+ * `packages/sdk/conformance/tools/build-primitive-schema.mjs` reads THIS to emit the JSON
33
+ * Schema halves, so the editor squiggle and the publish gate cannot disagree.
34
+ */
35
+ export const UNIVERSAL_PROPS = new Set([
36
+ // read for every node before dispatch. `brief` is GONE (UNOVERSE_AUTHORING §3b, ruled
37
+ // 2026-08-30): a field's contract lives on its prop, and the layout only arranges.
38
+ "type", "style", "visibleWhen", "bind", "action", "analytics", "skeleton", "$include",
39
+ ]);
40
+
41
+ /**
42
+ * A PROP, whole (UNOVERSE_AUTHORING §3b): JSON Schema's own words plus the platform's
43
+ * four. Closed, because the prop is now the only place a field's contract can live —
44
+ * a misspelled `maxlength` there is a limit that silently never applies.
45
+ */
46
+ export const PROP_KEYS = [
47
+ "type", "input", "description", "maxLength", "minItems", "maxItems",
48
+ "hydrate", "override", "optional", "enum", "preview", "default", "items",
49
+ ];
50
+
51
+ /**
52
+ * THE INTERFACE FIELDS (packages/docs/design/interface-data.md): the names a content row
53
+ * carries. A row fills a component BY NAME with no mapping layer, so a prop wearing one
54
+ * of these names is filled by the delivery — whatever the definition declares about it.
55
+ * Layer 1 arrives with every card; the `service`/`need` editorial fields arrive with the
56
+ * row that has them; layer 2 arrives when `getDetail` runs.
57
+ */
58
+ export const INTERFACE_FIELDS = new Set([
59
+ "universal_id", "title", "description", "object_type", "key_need", "source_url", "source_id",
60
+ "tagline", "shortDescription", "introParagraph", "callToAction", "actionPrompt", "primaryImage", "images", "action",
61
+ "bodyCopy", "features", "mainCategory", "section", "needs",
62
+ ]);
63
+
64
+ /**
65
+ * The keys that only make sense if an AUTHOR, not a delivery, decides the value — a cap,
66
+ * a count, a closed set. `description` is deliberately NOT one: every prop describes
67
+ * itself as standard (UNOVERSE_AUTHORING §3b), including the ones a row fills, so
68
+ * flagging a described `title` would fire on every content card in the estate and teach
69
+ * people to ignore the rule. What is worth saying is narrower and still true: a LIMIT you
70
+ * wrote does not apply to a value the delivery brings.
71
+ */
72
+ export const AUTHORED_CONTROLS = ["maxLength", "minItems", "maxItems", "enum"];
73
+
74
+ export const PRIMITIVE_PROPS = {
75
+ Box: ["children", "autoScroll", "revealOnStick", "selection", "appWidth"],
76
+ Stack: ["children", "autoScroll", "revealOnStick", "appWidth"],
77
+ Row: ["children", "autoScroll", "revealOnStick", "appWidth"],
78
+ Column: ["children", "autoScroll", "revealOnStick", "appWidth"],
79
+ Text: ["value"],
80
+ Image: ["src", "alt"],
81
+ Markdown: ["value", "inheritLinkColor"],
82
+ Icon: ["icon", "name"],
83
+ Skeleton: ["variant"],
84
+ Orb: ["state", "size"],
85
+ Button: ["children", "value", "label", "icon", "disabledWhen"],
86
+ Input: ["placeholder", "inputType", "disabledWhen", "maxLength", "multiline", "rows",
87
+ "inputMode", "autoComplete", "advanceOnFill"],
88
+ Select: ["placeholder", "options", "disabledWhen"],
89
+ Each: ["item", "app", "items"],
90
+ Switch: ["on", "cases", "fallback"],
91
+ Ref: ["ref", "props", "with", "children", "name"],
92
+ ComponentSlot: ["select", "frame", "fallback", "pinned", "appWidth"],
93
+ // THE MOUNT (UNOVERSE_TEMPLATE_MODEL §12): a layout place that runs a mounted
94
+ // template's machinery. `name` addresses the manifest's `templates:` entry;
95
+ // `frame` is the dressing drawn around it when occupied.
96
+ Template: ["name", "frame", "template", "director", "appWidth"],
97
+ Timeline: ["user", "assistant", "userData", "assistantData", "autoScroll"],
98
+ };
99
+
100
+ /** Which `bind` keys each primitive's view actually reads. Absent = the view reads the whole
101
+ * bind object (Orb), so any key is legitimate. */
102
+ export const PRIMITIVE_BINDS = {
103
+ Text: ["value"], Image: ["src", "alt"], Markdown: ["value"], Icon: ["name"],
104
+ Button: ["label"], Input: ["value", "placeholder"], Select: ["options", "value"],
105
+ Each: ["items"],
106
+ };
107
+ // the portable style vocabulary — every key the SDK interpreter maps (sdk/style.ts).
108
+ // Each is a neutral intent every native renderer (iOS/Android/RN/Flutter) implements;
109
+ // an unknown key is a typo or a web-ism that renders nowhere.
110
+ export const STYLE_KEYS = new Set([
111
+ "width", "height", "maxWidth", "minWidth", "minHeight", "maxHeight", "flex",
112
+ "padding", "margin", "gap", "overflow",
113
+ "position", "inset", "top", "right", "bottom", "left", "zIndex",
114
+ "direction", "wrap", "align", "justify", "display", "columns", "span", "stackBelow", "container", "hideBelow", "hideAbove",
115
+ "background", "radial", "border", "borderTop", "borderRight", "borderBottom", "borderLeft",
116
+ "outline", "shadow", "radius", "radiusTopLeft", "radiusTopRight", "radiusBottomLeft", "radiusBottomRight",
117
+ "font", "weight", "lineHeight", "color", "textAlign", "fit",
118
+ "transform", "transition", "animation", "animationDelay", "cursor",
119
+ "hover", "active", "when",
120
+ ]);
121
+ // exact regex from server/src/runtime/definition-tokens.test.ts
122
+ export const RAW_VALUE = /#[0-9a-fA-F]{3,8}\b|\b\d*\.?\d+(px|rem|em)\b/;
123
+ // nodes reachable through these keys (data keys like `items`/`cases` handled explicitly)
124
+ export const CHILD_NODE_KEYS = ["children", "item", "fallback", "user", "assistant"];
125
+ // folders that hold BARE PARTIALS one level under the definition root
126
+ export const PARTIAL_DIRS = new Set(["layouts", "states", "components", "blocks"]);
127
+
128
+ /** Style keys whose value is a dimension, so it must be a space-scale step. */
129
+ export const DIMENSION_KEYS = new Set([
130
+ "width", "height", "maxWidth", "minWidth", "minHeight", "maxHeight",
131
+ "gap", "padding", "margin", "top", "right", "bottom", "left", "inset",
132
+ // width THRESHOLDS, named on the same scale as any other width
133
+ "hideBelow", "hideAbove", "stackBelow",
134
+ ]);
135
+
136
+ /**
137
+ * WHICH THEME BUCKET EACH STYLE KEY RESOLVES AGAINST — mirrors sdk/style.ts `computeCss`,
138
+ * which is the only place that decides it. Dimensions are absent because the space scale
139
+ * has its own check (`checkDimension`); `border*` is absent because its value is a PAIR
140
+ * (an optional width token + a colour token) and is destructured separately.
141
+ *
142
+ * A key the interpreter passes straight through (`overflow`, `outline`, `cursor`,
143
+ * `transform`, `transition`, `position`, `display`, …) is absent on purpose: there is no
144
+ * bucket to check it against, so there is nothing here to be wrong about.
145
+ */
146
+ export const TOKEN_KEYS = {
147
+ background: "color",
148
+ color: "color",
149
+ shadow: "shadow",
150
+ radius: "radius",
151
+ radiusTopLeft: "radius",
152
+ radiusTopRight: "radius",
153
+ radiusBottomLeft: "radius",
154
+ radiusBottomRight: "radius",
155
+ font: "text",
156
+ lineHeight: "lineHeight",
157
+ };
158
+
159
+ /**
160
+ * CSS keywords a token key may legitimately carry instead of a token name. Kept tiny on
161
+ * purpose: every one of these is a value with no token equivalent, and anything else that
162
+ * "just works in CSS" is precisely the web-ism the closed vocabulary exists to keep out.
163
+ */
164
+ export const LITERAL_VALUES = new Set(["none", "transparent", "inherit", "currentColor", "unset", "initial", "auto"]);
165
+
166
+ /**
167
+ * CSS sizing keywords a dimension may carry that are NOT scale steps. `full` and `auto`
168
+ * are already seeded into the scale itself (the SDK special-cases `full` → 100%); these
169
+ * are the intrinsic-sizing words a layout legitimately needs and no token can express.
170
+ */
171
+ export const DIMENSION_LITERALS = new Set([
172
+ "auto", "full", "none", "inherit", "unset", "initial",
173
+ "fit-content", "min-content", "max-content",
174
+ ]);
175
+
176
+ /**
177
+ * `weight` used to be the exception here: the SDK held the scale as a literal four-name
178
+ * map, so this file had to mirror THAT rather than the tokens. It now resolves from
179
+ * `theme.weight` like every other value, so it is an ordinary entry above and this note
180
+ * only survives to say why one is not needed.
181
+ */