@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,3 +1,4 @@
1
+ import { GenerationRuntimeProbeStatus, GenerationRuntimeProbeOutcome } from '@ggui-ai/mcp-server-core';
1
2
  import { C as CanvasClass, D as DesignMode } from './design-mode-DLufhrNp.js';
2
3
  import { DataContract } from '@ggui-ai/protocol';
3
4
  import { C as Classification, A as AxisVector } from './axes-CzLEMDeB.js';
@@ -27,8 +28,10 @@ interface EvalIssue {
27
28
  line?: number;
28
29
  }
29
30
  /**
30
- * Runtime-render probe execution status — three-valued so "the probe
31
- * never ran" is never conflated with "the probe ran clean".
31
+ * Runtime-render probe execution status — four-valued so "the probe
32
+ * never ran" is never conflated with "the probe ran clean". ONE union: the
33
+ * same values a generation's metadata reports (`GenerationRuntimeProbeStatus`
34
+ * in `@ggui-ai/mcp-server-core`), declared there and named here.
32
35
  *
33
36
  * - `ran` — probe executed; its findings (possibly none) are
34
37
  * in the issue stream under `runtime:*` subcategories.
@@ -38,19 +41,98 @@ interface EvalIssue {
38
41
  * consumers MUST NOT count it as a pass.
39
42
  * - `not-applicable`— nothing to probe (no compiled code, no contract
40
43
  * surface, or no runtimeRender check configured).
44
+ * - `timed-out` — probe started but did not finish inside its
45
+ * wall-clock bound (ggui#1299). Carries ZERO
46
+ * evidence about the component: on a contended
47
+ * host an ordinary component crosses the bound.
48
+ * Consumers MUST NOT count it as a pass, and MUST
49
+ * NOT count it as a crash either. `elapsedMs` and
50
+ * `hostLoad` say how long it ran and how busy the
51
+ * host was, so a reader can tell the two cases apart.
41
52
  */
42
- type RuntimeProbeStatus = "ran" | "infra-skipped" | "not-applicable";
53
+ type RuntimeProbeStatus = GenerationRuntimeProbeStatus;
54
+ /**
55
+ * The host's 1-minute load average at a probe's start and end, beside the
56
+ * number of CPUs the process can use (ggui#1299). A load well above
57
+ * `cores` means the probe competed for CPU; a wall-clock bound crossed
58
+ * there says more about the host than about the component.
59
+ */
60
+ interface ProbeHostLoad {
61
+ readonly start: number;
62
+ readonly end: number;
63
+ readonly cores: number;
64
+ }
65
+ /**
66
+ * The engine's own fields on a probe's meta, beside the outcome a
67
+ * generation's metadata reports: why a probe did not finish, its render
68
+ * time, the host's load around it. Present on every arm of
69
+ * {@link RuntimeProbeMeta}; each is absent when the probe had nothing to
70
+ * say about it.
71
+ */
72
+ interface RuntimeProbeMetaDetail {
73
+ /** Populated for `infra-skipped` / `not-applicable` / `timed-out` — why the probe didn't finish. */
74
+ readonly reason?: string;
75
+ /** `ran` only: the check's own render time, inside `elapsedMs`. */
76
+ readonly renderMs?: number;
77
+ /** Host load around the probe, when it ran isolated (absent for an in-process probe). */
78
+ readonly hostLoad?: ProbeHostLoad;
79
+ /** Time the check waited for a probe slot before it started, ms; present only when > 0 (ggui#1380 C2b). */
80
+ readonly queuedMs?: number;
81
+ }
43
82
  /**
44
83
  * Probe execution meta stamped onto an `EvalResult` at the exit-decision
45
84
  * points that invoke the probe. Absence of this field means the eval
46
85
  * path never reached a probe invocation at all — consumers treat that
47
86
  * the same as not-run, never as a pass.
87
+ *
88
+ * ONE union with the generation metadata's probe outcome
89
+ * (`GenerationRuntimeProbeOutcome` in `@ggui-ai/mcp-server-core`, declared
90
+ * there and carried here with {@link RuntimeProbeMetaDetail} on every arm),
91
+ * so the round's stamp and the metadata's record cannot say different
92
+ * things (ggui#1380):
93
+ *
94
+ * - `ran` + `verdict: 'pass'` — the probe executed and no check failed;
95
+ * - `ran` + `verdict: 'fail'` — ANY check failed; `failChecks` lists the
96
+ * distinct check kinds that did (`RenderCheckKind`, the engine's name
97
+ * for the same union), never empty, in the order `RENDER_CHECK_KINDS`
98
+ * declares them, parsed from the probe's own
99
+ * `runtime:<check>[:<subject>]` issues;
100
+ * - `timed-out` / `infra-skipped` / `not-applicable` — no verdict, and the
101
+ * type carries none. `elapsedMs` (on every status that reached the
102
+ * check) and `hostLoad` say how long it ran and how busy the host was.
103
+ *
104
+ * The verdict and the repair trigger are two different questions. The
105
+ * verdict is `fail` on any failing check. The one repair turn a probe-only
106
+ * round buys fires on a `render-no-throw` fail the engine recognises
107
+ * (`isRecoverableRenderCrash`) and on nothing else: a `fail` verdict whose
108
+ * checks are `prop-sensitivity`, `action-wiring` or any other kind is
109
+ * recorded here and never fed back.
48
110
  */
