@ggui-ai/ui-gen 0.20.0 → 0.22.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 (93) hide show
  1. package/dist/adapters/base.d.ts +7 -0
  2. package/dist/adapters/base.js +1 -0
  3. package/dist/adapters/base.js.map +1 -1
  4. package/dist/adapters/generation-dispatch.d.ts +17 -3
  5. package/dist/adapters/generation-dispatch.js +1078 -3464
  6. package/dist/adapters/generation-dispatch.js.map +1 -1
  7. package/dist/adapters/index.js +60 -3
  8. package/dist/adapters/index.js.map +1 -1
  9. package/dist/advanced/index.d.ts +4 -4
  10. package/dist/advanced/index.js +1346 -3557
  11. package/dist/advanced/index.js.map +1 -1
  12. package/dist/blueprint-validator.js +10 -3
  13. package/dist/blueprint-validator.js.map +1 -1
  14. package/dist/boilerplate.js +2 -2
  15. package/dist/boilerplate.js.map +1 -1
  16. package/dist/check/index.d.ts +1 -1
  17. package/dist/check/index.js.map +1 -1
  18. package/dist/{create-ui-generator-CxPvudbs.d.ts → create-ui-generator-BEkzEtNz.d.ts} +2 -2
  19. package/dist/{dispatch-N8wdNOX-.d.ts → dispatch-DJNpQ7DI.d.ts} +1 -1
  20. package/dist/evaluation/axis-checks/index.d.ts +3 -3
  21. package/dist/evaluation/axis-checks/index.js.map +1 -1
  22. package/dist/evaluation/axis-checks/registry.d.ts +1 -1
  23. package/dist/evaluation/index.d.ts +38 -6
  24. package/dist/evaluation/index.js +670 -3374
  25. package/dist/evaluation/index.js.map +1 -1
  26. package/dist/harness/check/runtime-render/index.d.ts +2 -2
  27. package/dist/harness/check/runtime-render/index.js +10 -3
  28. package/dist/harness/check/runtime-render/index.js.map +1 -1
  29. package/dist/harness/check/runtime-render/render-check-worker.js +5 -3
  30. package/dist/harness/check/runtime-render/render-check-worker.js.map +1 -1
  31. package/dist/harness/index.d.ts +2 -2
  32. package/dist/harness/index.js +587 -30
  33. package/dist/harness/index.js.map +1 -1
  34. package/dist/harness/llm-trace-sink.d.ts +7 -1
  35. package/dist/harness/llm-trace-sink.js.map +1 -1
  36. package/dist/harness/prompts.js +1 -1
  37. package/dist/harness/prompts.js.map +1 -1
  38. package/dist/harness/result-types.d.ts +15 -2
  39. package/dist/harness/result-types.js.map +1 -1
  40. package/dist/harness/runtime.d.ts +11 -2
  41. package/dist/harness/runtime.js +3 -3
  42. package/dist/harness/runtime.js.map +1 -1
  43. package/dist/harness/types-public.d.ts +1 -1
  44. package/dist/harness/types-public.js +2 -2
  45. package/dist/harness/types-public.js.map +1 -1
  46. package/dist/harness/validator-trace-sink.d.ts +1 -1
  47. package/dist/index.d.ts +23 -7
  48. package/dist/index.js +1346 -3557
  49. package/dist/index.js.map +1 -1
  50. package/dist/{llm-router-D7fjBhtr.d.ts → llm-router-DwwUK1bz.d.ts} +16 -3
  51. package/dist/patch.d.ts +1 -1
  52. package/dist/providers/index.js +5 -4
  53. package/dist/providers/index.js.map +1 -1
  54. package/dist/{render-check-WfOVO9kU.d.ts → render-check-C0CqVceF.d.ts} +17 -0
  55. package/dist/{types-public-DKR_h70H.d.ts → types-public-mM_-1Yk3.d.ts} +59 -1
  56. package/dist/validation/index.d.ts +1 -1
  57. package/dist/validation/index.js +1 -1
  58. package/dist/validation/index.js.map +1 -1
  59. package/dist/workflows.d.ts +1 -1
  60. package/package.json +16 -12
  61. package/src/adapters/base.ts +8 -0
  62. package/src/adapters/claude/claude-code-login.ts +128 -0
  63. package/src/adapters/claude/sdk.ts +9 -1
  64. package/src/adapters/generation-dispatch.ts +19 -2
  65. package/src/adapters/openai/tokens.ts +18 -0
  66. package/src/adapters/provider-router.ts +28 -0
  67. package/src/boilerplate/generate.ts +19 -4
  68. package/src/boilerplate/hard-sections.ts +1 -1
  69. package/src/boilerplate/templates/layouts/chat-mobile.tsx.tmpl +7 -3
  70. package/src/boilerplate/templates/layouts/chat-universal.tsx.tmpl +7 -3
  71. package/src/contract-context.ts +1 -1
  72. package/src/create-ui-generator.ts +49 -10
  73. package/src/evaluation/design-identity.ts +16 -5
  74. package/src/evaluation/index.ts +1 -0
  75. package/src/evaluation/llm-evaluator.ts +40 -13
  76. package/src/evaluation/types-public.ts +58 -0
  77. package/src/evaluation/visual-evaluator.ts +240 -30
  78. package/src/generator-build.ts +158 -0
  79. package/src/harness/check/runtime-render/adapter.ts +9 -0
  80. package/src/harness/check/runtime-render/render-check.ts +26 -5
  81. package/src/harness/claude-code-login-query.ts +529 -0
  82. package/src/harness/coding/assemble-result.ts +18 -2
  83. package/src/harness/coding/generate-task-runner.ts +75 -36
  84. package/src/harness/coding/run-coding-turn.ts +9 -0
  85. package/src/harness/coding/run-eval-round.ts +338 -38
  86. package/src/harness/enforced-coding.ts +20 -0
  87. package/src/harness/llm-router.ts +390 -55
  88. package/src/harness/llm-trace-sink.ts +7 -1
  89. package/src/harness/result-types.ts +14 -0
  90. package/src/harness/runtime.ts +6 -0
  91. package/src/index.ts +2 -1
  92. package/src/providers/openai.ts +31 -19
  93. package/src/validation/primitives.ts +1 -1
