@ggui-ai/ui-gen 0.23.0 → 0.25.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 (123) hide show
  1. package/dist/adapter-Cg_rkpGq.d.ts +201 -0
  2. package/dist/adapters/generation-dispatch.d.ts +58 -15
  3. package/dist/adapters/generation-dispatch.js +1418 -180
  4. package/dist/adapters/generation-dispatch.js.map +1 -1
  5. package/dist/adapters/index.js +3 -1
  6. package/dist/adapters/index.js.map +1 -1
  7. package/dist/advanced/index.d.ts +12 -8
  8. package/dist/advanced/index.js +1467 -239
  9. package/dist/advanced/index.js.map +1 -1
  10. package/dist/{axes-CzLEMDeB.d.ts → axes-CKVCzR_x.d.ts} +1 -1
  11. package/dist/bank-CT4eEkta.d.ts +118 -0
  12. package/dist/blueprint-validator.js +153 -59
  13. package/dist/blueprint-validator.js.map +1 -1
  14. package/dist/boilerplate.js +24 -12
  15. package/dist/boilerplate.js.map +1 -1
  16. package/dist/check/index.d.ts +12 -4
  17. package/dist/check/index.js +94 -2
  18. package/dist/check/index.js.map +1 -1
  19. package/dist/classifier/index.d.ts +2 -2
  20. package/dist/compose.d.ts +2 -2
  21. package/dist/{create-ui-generator-D0kbWwln.d.ts → create-ui-generator-DFnnArrv.d.ts} +43 -11
  22. package/dist/{dispatch-wxaIMwZt.d.ts → dispatch-CStl9eAw.d.ts} +5 -3
  23. package/dist/evaluation/axis-checks/index.d.ts +6 -5
  24. package/dist/evaluation/axis-checks/index.js +90 -2
  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/axis-checks/registry.js +88 -1
  28. package/dist/evaluation/axis-checks/registry.js.map +1 -1
  29. package/dist/evaluation/index.d.ts +301 -23
  30. package/dist/evaluation/index.js +746 -30
  31. package/dist/evaluation/index.js.map +1 -1
  32. package/dist/evaluation/types.d.ts +9 -1
  33. package/dist/evaluation/types.js.map +1 -1
  34. package/dist/fragments/index.d.ts +3 -3
  35. package/dist/harness/check/runtime-render/index.d.ts +30 -11
  36. package/dist/harness/check/runtime-render/index.js +203 -60
  37. package/dist/harness/check/runtime-render/index.js.map +1 -1
  38. package/dist/harness/check/runtime-render/render-check-worker.d.ts +8 -1
  39. package/dist/harness/check/runtime-render/render-check-worker.js +72 -32
  40. package/dist/harness/check/runtime-render/render-check-worker.js.map +1 -1
  41. package/dist/harness/index.d.ts +5 -4
  42. package/dist/harness/index.js +33 -15
  43. package/dist/harness/index.js.map +1 -1
  44. package/dist/harness/prompts.js.map +1 -1
  45. package/dist/harness/result-types.d.ts +4 -3
  46. package/dist/harness/runtime.d.ts +11 -4
  47. package/dist/harness/runtime.js +26 -14
  48. package/dist/harness/runtime.js.map +1 -1
  49. package/dist/harness/types-public.d.ts +13 -4
  50. package/dist/harness/types-public.js +33 -15
  51. package/dist/harness/types-public.js.map +1 -1
  52. package/dist/harness/validator-trace-sink.d.ts +4 -3
  53. package/dist/hash.d.ts +1 -1
  54. package/dist/index.d.ts +59 -8
  55. package/dist/index.js +1476 -241
  56. package/dist/index.js.map +1 -1
  57. package/dist/{llm-router-DwwUK1bz.d.ts → llm-router-nfO7wPec.d.ts} +3 -1
  58. package/dist/patch.d.ts +4 -3
  59. package/dist/policy.d.ts +8 -5
  60. package/dist/policy.js.map +1 -1
  61. package/dist/tools/get-primitives-ts.d.ts +1 -1
  62. package/dist/tools/get-primitives-ts.js +1 -1
  63. package/dist/tools/get-primitives-ts.js.map +1 -1
  64. package/dist/tools/render-check-worker.d.ts +7 -1
  65. package/dist/tools/render-check-worker.js +55 -23
  66. package/dist/tools/render-check-worker.js.map +1 -1
  67. package/dist/{types-BOvHNG7K.d.ts → types-Dh1s4K9j.d.ts} +1 -1
  68. package/dist/{types-public-Ow-tNtFE.d.ts → types-public-BJTLpzWn.d.ts} +208 -15
  69. package/dist/validation/index.d.ts +1 -1
  70. package/dist/validation/index.js +1 -1
  71. package/dist/validation/index.js.map +1 -1
  72. package/dist/workflows.d.ts +4 -3
  73. package/package.json +12 -12
  74. package/src/adapters/generation-dispatch.ts +173 -98
  75. package/src/adapters/tools.ts +2 -1
  76. package/src/boilerplate/free-design-prompt.ts +1 -1
  77. package/src/boilerplate/generate.ts +26 -1
  78. package/src/boilerplate/hard-sections.ts +13 -13
  79. package/src/boilerplate/system-prompt.ts +1 -1
  80. package/src/check/index.ts +1 -0
  81. package/src/check/run-tier0.ts +80 -1
  82. package/src/check/sample-props.ts +63 -0
  83. package/src/coding-agent/tools.ts +4 -1
  84. package/src/create-harness.ts +3 -3
  85. package/src/create-ui-generator.ts +204 -95
  86. package/src/evaluation/__fixtures__/png.ts +100 -0
  87. package/src/evaluation/axis-checks/checks/state-merge.ts +1 -1
  88. package/src/evaluation/axis-checks/checks/universal.ts +111 -0
  89. package/src/evaluation/axis-checks/dispatch.ts +4 -1
  90. package/src/evaluation/criteria/bank.ts +85 -0
  91. package/src/evaluation/criteria/context.ts +52 -0
  92. package/src/evaluation/criteria/resolve.ts +159 -0
  93. package/src/evaluation/criteria/select.ts +79 -0
  94. package/src/evaluation/index.ts +23 -0
  95. package/src/evaluation/ink-extent.ts +200 -0
  96. package/src/evaluation/theme-css.ts +12 -5
  97. package/src/evaluation/types-public.ts +200 -11
  98. package/src/evaluation/types.ts +9 -0
  99. package/src/evaluation/visual-evaluator.ts +636 -30
  100. package/src/harness/check/runtime-render/adapter.ts +221 -75
  101. package/src/harness/check/runtime-render/index.ts +75 -2
  102. package/src/harness/check/runtime-render/render-check-host.ts +82 -19
  103. package/src/harness/check/runtime-render/render-check-worker.ts +83 -29
  104. package/src/harness/check/runtime-render/render-check.ts +154 -117
  105. package/src/harness/coding/generate-task-runner.ts +60 -4
  106. package/src/harness/coding/init-session.ts +13 -0
  107. package/src/harness/coding/run-coding-turn.ts +7 -3
  108. package/src/harness/coding/run-eval-round.ts +257 -15
  109. package/src/harness/policy.ts +11 -0
  110. package/src/harness/primitive-slice.ts +104 -0
  111. package/src/harness/runtime.ts +5 -0
  112. package/src/harness/types-public.ts +9 -1
  113. package/src/harness-tool-names.ts +38 -0
  114. package/src/index.ts +16 -0
  115. package/src/policy.ts +7 -4
  116. package/src/run-check.ts +2 -0
  117. package/src/tools/get-primitives-ts.ts +1 -1
  118. package/src/tools/get-wire.ts +1 -1
  119. package/src/tools/render-check-worker.ts +74 -23
  120. package/src/tools/render-check.ts +0 -60
  121. package/src/tools.ts +11 -1
  122. package/src/validation/primitives.ts +1 -1
  123. package/dist/render-check-Blwj8gB6.d.ts +0 -105
