@ggui-ai/ui-gen 0.25.0 → 0.27.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 (117) hide show
  1. package/README.md +2 -2
  2. package/dist/{adapter-Cg_rkpGq.d.ts → adapter-h4_V69LI.d.ts} +49 -1
  3. package/dist/adapters/base.d.ts +6 -1
  4. package/dist/adapters/base.js.map +1 -1
  5. package/dist/adapters/generation-dispatch.d.ts +8 -5
  6. package/dist/adapters/generation-dispatch.js +1174 -198
  7. package/dist/adapters/generation-dispatch.js.map +1 -1
  8. package/dist/adapters/index.js +59 -16
  9. package/dist/adapters/index.js.map +1 -1
  10. package/dist/advanced/index.d.ts +10 -9
  11. package/dist/advanced/index.js +1215 -216
  12. package/dist/advanced/index.js.map +1 -1
  13. package/dist/blueprint-validator.js +416 -92
  14. package/dist/blueprint-validator.js.map +1 -1
  15. package/dist/boilerplate.d.ts +2 -2
  16. package/dist/boilerplate.js +10 -5
  17. package/dist/boilerplate.js.map +1 -1
  18. package/dist/check/index.d.ts +3 -8
  19. package/dist/check/index.js +55 -2
  20. package/dist/check/index.js.map +1 -1
  21. package/dist/{create-ui-generator-DFnnArrv.d.ts → create-ui-generator-BrZHF0cf.d.ts} +3 -4
  22. package/dist/{design-mode-DLufhrNp.d.ts → design-mode-DGWN_Gkm.d.ts} +1 -1
  23. package/dist/{dispatch-CStl9eAw.d.ts → dispatch-B07TI30d.d.ts} +2 -2
  24. package/dist/evaluation/axis-checks/index.d.ts +5 -4
  25. package/dist/evaluation/axis-checks/index.js.map +1 -1
  26. package/dist/evaluation/axis-checks/registry.d.ts +4 -3
  27. package/dist/evaluation/index.d.ts +124 -546
  28. package/dist/evaluation/index.js +588 -65
  29. package/dist/evaluation/index.js.map +1 -1
  30. package/dist/evaluation/types.d.ts +17 -0
  31. package/dist/evaluation/types.js.map +1 -1
  32. package/dist/{generate-9IeNT4ZY.d.ts → generate-tSO_shQ0.d.ts} +1 -1
  33. package/dist/harness/check/runtime-render/index.d.ts +5 -5
  34. package/dist/harness/check/runtime-render/index.js +416 -92
  35. package/dist/harness/check/runtime-render/index.js.map +1 -1
  36. package/dist/harness/check/runtime-render/render-check-worker.js +393 -88
  37. package/dist/harness/check/runtime-render/render-check-worker.js.map +1 -1
  38. package/dist/harness/index.d.ts +4 -5
  39. package/dist/harness/index.js +36 -7
  40. package/dist/harness/index.js.map +1 -1
  41. package/dist/harness/prompts.d.ts +2 -2
  42. package/dist/harness/prompts.js +7 -1
  43. package/dist/harness/prompts.js.map +1 -1
  44. package/dist/harness/result-types.d.ts +17 -3
  45. package/dist/harness/result-types.js.map +1 -1
  46. package/dist/harness/runtime.d.ts +14 -6
  47. package/dist/harness/runtime.js +13 -7
  48. package/dist/harness/runtime.js.map +1 -1
  49. package/dist/harness/types-public.d.ts +4 -2
  50. package/dist/harness/types-public.js +10 -5
  51. package/dist/harness/types-public.js.map +1 -1
  52. package/dist/harness/validator-trace-sink.d.ts +4 -3
  53. package/dist/index.d.ts +46 -11
  54. package/dist/index.js +1217 -214
  55. package/dist/index.js.map +1 -1
  56. package/dist/patch.d.ts +3 -3
  57. package/dist/{prompts-YU9piOgs.d.ts → prompts-BhNUuRoZ.d.ts} +1 -1
  58. package/dist/tools/render-check-worker.js +8 -1
  59. package/dist/tools/render-check-worker.js.map +1 -1
  60. package/dist/{types-public-BJTLpzWn.d.ts → types-public-h8IMnYuh.d.ts} +388 -3
  61. package/dist/validation/index.d.ts +1 -1
  62. package/dist/validation/index.js +1 -1
  63. package/dist/validation/index.js.map +1 -1
  64. package/dist/visual-evaluator-C2strxqD.d.ts +639 -0
  65. package/dist/workflows.d.ts +3 -3
  66. package/package.json +12 -12
  67. package/src/adapters/base.ts +6 -1
  68. package/src/adapters/claude/message-parser.ts +5 -6
  69. package/src/adapters/claude/sdk-tool-pins.ts +44 -0
  70. package/src/adapters/claude/sdk.ts +3 -3
  71. package/src/adapters/claude/source-capture.ts +20 -0
  72. package/src/adapters/generation-dispatch.ts +2 -0
  73. package/src/boilerplate/free-design-prompt.ts +3 -3
  74. package/src/boilerplate/hard-sections.ts +1 -1
  75. package/src/boilerplate/system-prompt.ts +3 -2
  76. package/src/boilerplate/templates/layouts/chat-mobile.tsx.tmpl +3 -1
  77. package/src/boilerplate/templates/layouts/chat-universal.tsx.tmpl +3 -1
  78. package/src/boilerplate/templates/layouts/fullscreen-desktop.tsx.tmpl +3 -1
  79. package/src/boilerplate/templates/layouts/fullscreen-universal.tsx.tmpl +3 -1
  80. package/src/check/run-tier0.ts +67 -3
  81. package/src/contract-context.ts +1 -1
  82. package/src/design-system-docs.ts +2 -1
  83. package/src/evaluation/cost-tracker.ts +54 -6
  84. package/src/evaluation/criteria/edge-probe.ts +286 -0
  85. package/src/evaluation/criteria/edge.ts +202 -0
  86. package/src/evaluation/criteria/resolve.ts +74 -8
  87. package/src/evaluation/index.ts +5 -1
  88. package/src/evaluation/judge-spend.ts +48 -0
  89. package/src/evaluation/loop.ts +25 -4
  90. package/src/evaluation/message-parsing.ts +11 -12
  91. package/src/evaluation/types-public.ts +95 -0
  92. package/src/evaluation/types.ts +10 -0
  93. package/src/evaluation/visual-evaluator.ts +236 -40
  94. package/src/harness/check/runtime-render/adapter.ts +18 -0
  95. package/src/harness/check/runtime-render/probe-pending.ts +111 -0
  96. package/src/harness/check/runtime-render/render-check-host.ts +10 -6
  97. package/src/harness/check/runtime-render/render-check-worker.ts +6 -3
  98. package/src/harness/check/runtime-render/render-check.ts +417 -133
  99. package/src/harness/check/runtime-render/walk.ts +200 -0
  100. package/src/harness/coding/assemble-result.ts +2 -0
  101. package/src/harness/coding/generate-task-runner.ts +27 -0
  102. package/src/harness/coding/init-session.ts +5 -3
  103. package/src/harness/coding/run-coding-turn.ts +5 -1
  104. package/src/harness/coding/run-eval-round.ts +63 -3
  105. package/src/harness/in-loop-evaluation.ts +39 -0
  106. package/src/harness/llm-router.ts +58 -1
  107. package/src/harness/result-types.ts +9 -0
  108. package/src/harness/runtime.ts +9 -0
  109. package/src/harness/types-public.ts +10 -1
  110. package/src/index.ts +5 -0
  111. package/src/internal/verdict-line.ts +33 -0
  112. package/src/taught-tokens.ts +31 -0
  113. package/src/tools/render-check-worker.ts +2 -1
  114. package/src/tools/render-check.ts +8 -7
  115. package/src/validation/primitives.ts +1 -1
  116. package/dist/llm-router-nfO7wPec.d.ts +0 -267
  117. package/dist/{bank-CT4eEkta.d.ts → bank-Ctdp3FUA.d.ts} +3 -3
