@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.
Files changed (123) hide show
  1. package/dist/adapters/generation-dispatch.d.ts +24 -4
  2. package/dist/adapters/generation-dispatch.js +5188 -3920
  3. package/dist/adapters/generation-dispatch.js.map +1 -1
  4. package/dist/adapters/index.js +33 -26
  5. package/dist/adapters/index.js.map +1 -1
  6. package/dist/advanced/index.d.ts +22 -13
  7. package/dist/advanced/index.js +4889 -3561
  8. package/dist/advanced/index.js.map +1 -1
  9. package/dist/blueprint-validator.js +8 -12
  10. package/dist/blueprint-validator.js.map +1 -1
  11. package/dist/boilerplate.d.ts +19 -1
  12. package/dist/boilerplate.js +671 -254
  13. package/dist/boilerplate.js.map +1 -1
  14. package/dist/check/index.d.ts +17 -3
  15. package/dist/check/index.js +34 -25
  16. package/dist/check/index.js.map +1 -1
  17. package/dist/compose.js +1 -1
  18. package/dist/compose.js.map +1 -1
  19. package/dist/create-ui-generator-C8Ki9Wz1.d.ts +189 -0
  20. package/dist/design-mode-DLufhrNp.d.ts +61 -0
  21. package/dist/{dispatch-BuZfTh9r.d.ts → dispatch-D2htzi9h.d.ts} +4 -1
  22. package/dist/evaluation/axis-checks/index.d.ts +4 -3
  23. package/dist/evaluation/axis-checks/index.js +300 -14
  24. package/dist/evaluation/axis-checks/index.js.map +1 -1
  25. package/dist/evaluation/axis-checks/registry.d.ts +2 -1
  26. package/dist/evaluation/axis-checks/registry.js +253 -1
  27. package/dist/evaluation/axis-checks/registry.js.map +1 -1
  28. package/dist/evaluation/index.d.ts +297 -5
  29. package/dist/evaluation/index.js +4515 -120
  30. package/dist/evaluation/index.js.map +1 -1
  31. package/dist/fragments/index.js +1 -1
  32. package/dist/fragments/index.js.map +1 -1
  33. package/dist/{generate-BTfvELgl.d.ts → generate-9IeNT4ZY.d.ts} +10 -1
  34. package/dist/harness/check/runtime-render/index.d.ts +3 -1
  35. package/dist/harness/check/runtime-render/index.js +8 -12
  36. package/dist/harness/check/runtime-render/index.js.map +1 -1
  37. package/dist/harness/index.d.ts +3 -1
  38. package/dist/harness/index.js +913 -441
  39. package/dist/harness/index.js.map +1 -1
  40. package/dist/harness/llm-trace-sink.d.ts +3 -3
  41. package/dist/harness/llm-trace-sink.js.map +1 -1
  42. package/dist/harness/prompts.d.ts +2 -1
  43. package/dist/harness/prompts.js +6 -3
  44. package/dist/harness/prompts.js.map +1 -1
  45. package/dist/harness/result-types.d.ts +17 -5
  46. package/dist/harness/result-types.js.map +1 -1
  47. package/dist/harness/runtime.d.ts +28 -3
  48. package/dist/harness/runtime.js +702 -274
  49. package/dist/harness/runtime.js.map +1 -1
  50. package/dist/harness/types-public.d.ts +39 -1
  51. package/dist/harness/types-public.js +913 -441
  52. package/dist/harness/types-public.js.map +1 -1
  53. package/dist/harness/validator-trace-sink.d.ts +2 -1
  54. package/dist/index.d.ts +32 -6
  55. package/dist/index.js +4899 -3560
  56. package/dist/index.js.map +1 -1
  57. package/dist/patch.d.ts +3 -1
  58. package/dist/{prompts-BVhtH3M1.d.ts → prompts-YU9piOgs.d.ts} +21 -45
  59. package/dist/providers/index.d.ts +2 -2
  60. package/dist/providers/index.js.map +1 -1
  61. package/dist/styling-profile-CxfvV48g.d.ts +35 -0
  62. package/dist/tools/get-primitives-ts.d.ts +1 -1
  63. package/dist/tools/get-primitives-ts.js +1 -1
  64. package/dist/tools/get-primitives-ts.js.map +1 -1
  65. package/dist/{types-public-CkNWEov9.d.ts → types-public-DVSssdc-.d.ts} +85 -5
  66. package/dist/validation/index.d.ts +1 -1
  67. package/dist/validation/index.js +4 -4
  68. package/dist/validation/index.js.map +1 -1
  69. package/dist/workflows.d.ts +3 -1
  70. package/package.json +12 -12
  71. package/src/adapters/generation-dispatch.ts +62 -4
  72. package/src/adapters/provider-router.ts +7 -6
  73. package/src/adapters/tools.ts +5 -5
  74. package/src/advanced/generator.ts +11 -10
  75. package/src/advanced/index.ts +5 -4
  76. package/src/boilerplate/free-design-prompt.ts +336 -0
  77. package/src/boilerplate/generate.ts +10 -1
  78. package/src/boilerplate/hard-sections.ts +257 -0
  79. package/src/boilerplate/render.ts +32 -8
  80. package/src/boilerplate/styling-profile.ts +166 -0
  81. package/src/boilerplate/system-prompt.ts +101 -237
  82. package/src/boilerplate/templates/base-free.tsx.tmpl +24 -0
  83. package/src/check/run-tier0.ts +82 -20
  84. package/src/coding-agent/tools.ts +8 -2
  85. package/src/contract-context.ts +43 -14
  86. package/src/create-harness.ts +15 -0
  87. package/src/create-ui-generator.ts +112 -27
  88. package/src/design-mode.ts +192 -0
  89. package/src/design-system-docs.ts +24 -17
  90. package/src/effort.ts +48 -0
  91. package/src/evaluation/axis-checks/checks/grid.ts +148 -0
  92. package/src/evaluation/axis-checks/checks/universal.ts +244 -0
  93. package/src/evaluation/axis-checks/dispatch.ts +82 -13
  94. package/src/evaluation/axis-checks/extras.ts +5 -0
  95. package/src/evaluation/axis-checks/helpers.ts +12 -0
  96. package/src/evaluation/axis-checks/registry.ts +2 -0
  97. package/src/evaluation/cost-tracker.ts +2 -3
  98. package/src/evaluation/design-identity.ts +96 -0
  99. package/src/evaluation/index.ts +63 -2
  100. package/src/evaluation/llm-evaluator.ts +89 -21
  101. package/src/evaluation/theme-css.ts +14 -0
  102. package/src/evaluation/types-public.ts +137 -8
  103. package/src/evaluation/visual-evaluator.ts +759 -54
  104. package/src/fragments/render.ts +1 -1
  105. package/src/harness/check/runtime-render/prepare-mockup.ts +18 -11
  106. package/src/harness/coding/dupe-break.ts +0 -0
  107. package/src/harness/coding/init-session.ts +2 -0
  108. package/src/harness/coding/run-coding-turn.ts +9 -14
  109. package/src/harness/coding/run-eval-round.ts +46 -5
  110. package/src/harness/llm-trace-sink.ts +3 -3
  111. package/src/harness/result-types.ts +15 -3
  112. package/src/harness/runtime.ts +28 -0
  113. package/src/harness/types-public.ts +38 -0
  114. package/src/index.ts +28 -0
  115. package/src/internal/extract-call-signatures.ts +2 -2
  116. package/src/pin-fixtures.ts +98 -0
  117. package/src/providers/bedrock.ts +4 -4
  118. package/src/run-check.ts +11 -10
  119. package/src/tools/get-primitives-ts.ts +1 -1
  120. package/src/tools.ts +2 -1
  121. package/src/validation/allowed-imports.ts +8 -2
  122. package/src/validation/primitives.ts +1 -1
  123. 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 };