@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.
- package/README.md +2 -2
- package/dist/{adapter-Du7P_5Fx.d.ts → adapter-BJwn74rx.d.ts} +49 -1
- package/dist/adapters/generation-dispatch.d.ts +32 -7
- package/dist/adapters/generation-dispatch.js +1997 -216
- package/dist/adapters/generation-dispatch.js.map +1 -1
- package/dist/adapters/index.js +29 -6
- package/dist/adapters/index.js.map +1 -1
- package/dist/advanced/index.d.ts +15 -12
- package/dist/advanced/index.js +2013 -270
- package/dist/advanced/index.js.map +1 -1
- package/dist/{axes-CzLEMDeB.d.ts → axes-CKVCzR_x.d.ts} +1 -1
- package/dist/bank-Ctdp3FUA.d.ts +118 -0
- package/dist/blueprint-validator.js +416 -92
- package/dist/blueprint-validator.js.map +1 -1
- package/dist/boilerplate.d.ts +2 -2
- package/dist/boilerplate.js +34 -15
- package/dist/boilerplate.js.map +1 -1
- package/dist/check/index.d.ts +13 -5
- package/dist/check/index.js +56 -3
- package/dist/check/index.js.map +1 -1
- package/dist/classifier/index.d.ts +2 -2
- package/dist/compose.d.ts +2 -2
- package/dist/{create-ui-generator-GIhzx08x.d.ts → create-ui-generator-N4gRXpcL.d.ts} +11 -4
- package/dist/{design-mode-DLufhrNp.d.ts → design-mode-DGWN_Gkm.d.ts} +1 -1
- package/dist/{dispatch-BnAH56p4.d.ts → dispatch-BUoXRj_r.d.ts} +6 -4
- package/dist/evaluation/axis-checks/index.d.ts +7 -6
- package/dist/evaluation/axis-checks/index.js +90 -2
- package/dist/evaluation/axis-checks/index.js.map +1 -1
- package/dist/evaluation/axis-checks/registry.d.ts +6 -5
- package/dist/evaluation/axis-checks/registry.js +88 -1
- package/dist/evaluation/axis-checks/registry.js.map +1 -1
- package/dist/evaluation/index.d.ts +189 -344
- package/dist/evaluation/index.js +1272 -59
- package/dist/evaluation/index.js.map +1 -1
- package/dist/evaluation/types.d.ts +26 -1
- package/dist/evaluation/types.js.map +1 -1
- package/dist/fragments/index.d.ts +3 -3
- package/dist/{generate-9IeNT4ZY.d.ts → generate-tSO_shQ0.d.ts} +1 -1
- package/dist/harness/check/runtime-render/index.d.ts +7 -7
- package/dist/harness/check/runtime-render/index.js +416 -92
- package/dist/harness/check/runtime-render/index.js.map +1 -1
- package/dist/harness/check/runtime-render/render-check-worker.js +393 -88
- package/dist/harness/check/runtime-render/render-check-worker.js.map +1 -1
- package/dist/harness/index.d.ts +5 -6
- package/dist/harness/index.js +69 -20
- package/dist/harness/index.js.map +1 -1
- package/dist/harness/prompts.d.ts +2 -2
- package/dist/harness/prompts.js +10 -1
- package/dist/harness/prompts.js.map +1 -1
- package/dist/harness/result-types.d.ts +19 -5
- package/dist/harness/result-types.js.map +1 -1
- package/dist/harness/runtime.d.ts +21 -7
- package/dist/harness/runtime.js +36 -17
- package/dist/harness/runtime.js.map +1 -1
- package/dist/harness/types-public.d.ts +6 -4
- package/dist/harness/types-public.js +43 -18
- package/dist/harness/types-public.js.map +1 -1
- package/dist/harness/validator-trace-sink.d.ts +6 -5
- package/dist/hash.d.ts +1 -1
- package/dist/index.d.ts +64 -13
- package/dist/index.js +2023 -270
- package/dist/index.js.map +1 -1
- package/dist/patch.d.ts +5 -5
- package/dist/policy.d.ts +1 -1
- package/dist/{prompts-YU9piOgs.d.ts → prompts-BhNUuRoZ.d.ts} +1 -1
- package/dist/tools/get-primitives-ts.d.ts +1 -1
- package/dist/tools/get-primitives-ts.js +1 -1
- package/dist/tools/get-primitives-ts.js.map +1 -1
- package/dist/tools/render-check-worker.js +8 -1
- package/dist/tools/render-check-worker.js.map +1 -1
- package/dist/{types-BOvHNG7K.d.ts → types-Dh1s4K9j.d.ts} +1 -1
- package/dist/types-public-B7wn4ce5.d.ts +959 -0
- package/dist/validation/index.d.ts +1 -1
- package/dist/validation/index.js +1 -1
- package/dist/validation/index.js.map +1 -1
- package/dist/visual-evaluator-C9L-o6ap.d.ts +639 -0
- package/dist/workflows.d.ts +5 -5
- package/package.json +12 -12
- package/src/adapters/generation-dispatch.ts +38 -2
- package/src/adapters/tools.ts +2 -1
- package/src/boilerplate/free-design-prompt.ts +4 -4
- package/src/boilerplate/generate.ts +26 -1
- package/src/boilerplate/hard-sections.ts +14 -14
- package/src/boilerplate/system-prompt.ts +1 -1
- package/src/boilerplate/templates/layouts/chat-mobile.tsx.tmpl +3 -1
- package/src/boilerplate/templates/layouts/chat-universal.tsx.tmpl +3 -1
- package/src/boilerplate/templates/layouts/fullscreen-desktop.tsx.tmpl +3 -1
- package/src/boilerplate/templates/layouts/fullscreen-universal.tsx.tmpl +3 -1
- package/src/check/index.ts +1 -0
- package/src/check/run-tier0.ts +6 -3
- package/src/check/sample-props.ts +63 -0
- package/src/coding-agent/tools.ts +4 -1
- package/src/contract-context.ts +1 -1
- package/src/create-harness.ts +3 -3
- package/src/create-ui-generator.ts +20 -1
- package/src/evaluation/__fixtures__/png.ts +100 -0
- package/src/evaluation/axis-checks/checks/state-merge.ts +1 -1
- package/src/evaluation/axis-checks/checks/universal.ts +111 -0
- package/src/evaluation/axis-checks/dispatch.ts +4 -1
- package/src/evaluation/cost-tracker.ts +54 -6
- package/src/evaluation/criteria/bank.ts +85 -0
- package/src/evaluation/criteria/context.ts +52 -0
- package/src/evaluation/criteria/edge-probe.ts +286 -0
- package/src/evaluation/criteria/edge.ts +202 -0
- package/src/evaluation/criteria/resolve.ts +207 -0
- package/src/evaluation/criteria/select.ts +79 -0
- package/src/evaluation/index.ts +27 -0
- package/src/evaluation/ink-extent.ts +200 -0
- package/src/evaluation/judge-spend.ts +48 -0
- package/src/evaluation/theme-css.ts +12 -5
- package/src/evaluation/types-public.ts +221 -3
- package/src/evaluation/types.ts +19 -0
- package/src/evaluation/visual-evaluator.ts +853 -51
- package/src/harness/check/runtime-render/adapter.ts +18 -0
- package/src/harness/check/runtime-render/probe-pending.ts +111 -0
- package/src/harness/check/runtime-render/render-check-host.ts +10 -6
- package/src/harness/check/runtime-render/render-check-worker.ts +6 -3
- package/src/harness/check/runtime-render/render-check.ts +417 -133
- package/src/harness/check/runtime-render/walk.ts +200 -0
- package/src/harness/coding/assemble-result.ts +2 -0
- package/src/harness/coding/generate-task-runner.ts +30 -0
- package/src/harness/coding/init-session.ts +5 -3
- package/src/harness/coding/run-coding-turn.ts +12 -4
- package/src/harness/coding/run-eval-round.ts +82 -3
- package/src/harness/in-loop-evaluation.ts +39 -0
- package/src/harness/llm-router.ts +58 -1
- package/src/harness/result-types.ts +9 -0
- package/src/harness/runtime.ts +14 -0
- package/src/harness/types-public.ts +10 -1
- package/src/harness-tool-names.ts +38 -0
- package/src/index.ts +17 -0
- package/src/internal/verdict-line.ts +33 -0
- package/src/run-check.ts +2 -0
- package/src/taught-tokens.ts +32 -0
- package/src/tools/get-primitives-ts.ts +1 -1
- package/src/tools/get-wire.ts +1 -1
- package/src/tools/render-check-worker.ts +2 -1
- package/src/tools/render-check.ts +8 -67
- package/src/tools.ts +11 -1
- package/src/validation/primitives.ts +1 -1
- package/dist/llm-router-DwwUK1bz.d.ts +0 -265
- package/dist/types-public-Bk6d1WLN.d.ts +0 -451
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
import { C as CriteriaAnswerCounts } from '../types-public-B7wn4ce5.js';
|
|
2
|
+
import '@ggui-ai/protocol';
|
|
3
|
+
import '../llm.js';
|
|
4
|
+
import '@ggui-ai/mcp-server-core';
|
|
5
|
+
import '../design-mode-DGWN_Gkm.js';
|
|
6
|
+
import '../axes-CKVCzR_x.js';
|
|
7
|
+
import '../types-Dh1s4K9j.js';
|
|
8
|
+
|
|
1
9
|
/**
|
|
2
10
|
* Per-dimension quality scores from the evaluator (0-100 each).
|
|
3
11
|
*/
|
|
@@ -25,10 +33,23 @@ interface EvaluationIssue {
|
|
|
25
33
|
severity: 'critical' | 'major' | 'minor';
|
|
26
34
|
/** Suggested fix for the agent to apply */
|
|
27
35
|
fix: string;
|
|
36
|
+
/**
|
|
37
|
+
* Who produced it, on the visual leg (ggui#1545): `judge` for the model's own findings, `instrument` for a
|
|
38
|
+
* deterministic measurement (fit, overflow, blank). Absent on issues from other evaluators. The loop's
|
|
39
|
+
* `visualEvaluation.actOn` acts on `judge` findings only, so a new instrument check never joins the treatment
|
|
40
|
+
* by accident: it has to say it is a judge finding, and absence reads as "not acted on".
|
|
41
|
+
*/
|
|
42
|
+
origin?: 'judge' | 'instrument';
|
|
28
43
|
}
|
|
29
44
|
/**
|
|
30
45
|
* Result of a single evaluation round.
|
|
31
46
|
*/
|
|
47
|
+
/** One judge answer to a criterion (ggui#1436), as parsed — before the K-majority. */
|
|
48
|
+
interface CriteriaAnswer {
|
|
49
|
+
id: string;
|
|
50
|
+
verdict: 'pass' | 'fail' | 'n/a';
|
|
51
|
+
evidence: string;
|
|
52
|
+
}
|
|
32
53
|
interface EvaluationResult {
|
|
33
54
|
/** Whether the component passed the quality threshold */
|
|
34
55
|
passed: boolean;
|
|
@@ -44,6 +65,10 @@ interface EvaluationResult {
|
|
|
44
65
|
inputTokens?: number;
|
|
45
66
|
/** Output tokens consumed by the evaluation LLM call */
|
|
46
67
|
outputTokens?: number;
|
|
68
|
+
/** ggui#1436 — the judge's criteria answers, when the prompt asked for them; never part of the score. */
|
|
69
|
+
criteriaAnswers?: CriteriaAnswer[];
|
|
70
|
+
/** ggui#1687 — what the answer's criteria array held and what the parser dropped; set whenever the answer parsed. */
|
|
71
|
+
criteriaCounts?: CriteriaAnswerCounts;
|
|
47
72
|
}
|
|
48
73
|
/**
|
|
49
74
|
* Quality metadata attached to every generated component
|
|
@@ -103,4 +128,4 @@ interface EvaluationContext {
|
|
|
103
128
|
themeTokens: string;
|
|
104
129
|
}
|
|
105
130
|
|
|
106
|
-
export { DEFAULT_EVAL_MAX_ROUNDS, type DimensionScores, type EvaluationConfig, type EvaluationContext, type EvaluationIssue, type EvaluationResult, MAX_EVAL_ROUNDS_HARD_LIMIT, type QualityMetadata };
|
|
131
|
+
export { type CriteriaAnswer, DEFAULT_EVAL_MAX_ROUNDS, type DimensionScores, type EvaluationConfig, type EvaluationContext, type EvaluationIssue, type EvaluationResult, MAX_EVAL_ROUNDS_HARD_LIMIT, type QualityMetadata };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/evaluation/types.ts"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"sources":["../../src/evaluation/types.ts"],"names":[],"mappings":";AA4FO,IAAM,0BAAA,GAA6B;AAGnC,IAAM,uBAAA,GAA0B","file":"types.js","sourcesContent":["import type { CriteriaAnswerCounts } from './types-public.js';\n// packages/ui-gen/src/evaluation/types.ts\n\n/**\n * Per-dimension quality scores from the evaluator (0-100 each).\n */\nexport interface DimensionScores {\n /** How well the component fulfills the original prompt requirements */\n completeness: number;\n /** Visual quality: layout, typography, spacing, color usage */\n visualPolish: number;\n /** Interaction quality: hover states, transitions, form validation */\n interactivity: number;\n /** Accessibility: ARIA labels, keyboard navigation, contrast ratios */\n accessibility: number;\n /** Code quality: TypeScript types, clean structure, no anti-patterns */\n codeQuality: number;\n}\n\n/**\n * A specific issue found during evaluation.\n */\nexport interface EvaluationIssue {\n /** Which quality dimension this issue belongs to */\n dimension: string;\n /** Human-readable description of what is wrong */\n description: string;\n /** Severity level: critical blocks shipping, major degrades quality, minor is a polish issue */\n severity: 'critical' | 'major' | 'minor';\n /** Suggested fix for the agent to apply */\n fix: string;\n /**\n * Who produced it, on the visual leg (ggui#1545): `judge` for the model's own findings, `instrument` for a\n * deterministic measurement (fit, overflow, blank). Absent on issues from other evaluators. The loop's\n * `visualEvaluation.actOn` acts on `judge` findings only, so a new instrument check never joins the treatment\n * by accident: it has to say it is a judge finding, and absence reads as \"not acted on\".\n */\n origin?: 'judge' | 'instrument';\n}\n\n/**\n * Result of a single evaluation round.\n */\n/** One judge answer to a criterion (ggui#1436), as parsed — before the K-majority. */\nexport interface CriteriaAnswer {\n id: string;\n verdict: 'pass' | 'fail' | 'n/a';\n evidence: string;\n}\n\nexport interface EvaluationResult {\n /** Whether the component passed the quality threshold */\n passed: boolean;\n /** Weighted average score across all dimensions (0-100) */\n finalScore: number;\n /** Per-dimension score breakdown */\n dimensions: DimensionScores;\n /** Specific issues identified in this round */\n issues: EvaluationIssue[];\n /** Free-form critique text from the evaluator LLM */\n critique?: string;\n /** Input tokens consumed by the evaluation LLM call */\n inputTokens?: number;\n /** Output tokens consumed by the evaluation LLM call */\n outputTokens?: number;\n /** ggui#1436 — the judge's criteria answers, when the prompt asked for them; never part of the score. */\n criteriaAnswers?: CriteriaAnswer[];\n /** ggui#1687 — what the answer's criteria array held and what the parser dropped; set whenever the answer parsed. */\n criteriaCounts?: CriteriaAnswerCounts;\n}\n\n/**\n * Quality metadata attached to every generated component\n */\nexport interface QualityMetadata {\n /** Number of evaluation rounds run (0 = strict/no eval) */\n evaluationRounds: number;\n /** Final average score 0-100 */\n finalScore: number;\n /** Per-dimension breakdown */\n dimensions: DimensionScores;\n /** Whether the component passed (score >= threshold) */\n passed: boolean;\n /** Model used for evaluation */\n evaluatorModel: string;\n /** Total evaluation loop time in ms */\n evaluationTimeMs: number;\n /** S3 keys for screenshots (creative only) */\n screenshots?: string[];\n}\n\n/** Hard ceiling for evaluation rounds — never exceed this regardless of config */\nexport const MAX_EVAL_ROUNDS_HARD_LIMIT = 10;\n\n/** Default (soft) max rounds for the balanced strategy */\nexport const DEFAULT_EVAL_MAX_ROUNDS = 10;\n\n/**\n * Configuration for the evaluation loop\n */\nexport interface EvaluationConfig {\n /** Whether evaluation is enabled */\n enabled: boolean;\n /** Model to use for evaluation (default: provider's default) */\n model?: string;\n /** LLM provider for evaluation (default: same as generation provider) */\n provider?: 'claude' | 'openai' | 'google' | 'openrouter';\n /** Minimum average score to pass (default: 70) */\n passThreshold: number;\n /** Maximum evaluation rounds (soft max: 3, hard limit: 5) */\n maxRounds?: number;\n /** Budget cap per evaluation round in USD */\n maxBudgetPerEval?: number;\n /** Budget cap per fix round in USD */\n maxBudgetPerFix?: number;\n}\n\n/**\n * Context passed to the evaluator\n */\nexport interface EvaluationContext {\n /** TSX source code written by the generator */\n sourceCode: string;\n /** Compiled JavaScript output */\n compiledCode: string;\n /** Original user prompt */\n originalPrompt: string;\n /** DESIGN.md content (if present) */\n designContext?: string;\n /** CSS variable tokens for the app theme */\n themeTokens: string;\n}\n"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { A as AxisKey, H as HarnessFragment } from '../types-
|
|
2
|
-
export { a as CacheTier, C as ComposedHarness } from '../types-
|
|
3
|
-
import '../axes-
|
|
1
|
+
import { A as AxisKey, H as HarnessFragment } from '../types-Dh1s4K9j.js';
|
|
2
|
+
export { a as CacheTier, C as ComposedHarness } from '../types-Dh1s4K9j.js';
|
|
3
|
+
import '../axes-CKVCzR_x.js';
|
|
4
4
|
|
|
5
5
|
declare const FRAGMENT_REGISTRY: Record<AxisKey, Record<string, HarnessFragment>>;
|
|
6
6
|
declare function lookupFragment(axis: AxisKey, value: string): HarnessFragment | undefined;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { DataContract, GadgetDescriptor } from '@ggui-ai/protocol';
|
|
2
|
-
import { D as DesignMode } from './design-mode-
|
|
2
|
+
import { D as DesignMode } from './design-mode-DGWN_Gkm.js';
|
|
3
3
|
|
|
4
4
|
/** Shell layout modes supported by the boilerplate templates. */
|
|
5
5
|
type ShellType = "chat" | "fullscreen" | "spatial";
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { b as RenderCheckHostBounds } from '../../../adapter-
|
|
2
|
-
export { D as DEFAULT_RUNTIME_RENDER_CHECK, c as RENDER_CHECK_KINDS, d as RenderCheckHostOptions, a as RenderCheckIssue, e as RenderCheckKind, f as RenderCheckResult, R as RuntimeRenderProbeConfig, g as classifyRenderCrashFix, h as createRuntimeRenderCheck, i as isRecoverableRenderCrash, p as parseRuntimeSubcategory, r as runRenderCheck } from '../../../adapter-
|
|
1
|
+
import { b as RenderCheckHostBounds } from '../../../adapter-BJwn74rx.js';
|
|
2
|
+
export { D as DEFAULT_RUNTIME_RENDER_CHECK, c as RENDER_CHECK_KINDS, d as RenderCheckHostOptions, a as RenderCheckIssue, e as RenderCheckKind, f as RenderCheckResult, R as RuntimeRenderProbeConfig, g as classifyRenderCrashFix, h as createRuntimeRenderCheck, i as isRecoverableRenderCrash, p as parseRuntimeSubcategory, r as runRenderCheck } from '../../../adapter-BJwn74rx.js';
|
|
3
3
|
import { WireConfig } from '@ggui-ai/wire';
|
|
4
4
|
import { JsonObject, DataContract } from '@ggui-ai/protocol';
|
|
5
5
|
import '../../types-public.js';
|
|
6
6
|
import '../../../styling-profile-CxfvV48g.js';
|
|
7
|
-
import '../../../axes-
|
|
8
|
-
import '../../../types-public-
|
|
9
|
-
import '@ggui-ai/mcp-server-core';
|
|
10
|
-
import '../../../design-mode-DLufhrNp.js';
|
|
11
|
-
import '../../../types-BOvHNG7K.js';
|
|
7
|
+
import '../../../axes-CKVCzR_x.js';
|
|
8
|
+
import '../../../types-public-B7wn4ce5.js';
|
|
12
9
|
import '../../../llm.js';
|
|
10
|
+
import '@ggui-ai/mcp-server-core';
|
|
11
|
+
import '../../../design-mode-DGWN_Gkm.js';
|
|
12
|
+
import '../../../types-Dh1s4K9j.js';
|
|
13
13
|
import '../../../policy.js';
|
|
14
14
|
|
|
15
15
|
interface ActionFiredEvent {
|