@ggui-ai/ui-gen 0.24.0 → 0.26.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 (142) hide show
  1. package/README.md +2 -2
  2. package/dist/{adapter-Du7P_5Fx.d.ts → adapter-BJwn74rx.d.ts} +49 -1
  3. package/dist/adapters/generation-dispatch.d.ts +32 -7
  4. package/dist/adapters/generation-dispatch.js +1997 -216
  5. package/dist/adapters/generation-dispatch.js.map +1 -1
  6. package/dist/adapters/index.js +29 -6
  7. package/dist/adapters/index.js.map +1 -1
  8. package/dist/advanced/index.d.ts +15 -12
  9. package/dist/advanced/index.js +2013 -270
  10. package/dist/advanced/index.js.map +1 -1
  11. package/dist/{axes-CzLEMDeB.d.ts → axes-CKVCzR_x.d.ts} +1 -1
  12. package/dist/bank-Ctdp3FUA.d.ts +118 -0
  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 +34 -15
  17. package/dist/boilerplate.js.map +1 -1
  18. package/dist/check/index.d.ts +13 -5
  19. package/dist/check/index.js +56 -3
  20. package/dist/check/index.js.map +1 -1
  21. package/dist/classifier/index.d.ts +2 -2
  22. package/dist/compose.d.ts +2 -2
  23. package/dist/{create-ui-generator-GIhzx08x.d.ts → create-ui-generator-N4gRXpcL.d.ts} +11 -4
  24. package/dist/{design-mode-DLufhrNp.d.ts → design-mode-DGWN_Gkm.d.ts} +1 -1
  25. package/dist/{dispatch-BnAH56p4.d.ts → dispatch-BUoXRj_r.d.ts} +6 -4
  26. package/dist/evaluation/axis-checks/index.d.ts +7 -6
  27. package/dist/evaluation/axis-checks/index.js +90 -2
  28. package/dist/evaluation/axis-checks/index.js.map +1 -1
  29. package/dist/evaluation/axis-checks/registry.d.ts +6 -5
  30. package/dist/evaluation/axis-checks/registry.js +88 -1
  31. package/dist/evaluation/axis-checks/registry.js.map +1 -1
  32. package/dist/evaluation/index.d.ts +189 -344
  33. package/dist/evaluation/index.js +1272 -59
  34. package/dist/evaluation/index.js.map +1 -1
  35. package/dist/evaluation/types.d.ts +26 -1
  36. package/dist/evaluation/types.js.map +1 -1
  37. package/dist/fragments/index.d.ts +3 -3
  38. package/dist/{generate-9IeNT4ZY.d.ts → generate-tSO_shQ0.d.ts} +1 -1
  39. package/dist/harness/check/runtime-render/index.d.ts +7 -7
  40. package/dist/harness/check/runtime-render/index.js +416 -92
  41. package/dist/harness/check/runtime-render/index.js.map +1 -1
  42. package/dist/harness/check/runtime-render/render-check-worker.js +393 -88
  43. package/dist/harness/check/runtime-render/render-check-worker.js.map +1 -1
  44. package/dist/harness/index.d.ts +5 -6
  45. package/dist/harness/index.js +69 -20
  46. package/dist/harness/index.js.map +1 -1
  47. package/dist/harness/prompts.d.ts +2 -2
  48. package/dist/harness/prompts.js +10 -1
  49. package/dist/harness/prompts.js.map +1 -1
  50. package/dist/harness/result-types.d.ts +19 -5
  51. package/dist/harness/result-types.js.map +1 -1
  52. package/dist/harness/runtime.d.ts +21 -7
  53. package/dist/harness/runtime.js +36 -17
  54. package/dist/harness/runtime.js.map +1 -1
  55. package/dist/harness/types-public.d.ts +6 -4
  56. package/dist/harness/types-public.js +43 -18
  57. package/dist/harness/types-public.js.map +1 -1
  58. package/dist/harness/validator-trace-sink.d.ts +6 -5
  59. package/dist/hash.d.ts +1 -1
  60. package/dist/index.d.ts +64 -13
  61. package/dist/index.js +2023 -270
  62. package/dist/index.js.map +1 -1
  63. package/dist/patch.d.ts +5 -5
  64. package/dist/policy.d.ts +1 -1
  65. package/dist/{prompts-YU9piOgs.d.ts → prompts-BhNUuRoZ.d.ts} +1 -1
  66. package/dist/tools/get-primitives-ts.d.ts +1 -1
  67. package/dist/tools/get-primitives-ts.js +1 -1
  68. package/dist/tools/get-primitives-ts.js.map +1 -1
  69. package/dist/tools/render-check-worker.js +8 -1
  70. package/dist/tools/render-check-worker.js.map +1 -1
  71. package/dist/{types-BOvHNG7K.d.ts → types-Dh1s4K9j.d.ts} +1 -1
  72. package/dist/types-public-B7wn4ce5.d.ts +959 -0
  73. package/dist/validation/index.d.ts +1 -1
  74. package/dist/validation/index.js +1 -1
  75. package/dist/validation/index.js.map +1 -1
  76. package/dist/visual-evaluator-C9L-o6ap.d.ts +639 -0
  77. package/dist/workflows.d.ts +5 -5
  78. package/package.json +12 -12
  79. package/src/adapters/generation-dispatch.ts +38 -2
  80. package/src/adapters/tools.ts +2 -1
  81. package/src/boilerplate/free-design-prompt.ts +4 -4
  82. package/src/boilerplate/generate.ts +26 -1
  83. package/src/boilerplate/hard-sections.ts +14 -14
  84. package/src/boilerplate/system-prompt.ts +1 -1
  85. package/src/boilerplate/templates/layouts/chat-mobile.tsx.tmpl +3 -1
  86. package/src/boilerplate/templates/layouts/chat-universal.tsx.tmpl +3 -1
  87. package/src/boilerplate/templates/layouts/fullscreen-desktop.tsx.tmpl +3 -1
  88. package/src/boilerplate/templates/layouts/fullscreen-universal.tsx.tmpl +3 -1
  89. package/src/check/index.ts +1 -0
  90. package/src/check/run-tier0.ts +6 -3
  91. package/src/check/sample-props.ts +63 -0
  92. package/src/coding-agent/tools.ts +4 -1
  93. package/src/contract-context.ts +1 -1
  94. package/src/create-harness.ts +3 -3
  95. package/src/create-ui-generator.ts +20 -1
  96. package/src/evaluation/__fixtures__/png.ts +100 -0
  97. package/src/evaluation/axis-checks/checks/state-merge.ts +1 -1
  98. package/src/evaluation/axis-checks/checks/universal.ts +111 -0
  99. package/src/evaluation/axis-checks/dispatch.ts +4 -1
  100. package/src/evaluation/cost-tracker.ts +54 -6
  101. package/src/evaluation/criteria/bank.ts +85 -0
  102. package/src/evaluation/criteria/context.ts +52 -0
  103. package/src/evaluation/criteria/edge-probe.ts +286 -0
  104. package/src/evaluation/criteria/edge.ts +202 -0
  105. package/src/evaluation/criteria/resolve.ts +207 -0
  106. package/src/evaluation/criteria/select.ts +79 -0
  107. package/src/evaluation/index.ts +27 -0
  108. package/src/evaluation/ink-extent.ts +200 -0
  109. package/src/evaluation/judge-spend.ts +48 -0
  110. package/src/evaluation/theme-css.ts +12 -5
  111. package/src/evaluation/types-public.ts +221 -3
  112. package/src/evaluation/types.ts +19 -0
  113. package/src/evaluation/visual-evaluator.ts +853 -51
  114. package/src/harness/check/runtime-render/adapter.ts +18 -0
  115. package/src/harness/check/runtime-render/probe-pending.ts +111 -0
  116. package/src/harness/check/runtime-render/render-check-host.ts +10 -6
  117. package/src/harness/check/runtime-render/render-check-worker.ts +6 -3
  118. package/src/harness/check/runtime-render/render-check.ts +417 -133
  119. package/src/harness/check/runtime-render/walk.ts +200 -0
  120. package/src/harness/coding/assemble-result.ts +2 -0
  121. package/src/harness/coding/generate-task-runner.ts +30 -0
  122. package/src/harness/coding/init-session.ts +5 -3
  123. package/src/harness/coding/run-coding-turn.ts +12 -4
  124. package/src/harness/coding/run-eval-round.ts +82 -3
  125. package/src/harness/in-loop-evaluation.ts +39 -0
  126. package/src/harness/llm-router.ts +58 -1
  127. package/src/harness/result-types.ts +9 -0
  128. package/src/harness/runtime.ts +14 -0
  129. package/src/harness/types-public.ts +10 -1
  130. package/src/harness-tool-names.ts +38 -0
  131. package/src/index.ts +17 -0
  132. package/src/internal/verdict-line.ts +33 -0
  133. package/src/run-check.ts +2 -0
  134. package/src/taught-tokens.ts +32 -0
  135. package/src/tools/get-primitives-ts.ts +1 -1
  136. package/src/tools/get-wire.ts +1 -1
  137. package/src/tools/render-check-worker.ts +2 -1
  138. package/src/tools/render-check.ts +8 -67
  139. package/src/tools.ts +11 -1
  140. package/src/validation/primitives.ts +1 -1
  141. package/dist/llm-router-DwwUK1bz.d.ts +0 -265
  142. package/dist/types-public-Bk6d1WLN.d.ts +0 -451
