@ggui-ai/ui-gen 0.15.0 → 0.16.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/dist/adapters/generation-dispatch.d.ts +21 -4
- package/dist/adapters/generation-dispatch.js +913 -350
- package/dist/adapters/generation-dispatch.js.map +1 -1
- package/dist/adapters/index.js +26 -22
- package/dist/adapters/index.js.map +1 -1
- package/dist/advanced/index.d.ts +17 -12
- package/dist/advanced/index.js +966 -374
- package/dist/advanced/index.js.map +1 -1
- package/dist/boilerplate.d.ts +16 -1
- package/dist/boilerplate.js +579 -245
- package/dist/boilerplate.js.map +1 -1
- package/dist/check/index.d.ts +17 -3
- package/dist/check/index.js +32 -25
- package/dist/check/index.js.map +1 -1
- package/dist/{create-ui-generator-D6TKuv9V.d.ts → create-ui-generator-CCIeQaEe.d.ts} +77 -10
- package/dist/design-mode-BHEE7flj.d.ts +67 -0
- package/dist/{dispatch-BuZfTh9r.d.ts → dispatch-BA5dJcg-.d.ts} +4 -1
- package/dist/evaluation/axis-checks/index.d.ts +4 -3
- package/dist/evaluation/axis-checks/index.js +3 -1
- package/dist/evaluation/axis-checks/index.js.map +1 -1
- package/dist/evaluation/axis-checks/registry.d.ts +2 -1
- package/dist/evaluation/axis-checks/registry.js +1 -0
- package/dist/evaluation/axis-checks/registry.js.map +1 -1
- package/dist/evaluation/index.d.ts +143 -3
- package/dist/evaluation/index.js +3866 -92
- package/dist/evaluation/index.js.map +1 -1
- package/dist/{generate-BTfvELgl.d.ts → generate-8L_bc2iP.d.ts} +10 -1
- package/dist/harness/check/runtime-render/index.d.ts +2 -1
- package/dist/harness/index.d.ts +2 -1
- package/dist/harness/index.js +589 -248
- package/dist/harness/index.js.map +1 -1
- package/dist/harness/llm-trace-sink.d.ts +3 -3
- package/dist/harness/llm-trace-sink.js.map +1 -1
- package/dist/harness/prompts.d.ts +2 -1
- package/dist/harness/prompts.js +3 -0
- package/dist/harness/prompts.js.map +1 -1
- package/dist/harness/result-types.d.ts +17 -5
- package/dist/harness/result-types.js.map +1 -1
- package/dist/harness/runtime.d.ts +19 -3
- package/dist/harness/runtime.js +602 -261
- package/dist/harness/runtime.js.map +1 -1
- package/dist/harness/types-public.d.ts +28 -1
- package/dist/harness/types-public.js +589 -248
- package/dist/harness/types-public.js.map +1 -1
- package/dist/harness/validator-trace-sink.d.ts +2 -1
- package/dist/index.d.ts +8 -4
- package/dist/index.js +973 -372
- package/dist/index.js.map +1 -1
- package/dist/patch.d.ts +2 -1
- package/dist/{prompts-BVhtH3M1.d.ts → prompts-k6m6reqe.d.ts} +11 -1
- package/dist/providers/index.d.ts +2 -2
- package/dist/providers/index.js.map +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/{types-public-CkNWEov9.d.ts → types-public-D24JLJgl.d.ts} +49 -5
- package/dist/validation/index.d.ts +1 -1
- package/dist/validation/index.js +4 -4
- package/dist/validation/index.js.map +1 -1
- package/dist/workflows.d.ts +2 -1
- package/package.json +12 -12
- package/src/adapters/generation-dispatch.ts +57 -4
- package/src/adapters/provider-router.ts +7 -6
- package/src/adapters/tools.ts +5 -5
- package/src/advanced/generator.ts +11 -10
- package/src/advanced/index.ts +5 -4
- package/src/boilerplate/free-design-prompt.ts +329 -0
- package/src/boilerplate/generate.ts +10 -1
- package/src/boilerplate/hard-sections.ts +242 -0
- package/src/boilerplate/render.ts +32 -8
- package/src/boilerplate/system-prompt.ts +81 -229
- package/src/boilerplate/templates/base-free.tsx.tmpl +24 -0
- package/src/check/run-tier0.ts +80 -20
- package/src/coding-agent/tools.ts +8 -2
- package/src/contract-context.ts +28 -0
- package/src/create-harness.ts +11 -0
- package/src/create-ui-generator.ts +71 -25
- package/src/design-mode.ts +182 -0
- package/src/design-system-docs.ts +17 -13
- package/src/evaluation/axis-checks/dispatch.ts +4 -0
- package/src/evaluation/axis-checks/extras.ts +5 -0
- package/src/evaluation/cost-tracker.ts +2 -3
- package/src/evaluation/index.ts +46 -2
- package/src/evaluation/llm-evaluator.ts +77 -21
- package/src/evaluation/types-public.ts +103 -8
- package/src/evaluation/visual-evaluator.ts +301 -29
- package/src/harness/coding/dupe-break.ts +0 -0
- package/src/harness/coding/init-session.ts +1 -0
- package/src/harness/coding/run-coding-turn.ts +3 -0
- package/src/harness/coding/run-eval-round.ts +15 -2
- package/src/harness/llm-trace-sink.ts +3 -3
- package/src/harness/result-types.ts +15 -3
- package/src/harness/runtime.ts +18 -0
- package/src/harness/types-public.ts +27 -0
- package/src/index.ts +26 -0
- package/src/internal/extract-call-signatures.ts +2 -2
- package/src/providers/bedrock.ts +4 -4
- package/src/run-check.ts +1 -0
- package/src/tools/get-primitives-ts.ts +1 -1
- package/src/validation/allowed-imports.ts +8 -2
- package/src/validation/primitives.ts +1 -1
package/dist/workflows.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { C as Classification } from './axes-CzLEMDeB.js';
|
|
2
2
|
import { Workflow } from './harness/types-public.js';
|
|
3
3
|
import '@ggui-ai/protocol';
|
|
4
|
-
import './types-public-
|
|
4
|
+
import './types-public-D24JLJgl.js';
|
|
5
|
+
import './design-mode-BHEE7flj.js';
|
|
5
6
|
import './types-BOvHNG7K.js';
|
|
6
7
|
import './llm.js';
|
|
7
8
|
import './policy.js';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ggui-ai/ui-gen",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.16.0",
|
|
4
4
|
"description": "UI generation harness for ggui — the LLM system prompt, multi-turn coding loop, and evaluation engine that turn a DataContract into a React component. Implements the UiGenerator contract from @ggui-ai/mcp-server-core; consumed by @ggui-ai/mcp-server.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"keywords": [
|
|
@@ -188,9 +188,9 @@
|
|
|
188
188
|
"puppeteer-core": "^24.40.0 || ^25.0.0",
|
|
189
189
|
"react": "^18.0.0 || ^19.0.0",
|
|
190
190
|
"react-dom": "^18.0.0 || ^19.0.0",
|
|
191
|
-
"@ggui-ai/
|
|
192
|
-
"@ggui-ai/
|
|
193
|
-
"@ggui-ai/
|
|
191
|
+
"@ggui-ai/project-config": "0.16.0",
|
|
192
|
+
"@ggui-ai/mcp-server-core": "0.16.0",
|
|
193
|
+
"@ggui-ai/protocol": "0.16.0"
|
|
194
194
|
},
|
|
195
195
|
"peerDependenciesMeta": {
|
|
196
196
|
"@google/adk": {
|
|
@@ -229,11 +229,11 @@
|
|
|
229
229
|
"openai": "^7.9.0",
|
|
230
230
|
"typescript": "^5.0.0",
|
|
231
231
|
"zod": "^4.3.6",
|
|
232
|
-
"@ggui-ai/gadgets": "0.
|
|
233
|
-
"@ggui-ai/
|
|
234
|
-
"@ggui-ai/
|
|
235
|
-
"@ggui-ai/
|
|
236
|
-
"@ggui-ai/
|
|
232
|
+
"@ggui-ai/gadgets": "0.16.0",
|
|
233
|
+
"@ggui-ai/design": "0.16.0",
|
|
234
|
+
"@ggui-ai/sandbox": "0.16.0",
|
|
235
|
+
"@ggui-ai/ui-visual-tester": "0.16.0",
|
|
236
|
+
"@ggui-ai/wire": "0.16.0"
|
|
237
237
|
},
|
|
238
238
|
"devDependencies": {
|
|
239
239
|
"@google/adk": "^2.0.0",
|
|
@@ -248,9 +248,9 @@
|
|
|
248
248
|
"react-dom": "^19.0.0",
|
|
249
249
|
"tsup": "^8.5.0",
|
|
250
250
|
"vitest": "^3.2.6",
|
|
251
|
-
"@ggui-ai/mcp-server-core": "0.
|
|
252
|
-
"@ggui-ai/project-config": "0.
|
|
253
|
-
"@ggui-ai/protocol": "0.
|
|
251
|
+
"@ggui-ai/mcp-server-core": "0.16.0",
|
|
252
|
+
"@ggui-ai/project-config": "0.16.0",
|
|
253
|
+
"@ggui-ai/protocol": "0.16.0"
|
|
254
254
|
},
|
|
255
255
|
"engines": {
|
|
256
256
|
"node": ">=22.0.0"
|
|
@@ -51,13 +51,14 @@ import type {
|
|
|
51
51
|
GenerationResult,
|
|
52
52
|
RenderingContext,
|
|
53
53
|
} from "../harness/result-types.js";
|
|
54
|
-
import type {
|
|
54
|
+
import type { ProviderName, ToolDefinition } from "./types.js";
|
|
55
55
|
import type { QualityConfig } from "../evaluation/types-public.js";
|
|
56
56
|
import type { AgentConfig } from "../harness/llm-router.js";
|
|
57
57
|
import {
|
|
58
58
|
type GadgetDescriptor,
|
|
59
59
|
type JsonObject,
|
|
60
60
|
} from "@ggui-ai/protocol";
|
|
61
|
+
import { canvasForRendering, type CanvasClass, type DesignMode } from "../design-mode.js";
|
|
61
62
|
|
|
62
63
|
export interface GenerationDispatchParams {
|
|
63
64
|
provider: ProviderName;
|
|
@@ -93,6 +94,13 @@ export interface GenerationDispatchParams {
|
|
|
93
94
|
passThreshold?: number;
|
|
94
95
|
sampleProps?: JsonObject;
|
|
95
96
|
viewport?: { width: number; height: number };
|
|
97
|
+
/**
|
|
98
|
+
* Per-canvas judging — see `VisualEvalConfig.canvases`. When set, the
|
|
99
|
+
* eval round screenshots + judges once per class and the harness
|
|
100
|
+
* stamps `EvalResult.visual` with the PNG-free summary. Unset =
|
|
101
|
+
* today's single screenshot at `viewport`.
|
|
102
|
+
*/
|
|
103
|
+
canvases?: readonly CanvasClass[];
|
|
96
104
|
};
|
|
97
105
|
/** Quality config controlling eval tiers and improvement behavior */
|
|
98
106
|
qualityConfig?: QualityConfig;
|
|
@@ -163,6 +171,15 @@ export interface GenerationDispatchParams {
|
|
|
163
171
|
* a no-op.
|
|
164
172
|
*/
|
|
165
173
|
onRetry?: AgentConfig["onRetry"];
|
|
174
|
+
/**
|
|
175
|
+
* Which triad to materialise — see `CreateHarnessInput.designMode`.
|
|
176
|
+
* Reaches the system prompt, the boilerplate, the tier-0 gate, the
|
|
177
|
+
* axis checks and the evaluator criteria through the harness. Absent
|
|
178
|
+
* means `constrained` (byte-identical to the pre-`designMode` path).
|
|
179
|
+
*/
|
|
180
|
+
designMode?: DesignMode;
|
|
181
|
+
/** Rendering canvas class for the `free` prompt — see `CreateHarnessInput.canvas`. */
|
|
182
|
+
canvas?: CanvasClass;
|
|
166
183
|
}
|
|
167
184
|
|
|
168
185
|
/**
|
|
@@ -179,7 +196,7 @@ function mapProviderForLLMRouter(provider: ProviderName): "anthropic" | "openai"
|
|
|
179
196
|
*/
|
|
180
197
|
export async function dispatchGeneration(
|
|
181
198
|
params: GenerationDispatchParams,
|
|
182
|
-
): Promise<
|
|
199
|
+
): Promise<GenerationResult> {
|
|
183
200
|
// NOTE: userPrompt arrives already enriched with rendering context + contract
|
|
184
201
|
// (including examples) from the caller (runner.ts / generator.ts).
|
|
185
202
|
// The contract are injected via injectContracts() which calls propsSpecToTypeScript()
|
|
@@ -274,6 +291,9 @@ export async function dispatchGeneration(
|
|
|
274
291
|
...(params.gadgetTypes !== undefined
|
|
275
292
|
? { gadgetTypes: params.gadgetTypes }
|
|
276
293
|
: {}),
|
|
294
|
+
// Design mode + canvas — the harness carries them to every leg.
|
|
295
|
+
...(params.designMode !== undefined ? { designMode: params.designMode } : {}),
|
|
296
|
+
...(params.canvas !== undefined ? { canvas: params.canvas } : {}),
|
|
277
297
|
// Policy is pre-resolved at the dispatch boundary so `createHarness`
|
|
278
298
|
// stays free of experiment plumbing. `resolveHarnessPolicy` applies
|
|
279
299
|
// the `GGUI_POLICY_PROFILE` experimental-profile layer and hands the
|
|
@@ -293,7 +313,7 @@ export async function dispatchGeneration(
|
|
|
293
313
|
// prompt's gadget catalog renders a `Type:` line per third-party
|
|
294
314
|
// gadget (the LLM sees a wrapper's real call shape it otherwise
|
|
295
315
|
// can't know).
|
|
296
|
-
systemPromptBuilder: ({ userRequest, shellType, screen, axisDelta }) =>
|
|
316
|
+
systemPromptBuilder: ({ userRequest, shellType, screen, axisDelta, designMode, canvas }) =>
|
|
297
317
|
buildSystemPromptWithFunnel(
|
|
298
318
|
userRequest,
|
|
299
319
|
shellType,
|
|
@@ -301,6 +321,8 @@ export async function dispatchGeneration(
|
|
|
301
321
|
axisDelta,
|
|
302
322
|
params.appGadgets,
|
|
303
323
|
params.gadgetTypes,
|
|
324
|
+
designMode,
|
|
325
|
+
canvas,
|
|
304
326
|
),
|
|
305
327
|
// Pre-filtered axis-check registry. The `matches()` predicate
|
|
306
328
|
// selects the checks relevant to this generation's axis vector.
|
|
@@ -513,5 +535,36 @@ export async function dispatchGeneration(
|
|
|
513
535
|
// pairedSource via the workflow output) — guaranteed to pair with
|
|
514
536
|
// telemetry.compiledCode when runResult.ok is true.
|
|
515
537
|
const finalSource = runResult.finalSource ?? "";
|
|
516
|
-
|
|
538
|
+
// `assembleGenerationResult` is async — the spread below must see the
|
|
539
|
+
// RESOLVED result, never the promise (a spread promise is `{}`: every
|
|
540
|
+
// consumer downstream lost `compiledCode` / `tokens` on 2026-09-09).
|
|
541
|
+
const result: GenerationResult = await assembleGenerationResult({ session, telemetry, source: finalSource });
|
|
542
|
+
// Record the arm this generation ran under (bench reports read it per
|
|
543
|
+
// cell). The canvas is the one the free prompt stated: explicit when
|
|
544
|
+
// passed, else the same shell × screen derivation the prompt used.
|
|
545
|
+
// Nothing is stamped on the default (constrained, no option) path.
|
|
546
|
+
return withArmRecord(result, params);
|
|
547
|
+
}
|
|
548
|
+
|
|
549
|
+
/**
|
|
550
|
+
* Stamp the arm record (`designMode` / `canvas`) onto a RESOLVED
|
|
551
|
+
* {@link GenerationResult}. The input must be the resolved result, never a
|
|
552
|
+
* promise — a spread promise is `{}` and every consumer downstream loses
|
|
553
|
+
* `compiledCode` / `tokens` (2026-09-09; gate:
|
|
554
|
+
* `generation-dispatch.resolved-result.test.ts`). Nothing is stamped on the
|
|
555
|
+
* default (constrained, no option) path, so a default run's result is
|
|
556
|
+
* byte-identical to the input.
|
|
557
|
+
*/
|
|
558
|
+
function withArmRecord(
|
|
559
|
+
result: GenerationResult,
|
|
560
|
+
params: Pick<GenerationDispatchParams, "designMode" | "canvas" | "shellType" | "screen">,
|
|
561
|
+
): GenerationResult {
|
|
562
|
+
const recordedCanvas: CanvasClass | undefined =
|
|
563
|
+
params.canvas ??
|
|
564
|
+
(params.designMode === "free" ? canvasForRendering(params.shellType, params.screen) : undefined);
|
|
565
|
+
return {
|
|
566
|
+
...result,
|
|
567
|
+
...(params.designMode !== undefined ? { designMode: params.designMode } : {}),
|
|
568
|
+
...(recordedCanvas !== undefined ? { canvas: recordedCanvas } : {}),
|
|
569
|
+
};
|
|
517
570
|
}
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
// the typed `LlmRoute` (slice #43) guarantees `route.model` is
|
|
9
9
|
// wire-canonical at construction time, so there is no LiteLLM prefix
|
|
10
10
|
// to strip at this boundary. `getBedrockModelId` stays — the
|
|
11
|
-
// "anthropic route + bedrock IAM" mixed-mode escape hatch (
|
|
11
|
+
// "anthropic route + bedrock IAM" mixed-mode escape hatch (a hosted deployment's
|
|
12
12
|
// legacy) still needs the wire-canonical anthropic id → cross-region
|
|
13
13
|
// profile id upcast.
|
|
14
14
|
|
|
@@ -18,7 +18,7 @@ import type { LlmRoute } from '@ggui-ai/protocol';
|
|
|
18
18
|
* Map a wire-canonical Anthropic model id (or already-bedrock id) to
|
|
19
19
|
* the AWS Bedrock cross-region inference profile id. Used by the
|
|
20
20
|
* mixed-mode `anthropic` route + bedrock-IAM fallback path in
|
|
21
|
-
* {@link resolveRoute} (
|
|
21
|
+
* {@link resolveRoute} (a hosted deployment's legacy) and the analogous branch in
|
|
22
22
|
* `harness/llm-router.ts::AnthropicAgent.resolveModel`.
|
|
23
23
|
*
|
|
24
24
|
* Operators picking the bedrock route explicitly (slice #43 Phase 4)
|
|
@@ -41,13 +41,13 @@ export function getBedrockModelId(model: string): string {
|
|
|
41
41
|
'anthropic/claude-fable-5': 'us.anthropic.claude-fable-5',
|
|
42
42
|
};
|
|
43
43
|
// Normalize the Bedrock dot-form opt-in (e.g. `anthropic.claude-haiku-4-5`,
|
|
44
|
-
// produced when
|
|
44
|
+
// produced when a route resolver strips a `bedrock/` opt-in
|
|
45
45
|
// prefix) to the Anthropic slash form. Both spellings should resolve to
|
|
46
46
|
// the same cross-region inference profile id — without this, the dot
|
|
47
47
|
// form would skip the BEDROCK_MAP hit, fall through the `^anthropic\/`
|
|
48
48
|
// strip (which is a no-op for the dot form), and re-prepend
|
|
49
49
|
// `us.anthropic.` to produce a double-`anthropic.` id that Bedrock
|
|
50
|
-
// rejects with 400 (
|
|
50
|
+
// rejects with 400 (regression seen live on 2026-05-25).
|
|
51
51
|
const normalized = model.replace(/^anthropic\./, 'anthropic/');
|
|
52
52
|
if (BEDROCK_MAP[normalized]) return BEDROCK_MAP[normalized];
|
|
53
53
|
if (normalized.startsWith('us.anthropic.') || normalized.startsWith('arn:')) {
|
|
@@ -131,7 +131,7 @@ function clearSiblings(
|
|
|
131
131
|
* 2. Without `apiKey` AND explicit `env.CLAUDE_CODE_USE_BEDROCK === '1'`
|
|
132
132
|
* (or no `env.ANTHROPIC_API_KEY`) → mixed-mode bedrock fallback
|
|
133
133
|
* (model upcast to cross-region profile via `getBedrockModelId`).
|
|
134
|
-
*
|
|
134
|
+
* A hosted deployment's legacy escape hatch; the Phase 4 strict-fail
|
|
135
135
|
* prevents end-users from reaching this branch implicitly.
|
|
136
136
|
* 3. Otherwise → direct Anthropic API with whatever
|
|
137
137
|
* `ANTHROPIC_API_KEY` is already in `env`.
|
|
@@ -225,7 +225,8 @@ export function resolveRoute(input: RoutingInput): RoutingDecision {
|
|
|
225
225
|
};
|
|
226
226
|
}
|
|
227
227
|
// Mixed-mode legacy: anthropic route + bedrock IAM fallback.
|
|
228
|
-
//
|
|
228
|
+
// Escape hatch for a production deployment that authenticates via Bedrock
|
|
229
|
+
// IAM and never sets `ANTHROPIC_API_KEY`.
|
|
229
230
|
const explicitBedrock = env.CLAUDE_CODE_USE_BEDROCK === '1';
|
|
230
231
|
const noApiKey = !env.ANTHROPIC_API_KEY;
|
|
231
232
|
if (explicitBedrock || noApiKey) {
|
package/src/adapters/tools.ts
CHANGED
|
@@ -461,7 +461,7 @@ export async function runSelfChecks(
|
|
|
461
461
|
check: 'hex-color',
|
|
462
462
|
line: lineNum,
|
|
463
463
|
message: `Hardcoded color "${hexMatch[0]}" — must use design tokens`,
|
|
464
|
-
fix: `Replace with var(--ggui-color
|
|
464
|
+
fix: `Replace "${hexMatch[0]}" with a primitive variant OR a bare token reference such as var(--ggui-color-primary-500) — never a literal fallback inside var()`,
|
|
465
465
|
});
|
|
466
466
|
}
|
|
467
467
|
|
|
@@ -472,7 +472,7 @@ export async function runSelfChecks(
|
|
|
472
472
|
check: 'hardcoded-color-fn',
|
|
473
473
|
line: lineNum,
|
|
474
474
|
message: `Hardcoded ${colorFnMatch[1]}() — use design tokens instead`,
|
|
475
|
-
fix: `Replace with
|
|
475
|
+
fix: `Replace with the layering roles: var(--ggui-color-container), var(--ggui-color-onContainer), var(--ggui-color-outline), etc.`,
|
|
476
476
|
});
|
|
477
477
|
}
|
|
478
478
|
|
|
@@ -482,7 +482,7 @@ export async function runSelfChecks(
|
|
|
482
482
|
check: 'prefer-semantic',
|
|
483
483
|
line: lineNum,
|
|
484
484
|
message: `neutral-50 for background — prefer semantic token for dark-theme compatibility`,
|
|
485
|
-
fix: `Replace with var(--ggui-color-
|
|
485
|
+
fix: `Replace with var(--ggui-color-container) or var(--ggui-color-sunken)`,
|
|
486
486
|
});
|
|
487
487
|
}
|
|
488
488
|
if (/--ggui-color-neutral-900[^0-9]/.test(line) && /color/i.test(line) && !/background/i.test(line)) {
|
|
@@ -490,7 +490,7 @@ export async function runSelfChecks(
|
|
|
490
490
|
check: 'prefer-semantic',
|
|
491
491
|
line: lineNum,
|
|
492
492
|
message: `neutral-900 for text color — prefer semantic token for dark-theme compatibility`,
|
|
493
|
-
fix: `Replace with var(--ggui-color-
|
|
493
|
+
fix: `Replace with var(--ggui-color-onContainer) or var(--ggui-color-onSunken)`,
|
|
494
494
|
});
|
|
495
495
|
}
|
|
496
496
|
|
|
@@ -501,7 +501,7 @@ export async function runSelfChecks(
|
|
|
501
501
|
check: 'raw-pixels',
|
|
502
502
|
line: lineNum,
|
|
503
503
|
message: `Raw pixel value in spacing — must use design tokens`,
|
|
504
|
-
fix: `Replace with var(--ggui-spacing
|
|
504
|
+
fix: `Replace with a bare var(--ggui-spacing-*) token — no literal fallback — or the scale name on the primitive prop (gap="md", padding="lg")`,
|
|
505
505
|
});
|
|
506
506
|
}
|
|
507
507
|
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Advanced UI generator factory (`ui-gen-advanced
|
|
2
|
+
* Advanced UI generator factory (`ui-gen-advanced`).
|
|
3
3
|
*
|
|
4
4
|
* See `./index.ts` for the design narrative. This file owns the
|
|
5
5
|
* iterative two-stage loop and the {@link UiGenerator} adapter that
|
|
6
|
-
* registers under the slug `ui-gen-advanced
|
|
6
|
+
* registers under the slug `ui-gen-advanced`.
|
|
7
7
|
*
|
|
8
8
|
* Loop structure (max 3 iterations, threshold 0.8, always-persist):
|
|
9
9
|
*
|
|
@@ -26,10 +26,10 @@
|
|
|
26
26
|
* spinning up Chromium for code we already know is broken) AND when
|
|
27
27
|
* the contract has no `actionSpec` entries (no behaviour to verify).
|
|
28
28
|
*
|
|
29
|
-
* Generator identity is baked in — slug `ui-gen-advanced
|
|
30
|
-
*
|
|
31
|
-
*
|
|
32
|
-
* tier
|
|
29
|
+
* Generator identity is baked in — slug `ui-gen-advanced`, tier
|
|
30
|
+
* `advanced`; the declared model is `ADVANCED_GENERATOR_MODEL` and is not
|
|
31
|
+
* part of the slug (ggui#923). Operators can NOT override the slug via
|
|
32
|
+
* this factory; build a different factory for a different tier.
|
|
33
33
|
*/
|
|
34
34
|
import type {
|
|
35
35
|
GenerationMetadata,
|
|
@@ -39,6 +39,7 @@ import type {
|
|
|
39
39
|
UiGenerator,
|
|
40
40
|
} from '@ggui-ai/mcp-server-core';
|
|
41
41
|
import type { DataContract, JsonObject } from '@ggui-ai/protocol';
|
|
42
|
+
import type { ModelRef } from '@ggui-ai/protocol';
|
|
42
43
|
import type {
|
|
43
44
|
BehaviorFailure,
|
|
44
45
|
PlaywrightModule,
|
|
@@ -61,9 +62,9 @@ import {
|
|
|
61
62
|
} from './feedback.js';
|
|
62
63
|
|
|
63
64
|
/** Generator identity — slug, tier, and model. */
|
|
64
|
-
export const ADVANCED_GENERATOR_SLUG = 'ui-gen-advanced
|
|
65
|
+
export const ADVANCED_GENERATOR_SLUG = 'ui-gen-advanced' as const;
|
|
65
66
|
export const ADVANCED_GENERATOR_TIER: GeneratorTier = 'advanced';
|
|
66
|
-
export const ADVANCED_GENERATOR_MODEL = 'opus-4-7'
|
|
67
|
+
export const ADVANCED_GENERATOR_MODEL: ModelRef = 'anthropic/claude-opus-4-7';
|
|
67
68
|
|
|
68
69
|
/**
|
|
69
70
|
* Re-exported under a friendlier name for callers wiring deploys.
|
|
@@ -162,7 +163,7 @@ const DEFAULT_SLOW_TIMEOUT_MS = 5000;
|
|
|
162
163
|
|
|
163
164
|
/**
|
|
164
165
|
* Create the advanced generator. Returns a {@link UiGenerator}
|
|
165
|
-
* registrable under the slug `ui-gen-advanced
|
|
166
|
+
* registrable under the slug `ui-gen-advanced`.
|
|
166
167
|
*
|
|
167
168
|
* @example
|
|
168
169
|
* import { chromium } from 'playwright-core';
|
|
@@ -189,7 +190,7 @@ export function createAdvancedUiGenerator(
|
|
|
189
190
|
options.innerGenerator ??
|
|
190
191
|
createUiGenerator({
|
|
191
192
|
tier: 'advanced',
|
|
192
|
-
model:
|
|
193
|
+
model: ADVANCED_GENERATOR_MODEL,
|
|
193
194
|
...(options.maxAttempts !== undefined
|
|
194
195
|
? { maxAttempts: options.maxAttempts }
|
|
195
196
|
: {}),
|
package/src/advanced/index.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Advanced UI generator — `ui-gen-advanced
|
|
2
|
+
* Advanced UI generator — `ui-gen-advanced`.
|
|
3
3
|
*
|
|
4
4
|
* Iterative two-stage validator-feedback loop. Sibling to the default
|
|
5
5
|
* generator at `@ggui-ai/ui-gen/create-ui-generator.ts`. The default
|
|
@@ -27,9 +27,10 @@
|
|
|
27
27
|
* Missing the dep throws on every `generate()` call (not at factory
|
|
28
28
|
* time) so a config file dropping the registration is observable.
|
|
29
29
|
*
|
|
30
|
-
*
|
|
31
|
-
*
|
|
32
|
-
*
|
|
30
|
+
* The default install does NOT ship Playwright. Operators opt into this
|
|
31
|
+
* generator by installing `playwright-core` + Chromium and registering
|
|
32
|
+
* `createAdvancedUiGenerator({ playwright })` in the generator registry
|
|
33
|
+
* they hand to the server.
|
|
33
34
|
*/
|
|
34
35
|
export {
|
|
35
36
|
createAdvancedUiGenerator,
|