49
- interface RuntimeProbeMeta {
50
- readonly status: RuntimeProbeStatus;
51
- /** Populated for `infra-skipped` / `not-applicable` — why the probe didn't run. */
52
- readonly reason?: string;
53
- }
111
+ type RuntimeProbeMeta = GenerationRuntimeProbeOutcome & RuntimeProbeMetaDetail;
112
+ /**
113
+ * The one repair turn a probe-only round buys (ggui#1380). A serving
114
+ * deployment that wires the runtime probe and configures no evaluator runs
115
+ * the probe once after the coding turns; a render crash the engine
116
+ * recognises buys exactly one repair turn, then one re-probe. This records
117
+ * what came of it:
118
+ * - `compiled: false` — the repair turn's code did not pass self-check, so
119
+ * no re-probe ran (there is no `after`) and the pre-repair card is the
120
+ * one served;
121
+ * - `compiled: true` — the re-probe ran and `after` is its whole meta:
122
+ * its status, its verdict when it ran, and the checks that still fail.
123
+ * Whether the crash class the turn was bought for is still there is
124
+ * `after.verdict === 'fail' && after.failChecks.includes('render-no-throw')`.
125
+ * The two arms are exclusive by type.
126
+ */
127
+ type RuntimeProbeRepair = {
128
+ readonly attempted: true;
129
+ readonly compiled: false;
130
+ readonly trigger?: never;
131
+ } | {
132
+ readonly attempted: true;
133
+ readonly compiled: true;
134
+ readonly trigger: RuntimeProbeMeta;
135
+ };
54
136
  /**
55
137
  * Per-criterion execution status — three-valued so "the criterion
56
138
  * silently produced no verdict" is never conflated with "the criterion
@@ -146,6 +228,13 @@ interface EvalResult {
146
228
  * probe runner; absent on eval paths that never invoke the probe.
147
229
  */
148
230
  runtimeProbe?: RuntimeProbeMeta;
231
+ /**
232
+ * The probe-only round's repair record (ggui#1380) — present only when a
233
+ * recoverable render crash bought the one repair turn. See
234
+ * {@link RuntimeProbeRepair}. `runtimeProbe` beside it is the re-probe's
235
+ * verdict when the repair compiled, else the pre-repair probe's.
236
+ */
237
+ runtimeProbeRepair?: RuntimeProbeRepair;
149
238
  /**
150
239
  * The contract-feedback round, when one fired this generation (ggui#1261):
151
240
  * which exit-probe findings bought it and the source as it stood when the
@@ -359,4 +448,4 @@ declare function getLLMCriteria(designMode?: DesignMode): EvalCriterion[];
359
448
  */
360
449
  declare function buildCodingCriteriaSummary(designMode?: DesignMode): string;
361
450
 
362
- export { type AxisCheck as A, type CanvasJudgeRecord as C, DEFAULT_QUALITY_CONFIG as D, type EvalIssue as E, LLM_EVAL_STATIC_CRITERIA as L, type Priority as P, type QualityConfig as Q, type RuntimeProbeStatus as R, type VisualEvalSummary as V, type AxisCheckInput as a, type EvalResult as b, type EvalTier as c, type VisualCoverage as d, CRITERIA as e, type CanvasVisualSummary as f, type ContractFeedbackRecord as g, type CriterionCoverage as h, type CriterionRunStatus as i, type EvalCategory as j, type EvalCriterion as k, type EvalOutcome as l, matches as m, type QualityMode as n, buildCodingCriteriaSummary as o, criteriaFor as p, getActionableIssues as q, getCriteriaByPriority as r, getCriterionById as s, getLLMCriteria as t, isBlocked as u, notApplicableCoverage as v, priorityForIssue as w };
451
+ export { type AxisCheck as A, type CanvasJudgeRecord as C, DEFAULT_QUALITY_CONFIG as D, type EvalIssue as E, LLM_EVAL_STATIC_CRITERIA as L, type ProbeHostLoad as P, type QualityConfig as Q, type RuntimeProbeStatus as R, type VisualEvalSummary as V, type AxisCheckInput as a, type EvalResult as b, type EvalTier as c, type VisualCoverage as d, CRITERIA as e, type CanvasVisualSummary as f, type ContractFeedbackRecord as g, type CriterionCoverage as h, type CriterionRunStatus as i, type EvalCategory as j, type EvalCriterion as k, type EvalOutcome as l, matches as m, type Priority as n, type QualityMode as o, buildCodingCriteriaSummary as p, criteriaFor as q, getActionableIssues as r, getCriteriaByPriority as s, getCriterionById as t, getLLMCriteria as u, isBlocked as v, notApplicableCoverage as w, priorityForIssue as x };