@ggui-ai/ui-gen 0.15.0 → 0.17.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 +24 -4
- package/dist/adapters/generation-dispatch.js +5188 -3920
- package/dist/adapters/generation-dispatch.js.map +1 -1
- package/dist/adapters/index.js +33 -26
- package/dist/adapters/index.js.map +1 -1
- package/dist/advanced/index.d.ts +22 -13
- package/dist/advanced/index.js +4889 -3561
- package/dist/advanced/index.js.map +1 -1
- package/dist/blueprint-validator.js +8 -12
- package/dist/blueprint-validator.js.map +1 -1
- package/dist/boilerplate.d.ts +19 -1
- package/dist/boilerplate.js +671 -254
- package/dist/boilerplate.js.map +1 -1
- package/dist/check/index.d.ts +17 -3
- package/dist/check/index.js +34 -25
- package/dist/check/index.js.map +1 -1
- package/dist/compose.js +1 -1
- package/dist/compose.js.map +1 -1
- package/dist/create-ui-generator-C8Ki9Wz1.d.ts +189 -0
- package/dist/design-mode-DLufhrNp.d.ts +61 -0
- package/dist/{dispatch-BuZfTh9r.d.ts → dispatch-D2htzi9h.d.ts} +4 -1
- package/dist/evaluation/axis-checks/index.d.ts +4 -3
- package/dist/evaluation/axis-checks/index.js +300 -14
- 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 +253 -1
- package/dist/evaluation/axis-checks/registry.js.map +1 -1
- package/dist/evaluation/index.d.ts +297 -5
- package/dist/evaluation/index.js +4515 -120
- package/dist/evaluation/index.js.map +1 -1
- package/dist/fragments/index.js +1 -1
- package/dist/fragments/index.js.map +1 -1
- package/dist/{generate-BTfvELgl.d.ts → generate-9IeNT4ZY.d.ts} +10 -1
- package/dist/harness/check/runtime-render/index.d.ts +3 -1
- package/dist/harness/check/runtime-render/index.js +8 -12
- package/dist/harness/check/runtime-render/index.js.map +1 -1
- package/dist/harness/index.d.ts +3 -1
- package/dist/harness/index.js +913 -441
- 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 +6 -3
- 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 +28 -3
- package/dist/harness/runtime.js +702 -274
- package/dist/harness/runtime.js.map +1 -1
- package/dist/harness/types-public.d.ts +39 -1
- package/dist/harness/types-public.js +913 -441
- package/dist/harness/types-public.js.map +1 -1
- package/dist/harness/validator-trace-sink.d.ts +2 -1
- package/dist/index.d.ts +32 -6
- package/dist/index.js +4899 -3560
- package/dist/index.js.map +1 -1
- package/dist/patch.d.ts +3 -1
- package/dist/{prompts-BVhtH3M1.d.ts → prompts-YU9piOgs.d.ts} +21 -45
- package/dist/providers/index.d.ts +2 -2
- package/dist/providers/index.js.map +1 -1
- package/dist/styling-profile-CxfvV48g.d.ts +35 -0
- 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-DVSssdc-.d.ts} +85 -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 +3 -1
- package/package.json +12 -12
- package/src/adapters/generation-dispatch.ts +62 -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 +336 -0
- package/src/boilerplate/generate.ts +10 -1
- package/src/boilerplate/hard-sections.ts +257 -0
- package/src/boilerplate/render.ts +32 -8
- package/src/boilerplate/styling-profile.ts +166 -0
- package/src/boilerplate/system-prompt.ts +101 -237
- package/src/boilerplate/templates/base-free.tsx.tmpl +24 -0
- package/src/check/run-tier0.ts +82 -20
- package/src/coding-agent/tools.ts +8 -2
- package/src/contract-context.ts +43 -14
- package/src/create-harness.ts +15 -0
- package/src/create-ui-generator.ts +112 -27
- package/src/design-mode.ts +192 -0
- package/src/design-system-docs.ts +24 -17
- package/src/effort.ts +48 -0
- package/src/evaluation/axis-checks/checks/grid.ts +148 -0
- package/src/evaluation/axis-checks/checks/universal.ts +244 -0
- package/src/evaluation/axis-checks/dispatch.ts +82 -13
- package/src/evaluation/axis-checks/extras.ts +5 -0
- package/src/evaluation/axis-checks/helpers.ts +12 -0
- package/src/evaluation/axis-checks/registry.ts +2 -0
- package/src/evaluation/cost-tracker.ts +2 -3
- package/src/evaluation/design-identity.ts +96 -0
- package/src/evaluation/index.ts +63 -2
- package/src/evaluation/llm-evaluator.ts +89 -21
- package/src/evaluation/theme-css.ts +14 -0
- package/src/evaluation/types-public.ts +137 -8
- package/src/evaluation/visual-evaluator.ts +759 -54
- package/src/fragments/render.ts +1 -1
- package/src/harness/check/runtime-render/prepare-mockup.ts +18 -11
- package/src/harness/coding/dupe-break.ts +0 -0
- package/src/harness/coding/init-session.ts +2 -0
- package/src/harness/coding/run-coding-turn.ts +9 -14
- package/src/harness/coding/run-eval-round.ts +46 -5
- package/src/harness/llm-trace-sink.ts +3 -3
- package/src/harness/result-types.ts +15 -3
- package/src/harness/runtime.ts +28 -0
- package/src/harness/types-public.ts +38 -0
- package/src/index.ts +28 -0
- package/src/internal/extract-call-signatures.ts +2 -2
- package/src/pin-fixtures.ts +98 -0
- package/src/providers/bedrock.ts +4 -4
- package/src/run-check.ts +11 -10
- package/src/tools/get-primitives-ts.ts +1 -1
- package/src/tools.ts +2 -1
- package/src/validation/allowed-imports.ts +8 -2
- package/src/validation/primitives.ts +1 -1
- package/dist/create-ui-generator-D6TKuv9V.d.ts +0 -106
|
@@ -1,106 +0,0 @@
|
|
|
1
|
-
import { GadgetCatalogAdapter } from '@ggui-ai/gadgets';
|
|
2
|
-
import { GeneratorTier, UiGenerator } from '@ggui-ai/mcp-server-core';
|
|
3
|
-
import { Q as QualityConfig } from './types-public-CkNWEov9.js';
|
|
4
|
-
import { A as AgentConfig } from './llm-router-D7fjBhtr.js';
|
|
5
|
-
|
|
6
|
-
interface CreateUiGeneratorOptions {
|
|
7
|
-
/**
|
|
8
|
-
* Wire `DEFAULT_RUNTIME_RENDER_CHECK` into the harness's check leg.
|
|
9
|
-
* When `true`, every coding turn ends with a happy-dom runtime-render
|
|
10
|
-
* probe that catches contract-wiring bugs (missing `useAction()`,
|
|
11
|
-
* wrong stream channel name, etc.).
|
|
12
|
-
*
|
|
13
|
-
* Default: `false` for OSS — keeps cold-start light. The probe pulls
|
|
14
|
-
* happy-dom + @testing-library on first use (~700-1500ms cold). Bench
|
|
15
|
-
* enables it via dispatch's own default for stricter quality gating.
|
|
16
|
-
*/
|
|
17
|
-
readonly enableRuntimeRender?: boolean;
|
|
18
|
-
/** Maximum coding attempts per generation pass. */
|
|
19
|
-
readonly maxAttempts?: number;
|
|
20
|
-
/** Maximum evaluation rounds. */
|
|
21
|
-
readonly maxEvalRounds?: number;
|
|
22
|
-
/** Quality config controlling eval tiers + improvement behavior. */
|
|
23
|
-
readonly qualityConfig?: QualityConfig;
|
|
24
|
-
/**
|
|
25
|
-
* Generator identity — registry key + parsed components.
|
|
26
|
-
*
|
|
27
|
-
* The tier + model determine the {@link UiGenerator.slug} the
|
|
28
|
-
* factory bakes onto the returned generator. Defaults to
|
|
29
|
-
* `{tier: 'default', model: 'haiku-4-5'}` → slug
|
|
30
|
-
* `ui-gen-default-haiku-4-5`, the OSS seed.
|
|
31
|
-
*
|
|
32
|
-
* The actual model used per request still comes from
|
|
33
|
-
* `UiGenerateInput.llm.model` (operators may override via BYOK).
|
|
34
|
-
* The identity here is the registry-level handle, not a runtime
|
|
35
|
-
* model constraint.
|
|
36
|
-
*
|
|
37
|
-
* Mutually-exclusive shortcut: pass `slug` instead and the factory
|
|
38
|
-
* parses it for you. The slug + tier/model overloads conflict; the
|
|
39
|
-
* factory throws if both are supplied.
|
|
40
|
-
*/
|
|
41
|
-
readonly tier?: GeneratorTier;
|
|
42
|
-
readonly model?: string;
|
|
43
|
-
readonly slug?: string;
|
|
44
|
-
/**
|
|
45
|
-
* Per-deployment gadget descriptor source. Wired once at factory
|
|
46
|
-
* time; the generator resolves descriptors per-call via
|
|
47
|
-
* `gadgetCatalog.list(input.appId)` when `input.appGadgets` is
|
|
48
|
-
* absent. See {@link GadgetCatalogAdapter} (`@ggui-ai/gadgets`) for
|
|
49
|
-
* the port + the two batteries-included implementations.
|
|
50
|
-
*
|
|
51
|
-
* Wiring patterns:
|
|
52
|
-
*
|
|
53
|
-
* ```ts
|
|
54
|
-
* // OSS: stdlib seed, no app-specific catalogs.
|
|
55
|
-
* createUiGenerator({
|
|
56
|
-
* gadgetCatalog: InMemoryGadgetCatalog.withDefault(STDLIB_GADGETS),
|
|
57
|
-
* });
|
|
58
|
-
*
|
|
59
|
-
* // Cloud / prod: TTL cache over a registry-backed adapter.
|
|
60
|
-
* createUiGenerator({
|
|
61
|
-
* gadgetCatalog: new CachingGadgetCatalog(
|
|
62
|
-
* new DynamoGadgetCatalog(appMetadataStore),
|
|
63
|
-
* { ttlMs: 30_000 },
|
|
64
|
-
* ),
|
|
65
|
-
* });
|
|
66
|
-
* ```
|
|
67
|
-
*
|
|
68
|
-
* Per-call resolution precedence (in {@link UiGenerator.generate}):
|
|
69
|
-
*
|
|
70
|
-
* 1. `input.appGadgets` (pre-fetched by caller — handler-side path)
|
|
71
|
-
* 2. `gadgetCatalog.list(input.appId)` (factory path, this option)
|
|
72
|
-
* 3. empty list (legacy callers — no gadgets resolved)
|
|
73
|
-
*
|
|
74
|
-
* Optional. When omitted, callers MUST pre-fetch and pass
|
|
75
|
-
* `appGadgets` themselves; the legacy handler path stays unchanged.
|
|
76
|
-
*/
|
|
77
|
-
readonly gadgetCatalog?: GadgetCatalogAdapter;
|
|
78
|
-
/**
|
|
79
|
-
* When `true`, `generate()` never mutates `process.env` — the
|
|
80
|
-
* resolved provider route is threaded structurally into the
|
|
81
|
-
* dispatch call instead of being written to and restored from the
|
|
82
|
-
* process environment. Use this when running concurrent
|
|
83
|
-
* generations in one process (the default backup/mutate/restore
|
|
84
|
-
* dance is NOT concurrency-safe: two simultaneous calls race on
|
|
85
|
-
* the shared `process.env`).
|
|
86
|
-
*
|
|
87
|
-
* Default `false` — preserves the original env-mutation behavior
|
|
88
|
-
* for callers that don't need concurrent generations in-process.
|
|
89
|
-
*/
|
|
90
|
-
readonly disableEnvMutation?: boolean;
|
|
91
|
-
/**
|
|
92
|
-
* Retry observer (#489) — see `AgentConfig.onRetry`. Bound ONCE at
|
|
93
|
-
* factory construction time (mirrors `disableEnvMutation`), not
|
|
94
|
-
* per-call: `generate()` is invoked once per request, but the
|
|
95
|
-
* generator instance itself is typically long-lived and cached by
|
|
96
|
-
* the caller, so a single observer covers every generation it runs.
|
|
97
|
-
* Fires whenever any agent's `apiCall()` retries a rate-limited
|
|
98
|
-
* request. Absent (default) is a no-op — retries still happen and
|
|
99
|
-
* still log via `console.warn`, just without a caller-side hook.
|
|
100
|
-
*/
|
|
101
|
-
readonly onRetry?: AgentConfig['onRetry'];
|
|
102
|
-
}
|
|
103
|
-
declare function createUiGenerator(options?: CreateUiGeneratorOptions): UiGenerator;
|
|
104
|
-
declare function extractComponentCode(raw: string): string;
|
|
105
|
-
|
|
106
|
-
export { type CreateUiGeneratorOptions as C, createUiGenerator as c, extractComponentCode as e };
|