@ggui-ai/ui-gen 0.22.0 → 0.24.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 (90) hide show
  1. package/dist/adapter-Du7P_5Fx.d.ts +201 -0
  2. package/dist/adapters/generation-dispatch.d.ts +33 -12
  3. package/dist/adapters/generation-dispatch.js +549 -129
  4. package/dist/adapters/generation-dispatch.js.map +1 -1
  5. package/dist/adapters/index.js +1 -1
  6. package/dist/adapters/index.js.map +1 -1
  7. package/dist/advanced/index.d.ts +5 -3
  8. package/dist/advanced/index.js +601 -144
  9. package/dist/advanced/index.js.map +1 -1
  10. package/dist/blueprint-validator.js +178 -54
  11. package/dist/blueprint-validator.js.map +1 -1
  12. package/dist/boilerplate.js +1 -0
  13. package/dist/boilerplate.js.map +1 -1
  14. package/dist/check/index.d.ts +2 -1
  15. package/dist/check/index.js +47 -1
  16. package/dist/check/index.js.map +1 -1
  17. package/dist/{create-ui-generator-BEkzEtNz.d.ts → create-ui-generator-GIhzx08x.d.ts} +34 -10
  18. package/dist/{dispatch-DJNpQ7DI.d.ts → dispatch-BnAH56p4.d.ts} +1 -1
  19. package/dist/evaluation/axis-checks/index.d.ts +4 -3
  20. package/dist/evaluation/axis-checks/index.js +19 -4
  21. package/dist/evaluation/axis-checks/index.js.map +1 -1
  22. package/dist/evaluation/axis-checks/registry.d.ts +2 -1
  23. package/dist/evaluation/axis-checks/registry.js +19 -4
  24. package/dist/evaluation/axis-checks/registry.js.map +1 -1
  25. package/dist/evaluation/index.d.ts +4 -3
  26. package/dist/evaluation/index.js +21 -6
  27. package/dist/evaluation/index.js.map +1 -1
  28. package/dist/harness/check/runtime-render/index.d.ts +27 -8
  29. package/dist/harness/check/runtime-render/index.js +217 -54
  30. package/dist/harness/check/runtime-render/index.js.map +1 -1
  31. package/dist/harness/check/runtime-render/render-check-worker.d.ts +8 -1
  32. package/dist/harness/check/runtime-render/render-check-worker.js +72 -32
  33. package/dist/harness/check/runtime-render/render-check-worker.js.map +1 -1
  34. package/dist/harness/index.d.ts +2 -1
  35. package/dist/harness/index.js +3 -2
  36. package/dist/harness/index.js.map +1 -1
  37. package/dist/harness/prompts.js.map +1 -1
  38. package/dist/harness/result-types.d.ts +2 -1
  39. package/dist/harness/runtime.d.ts +2 -1
  40. package/dist/harness/runtime.js +2 -1
  41. package/dist/harness/runtime.js.map +1 -1
  42. package/dist/harness/types-public.d.ts +18 -5
  43. package/dist/harness/types-public.js +1 -0
  44. package/dist/harness/types-public.js.map +1 -1
  45. package/dist/harness/validator-trace-sink.d.ts +2 -1
  46. package/dist/index.d.ts +38 -3
  47. package/dist/index.js +592 -144
  48. package/dist/index.js.map +1 -1
  49. package/dist/patch.d.ts +2 -1
  50. package/dist/policy.d.ts +7 -4
  51. package/dist/policy.js.map +1 -1
  52. package/dist/tools/get-primitives-ts.d.ts +1 -1
  53. package/dist/tools/get-primitives-ts.js +1 -1
  54. package/dist/tools/get-primitives-ts.js.map +1 -1
  55. package/dist/tools/render-check-worker.d.ts +7 -1
  56. package/dist/tools/render-check-worker.js +55 -23
  57. package/dist/tools/render-check-worker.js.map +1 -1
  58. package/dist/{types-public-mM_-1Yk3.d.ts → types-public-Bk6d1WLN.d.ts} +98 -9
  59. package/dist/validation/index.d.ts +1 -1
  60. package/dist/validation/index.js +1 -1
  61. package/dist/validation/index.js.map +1 -1
  62. package/dist/workflows.d.ts +2 -1
  63. package/package.json +12 -12
  64. package/src/adapters/generation-dispatch.ts +137 -96
  65. package/src/advanced/generator.ts +16 -1
  66. package/src/blueprint-validator.ts +21 -6
  67. package/src/boilerplate/hard-sections.ts +1 -0
  68. package/src/check/run-tier0.ts +80 -1
  69. package/src/coding-agent/tools.ts +6 -1
  70. package/src/create-ui-generator.ts +185 -95
  71. package/src/evaluation/axis-checks/checks/state-payload.ts +29 -4
  72. package/src/evaluation/types-public.ts +94 -8
  73. package/src/harness/check/runtime-render/adapter.ts +223 -58
  74. package/src/harness/check/runtime-render/index.ts +75 -2
  75. package/src/harness/check/runtime-render/render-check-host.ts +111 -26
  76. package/src/harness/check/runtime-render/render-check-worker.ts +83 -29
  77. package/src/harness/check/runtime-render/render-check.ts +173 -117
  78. package/src/harness/coding/generate-task-runner.ts +57 -4
  79. package/src/harness/coding/init-session.ts +13 -0
  80. package/src/harness/coding/run-eval-round.ts +238 -13
  81. package/src/harness/llm-router.ts +3 -3
  82. package/src/harness/policy.ts +11 -0
  83. package/src/harness/primitive-slice.ts +104 -0
  84. package/src/harness/types-public.ts +17 -5
  85. package/src/index.ts +4 -0
  86. package/src/policy.ts +7 -4
  87. package/src/tools/get-primitives-ts.ts +1 -1
  88. package/src/tools/render-check-worker.ts +74 -23
  89. package/src/validation/primitives.ts +1 -1
  90. package/dist/render-check-C0CqVceF.d.ts +0 -87
