@ggui-ai/ui-gen 0.26.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 (60) hide show
  1. package/dist/{adapter-BJwn74rx.d.ts → adapter-h4_V69LI.d.ts} +1 -1
  2. package/dist/adapters/base.d.ts +6 -1
  3. package/dist/adapters/base.js.map +1 -1
  4. package/dist/adapters/generation-dispatch.d.ts +2 -2
  5. package/dist/adapters/generation-dispatch.js +61 -10
  6. package/dist/adapters/generation-dispatch.js.map +1 -1
  7. package/dist/adapters/index.js +36 -14
  8. package/dist/adapters/index.js.map +1 -1
  9. package/dist/advanced/index.d.ts +4 -4
  10. package/dist/advanced/index.js +94 -19
  11. package/dist/advanced/index.js.map +1 -1
  12. package/dist/boilerplate.js +4 -6
  13. package/dist/boilerplate.js.map +1 -1
  14. package/dist/check/index.d.ts +1 -7
  15. package/dist/check/index.js +50 -4
  16. package/dist/check/index.js.map +1 -1
  17. package/dist/{create-ui-generator-N4gRXpcL.d.ts → create-ui-generator-BrZHF0cf.d.ts} +2 -2
  18. package/dist/{dispatch-BUoXRj_r.d.ts → dispatch-B07TI30d.d.ts} +1 -1
  19. package/dist/evaluation/axis-checks/index.d.ts +3 -3
  20. package/dist/evaluation/axis-checks/index.js.map +1 -1
  21. package/dist/evaluation/axis-checks/registry.d.ts +1 -1
  22. package/dist/evaluation/index.d.ts +22 -12
  23. package/dist/evaluation/index.js +36 -10
  24. package/dist/evaluation/index.js.map +1 -1
  25. package/dist/evaluation/types.d.ts +1 -1
  26. package/dist/harness/check/runtime-render/index.d.ts +3 -3
  27. package/dist/harness/index.d.ts +1 -1
  28. package/dist/harness/index.js +4 -6
  29. package/dist/harness/index.js.map +1 -1
  30. package/dist/harness/prompts.js +1 -4
  31. package/dist/harness/prompts.js.map +1 -1
  32. package/dist/harness/result-types.d.ts +2 -2
  33. package/dist/harness/runtime.d.ts +1 -1
  34. package/dist/harness/runtime.js +6 -7
  35. package/dist/harness/runtime.js.map +1 -1
  36. package/dist/harness/types-public.d.ts +1 -1
  37. package/dist/harness/types-public.js +4 -6
  38. package/dist/harness/types-public.js.map +1 -1
  39. package/dist/harness/validator-trace-sink.d.ts +1 -1
  40. package/dist/index.d.ts +5 -5
  41. package/dist/index.js +94 -19
  42. package/dist/index.js.map +1 -1
  43. package/dist/patch.d.ts +1 -1
  44. package/dist/{types-public-B7wn4ce5.d.ts → types-public-h8IMnYuh.d.ts} +4 -0
  45. package/dist/{visual-evaluator-C9L-o6ap.d.ts → visual-evaluator-C2strxqD.d.ts} +1 -1
  46. package/dist/workflows.d.ts +1 -1
  47. package/package.json +12 -12
  48. package/src/adapters/base.ts +6 -1
  49. package/src/adapters/claude/message-parser.ts +5 -6
  50. package/src/adapters/claude/sdk-tool-pins.ts +44 -0
  51. package/src/adapters/claude/sdk.ts +3 -3
  52. package/src/adapters/claude/source-capture.ts +20 -0
  53. package/src/boilerplate/system-prompt.ts +3 -2
  54. package/src/check/run-tier0.ts +61 -0
  55. package/src/design-system-docs.ts +2 -1
  56. package/src/evaluation/criteria/resolve.ts +19 -1
  57. package/src/evaluation/loop.ts +25 -4
  58. package/src/evaluation/message-parsing.ts +11 -12
  59. package/src/evaluation/types-public.ts +4 -0
  60. package/src/taught-tokens.ts +5 -6
@@ -1,6 +1,6 @@
1
1
  import { DataContract, JsonObject, PropsSpec, ActionSpec, StreamSpec } from '@ggui-ai/protocol';
2
2
  import { D as DesignMode } from '../design-mode-DGWN_Gkm.js';
3
- import { e as EvalResult, E as EvalIssue } from '../types-public-B7wn4ce5.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
5
  import '../llm.js';
6
6
  import '@ggui-ai/mcp-server-core';
@@ -211,12 +211,6 @@ interface ReactLintDiagnostic {
211
211
  */
212
212
  declare function lintReactHooks(code: string): Promise<ReactLintDiagnostic[]>;
213
213
 
214
- /**
215
- * Run all tier 0 (deterministic, no-LLM) checks against component source.
216
- *
217
- * Wraps the same logic as runSelfChecks (adapters/tools.ts) but emits EvalIssue[].
218
- * Also runs contract validation when contract are provided.
219
- */
220
214
  declare function runTier0Checks(sourceCode: string, contract?: DataContract, buildErrors?: string[],
221
215
  /**
222
216
  * A `package -> .d.ts content` map for third-party gadget wrappers.
@@ -879,10 +879,7 @@ 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
- "--ggui-color-controlAccentOutline",
884
- "--ggui-color-controlOutline"
885
- ]);
882
+ var NOT_YET_TAUGHT_TOKENS = /* @__PURE__ */ new Set([]);
886
883
  var taughtTokenManifest = consumedTokenManifest.filter(
887
884
  (token) => !NOT_YET_TAUGHT_TOKENS.has(token)
888
885
  );
@@ -1159,6 +1156,41 @@ function detectComponentNeverReturns(sourceCode) {
1159
1156
  for (const st of body.statements) if (!isFunctionLike(st)) visit(st);
1160
1157
  return returnsValue ? null : { jsxStatementLine };
1161
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
+ }
1162
1194
  async function runTier0Checks(sourceCode, contract, buildErrors, gadgetTypes, designMode = DEFAULT_DESIGN_MODE) {
1163
1195
  const issues = [];
1164
1196
  const lines = sourceCode.split("\n");
@@ -1556,6 +1588,20 @@ ${errorDetail}`,
1556
1588
  });
1557
1589
  }
1558
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
+ }
1559
1605
  if (!sourceCode.includes("interface Props") && !sourceCode.includes("type Props")) {
1560
1606
  issues.push({
1561
1607
  tier: 0,