@@ -83,6 +83,23 @@ interface CriterionCoverage {
83
83
  /** Populated for `skipped` / `not-applicable` — why no verdict. */
84
84
  readonly reason?: string;
85
85
  }
86
+ /**
87
+ * Coverage of the screenshot JUDGE leg for one eval round (ggui#1221) — a
88
+ * different surface from the `visual` CRITERION in `criteriaCoverage` (the
89
+ * LLM evaluator's read of the source). `ran` = a frame was captured and
90
+ * judged; `skipped` = the leg was configured but produced no verdict
91
+ * (no browser, a launch or in-page failure, an unbundlable component, an
92
+ * unparsable judge answer) with `reason` naming why; `not-applicable` =
93
+ * the round had no visual leg configured. Before this row a skipped leg
94
+ * left NO trace on the result — `{ issues: [] }` read exactly like a
95
+ * clean run, and every bootstrap mint on a browserless runtime "passed"
96
+ * its visual round that way.
97
+ */
98
+ interface VisualCoverage {
99
+ readonly status: CriterionRunStatus;
100
+ /** Populated for `skipped` / `not-applicable` — why no verdict. */
101
+ readonly reason?: string;
102
+ }
86
103
  /**
87
104
  * The static criteria `runLLMEvaluation` runs, in stamp order — the
88
105
  * ONE list both the evaluator's coverage stamp and the harness's
@@ -103,6 +120,13 @@ declare const LLM_EVAL_STATIC_CRITERIA: ReadonlyArray<{
103
120
  * exit runs before the evaluator module is lazily loaded.
104
121
  */
105
122
  declare function notApplicableCoverage(reason: string): CriterionCoverage[];