@@ -1,9 +1,10 @@
1
- import { A as AxisCheck } from '../../types-public-Bk6d1WLN.js';
2
- import '@ggui-ai/mcp-server-core';
3
- import '../../design-mode-DLufhrNp.js';
1
+ import { A as AxisCheck } from '../../types-public-B7wn4ce5.js';
4
2
  import '@ggui-ai/protocol';
5
- import '../../axes-CzLEMDeB.js';
6
- import '../../types-BOvHNG7K.js';
3
+ import '../../llm.js';
4
+ import '@ggui-ai/mcp-server-core';
5
+ import '../../design-mode-DGWN_Gkm.js';
6
+ import '../../axes-CKVCzR_x.js';
7
+ import '../../types-Dh1s4K9j.js';
7
8
 
8
9
  declare const REGISTRY: readonly AxisCheck[];
9
10
 
@@ -568,6 +568,81 @@ function runActionLabelDropped(input) {
568
568
  )
569
569
  );
570
570
  }
571
+ var MIN_ECHO_CHARS = 12;
572
+ function collectStrings(value, out) {
573
+ if (typeof value === "string") {
574
+ out.push(value);
575
+ } else if (Array.isArray(value)) {
576
+ for (const v of value) collectStrings(v, out);
577
+ } else if (value !== null && typeof value === "object") {
578
+ for (const v of Object.values(value)) collectStrings(v, out);
579
+ }
580
+ }
581
+ function fixtureOnlyStrings(input) {
582
+ if (input.fixtureProps === void 0) return [];
583
+ const values = [];
584
+ collectStrings(input.fixtureProps, values);
585
+ const stated = `${input.originalPrompt}
586
+ ${input.contract === void 0 ? "" : JSON.stringify(input.contract)}`;
587
+ const seen = /* @__PURE__ */ new Set();
588
+ const out = [];
589
+ for (const v of values) {
590
+ const t = v.trim();
591
+ if (t.length < MIN_ECHO_CHARS || !t.includes(" ") || seen.has(t)) continue;
592
+ seen.add(t);
593
+ if (stated.includes(t)) continue;
594
+ out.push(t);
595
+ }
596
+ return out;
597
+ }
598
+ function runFixtureDefaultEcho(input) {
599
+ if (input.compiledCode === null) return [];
600
+ const src = input.sourceCode;
601
+ const issues = [];
602
+ for (const value of fixtureOnlyStrings(input)) {
603
+ if (!src.includes(value)) continue;
604
+ issues.push(
605
+ mkIssue(
606
+ "universal.fixture_default_echo",
607
+ `A literal in the source equals a fixture value the request never stated: "${value.length > 60 ? `${value.slice(0, 57)}\u2026` : value}". The fixture is judging data; a visitor sees this copy whenever the agent leaves the prop out.`,
608
+ "Take that copy from the prop it renders and drop the literal \u2014 no default, fallback or placeholder that repeats a fixture value. A default may only carry text the request itself states.",
609
+ "warn"
610
+ )
611
+ );
612
+ }
613
+ return issues;
614
+ }
615
+ var FORM_OPEN_RX = /<form\b[^<>]*\bonSubmit\s*=[^<>]*>/g;
616
+ var CONTROL_TAG_RX = /<(?:Button|button|input)\b[^<>]*>/g;
617
+ var SUBMIT_TYPE_RX = /\btype\s*=\s*(?:["']submit["']|\{\s*["']submit["']\s*\})/;
618
+ function submitForms(sourceCode) {
619
+ const out = [];
620
+ for (const m of sourceCode.matchAll(FORM_OPEN_RX)) {
621
+ const start = m.index ?? 0;
622
+ const end = sourceCode.indexOf("</form>", start + m[0].length);
623
+ out.push(end === -1 ? sourceCode.slice(start) : sourceCode.slice(start, end + "</form>".length));
624
+ }
625
+ return out;
626
+ }
627
+ function runFormSubmitControl(input) {
628
+ if (input.compiledCode === null) return [];
629
+ const issues = [];
630
+ for (const form of submitForms(input.sourceCode)) {
631
+ const controls = [...form.matchAll(CONTROL_TAG_RX)].map((m) => m[0]);
632
+ if (controls.length === 0) continue;
633
+ if (controls.some((tag) => SUBMIT_TYPE_RX.test(tag))) continue;
634
+ const named = controls.find((tag) => /<Button\b/.test(tag)) ?? controls[0];
635
+ issues.push(
636
+ mkIssue(
637
+ "universal.form_submit_control",
638
+ `A <form onSubmit> renders ${controls.length} control(s) and none submits it: the design Button defaults to type="button", so clicking ${named.length > 60 ? `${named.slice(0, 57)}\u2026` : named} does nothing \u2014 only Enter in a field submits.`,
639
+ 'Give the control that submits this form type="submit" \u2014 a Button inside a form defaults to type="button" and never submits on click; keep type="button" on the others.',
640
+ "fail"
641
+ )
642
+ );
643
+ }
644
+ return issues;
645
+ }
571
646
  var UNIVERSAL_CHECKS = [
572
647
  {
573
648
  id: "universal.icon_name_known",
@@ -605,6 +680,18 @@ var UNIVERSAL_CHECKS = [
605
680
  values: ALL_RENDER_VALUES,
606
681
  run: runTerminalActionUnguarded
607
682
  },
683
+ {
684
+ id: "universal.form_submit_control",
685
+ axis: "render",
686
+ values: ALL_RENDER_VALUES,
687
+ run: runFormSubmitControl
688
+ },
689
+ {
690
+ id: "universal.fixture_default_echo",
691
+ axis: "render",
692
+ values: ALL_RENDER_VALUES,
693
+ run: runFixtureDefaultEcho
694
+ },
608
695
  {
609
696
  id: "universal.accent_text_ink",
610
697
  axis: "render",
@@ -728,7 +815,7 @@ function runMapKeyIsId(input) {
728
815
  mkIssue(
729
816
  "render.map_key_is_id",
730
817
  `Array key uses index variable "${key}" \u2014 reorders and stream merges will break React reconciliation.`,
731
- `Replace key={${key}} with key={item.id} (or item.symbol / whatever the entity id field is).`
818
+ `Replace key={${key}} with key={item.id} \u2014 or, when the items carry no id, with the field that names each one (item.label / item.symbol / item.name).`
732
819
  )
733
820
  );
734
821
  }