@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,5 +1,5 @@
1
- import { S as StreamEventKind, C as Classification, A as AxisVector, R as RiskTier, F as FetchShape, a as AxisSource, L as LayoutShape, b as RealtimeShape, c as RenderShape, d as StateShape, T as ToolingShape, W as WriteTrigger, e as WriteShape } from '../axes-CzLEMDeB.js';
2
- export { f as AxisProvenance } from '../axes-CzLEMDeB.js';
1
+ import { b as StreamEventKind, C as Classification, A as AxisVector, R as RiskTier, F as FetchShape, c as AxisSource, L as LayoutShape, d as RealtimeShape, a as RenderShape, S as StateShape, T as ToolingShape, e as WriteTrigger, W as WriteShape } from '../axes-CKVCzR_x.js';
2
+ export { f as AxisProvenance } from '../axes-CKVCzR_x.js';
3
3
  import * as _ggui_ai_protocol from '@ggui-ai/protocol';
4
4
  import { ClientCapabilitiesSpec } from '@ggui-ai/protocol';
5
5
 
package/dist/compose.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { C as Classification } from './axes-CzLEMDeB.js';
2
- import { C as ComposedHarness } from './types-BOvHNG7K.js';
1
+ import { C as Classification } from './axes-CKVCzR_x.js';
2
+ import { C as ComposedHarness } from './types-Dh1s4K9j.js';
3
3
 
4
4
  declare function compose(classification: Classification): ComposedHarness;
5
5
 
@@ -2,12 +2,12 @@ import { SingleComponentParams } from './harness/runtime.js';
2
2
  import { ModelRef } from '@ggui-ai/protocol';
3
3
  import { GadgetCatalogAdapter } from '@ggui-ai/gadgets';
4
4
  import { GeneratorTier, UiGenerator } from '@ggui-ai/mcp-server-core';
5
- import { R as RuntimeRenderProbeConfig } from './adapter-Du7P_5Fx.js';
5
+ import { VisualEvalAgentSpec } from './adapters/generation-dispatch.js';
6
+ import { R as RuntimeRenderProbeConfig } from './adapter-BJwn74rx.js';
6
7
  import { GenerationResult } from './harness/result-types.js';
7
- import { D as DesignMode } from './design-mode-DLufhrNp.js';
8
- import { Q as QualityConfig } from './types-public-Bk6d1WLN.js';
8
+ import { D as DesignMode } from './design-mode-DGWN_Gkm.js';
9
+ import { Q as QualityConfig, b as AgentConfig } from './types-public-B7wn4ce5.js';
9
10
  import { EvaluationConfig } from './evaluation/types.js';
10
- import { A as AgentConfig } from './llm-router-DwwUK1bz.js';
11
11
 
12
12
  /**
13
13
  * `createUiGenerator` — full-harness UI generation factory.
@@ -96,6 +96,13 @@ interface CreateUiGeneratorOptions {
96
96
  * prompt or the identity. Default: none — the round runs as today.
97
97
  */
98
98
  readonly visualEvaluation?: SingleComponentParams["visualEvaluation"];
99
+ /**
100
+ * ggui#1250 — the in-loop VISUAL judge as its own agent (a vision provider, a model, and that
101
+ * provider's key when the caller resolves keys itself). Absent (default): the judge is the
102
+ * evaluation agent's provider, which on a lane without a vision path records the score half as
103
+ * skipped (#1248). Forwarded verbatim to the dispatch; never part of the prompt or the identity.
104
+ */
105
+ readonly visualEvalAgent?: VisualEvalAgentSpec;
99
106
  /** Quality config controlling eval tiers + improvement behavior. */
100
107
  readonly qualityConfig?: QualityConfig;
101
108
  /**
@@ -58,4 +58,4 @@ declare const CANVAS_DESCRIPTORS: Readonly<Record<CanvasClass, CanvasDescriptor>
58
58
  */
59
59
  declare function describeCanvas(canvas: CanvasClass): string;
60
60
 
