@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,451 +0,0 @@
1
- import { GenerationRuntimeProbeStatus, GenerationRuntimeProbeOutcome } from '@ggui-ai/mcp-server-core';
2
- import { C as CanvasClass, D as DesignMode } from './design-mode-DLufhrNp.js';
3
- import { DataContract } from '@ggui-ai/protocol';
4
- import { C as Classification, A as AxisVector } from './axes-CzLEMDeB.js';
5
- import { A as AxisKey } from './types-BOvHNG7K.js';
6
-
7
- type Priority = "P0" | "P1" | "P2";
8
-
9
- type EvalTier = 0 | 1 | 2;
10
- type EvalOutcome = "fail" | "warn" | "pass";
11
- type EvalCategory = "compile" | "security" | "contract" | "types" | "imports" | "tokens" | "mode" | "functionality" | "crash" | "interactivity" | "accessibility" | "layout" | "loading" | "visual";
12
- interface EvalIssue {
13
- tier: EvalTier;
14
- result: EvalOutcome;
15
- category: EvalCategory;
16
- /**
17
- * Priority tier — threaded through to the retry formatter so the LLM can
18
- * rank its next patch against the prompt's P0/P1/P2 priority schema.
19
- * Derived from (category, result) via {@link priorityForIssue} when not
20
- * explicitly set. Optional on construction; check-runners typically
21
- * populate it before returning.
22
- */
23
- priority?: Priority;
24
- subcategory?: string;
25
- severity?: "critical" | "major";
26
- description: string;
27
- fix: string;
28
- line?: number;
29
- }
30
- /**
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.
35
- *
36
- * - `ran` — probe executed; its findings (possibly none) are
37
- * in the issue stream under `runtime:*` subcategories.
38
- * - `infra-skipped` — probe could NOT execute (environment failure:
39
- * happy-dom load, user-event document capture,
40
- * ESM/CJS interop). Carries ZERO probe evidence;
41
- * consumers MUST NOT count it as a pass.
42
- * - `not-applicable`— nothing to probe (no compiled code, no contract
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.
52
- */
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
- }
82
- /**
83
- * Probe execution meta stamped onto an `EvalResult` at the exit-decision
84
- * points that invoke the probe. Absence of this field means the eval
85
- * path never reached a probe invocation at all — consumers treat that
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.
110
- */
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
- };
136
- /**
137
- * Per-criterion execution status — three-valued so "the criterion
138
- * silently produced no verdict" is never conflated with "the criterion
139
- * ran clean", and neither is conflated with "not evaluated by design".
140
- * Same doctrine and vocabulary family as `RuntimeProbeStatus` above.
141
- *
142
- * - `ran` — the LLM call completed and returned a verdict
143
- * for this criterion; its findings (possibly
144
- * none) are in `issues`.
145
- * - `skipped` — the call errored or returned no tool call. The
146
- * criterion carries ZERO evidence; the evaluator
147
- * fail-opens it into `pass` to avoid blocking
148
- * generation on flaky LLM calls, so consumers
149
- * MUST consult this field before treating `pass`
150
- * membership as a verdict. Counts AGAINST
151
- * coverage.
152
- * - `not-applicable` — the evaluator was bypassed by design for this
153
- * cell (e.g. the same-image low-risk bypass:
154
- * axis checks clean, tier-1/2 never invoked).
155
- * `reason` names the bypass. Excluded from
156
- * coverage denominators — it is neither evidence
157
- * nor a silent absence.
158
- */
159
- type CriterionRunStatus = "ran" | "skipped" | "not-applicable";
160
- /** Coverage row for one evaluation criterion of one eval run. */
161
- interface CriterionCoverage {
162
- readonly criterion: string;
163
- readonly tier: 1 | 2;
164
- readonly status: CriterionRunStatus;
165
- /** Populated for `skipped` / `not-applicable` — why no verdict. */
166
- readonly reason?: string;
167
- }
168
- /**
169
- * Coverage of the screenshot JUDGE leg for one eval round (ggui#1221) — a
170
- * different surface from the `visual` CRITERION in `criteriaCoverage` (the
171
- * LLM evaluator's read of the source). `ran` = a frame was captured and
172
- * judged; `skipped` = the leg was configured but produced no verdict
173
- * (no browser, a launch or in-page failure, an unbundlable component, an
174
- * unparsable judge answer) with `reason` naming why; `not-applicable` =
175
- * the round had no visual leg configured. Before this row a skipped leg
176
- * left NO trace on the result — `{ issues: [] }` read exactly like a
177
- * clean run, and every bootstrap mint on a browserless runtime "passed"
178
- * its visual round that way.
179
- */
180
- interface VisualCoverage {
181
- readonly status: CriterionRunStatus;
182
- /** Populated for `skipped` / `not-applicable` — why no verdict. */
183
- readonly reason?: string;
184
- }
185
- /**
186
- * The static criteria `runLLMEvaluation` runs, in stamp order — the
187
- * ONE list both the evaluator's coverage stamp and the harness's
188
- * bypass stamp derive from, so the two can never disagree on the set.
189
- * Tier 1 = binary pass/fail gates; tier 2 = fail/warn/pass quality.
190
- */
191
- declare const LLM_EVAL_STATIC_CRITERIA: ReadonlyArray<{
192
- readonly criterion: string;
193
- readonly tier: 1 | 2;
194
- }>;
195
- /**
196
- * Coverage rows for a cell where the evaluator was BYPASSED BY DESIGN
197
- * (never invoked) — one `not-applicable` row per static criterion, all
198
- * carrying `reason`. Harness exits that skip tier-1/2 evaluation stamp
199
- * this so the cell is neither a silent absence (field missing) nor
200
- * evidence. Same shape contract as `runLLMEvaluation`'s stamp: always
201
- * every criterion. Lives here (not in llm-evaluator) because the bypass
202
- * exit runs before the evaluator module is lazily loaded.
203
- */
204
- declare function notApplicableCoverage(reason: string): CriterionCoverage[];
205
- /** One contract-feedback round (ggui#1261): what bought it, and the source it was fed back on. */
206
- interface ContractFeedbackRecord {
207
- /** The exit-probe issue subcategories that bought the round, e.g. `runtime:prop-sensitivity:currentUser`. */
208
- readonly firedOn: readonly string[];
209
- /** The component source as it stood when the model was told — the round's BEFORE. */
210
- readonly sourceBefore: string;
211
- }
212
- interface EvalResult {
213
- issues: EvalIssue[];
214
- pass: string[];
215
- /**
216
- * Per-criterion coverage for this eval run — one row per static
217
- * criterion, ALWAYS all of them when present. Stamped by
218
- * `runLLMEvaluation` (`ran` / `skipped`) and by the harness on
219
- * evaluator-bypass exits (`not-applicable` + reason). The harness
220
- * carries it unchanged through every later re-stamp of this result.
221
- * Absent = coverage UNKNOWN (paths that predate the instrument, e.g.
222
- * `parseEvalResponse` replays) — never assume `ran`, never assume
223
- * bypass.
224
- */
225
- criteriaCoverage?: CriterionCoverage[];
226
- /**
227
- * Runtime-render probe execution meta. Stamped by the exit-decision
228
- * probe runner; absent on eval paths that never invoke the probe.
229
- */
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;
238
- /**
239
- * The contract-feedback round, when one fired this generation (ggui#1261):
240
- * which exit-probe findings bought it and the source as it stood when the
241
- * model was told. `runtimeProbe` and the `runtime:*` issues on this result
242
- * are the probe's verdict AFTER that round; `sourceBefore` beside the final
243
- * source is the round's before/after. Absent when no such round fired.
244
- */
245
- contractFeedback?: ContractFeedbackRecord;
246
- /**
247
- * Per-canvas visual verdicts. Stamped by the harness ONLY when the
248
- * visual leg ran with `visualEvaluation.canvases` set (arm-neutral —
249
- * the same judge in every design mode); absent on the single-shot
250
- * visual path and whenever the visual leg did not run. PNGs stay on
251
- * `runVisualEvaluation`'s own result (`VisualEvaluationResult.canvases[*].screenshotPng`),
252
- * never here — this object is serialized into reports.
253
- */
254
- visual?: VisualEvalSummary;
255
- /**
256
- * Whether the screenshot judge leg ran, was skipped (with the reason) or
257
- * was not configured — ALWAYS stamped by the harness's eval round
258
- * (ggui#1221), so a consumer can tell a clean visual run from a leg
259
- * that silently could not run. See {@link VisualCoverage}.
260
- */
261
- visualCoverage?: VisualCoverage;
262
- }
263
- /** One canvas's visual verdict, PNG-free — see `EvalResult.visual`. */
264
- /**
265
- * How one canvas's `score` was reached (ggui#1072): `k` vision calls on the
266
- * SAME captured frame, aggregated by `rule`. Always present — `k: 1` ⇒
267
- * `samples: [score]`, `sigma: 0`, `notes: [critique]` — so one shape serves
268
- * a single judgement and a median of many. `samples`/`notes` carry only the
269
- * calls the judge could parse (in call order); `k` stays the requested count,
270
- * so a short `samples` is visible on the row rather than filled in.
271
- */
272
- interface CanvasJudgeRecord {
273
- readonly k: number;
274
- readonly rule: 'median';
275
- readonly samples: number[];
276
- /** Population σ of `samples` (0 when one sample). */
277
- readonly sigma: number;
278
- /** The judge's per-canvas critique per sample — the words beside a swing. */
279
- readonly notes: string[];
280
- }
281
- interface CanvasVisualSummary {
282
- canvas: CanvasClass;
283
- viewport: {
284
- width: number;
285
- height: number;
286
- };
287
- /** The judge's weighted score at this canvas (0-100). */
288
- score: number;
289
- /** `score >= passThreshold`, and on the inline card: no overflow (ggui#1027). */
290
- passed: boolean;
291
- /** The document's scroll height at this canvas, CSS px; `null` when unmeasurable (ggui#1027). */
292
- contentHeight: number | null;
293
- /** `contentHeight > viewport.height` — measured on every canvas, judged per `canvasFitPolicy`. */
294
- overflow: boolean;
295
- /** How `score` was reached — always present (ggui#1072). */
296
- judge: CanvasJudgeRecord;
297
- /**
298
- * How the judge composed the mount (ggui#1100): `'fill'` on every
299
- * fullscreen canvas — the served runtime's fit, the root stretched to
300
- * the frame; absent on the inline card, which keeps its natural height.
301
- */
302
- fit?: 'fill';
303
- }
304
- /**
305
- * ggui#1195 — the fit reading on the canvas whose policy FAILS an overflow
306
- * (the inline chat card): the box it was judged at (`ceiling` — the order's
307
- * declared viewport when one was carried, else the class box), whether that
308
- * box was declared, and how many px of content sit below it (0 = fits).
309
- * Present only when such a canvas was judged with a measurable height, so
310
- * the bar and the ledger read one number for "does the hello fit".
311
- */
312
- interface VisualFitStamp {
313
- readonly canvas: CanvasClass;
314
- readonly ceiling: {
315
- readonly width: number;
316
- readonly height: number;
317
- };
318
- readonly declared: boolean;
319
- readonly overflowPx: number;
320
- }
321
- /** The visual leg's per-canvas summary — see `EvalResult.visual`. */
322
- interface VisualEvalSummary {
323
- /** Mean of the canvas scores (rounded). */
324
- score: number;
325
- /** Every canvas passed. */
326
- passed: boolean;
327
- canvases: CanvasVisualSummary[];
328
- /** ggui#1195 — see {@link VisualFitStamp}; absent when no fail-policy canvas was judged. */
329
- fit?: VisualFitStamp;
330
- /** The design tree the judge painted with (ggui#1042): `src` + `srcSha256` — `design@judge`. */
331
- design?: {
332
- readonly src: string;
333
- readonly srcSha256: string;
334
- };
335
- /** The mode the judge's tokens were composed in, when the caller said (ggui#1076). */
336
- themeMode?: 'light' | 'dark';
337
- }
338
- type QualityMode = "fast" | "auto-improve" | "high-quality";
339
- interface QualityConfig {
340
- quality: QualityMode;
341
- visualEval: boolean;
342
- maxCostPerGeneration: number;
343
- model?: {
344
- provider?: string;
345
- model?: string;
346
- };
347
- }
348
- declare const DEFAULT_QUALITY_CONFIG: QualityConfig;
349
-
350
- interface AxisCheckInput {
351
- sourceCode: string;
352
- compiledCode: string | null;
353
- contract?: DataContract;
354
- originalPrompt: string;
355
- /** Full classification — checks may read sibling axes. */
356
- classification: Classification;
357
- /**
358
- * Which triad produced the source. Checks that assert a design-package
359
- * component (e.g. `layout.multi_step.stepper_adopted`) read it and
360
- * stand down in `free` mode, where the primitive is optional. Absent
361
- * means `constrained`.
362
- */
363
- designMode?: DesignMode;
364
- /**
365
- * The rendering canvas the source is judged FOR (ggui#1117). A width cap on
366
- * the outermost element is a defect on a fullscreen canvas and a no-op in a
367
- * chat bubble, so a check that reads width must know the surface. Populated
368
- * where the harness is built (`Harness.canvas`); ABSENT for callers with no
369
- * rendering context — a check handles `undefined`, it never assumes a
370
- * default (a silent `lg` would be the same guess with a nicer face).
371
- */
372
- canvas?: CanvasClass;
373
- }
374
- /**
375
- * A gated check. Runs only when the classification's axis value matches
376
- * one of the gate's accepted values. Multiple gates (implicit AND) support
377
- * cross-axis combinations.
378
- */
379
- interface AxisCheck {
380
- /** Stable id used in issue subcategories. */
381
- id: string;
382
- /** Primary axis this check gates on. */
383
- axis: AxisKey;
384
- /** Which values of that axis activate the check. */
385
- values: readonly string[];
386
- /** Optional extra gate on a sibling axis (e.g., only when state=merge AND writes=per-item). */
387
- and?: {
388
- axis: AxisKey;
389
- values: readonly string[];
390
- };
391
- /** Execute the check and emit zero or more issues. */
392
- run(input: AxisCheckInput): EvalIssue[];
393
- }
394
- /**
395
- * Whether a check's gate(s) match the given axis vector. Pure function,
396
- * no issue emission.
397
- */
398
- declare function matches(vector: AxisVector, check: AxisCheck): boolean;
399
- /**
400
- * Map a tier-0 issue category to the canonical P0/P1/P2 priority.
401
- *
402
- * Sourced from the criteria priority assignments:
403
- * - P0 (must): compile, security, imports, contract, types, mode
404
- * - P1 (safety): tokens, crash, functionality
405
- * - P2 (quality): interactivity, accessibility, layout, loading, visual
406
- */
407
- declare function priorityForIssue(category: EvalCategory): Priority;
408
- /** Whether any issue blocks shipping (has result = 'fail'). */
409
- declare function isBlocked(result: EvalResult): boolean;
410
- /**
411
- * Return the issues the agent should act on, depending on quality mode.
412
- * - fast: only fails (blocking issues)
413
- * - auto-improve / high-quality: fails + warns
414
- */
415
- declare function getActionableIssues(result: EvalResult, mode: QualityMode): EvalIssue[];
416
- interface EvalCriterion {
417
- /** Unique identifier matching the eval tool name (e.g., 'functionality') */
418
- id: string;
419
- /** Human-readable name shown to both agents */
420
- name: string;
421
- /** Priority tier — P0 must, P1 should, P2 nice */
422
- priority: Priority;
423
- /** What the coding agent should DO to satisfy this criterion */
424
- codingGuidance: string;
425
- /** What the eval agent should CHECK — the evaluation prompt */
426
- evalInstruction: string;
427
- /** Tier 0 = programmatic, Tier 1 = LLM critical, Tier 2 = LLM quality */
428
- tier: 0 | 1 | 2;
429
- /** Eval outcome when this criterion fails */
430
- failOutcome: "fail" | "warn";
431
- }
432
- declare const CRITERIA: readonly EvalCriterion[];
433
- /**
434
- * The criteria registry for a design mode. `constrained` IS `CRITERIA`
435
- * (same array, byte-identical summary); `free` swaps in the two
436
- * overrides above by id, preserving order.
437
- */
438
- declare function criteriaFor(designMode?: DesignMode): readonly EvalCriterion[];
439
- /** Get all criteria for a specific priority level */
440
- declare function getCriteriaByPriority(priority: Priority, designMode?: DesignMode): EvalCriterion[];
441
- /** Get a specific criterion by ID */
442
- declare function getCriterionById(id: string, designMode?: DesignMode): EvalCriterion | undefined;
443
- /** Get all LLM-evaluated criteria (tier 1 + 2) */
444
- declare function getLLMCriteria(designMode?: DesignMode): EvalCriterion[];
445
- /**
446
- * Build the coding agent's criteria summary from the single source of truth.
447
- * Grouped by priority for the P0→P1→P2 hierarchy.
448
- */
449
- declare function buildCodingCriteriaSummary(designMode?: DesignMode): string;
450
-
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 };