@@ -1,87 +0,0 @@
1
- import { JsonObject, DataContract } from '@ggui-ai/protocol';
2
-
3
- /**
4
- * 3-state outcome. Internal to runtime-render.
5
- * The adapter maps this to existing EvalIssue shapes:
6
- * verified → no issue
7
- * failed → fail
8
- * unverified → warn
9
- * skipped → no issue
10
- */
11
- type CheckOutcome = "verified" | "failed" | "unverified" | "skipped";
12
- interface RenderCheckIssue {
13
- readonly check: "render-no-throw" | "action-wiring" | "selection-identity" | "prop-coverage" | "prop-sensitivity" | "stream-rerender" | "optional-props-omitted";
14
- readonly outcome: CheckOutcome;
15
- readonly subject?: string;
16
- readonly reason: string;
17
- /** Optional element description ("button[aria-label='Save']") for action-wiring failures. */
18
- readonly elementHint?: string;
19
- /**
20
- * Diagnostic context from probe + AST analysis. Populated for richer feedback
21
- * to the coding agent (which native props the callback flows into, what the
22
- * probe observed firing, etc.).
23
- */
24
- readonly diagnostics?: {
25
- readonly observedJsxElements?: readonly string[];
26
- readonly observedNativeProps?: readonly string[];
27
- readonly observedCustomProps?: readonly string[];
28
- /** For action-wiring: which actions DID fire from probe clicks (helps surface mis-wiring). */
29
- readonly actionsFiredFromClicks?: readonly string[];
30
- /** Surfaced to the agent: prop sourceTool hints from the contract (only if present). */
31
- readonly sourceToolHints?: Readonly<Record<string, string>>;
32
- /**
33
- * For action-wiring (ggui#1187): what input priming did before the
34
- * synthetic dispatch — how many controls it filled, or why it could not
35
- * run. A "did not dispatch it" on an input-gated action reads differently
36
- * beside `{ primed: 0 }` or `{ error }` than beside `{ primed: 1 }`.
37
- */
38
- readonly inputPriming?: InputPrimingDiagnostic;
39
- };
40
- }
41
- /**
42
- * Outcome of `primeInputs` before the action-wiring probe (ggui#1187). A
43
- * priming failure never aborts the check — it is recorded here, on every
44
- * action-wiring issue, so it is visible in the feedback instead of vanishing.
45
- */
46
- type InputPrimingDiagnostic = {
47
- readonly primed: number;
48
- } | {
49
- readonly error: string;
50
- };
51
- interface RenderCheckResult {
52
- readonly ok: boolean;
53
- readonly issues: readonly RenderCheckIssue[];
54
- readonly stats: {
55
- readonly actionsChecked: number;
56
- readonly streamsChecked: number;
57
- readonly renderMs: number;
58
- };
59
- }
60
- interface RunRenderCheckInput {
61
- readonly sourceCode: string;
62
- readonly mockupProps: JsonObject;
63
- readonly contract?: DataContract;
64
- }
65
- /**
66
- * Run the in-loop runtime render check.
67
- *
68
- * Isolation dispatcher (#592): when the CALLING environment already
69
- * owns a DOM (`window` + `document` on `globalThis` — e.g. a vitest
70
- * `happy-dom` environment, where the environment owner installed the
71
- * globals deliberately), the check runs in-process exactly as before.
72
- * In a plain Node process it runs in an ISOLATED SUBPROCESS
73
- * (`render-check-host.ts` → `render-check-worker.ts`), because the
74
- * in-process path installs happy-dom globals on `globalThis`
75
- * process-wide — a TOCTOU hazard for anything that sniffs `window`
76
- * concurrently (provider SDKs throw "browser-like environment" at
77
- * client construction; two overlapping checks corrupt each other's
78
- * teardown). See #592 for the measured incident (4 bench cells hard-
79
- * failed on the 2026-08-19 run).
80
- *
81
- * The host is loaded lazily so the worker bundle (which imports this
82
- * module for `runRenderCheckInProcess`) never drags in the sandbox
83
- * spawn machinery.
84
- */
85
- declare function runRenderCheck(input: RunRenderCheckInput): Promise<RenderCheckResult>;
86
-
87
- export { type RenderCheckIssue as R, type RenderCheckResult as a, runRenderCheck as r };