@@ -1,105 +0,0 @@
1
- import { JsonObject, DataContract } from '@ggui-ai/protocol';
2
- import { P as ProbeHostLoad } from './types-public-Ow-tNtFE.js';
3
-
4
- /**
5
- * 3-state outcome. Internal to runtime-render.
6
- * The adapter maps this to existing EvalIssue shapes:
7
- * verified → no issue
8
- * failed → fail
9
- * unverified → warn
10
- * skipped → no issue
11
- */
12
- type CheckOutcome = "verified" | "failed" | "unverified" | "skipped";
13
- interface RenderCheckIssue {
14
- readonly check: "render-no-throw" | "action-wiring" | "selection-identity" | "prop-coverage" | "prop-sensitivity" | "stream-rerender" | "optional-props-omitted";
15
- readonly outcome: CheckOutcome;
16
- readonly subject?: string;
17
- readonly reason: string;
18
- /** Optional element description ("button[aria-label='Save']") for action-wiring failures. */
19
- readonly elementHint?: string;
20
- /**
21
- * Diagnostic context from probe + AST analysis. Populated for richer feedback
22
- * to the coding agent (which native props the callback flows into, what the
23
- * probe observed firing, etc.).
24
- */
25
- readonly diagnostics?: {
26
- readonly observedJsxElements?: readonly string[];
27
- readonly observedNativeProps?: readonly string[];
28
- readonly observedCustomProps?: readonly string[];
29
- /** For action-wiring: which actions DID fire from probe clicks (helps surface mis-wiring). */
30
- readonly actionsFiredFromClicks?: readonly string[];
31
- /** Surfaced to the agent: prop sourceTool hints from the contract (only if present). */
32
- readonly sourceToolHints?: Readonly<Record<string, string>>;
33
- /**
34
- * For action-wiring (ggui#1187): what input priming did before the
35
- * synthetic dispatch — how many controls it filled, or why it could not
36
- * run. A "did not dispatch it" on an input-gated action reads differently
37
- * beside `{ primed: 0 }` or `{ error }` than beside `{ primed: 1 }`.
38
- */
39
- readonly inputPriming?: InputPrimingDiagnostic;
40
- };
41
- }
42
- /**
43
- * Outcome of `primeInputs` before the action-wiring probe (ggui#1187). A
44
- * priming failure never aborts the check — it is recorded here, on every
45
- * action-wiring issue, so it is visible in the feedback instead of vanishing.
46
- */
47
- type InputPrimingDiagnostic = {
48
- readonly primed: number;
49
- } | {
50
- readonly error: string;
51
- };
52
- /**
53
- * The check started but did not finish (ggui#1299). The only kind is a
54
- * wall-clock timeout in the isolated worker. It is not a verdict on the
55
- * component: `issues` is empty and `ok` is false because nothing was
56
- * verified, never because something failed.
57
- */
58
- interface RenderCheckIncomplete {
59
- readonly kind: "timeout";
60
- /** How long the worker ran before it was stopped. */
61
- readonly elapsedMs: number;
62
- /** The wall-clock bound it crossed. */
63
- readonly boundMs: number;
64
- }
65
- interface RenderCheckResult {
66
- readonly ok: boolean;
67
- readonly issues: readonly RenderCheckIssue[];
68
- /** Present only when the check did not finish; see {@link RenderCheckIncomplete}. */
69
- readonly incomplete?: RenderCheckIncomplete;
70
- readonly stats: {
71
- readonly actionsChecked: number;
72
- readonly streamsChecked: number;
73
- readonly renderMs: number;
74
- /** Host load around an isolated check (absent in-process). */
75
- readonly hostLoad?: ProbeHostLoad;
76
- };
77
- }
78
- interface RunRenderCheckInput {
79
- readonly sourceCode: string;
80
- readonly mockupProps: JsonObject;
81
- readonly contract?: DataContract;
82
- }
83
- /**
84
- * Run the in-loop runtime render check.
85
- *
86
- * Isolation dispatcher (#592): when the CALLING environment already
87
- * owns a DOM (`window` + `document` on `globalThis` — e.g. a vitest
88
- * `happy-dom` environment, where the environment owner installed the
89
- * globals deliberately), the check runs in-process exactly as before.
90
- * In a plain Node process it runs in an ISOLATED SUBPROCESS
91
- * (`render-check-host.ts` → `render-check-worker.ts`), because the
92
- * in-process path installs happy-dom globals on `globalThis`
93
- * process-wide — a TOCTOU hazard for anything that sniffs `window`
94
- * concurrently (provider SDKs throw "browser-like environment" at
95
- * client construction; two overlapping checks corrupt each other's
96
- * teardown). See #592 for the measured incident (4 bench cells hard-
97
- * failed on the 2026-08-19 run).
98
- *
99
- * The host is loaded lazily so the worker bundle (which imports this
100
- * module for `runRenderCheckInProcess`) never drags in the sandbox
101
- * spawn machinery.
102
- */
103
- declare function runRenderCheck(input: RunRenderCheckInput): Promise<RenderCheckResult>;
104
-
105
- export { type RenderCheckIssue as R, type RenderCheckResult as a, runRenderCheck as r };