@ggui-ai/ui-gen 0.25.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-Cg_rkpGq.d.ts → adapter-BJwn74rx.d.ts} +49 -1
- package/dist/adapters/generation-dispatch.d.ts +8 -5
- package/dist/adapters/generation-dispatch.js +1118 -193
- package/dist/adapters/generation-dispatch.js.map +1 -1
- package/dist/adapters/index.js +27 -6
- package/dist/adapters/index.js.map +1 -1
- package/dist/advanced/index.d.ts +10 -9
- package/dist/advanced/index.js +1126 -202
- package/dist/advanced/index.js.map +1 -1
- 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 +10 -3
- package/dist/boilerplate.js.map +1 -1
- package/dist/check/index.d.ts +3 -2
- package/dist/check/index.js +9 -2
- package/dist/check/index.js.map +1 -1
- package/dist/{create-ui-generator-DFnnArrv.d.ts → create-ui-generator-N4gRXpcL.d.ts} +3 -4
- package/dist/{design-mode-DLufhrNp.d.ts → design-mode-DGWN_Gkm.d.ts} +1 -1
- package/dist/{dispatch-CStl9eAw.d.ts → dispatch-BUoXRj_r.d.ts} +2 -2
- package/dist/evaluation/axis-checks/index.d.ts +5 -4
- package/dist/evaluation/axis-checks/index.js.map +1 -1
- package/dist/evaluation/axis-checks/registry.d.ts +4 -3
- package/dist/evaluation/index.d.ts +107 -539
- package/dist/evaluation/index.js +552 -55
- package/dist/evaluation/index.js.map +1 -1
- package/dist/evaluation/types.d.ts +17 -0
- package/dist/evaluation/types.js.map +1 -1
- package/dist/{generate-9IeNT4ZY.d.ts → generate-tSO_shQ0.d.ts} +1 -1
- package/dist/harness/check/runtime-render/index.d.ts +5 -5
- 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 +4 -5
- package/dist/harness/index.js +36 -5
- 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 +17 -3
- package/dist/harness/result-types.js.map +1 -1
- package/dist/harness/runtime.d.ts +14 -6
- package/dist/harness/runtime.js +11 -4
- package/dist/harness/runtime.js.map +1 -1
- package/dist/harness/types-public.d.ts +4 -2
- package/dist/harness/types-public.js +10 -3
- package/dist/harness/types-public.js.map +1 -1
- package/dist/harness/validator-trace-sink.d.ts +4 -3
- package/dist/index.d.ts +46 -11
- package/dist/index.js +1128 -200
- package/dist/index.js.map +1 -1
- package/dist/patch.d.ts +3 -3
- package/dist/{prompts-YU9piOgs.d.ts → prompts-BhNUuRoZ.d.ts} +1 -1
- package/dist/tools/render-check-worker.js +8 -1
- package/dist/tools/render-check-worker.js.map +1 -1
- package/dist/{types-public-BJTLpzWn.d.ts → types-public-B7wn4ce5.d.ts} +384 -3
- 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 +3 -3
- package/package.json +12 -12
- package/src/adapters/generation-dispatch.ts +2 -0
- package/src/boilerplate/free-design-prompt.ts +3 -3
- package/src/boilerplate/hard-sections.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/run-tier0.ts +6 -3
- package/src/contract-context.ts +1 -1
- package/src/evaluation/cost-tracker.ts +54 -6
- package/src/evaluation/criteria/edge-probe.ts +286 -0
- package/src/evaluation/criteria/edge.ts +202 -0
- package/src/evaluation/criteria/resolve.ts +55 -7
- package/src/evaluation/index.ts +5 -1
- package/src/evaluation/judge-spend.ts +48 -0
- package/src/evaluation/types-public.ts +91 -0
- package/src/evaluation/types.ts +10 -0
- package/src/evaluation/visual-evaluator.ts +236 -40
- 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 +27 -0
- package/src/harness/coding/init-session.ts +5 -3
- package/src/harness/coding/run-coding-turn.ts +5 -1
- package/src/harness/coding/run-eval-round.ts +63 -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 +9 -0
- package/src/harness/types-public.ts +10 -1
- package/src/index.ts +5 -0
- package/src/internal/verdict-line.ts +33 -0
- package/src/taught-tokens.ts +32 -0
- package/src/tools/render-check-worker.ts +2 -1
- package/src/tools/render-check.ts +8 -7
- package/src/validation/primitives.ts +1 -1
- package/dist/llm-router-nfO7wPec.d.ts +0 -267
- package/dist/{bank-CT4eEkta.d.ts → bank-Ctdp3FUA.d.ts} +3 -3
package/README.md
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
# @ggui-ai/ui-gen
|
|
2
2
|
|
|
3
|
-
UI generation harness for [
|
|
3
|
+
UI generation harness for [GGUI](https://github.com/ggui-ai/ggui) — the engine that turns a `DataContract` into a working React component.
|
|
4
4
|
|
|
5
5
|
It bundles the three coupled pieces of the generation pipeline:
|
|
6
6
|
|
|
7
|
-
- **System prompt** — the instructions that tell the LLM _how_ to code against the
|
|
7
|
+
- **System prompt** — the instructions that tell the LLM _how_ to code against the GGUI design system.
|
|
8
8
|
- **Coding harness** — the multi-turn loop (implement → self-check → patch → evaluate) plus provider adapters for Claude, OpenAI, and Google models.
|
|
9
9
|
- **Evaluation engine** — deterministic checks and LLM-judged scoring of generated components.
|
|
10
10
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { RuntimeRenderCheck } from './harness/types-public.js';
|
|
2
2
|
import { GenerationRuntimeProbeCheck } from '@ggui-ai/mcp-server-core';
|
|
3
3
|
import { JsonObject, DataContract } from '@ggui-ai/protocol';
|
|
4
|
-
import {
|
|
4
|
+
import { f as ProbeHostLoad, g as ProbePendingAffordance } from './types-public-B7wn4ce5.js';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* The subprocess bounds of one isolated check (ggui#1380). They are
|
|
@@ -38,6 +38,30 @@ interface RenderCheckHostOptions {
|
|
|
38
38
|
readonly bounds?: Partial<RenderCheckHostBounds>;
|
|
39
39
|
}
|
|
40
40
|
|
|
41
|
+
/**
|
|
42
|
+
* The action walk (ggui#1652): find a control that dispatches one action by
|
|
43
|
+
* walking the card's screens, as a person would, in a mount of its own.
|
|
44
|
+
*
|
|
45
|
+
* A screen is the card's set of controls, told apart by each control's tag,
|
|
46
|
+
* type, label (its aria-label, placeholder or text) and disabled state, never
|
|
47
|
+
* by typed values, selection or generated names.
|
|
48
|
+
* Picking an answer is the same screen unless it enables or disables a
|
|
49
|
+
* control; a wizard's next step, or an Edit button that now reads Save, is a
|
|
50
|
+
* new one. Each control is pressed once per screen. When every control on
|
|
51
|
+
* the current screen has been pressed, the walk returns over controls it has
|
|
52
|
+
* already pressed to the nearest screen that still has one to press. A press
|
|
53
|
+
* that leads back to a screen already seen is not progress, so Back and Next
|
|
54
|
+
* cannot loop, in any language. The walk stops at the first press that
|
|
55
|
+
* dispatches the action, when every reachable control has been pressed, at
|
|
56
|
+
* a cap on presses, or at its deadline. Neither the cap nor the deadline
|
|
57
|
+
* stops it while it is on the first screen with a control there still
|
|
58
|
+
* unpressed; once a press leaves the first screen both apply, and a
|
|
59
|
+
* first-screen control left unpressed is pressed only if a known route
|
|
60
|
+
* leads back to it (a one-way wizard has none).
|
|
61
|
+
*/
|
|
62
|
+
|
|
63
|
+
type WalkStop = "dispatched" | "explored" | "press-cap" | "deadline" | "no-mount";
|
|
64
|
+
|
|
41
65
|
/**
|
|
42
66
|
* 3-state outcome. Internal to runtime-render.
|
|
43
67
|
* The adapter maps this to existing EvalIssue shapes:
|
|
@@ -88,8 +112,23 @@ interface RenderCheckIssue {
|
|
|
88
112
|
* beside `{ primed: 0 }` or `{ error }` than beside `{ primed: 1 }`.
|
|
89
113
|
*/
|
|
90
114
|
readonly inputPriming?: InputPrimingDiagnostic;
|
|
115
|
+
/** For action-wiring (ggui#1652): how far the walk over the card's screens got without dispatching the action. */
|
|
116
|
+
readonly walk?: ActionWalkDiagnostic;
|
|
91
117
|
};
|
|
92
118
|
}
|
|
119
|
+
/**
|
|
120
|
+
* The action walk's account of an action it could not dispatch (ggui#1652):
|
|
121
|
+
* how many controls it pressed across how many screens, why it stopped,
|
|
122
|
+
* whether any screen rendered a control naming the action, and the last
|
|
123
|
+
* controls it pressed. Never the first button in the page.
|
|
124
|
+
*/
|
|
125
|
+
interface ActionWalkDiagnostic {
|
|
126
|
+
readonly presses: number;
|
|
127
|
+
readonly screens: number;
|
|
128
|
+
readonly stoppedBy: Exclude<WalkStop, "dispatched">;
|
|
129
|
+
readonly namedControlSeen: boolean;
|
|
130
|
+
readonly lastPressed: readonly string[];
|
|
131
|
+
}
|
|
93
132
|
/**
|
|
94
133
|
* Outcome of `primeInputs` before the action-wiring probe (ggui#1187). A
|
|
95
134
|
* priming failure never aborts the check — it is recorded here, on every
|
|
@@ -124,12 +163,21 @@ interface RenderCheckResult {
|
|
|
124
163
|
readonly renderMs: number;
|
|
125
164
|
/** Host load around an isolated check (absent in-process). */
|
|
126
165
|
readonly hostLoad?: ProbeHostLoad;
|
|
166
|
+
/** ggui#1398: the pending-affordance walk, report-only; absent when no action walk ran. */
|
|
167
|
+
readonly pendingAffordance?: ProbePendingAffordance;
|
|
127
168
|
};
|
|
128
169
|
}
|
|
129
170
|
interface RunRenderCheckInput {
|
|
130
171
|
readonly sourceCode: string;
|
|
131
172
|
readonly mockupProps: JsonObject;
|
|
132
173
|
readonly contract?: DataContract;
|
|
174
|
+
/**
|
|
175
|
+
* Epoch ms by which the check must finish: set by the isolating host from
|
|
176
|
+
* its own bound, absent in-process. The report-only pending phase is
|
|
177
|
+
* skipped when less than {@link PENDING_PHASE_RESERVE_MS} remains, so it
|
|
178
|
+
* can never push a check past its bound (ggui#1398).
|
|
179
|
+
*/
|
|
180
|
+
readonly deadlineAt?: number;
|
|
133
181
|
}
|
|
134
182
|
/**
|
|
135
183
|
* Options of {@link runRenderCheck} (ggui#1380): the host's options —
|
|
@@ -2,17 +2,18 @@ import { EvaluationConfig } from '../evaluation/types.js';
|
|
|
2
2
|
import { RuntimeRenderCheck } from '../harness/types-public.js';
|
|
3
3
|
import { ModelRoles, GenerationResult } from '../harness/result-types.js';
|
|
4
4
|
import { ProviderName, ToolDefinition } from './types.js';
|
|
5
|
-
import { Q as QualityConfig } from '../types-public-
|
|
6
|
-
import { A as AgentConfig, V as VisionProvider } from '../llm-router-nfO7wPec.js';
|
|
5
|
+
import { Q as QualityConfig, b as AgentConfig, V as VisionProvider } from '../types-public-B7wn4ce5.js';
|
|
7
6
|
import { DataContract, JsonObject, GadgetDescriptor } from '@ggui-ai/protocol';
|
|
8
|
-
import { C as CanvasClass, D as DesignMode } from '../design-mode-
|
|
9
|
-
import { C as CriteriaBank } from '../bank-
|
|
7
|
+
import { C as CanvasClass, D as DesignMode } from '../design-mode-DGWN_Gkm.js';
|
|
8
|
+
import { C as CriteriaBank } from '../bank-Ctdp3FUA.js';
|
|
10
9
|
import { G as GenerationProfileInput } from '../styling-profile-CxfvV48g.js';
|
|
11
|
-
import { R as RenderingContext } from '../prompts-
|
|
10
|
+
import { R as RenderingContext } from '../prompts-BhNUuRoZ.js';
|
|
12
11
|
import '../axes-CKVCzR_x.js';
|
|
13
12
|
import '../llm.js';
|
|
14
13
|
import '../types-Dh1s4K9j.js';
|
|
15
14
|
import '../policy.js';
|
|
15
|
+
import '../visual-evaluator-C9L-o6ap.js';
|
|
16
|
+
import 'puppeteer-core';
|
|
16
17
|
import 'zod';
|
|
17
18
|
import '@ggui-ai/mcp-server-core';
|
|
18
19
|
|
|
@@ -83,6 +84,8 @@ interface GenerationDispatchParams {
|
|
|
83
84
|
/** ggui#1436 — see `SingleComponentParams.visualEvaluation.criteriaBank`. */
|
|
84
85
|
criteriaBank?: CriteriaBank;
|
|
85
86
|
criteriaKind?: string;
|
|
87
|
+
/** ggui#1542 — see `SingleComponentParams.visualEvaluation.actOn`. */
|
|
88
|
+
actOn?: "critical" | "major";
|
|
86
89
|
};
|
|
87
90
|
/** Quality config controlling eval tiers and improvement behavior */
|
|
88
91
|
qualityConfig?: QualityConfig;
|