61
- export { type CanvasClass as C, type DesignMode as D, CANVAS_BREAKPOINTS as a, CANVAS_CLASSES as b, CANVAS_DESCRIPTORS as c, CANVAS_VIEWPORTS as d, type CanvasDescriptor as e, type CanvasDisplayMode as f, type CanvasViewport as g, DEFAULT_DESIGN_MODE as h, DESIGN_MODES as i, canvasDisplayModeForShell as j, canvasForRendering as k, canvasForViewportWidth as l, describeCanvas as m };
61
+ export { type CanvasClass as C, type DesignMode as D, type CanvasViewport as a, CANVAS_BREAKPOINTS as b, CANVAS_CLASSES as c, CANVAS_DESCRIPTORS as d, CANVAS_VIEWPORTS as e, type CanvasDescriptor as f, type CanvasDisplayMode as g, DEFAULT_DESIGN_MODE as h, DESIGN_MODES as i, canvasDisplayModeForShell as j, canvasForRendering as k, canvasForViewportWidth as l, describeCanvas as m };
@@ -1,7 +1,7 @@
1
- import { DataContract } from '@ggui-ai/protocol';
2
- import { C as Classification } from './axes-CzLEMDeB.js';
3
- import { E as EvalIssue } from './types-public-Bk6d1WLN.js';
4
- import { D as DesignMode, C as CanvasClass } from './design-mode-DLufhrNp.js';
1
+ import { DataContract, JsonObject } from '@ggui-ai/protocol';
2
+ import { C as Classification } from './axes-CKVCzR_x.js';
3
+ import { E as EvalIssue } from './types-public-B7wn4ce5.js';
4
+ import { D as DesignMode, C as CanvasClass } from './design-mode-DGWN_Gkm.js';
5
5
 
6
6
  interface RunAxisChecksInput {
7
7
  sourceCode: string;
@@ -12,6 +12,8 @@ interface RunAxisChecksInput {
12
12
  designMode?: DesignMode;
13
13
  /** The canvas the source is judged for — see `AxisCheckInput.canvas` (ggui#1117); absent = no rendering context. */
14
14
  canvas?: CanvasClass;
15
+ /** The props the source was rendered with — see `AxisCheckInput.fixtureProps` (ggui#1285); absent = the echo check stands down. */
16
+ fixtureProps?: JsonObject;
15
17
  }
16
18
  declare function runAxisChecks(classification: Classification, input: RunAxisChecksInput): EvalIssue[];
17
19
 
@@ -1,12 +1,13 @@
1
- export { R as RunAxisChecksInput, r as runAxisChecks } from '../../dispatch-BnAH56p4.js';
1
+ export { R as RunAxisChecksInput, r as runAxisChecks } from '../../dispatch-BUoXRj_r.js';
2
2
  export { REGISTRY } from './registry.js';
3
- import { A as AxisCheck } from '../../types-public-Bk6d1WLN.js';
4
- export { a as AxisCheckInput, m as matches } from '../../types-public-Bk6d1WLN.js';
3
+ import { A as AxisCheck } from '../../types-public-B7wn4ce5.js';
4
+ export { a as AxisCheckInput, m as matches } from '../../types-public-B7wn4ce5.js';
5
5
  import '@ggui-ai/protocol';
6
- import '../../axes-CzLEMDeB.js';
7
- import '../../design-mode-DLufhrNp.js';
6
+ import '../../axes-CKVCzR_x.js';
7
+ import '../../design-mode-DGWN_Gkm.js';
8
+ import '../../llm.js';
8
9
  import '@ggui-ai/mcp-server-core';
9
- import '../../types-BOvHNG7K.js';
10
+ import '../../types-Dh1s4K9j.js';
10
11
 
11
12
  declare const EXTRA_CHECKS: readonly AxisCheck[];
12
13
 
@@ -569,6 +569,81 @@ function runActionLabelDropped(input) {
569
569
  )
570
570
  );
571
571
  }