123
+ /** One contract-feedback round (ggui#1261): what bought it, and the source it was fed back on. */
124
+ interface ContractFeedbackRecord {
125
+ /** The exit-probe issue subcategories that bought the round, e.g. `runtime:prop-sensitivity:currentUser`. */
126
+ readonly firedOn: readonly string[];
127
+ /** The component source as it stood when the model was told — the round's BEFORE. */
128
+ readonly sourceBefore: string;
129
+ }
106
130
  interface EvalResult {
107
131
  issues: EvalIssue[];
108
132
  pass: string[];
@@ -122,6 +146,14 @@ interface EvalResult {
122
146
  * probe runner; absent on eval paths that never invoke the probe.
123
147
  */
124
148
  runtimeProbe?: RuntimeProbeMeta;
149
+ /**
150
+ * The contract-feedback round, when one fired this generation (ggui#1261):
151
+ * which exit-probe findings bought it and the source as it stood when the
152
+ * model was told. `runtimeProbe` and the `runtime:*` issues on this result
153
+ * are the probe's verdict AFTER that round; `sourceBefore` beside the final
154
+ * source is the round's before/after. Absent when no such round fired.
155
+ */
156
+ contractFeedback?: ContractFeedbackRecord;
125
157
  /**
126
158
  * Per-canvas visual verdicts. Stamped by the harness ONLY when the
127
159
  * visual leg ran with `visualEvaluation.canvases` set (arm-neutral —
@@ -131,6 +163,13 @@ interface EvalResult {
131
163
  * never here — this object is serialized into reports.
132
164
  */
133
165
  visual?: VisualEvalSummary;
166
+ /**
167
+ * Whether the screenshot judge leg ran, was skipped (with the reason) or
168
+ * was not configured — ALWAYS stamped by the harness's eval round
169
+ * (ggui#1221), so a consumer can tell a clean visual run from a leg
170
+ * that silently could not run. See {@link VisualCoverage}.
171
+ */
172
+ visualCoverage?: VisualCoverage;
134
173
  }
135
174
  /** One canvas's visual verdict, PNG-free — see `EvalResult.visual`. */
136
175
  /**
@@ -173,6 +212,23 @@ interface CanvasVisualSummary {
173
212
  */
174
213
  fit?: 'fill';
175
214
  }
215
+ /**
216
+ * ggui#1195 — the fit reading on the canvas whose policy FAILS an overflow
217
+ * (the inline chat card): the box it was judged at (`ceiling` — the order's
218
+ * declared viewport when one was carried, else the class box), whether that
219
+ * box was declared, and how many px of content sit below it (0 = fits).
220
+ * Present only when such a canvas was judged with a measurable height, so
221
+ * the bar and the ledger read one number for "does the hello fit".
222
+ */
223
+ interface VisualFitStamp {
224
+ readonly canvas: CanvasClass;
225
+ readonly ceiling: {
226
+ readonly width: number;
227
+ readonly height: number;
228
+ };
229
+ readonly declared: boolean;
230
+ readonly overflowPx: number;
231
+ }
176
232
  /** The visual leg's per-canvas summary — see `EvalResult.visual`. */
177
233
  interface VisualEvalSummary {
178
234
  /** Mean of the canvas scores (rounded). */
@@ -180,6 +236,8 @@ interface VisualEvalSummary {
180
236
  /** Every canvas passed. */
181
237
  passed: boolean;
182
238
  canvases: CanvasVisualSummary[];
239
+ /** ggui#1195 — see {@link VisualFitStamp}; absent when no fail-policy canvas was judged. */
240
+ fit?: VisualFitStamp;
183
241
  /** The design tree the judge painted with (ggui#1042): `src` + `srcSha256` — `design@judge`. */
184
242
  design?: {
185
243
  readonly src: string;
@@ -301,4 +359,4 @@ declare function getLLMCriteria(designMode?: DesignMode): EvalCriterion[];
301
359
  */
302
360
  declare function buildCodingCriteriaSummary(designMode?: DesignMode): string;
303
361
 
304
- 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, CRITERIA as d, type CanvasVisualSummary as e, type CriterionCoverage as f, type CriterionRunStatus as g, type EvalCategory as h, type EvalCriterion as i, type EvalOutcome as j, type QualityMode as k, buildCodingCriteriaSummary as l, matches as m, criteriaFor as n, getActionableIssues as o, getCriteriaByPriority as p, getCriterionById as q, getLLMCriteria as r, isBlocked as s, notApplicableCoverage as t, priorityForIssue as u };
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 };