@@ -1,7 +1,8 @@
1
1
  import { DataContract, JsonObject, PropsSpec, ActionSpec, StreamSpec } from '@ggui-ai/protocol';
2
- import { D as DesignMode } from '../design-mode-DLufhrNp.js';
3
- import { b as EvalResult, E as EvalIssue } from '../types-public-BJTLpzWn.js';
2
+ import { D as DesignMode } from '../design-mode-DGWN_Gkm.js';
3
+ import { e as EvalResult, E as EvalIssue } from '../types-public-h8IMnYuh.js';
4
4
  export { j as jsonSchemaTypeToTs } from '../json-schema-ts-CbB78b3n.js';
5
+ import '../llm.js';
5
6
  import '@ggui-ai/mcp-server-core';
6
7
  import '../axes-CKVCzR_x.js';
7
8
  import '../types-Dh1s4K9j.js';
@@ -210,12 +211,6 @@ interface ReactLintDiagnostic {
210
211
  */
211
212
  declare function lintReactHooks(code: string): Promise<ReactLintDiagnostic[]>;
212
213
 
213
- /**
214
- * Run all tier 0 (deterministic, no-LLM) checks against component source.
215
- *
216
- * Wraps the same logic as runSelfChecks (adapters/tools.ts) but emits EvalIssue[].
217
- * Also runs contract validation when contract are provided.
218
- */
219
214
  declare function runTier0Checks(sourceCode: string, contract?: DataContract, buildErrors?: string[],
220
215
  /**
221
216
  * A `package -> .d.ts content` map for third-party gadget wrappers.
@@ -879,6 +879,10 @@ function generateReactFix(ruleId, message) {
879
879
 
880
880
  // src/design-mode.ts
881
881
  var DEFAULT_DESIGN_MODE = "constrained";
882
+ var NOT_YET_TAUGHT_TOKENS = /* @__PURE__ */ new Set([]);
883
+ var taughtTokenManifest = consumedTokenManifest.filter(
884
+ (token) => !NOT_YET_TAUGHT_TOKENS.has(token)
885
+ );
882
886
 
883
887
  // src/evaluation/types-public.ts
884
888
  function priorityForIssue(category) {
@@ -1037,14 +1041,14 @@ function suggestManifestTokens(name) {
1037
1041
  const own = name.endsWith("-") ? segments.length : segments.length - 1;
1038
1042
  for (let n = own; n >= 2; n--) {
1039
1043
  const prefix = `--${segments.slice(0, n).join("-")}-`;
1040
- const family = consumedTokenManifest.filter((token) => token.startsWith(prefix));
1044
+ const family = taughtTokenManifest.filter((token) => token.startsWith(prefix));
1041
1045
  if (family.length > 0) return wordHitsFirst(name, rolesFirst(family));
1042
1046
  }
1043
1047
  const words = new Set(
1044
1048
  segments.slice(1).filter((segment) => segment.length >= 4).map((segment) => segment.toLowerCase())
1045
1049
  );
1046
1050
  return rolesFirst(
1047
- consumedTokenManifest.filter(
1051
+ taughtTokenManifest.filter(
1048
1052
  (token) => token.split("-").some((segment) => words.has(segment.toLowerCase()))
1049
1053
  )
1050
1054
  );
@@ -1152,6 +1156,41 @@ function detectComponentNeverReturns(sourceCode) {
1152
1156
  for (const st of body.statements) if (!isFunctionLike(st)) visit(st);
1153
1157
  return returnsValue ? null : { jsxStatementLine };
1154
1158
  }
1159
+ var KIT_CONTROLS = ["Button", "Input", "Select", "TextArea", "Checkbox", "RadioGroup", "Toggle", "SearchField"];
1160
+ function kitControlTags(source) {
1161
+ const out = [];
1162
+ const open = new RegExp(`<(${KIT_CONTROLS.join("|")})\\b`, "g");
1163
+ for (const m of source.matchAll(open)) {
1164
+ const start = (m.index ?? 0) + m[0].length;
1165
+ let depth = 0;
1166
+ let quote = null;
1167
+ let i = start;
1168
+ for (; i < source.length; i += 1) {
1169
+ const c = source[i];
1170
+ if (quote !== null) {
1171
+ if (c === quote && source[i - 1] !== "\\") quote = null;
1172
+ } else if (c === '"' || c === "'" || c === "`") quote = c;
1173
+ else if (c === "{") depth += 1;
1174
+ else if (c === "}") depth -= 1;
1175
+ else if (c === ">" && depth === 0) break;
1176
+ }
1177
+ out.push({ name: m[1] ?? "", attrs: source.slice(start, i), line: source.slice(0, m.index ?? 0).split("\n").length });
1178
+ }
1179
+ return out;
1180
+ }
1181
+ function inlineBorderKey(attrs, source) {
1182
+ const BORDER = /\b(border(?:Top|Right|Bottom|Left)?(?:Color|Width|Style)?)\s*:/;
1183
+ const style = attrs.match(/\bstyle=\{\{([\s\S]*)\}\}/);
1184
+ if (style !== null) {
1185
+ const hit2 = (style[1] ?? "").match(BORDER);
1186
+ if (hit2 !== null) return hit2[1] ?? null;
1187
+ }
1188
+ const named = attrs.match(/\bstyle=\{\s*([A-Za-z_$][\w$]*)\s*\}/);
1189
+ if (named === null) return null;
1190
+ const decl = source.match(new RegExp(`\\b(?:const|let)\\s+${named[1]}\\b[^=]*=\\s*\\{([^{}]*)\\}`));
1191
+ const hit = decl !== null ? (decl[1] ?? "").match(BORDER) : null;
1192
+ return hit !== null ? hit[1] ?? null : null;
1193
+ }
1155
1194
  async function runTier0Checks(sourceCode, contract, buildErrors, gadgetTypes, designMode = DEFAULT_DESIGN_MODE) {
1156
1195
  const issues = [];
1157
1196
  const lines = sourceCode.split("\n");
@@ -1549,6 +1588,20 @@ ${errorDetail}`,
1549
1588
  });
1550
1589
  }
1551
1590
  }
1591
+ for (const tag of enforceDesignVocabulary ? kitControlTags(sourceCode) : []) {
1592
+ const key = inlineBorderKey(tag.attrs, sourceCode);
1593
+ if (key === null) continue;
1594
+ issues.push({
1595
+ tier: 0,
1596
+ result: "fail",
1597
+ category: "tokens",
1598
+ subcategory: "control-inline-border",
1599
+ severity: "critical",
1600
+ description: `control-inline-border: <${tag.name}> sets an inline \`${key}\` \u2014 a kit control draws its own boundary, and an inline border paints over it`,
1601
+ fix: `Remove the border from <${tag.name}>'s style (keep borderRadius if you need it). An outline chip is <Button variant="outline"> exactly as it comes; a control-like edge on your own element uses var(--ggui-color-controlOutline).`,
1602
+ line: tag.line
1603
+ });
1604
+ }
1552
1605
  if (!sourceCode.includes("interface Props") && !sourceCode.includes("type Props")) {
1553
1606
  issues.push({
1554
1607
  tier: 0,