572
+ var MIN_ECHO_CHARS = 12;
573
+ function collectStrings(value, out) {
574
+ if (typeof value === "string") {
575
+ out.push(value);
576
+ } else if (Array.isArray(value)) {
577
+ for (const v of value) collectStrings(v, out);
578
+ } else if (value !== null && typeof value === "object") {
579
+ for (const v of Object.values(value)) collectStrings(v, out);
580
+ }
581
+ }
582
+ function fixtureOnlyStrings(input) {
583
+ if (input.fixtureProps === void 0) return [];
584
+ const values = [];
585
+ collectStrings(input.fixtureProps, values);
586
+ const stated = `${input.originalPrompt}
587
+ ${input.contract === void 0 ? "" : JSON.stringify(input.contract)}`;
588
+ const seen = /* @__PURE__ */ new Set();
589
+ const out = [];
590
+ for (const v of values) {
591
+ const t = v.trim();
592
+ if (t.length < MIN_ECHO_CHARS || !t.includes(" ") || seen.has(t)) continue;
593
+ seen.add(t);
594
+ if (stated.includes(t)) continue;
595
+ out.push(t);
596
+ }
597
+ return out;
598
+ }
599
+ function runFixtureDefaultEcho(input) {
600
+ if (input.compiledCode === null) return [];
601
+ const src = input.sourceCode;
602
+ const issues = [];
603
+ for (const value of fixtureOnlyStrings(input)) {
604
+ if (!src.includes(value)) continue;
605
+ issues.push(
606
+ mkIssue(
607
+ "universal.fixture_default_echo",
608
+ `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.`,
609
+ "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.",
610
+ "warn"
611
+ )
612
+ );
613
+ }
614
+ return issues;
615
+ }
616
+ var FORM_OPEN_RX = /<form\b[^<>]*\bonSubmit\s*=[^<>]*>/g;
617
+ var CONTROL_TAG_RX = /<(?:Button|button|input)\b[^<>]*>/g;
618
+ var SUBMIT_TYPE_RX = /\btype\s*=\s*(?:["']submit["']|\{\s*["']submit["']\s*\})/;
619
+ function submitForms(sourceCode) {
620
+ const out = [];
621
+ for (const m of sourceCode.matchAll(FORM_OPEN_RX)) {
622
+ const start = m.index ?? 0;
623
+ const end = sourceCode.indexOf("</form>", start + m[0].length);
624
+ out.push(end === -1 ? sourceCode.slice(start) : sourceCode.slice(start, end + "</form>".length));
625
+ }
626
+ return out;
627
+ }
628
+ function runFormSubmitControl(input) {
629
+ if (input.compiledCode === null) return [];
630
+ const issues = [];
631
+ for (const form of submitForms(input.sourceCode)) {
632
+ const controls = [...form.matchAll(CONTROL_TAG_RX)].map((m) => m[0]);
633
+ if (controls.length === 0) continue;
634
+ if (controls.some((tag) => SUBMIT_TYPE_RX.test(tag))) continue;
635
+ const named = controls.find((tag) => /<Button\b/.test(tag)) ?? controls[0];
636
+ issues.push(
637
+ mkIssue(
638
+ "universal.form_submit_control",
639
+ `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.`,
640
+ '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.',
641
+ "fail"
642
+ )
643
+ );
644
+ }
645
+ return issues;
646
+ }
572
647
  var UNIVERSAL_CHECKS = [
573
648
  {
574
649
  id: "universal.icon_name_known",
@@ -606,6 +681,18 @@ var UNIVERSAL_CHECKS = [
606
681
  values: ALL_RENDER_VALUES,
607
682
  run: runTerminalActionUnguarded
608
683
  },
684
+ {
685
+ id: "universal.form_submit_control",
686
+ axis: "render",
687
+ values: ALL_RENDER_VALUES,
688
+ run: runFormSubmitControl
689
+ },
690
+ {
691
+ id: "universal.fixture_default_echo",
692
+ axis: "render",
693
+ values: ALL_RENDER_VALUES,
694
+ run: runFixtureDefaultEcho
695
+ },
609
696
  {
610
697
  id: "universal.accent_text_ink",
611
698
  axis: "render",
@@ -729,7 +816,7 @@ function runMapKeyIsId(input) {
729
816
  mkIssue(
730
817
  "render.map_key_is_id",
731
818
  `Array key uses index variable "${key}" \u2014 reorders and stream merges will break React reconciliation.`,
732
- `Replace key={${key}} with key={item.id} (or item.symbol / whatever the entity id field is).`
819
+ `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).`
733
820
  )
734
821
  );
735
822
  }
@@ -1676,7 +1763,8 @@ function runAxisChecks(classification, input) {
1676
1763
  originalPrompt: input.originalPrompt,
1677
1764
  classification,
1678
1765
  ...input.designMode !== void 0 ? { designMode: input.designMode } : {},
1679
- ...input.canvas !== void 0 ? { canvas: input.canvas } : {}
1766
+ ...input.canvas !== void 0 ? { canvas: input.canvas } : {},
1767
+ ...input.fixtureProps !== void 0 ? { fixtureProps: input.fixtureProps } : {}
1680
1768
  };
1681
1769
  if (input.compiledCode === null) {
1682
1770
  traceAxisChecksSkipped(facts, "compiledCode null \u2014 no check ran");