@ggui-ai/ui-gen 0.11.0 → 0.13.0

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 (32) hide show
  1. package/dist/adapters/generation-dispatch.js +180 -18
  2. package/dist/adapters/generation-dispatch.js.map +1 -1
  3. package/dist/advanced/index.d.ts +1 -1
  4. package/dist/advanced/index.js +180 -18
  5. package/dist/advanced/index.js.map +1 -1
  6. package/dist/blueprint-validator.js +146 -0
  7. package/dist/blueprint-validator.js.map +1 -1
  8. package/dist/boilerplate.js +7 -7
  9. package/dist/boilerplate.js.map +1 -1
  10. package/dist/check/index.js +27 -11
  11. package/dist/check/index.js.map +1 -1
  12. package/dist/harness/check/runtime-render/index.d.ts +1 -1
  13. package/dist/harness/check/runtime-render/index.js +146 -0
  14. package/dist/harness/check/runtime-render/index.js.map +1 -1
  15. package/dist/harness/check/runtime-render/render-check-worker.js +126 -0
  16. package/dist/harness/check/runtime-render/render-check-worker.js.map +1 -1
  17. package/dist/harness/index.js +7 -7
  18. package/dist/harness/index.js.map +1 -1
  19. package/dist/harness/runtime.js +7 -7
  20. package/dist/harness/runtime.js.map +1 -1
  21. package/dist/harness/types-public.js +7 -7
  22. package/dist/harness/types-public.js.map +1 -1
  23. package/dist/index.js +180 -18
  24. package/dist/index.js.map +1 -1
  25. package/dist/provider-adapter-contract.js +1161 -387
  26. package/dist/provider-adapter-contract.js.map +1 -1
  27. package/dist/{render-check-BZoIE8-u.d.ts → render-check-WfOVO9kU.d.ts} +1 -1
  28. package/package.json +13 -13
  29. package/src/boilerplate/system-prompt.ts +7 -7
  30. package/src/check/run-tier0.ts +35 -16
  31. package/src/harness/check/runtime-render/adapter.ts +28 -0
  32. package/src/harness/check/runtime-render/render-check.ts +224 -1
@@ -1130,17 +1130,33 @@ ${errorDetail}`,
1130
1130
  }
1131
1131
  }
1132
1132
  const hexMatch = line.match(/#[0-9a-fA-F]{3,8}\b/);
1133
- if (hexMatch && !line.includes("var(--ggui-") && !line.includes("// fallback") && !assetEscapedLines.has(lineNum)) {
1134
- issues.push({
1135
- tier: 0,
1136
- result: "fail",
1137
- category: "tokens",
1138
- subcategory: "hex-color",
1139
- severity: "critical",
1140
- description: `Hardcoded color "${hexMatch[0]}" breaks theme switching \u2014 use design tokens.`,
1141
- fix: `Replace with a primitive variant (Button variant="primary"|Badge variant="success"|...) OR a token reference like var(--ggui-color-primary-500, ${hexMatch[0]}). Hardcoded colors mean the operator's theme has no effect on this surface.`,
1142
- line: lineNum
1143
- });
1133
+ if (hexMatch && !assetEscapedLines.has(lineNum)) {
1134
+ const fallbackVarMatch = line.match(
1135
+ /var\((--ggui-[a-zA-Z0-9-]+)\s*,[^)]*#[0-9a-fA-F]{3,8}/
1136
+ );
1137
+ if (fallbackVarMatch) {
1138
+ issues.push({
1139
+ tier: 0,
1140
+ result: "fail",
1141
+ category: "tokens",
1142
+ subcategory: "token-fallback",
1143
+ severity: "critical",
1144
+ description: `Literal fallback "${hexMatch[0]}" inside a token reference \u2014 the runtime injects every token, and the fallback paints the wrong brand exactly when the theme matters most.`,
1145
+ fix: `Drop the fallback: write var(${fallbackVarMatch[1]}) bare. If the token might not exist, that is a vocabulary problem to fix by choosing a token from the design-system docs, never by a literal.`,
1146
+ line: lineNum
1147
+ });
1148
+ } else if (!line.includes("// fallback")) {
1149
+ issues.push({
1150
+ tier: 0,
1151
+ result: "fail",
1152
+ category: "tokens",
1153
+ subcategory: "hex-color",
1154
+ severity: "critical",
1155
+ description: `Hardcoded color "${hexMatch[0]}" breaks theme switching \u2014 use design tokens.`,
1156
+ fix: `Replace with a primitive variant (Button variant="primary"|Badge variant="success"|...) OR a bare token reference like var(--ggui-color-primary-500) \u2014 never a literal fallback. Hardcoded colors mean the operator's theme has no effect on this surface.`,
1157
+ line: lineNum
1158
+ });
1159
+ }
1144
1160
  }
1145
1161
  const colorFnMatch = line.match(/\b(rgba?|hsla?)\s*\(/);
1146
1162
  if (colorFnMatch && !line.includes("var(--ggui-") && !line.includes("// fallback") && !line.includes("$value") && !assetEscapedLines.has(lineNum)) {