@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.
Files changed (142) hide show
  1. package/README.md +2 -2
  2. package/dist/{adapter-Du7P_5Fx.d.ts → adapter-BJwn74rx.d.ts} +49 -1
  3. package/dist/adapters/generation-dispatch.d.ts +32 -7
  4. package/dist/adapters/generation-dispatch.js +1997 -216
  5. package/dist/adapters/generation-dispatch.js.map +1 -1
  6. package/dist/adapters/index.js +29 -6
  7. package/dist/adapters/index.js.map +1 -1
  8. package/dist/advanced/index.d.ts +15 -12
  9. package/dist/advanced/index.js +2013 -270
  10. package/dist/advanced/index.js.map +1 -1
  11. package/dist/{axes-CzLEMDeB.d.ts → axes-CKVCzR_x.d.ts} +1 -1
  12. package/dist/bank-Ctdp3FUA.d.ts +118 -0
  13. package/dist/blueprint-validator.js +416 -92
  14. package/dist/blueprint-validator.js.map +1 -1
  15. package/dist/boilerplate.d.ts +2 -2
  16. package/dist/boilerplate.js +34 -15
  17. package/dist/boilerplate.js.map +1 -1
  18. package/dist/check/index.d.ts +13 -5
  19. package/dist/check/index.js +56 -3
  20. package/dist/check/index.js.map +1 -1
  21. package/dist/classifier/index.d.ts +2 -2
  22. package/dist/compose.d.ts +2 -2
  23. package/dist/{create-ui-generator-GIhzx08x.d.ts → create-ui-generator-N4gRXpcL.d.ts} +11 -4
  24. package/dist/{design-mode-DLufhrNp.d.ts → design-mode-DGWN_Gkm.d.ts} +1 -1
  25. package/dist/{dispatch-BnAH56p4.d.ts → dispatch-BUoXRj_r.d.ts} +6 -4
  26. package/dist/evaluation/axis-checks/index.d.ts +7 -6
  27. package/dist/evaluation/axis-checks/index.js +90 -2
  28. package/dist/evaluation/axis-checks/index.js.map +1 -1
  29. package/dist/evaluation/axis-checks/registry.d.ts +6 -5
  30. package/dist/evaluation/axis-checks/registry.js +88 -1
  31. package/dist/evaluation/axis-checks/registry.js.map +1 -1
  32. package/dist/evaluation/index.d.ts +189 -344
  33. package/dist/evaluation/index.js +1272 -59
  34. package/dist/evaluation/index.js.map +1 -1
  35. package/dist/evaluation/types.d.ts +26 -1
  36. package/dist/evaluation/types.js.map +1 -1
  37. package/dist/fragments/index.d.ts +3 -3
  38. package/dist/{generate-9IeNT4ZY.d.ts → generate-tSO_shQ0.d.ts} +1 -1
  39. package/dist/harness/check/runtime-render/index.d.ts +7 -7
  40. package/dist/harness/check/runtime-render/index.js +416 -92
  41. package/dist/harness/check/runtime-render/index.js.map +1 -1
  42. package/dist/harness/check/runtime-render/render-check-worker.js +393 -88
  43. package/dist/harness/check/runtime-render/render-check-worker.js.map +1 -1
  44. package/dist/harness/index.d.ts +5 -6
  45. package/dist/harness/index.js +69 -20
  46. package/dist/harness/index.js.map +1 -1
  47. package/dist/harness/prompts.d.ts +2 -2
  48. package/dist/harness/prompts.js +10 -1
  49. package/dist/harness/prompts.js.map +1 -1
  50. package/dist/harness/result-types.d.ts +19 -5
  51. package/dist/harness/result-types.js.map +1 -1
  52. package/dist/harness/runtime.d.ts +21 -7
  53. package/dist/harness/runtime.js +36 -17
  54. package/dist/harness/runtime.js.map +1 -1
  55. package/dist/harness/types-public.d.ts +6 -4
  56. package/dist/harness/types-public.js +43 -18
  57. package/dist/harness/types-public.js.map +1 -1
  58. package/dist/harness/validator-trace-sink.d.ts +6 -5
  59. package/dist/hash.d.ts +1 -1
  60. package/dist/index.d.ts +64 -13
  61. package/dist/index.js +2023 -270
  62. package/dist/index.js.map +1 -1
  63. package/dist/patch.d.ts +5 -5
  64. package/dist/policy.d.ts +1 -1
  65. package/dist/{prompts-YU9piOgs.d.ts → prompts-BhNUuRoZ.d.ts} +1 -1
  66. package/dist/tools/get-primitives-ts.d.ts +1 -1
  67. package/dist/tools/get-primitives-ts.js +1 -1
  68. package/dist/tools/get-primitives-ts.js.map +1 -1
  69. package/dist/tools/render-check-worker.js +8 -1
  70. package/dist/tools/render-check-worker.js.map +1 -1
  71. package/dist/{types-BOvHNG7K.d.ts → types-Dh1s4K9j.d.ts} +1 -1
  72. package/dist/types-public-B7wn4ce5.d.ts +959 -0
  73. package/dist/validation/index.d.ts +1 -1
  74. package/dist/validation/index.js +1 -1
  75. package/dist/validation/index.js.map +1 -1
  76. package/dist/visual-evaluator-C9L-o6ap.d.ts +639 -0
  77. package/dist/workflows.d.ts +5 -5
  78. package/package.json +12 -12
  79. package/src/adapters/generation-dispatch.ts +38 -2
  80. package/src/adapters/tools.ts +2 -1
  81. package/src/boilerplate/free-design-prompt.ts +4 -4
  82. package/src/boilerplate/generate.ts +26 -1
  83. package/src/boilerplate/hard-sections.ts +14 -14
  84. package/src/boilerplate/system-prompt.ts +1 -1
  85. package/src/boilerplate/templates/layouts/chat-mobile.tsx.tmpl +3 -1
  86. package/src/boilerplate/templates/layouts/chat-universal.tsx.tmpl +3 -1
  87. package/src/boilerplate/templates/layouts/fullscreen-desktop.tsx.tmpl +3 -1
  88. package/src/boilerplate/templates/layouts/fullscreen-universal.tsx.tmpl +3 -1
  89. package/src/check/index.ts +1 -0
  90. package/src/check/run-tier0.ts +6 -3
  91. package/src/check/sample-props.ts +63 -0
  92. package/src/coding-agent/tools.ts +4 -1
  93. package/src/contract-context.ts +1 -1
  94. package/src/create-harness.ts +3 -3
  95. package/src/create-ui-generator.ts +20 -1
  96. package/src/evaluation/__fixtures__/png.ts +100 -0
  97. package/src/evaluation/axis-checks/checks/state-merge.ts +1 -1
  98. package/src/evaluation/axis-checks/checks/universal.ts +111 -0
  99. package/src/evaluation/axis-checks/dispatch.ts +4 -1
  100. package/src/evaluation/cost-tracker.ts +54 -6
  101. package/src/evaluation/criteria/bank.ts +85 -0
  102. package/src/evaluation/criteria/context.ts +52 -0
  103. package/src/evaluation/criteria/edge-probe.ts +286 -0
  104. package/src/evaluation/criteria/edge.ts +202 -0
  105. package/src/evaluation/criteria/resolve.ts +207 -0
  106. package/src/evaluation/criteria/select.ts +79 -0
  107. package/src/evaluation/index.ts +27 -0
  108. package/src/evaluation/ink-extent.ts +200 -0
  109. package/src/evaluation/judge-spend.ts +48 -0
  110. package/src/evaluation/theme-css.ts +12 -5
  111. package/src/evaluation/types-public.ts +221 -3
  112. package/src/evaluation/types.ts +19 -0
  113. package/src/evaluation/visual-evaluator.ts +853 -51
  114. package/src/harness/check/runtime-render/adapter.ts +18 -0
  115. package/src/harness/check/runtime-render/probe-pending.ts +111 -0
  116. package/src/harness/check/runtime-render/render-check-host.ts +10 -6
  117. package/src/harness/check/runtime-render/render-check-worker.ts +6 -3
  118. package/src/harness/check/runtime-render/render-check.ts +417 -133
  119. package/src/harness/check/runtime-render/walk.ts +200 -0
  120. package/src/harness/coding/assemble-result.ts +2 -0
  121. package/src/harness/coding/generate-task-runner.ts +30 -0
  122. package/src/harness/coding/init-session.ts +5 -3
  123. package/src/harness/coding/run-coding-turn.ts +12 -4
  124. package/src/harness/coding/run-eval-round.ts +82 -3
  125. package/src/harness/in-loop-evaluation.ts +39 -0
  126. package/src/harness/llm-router.ts +58 -1
  127. package/src/harness/result-types.ts +9 -0
  128. package/src/harness/runtime.ts +14 -0
  129. package/src/harness/types-public.ts +10 -1
  130. package/src/harness-tool-names.ts +38 -0
  131. package/src/index.ts +17 -0
  132. package/src/internal/verdict-line.ts +33 -0
  133. package/src/run-check.ts +2 -0
  134. package/src/taught-tokens.ts +32 -0
  135. package/src/tools/get-primitives-ts.ts +1 -1
  136. package/src/tools/get-wire.ts +1 -1
  137. package/src/tools/render-check-worker.ts +2 -1
  138. package/src/tools/render-check.ts +8 -67
  139. package/src/tools.ts +11 -1
  140. package/src/validation/primitives.ts +1 -1
  141. package/dist/llm-router-DwwUK1bz.d.ts +0 -265
  142. package/dist/types-public-Bk6d1WLN.d.ts +0 -451
@@ -1,9 +1,10 @@
1
- import { C as Classification } from '../axes-CzLEMDeB.js';
2
- import { E as EvalIssue } from '../types-public-Bk6d1WLN.js';
3
- import '@ggui-ai/mcp-server-core';
4
- import '../design-mode-DLufhrNp.js';
1
+ import { C as Classification } from '../axes-CKVCzR_x.js';
2
+ import { E as EvalIssue } from '../types-public-B7wn4ce5.js';
5
3
  import '@ggui-ai/protocol';
6
- import '../types-BOvHNG7K.js';
4
+ import '../llm.js';
5
+ import '@ggui-ai/mcp-server-core';
6
+ import '../design-mode-DGWN_Gkm.js';
7
+ import '../types-Dh1s4K9j.js';
7
8
 
8
9
  /**
9
10
  * Live validator-tier trace sink — devtools introspection of every
package/dist/hash.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { C as Classification } from './axes-CzLEMDeB.js';
1
+ import { C as Classification } from './axes-CKVCzR_x.js';
2
2
 
3
3
  /** Hash a classification — used as a sub-component of the harness id. */
4
4
  declare function hashClassification(c: Classification): string;
package/dist/index.d.ts CHANGED
@@ -1,27 +1,31 @@
1
- export { C as CreateUiGeneratorOptions, c as createUiGenerator, e as extractComponentCode } from './create-ui-generator-GIhzx08x.js';
2
- export { R as RuntimeRenderProbeConfig } from './adapter-Du7P_5Fx.js';
3
- export { P as ProviderRetryInfo } from './llm-router-DwwUK1bz.js';
1
+ export { C as CreateUiGeneratorOptions, c as createUiGenerator, e as extractComponentCode } from './create-ui-generator-N4gRXpcL.js';
2
+ export { R as RuntimeRenderProbeConfig } from './adapter-BJwn74rx.js';
3
+ import { Q as QualityConfig } from './types-public-B7wn4ce5.js';
4
+ export { P as ProviderRetryInfo } from './types-public-B7wn4ce5.js';
4
5
  export { GenerationResult, SameExchangeBreak } from './harness/result-types.js';
5
6
  import { GeneratorBuild, UiGenerator } from '@ggui-ai/mcp-server-core';
6
- import { D as DesignMode } from './design-mode-DLufhrNp.js';
7
- export { a as CANVAS_BREAKPOINTS, b as CANVAS_CLASSES, c as CANVAS_DESCRIPTORS, d as CANVAS_VIEWPORTS, C as CanvasClass, e as CanvasDescriptor, f as CanvasDisplayMode, g as CanvasViewport, h as DEFAULT_DESIGN_MODE, i as DESIGN_MODES, j as canvasDisplayModeForShell, k as canvasForRendering, l as canvasForViewportWidth, m as describeCanvas } from './design-mode-DLufhrNp.js';
7
+ import { D as DesignMode } from './design-mode-DGWN_Gkm.js';
8
+ export { b as CANVAS_BREAKPOINTS, c as CANVAS_CLASSES, d as CANVAS_DESCRIPTORS, e as CANVAS_VIEWPORTS, C as CanvasClass, f as CanvasDescriptor, g as CanvasDisplayMode, a as CanvasViewport, h as DEFAULT_DESIGN_MODE, i as DESIGN_MODES, j as canvasDisplayModeForShell, k as canvasForRendering, l as canvasForViewportWidth, m as describeCanvas } from './design-mode-DGWN_Gkm.js';
8
9
  export { CreateInMemoryGeneratorRegistryOptions, createInMemoryGeneratorRegistry } from '@ggui-ai/mcp-server-core/in-memory';
9
- export { R as RenderingContext, b as buildContractsContext, a as buildRenderingContext, c as buildVarianceContext, d as canvasForRenderingContext, i as injectContracts, e as injectRenderingContext, f as injectVariance } from './prompts-YU9piOgs.js';
10
+ export { R as RenderingContext, b as buildContractsContext, a as buildRenderingContext, c as buildVarianceContext, d as canvasForRenderingContext, i as injectContracts, e as injectRenderingContext, f as injectVariance } from './prompts-BhNUuRoZ.js';
11
+ import { LLMToolDef } from './llm.js';
10
12
  import Anthropic from '@anthropic-ai/sdk';
11
13
  export { A as AESTHETIC_BRIEF_MAX_CHARS, G as GenerationProfileInput } from './styling-profile-CxfvV48g.js';
14
+ export { VisualEvalAgentSpec } from './adapters/generation-dispatch.js';
12
15
  import { AppGenerationProfileEffort, ModelTier } from '@ggui-ai/protocol';
13
16
  import './harness/runtime.js';
14
- import './types-public-Bk6d1WLN.js';
15
- import './axes-CzLEMDeB.js';
16
- import './types-BOvHNG7K.js';
17
- import './generate-9IeNT4ZY.js';
18
- import './llm.js';
17
+ import './bank-Ctdp3FUA.js';
18
+ import 'zod';
19
+ import './generate-tSO_shQ0.js';
20
+ import './axes-CKVCzR_x.js';
21
+ import './types-Dh1s4K9j.js';
19
22
  import '@ggui-ai/gadgets';
20
23
  import './evaluation/types.js';
21
24
  import './harness/types-public.js';
22
25
  import './policy.js';
23
26
  import './adapters/types.js';
24
- import 'zod';
27
+ import './visual-evaluator-C9L-o6ap.js';
28
+ import 'puppeteer-core';
25
29
 
26
30
  /**
27
31
  * ui-gen's precise {@link GeneratorBuild}: the core port's generic shape with
@@ -37,6 +41,45 @@ interface UiGenBuild extends GeneratorBuild {
37
41
  readonly boilerplateTemplateSha256: string;
38
42
  };
39
43
  }
44
+ /**
45
+ * The build identity for `designMode`, computed once per process per design
46
+ * mode and pitfalls env gate (the only env the templates read), so a changed
47
+ * gate is never answered from a stale memo.
48
+ */
49
+ declare function generatorBuild(designMode: DesignMode): UiGenBuild;
50
+
51
+ /**
52
+ * Which in-loop evaluation legs a generation runs (ggui#1513).
53
+ *
54
+ * The harness gates its evaluation rounds on this, and nothing else does:
55
+ * the text evaluator runs when `evaluation.enabled`, and the visual judge
56
+ * runs when `visualEvaluation.enabled` or when a quality config asks for it
57
+ * (`qualityConfig.visualEval`). A host that needs to know whether a
58
+ * generation's token counts (`GenerationMetadata`) can include evaluation
59
+ * calls reads it here, with the options it configured the generator with,
60
+ * instead of keeping its own copy of the rule.
61
+ */
62
+
63
+ /** The switches that turn an in-loop evaluation leg on. */
64
+ interface InLoopEvaluationSwitches {
65
+ readonly evaluation?: {
66
+ readonly enabled: boolean;
67
+ };
68
+ readonly visualEvaluation?: {
69
+ readonly enabled: boolean;
70
+ };
71
+ readonly qualityConfig?: Pick<QualityConfig, "visualEval">;
72
+ }
73
+ /** The in-loop evaluation legs these options turn on. */
74
+ declare function inLoopEvaluation(options: InLoopEvaluationSwitches): {
75
+ readonly text: boolean;
76
+ readonly visual: boolean;
77
+ };
78
+ /**
79
+ * True when these options turn either leg on: a generation built with them
80
+ * can spend tokens on evaluation calls as well as on its coding turns.
81
+ */
82
+ declare function runsInLoopEvaluation(options: InLoopEvaluationSwitches): boolean;
40
83
 
41
84
  /**
42
85
  * Compile raw JSX/TSX component code emitted by `createUiGenerator` into
@@ -124,6 +167,14 @@ declare function compileComponentCode(source: string): Promise<string>;
124
167
  */
125
168
  declare function withBrowserCompile(generator: UiGenerator): UiGenerator;
126
169
 
170
+ /** The coding tools every harness declares (`what.codingTools`). */
171
+ declare const HARNESS_CODING_TOOLS: readonly LLMToolDef[];
172
+ /** The scoped fallback the runtime promotes into `codingTools` on a duplicate-fingerprint escape. */
173
+ declare const HARNESS_SCOPED_TOOLS: readonly LLMToolDef[];
174
+ /** One tool's entry: `<name>@<first 8 hex of sha256(JSON.stringify(def))>`. */
175
+ declare function harnessToolEntry(def: LLMToolDef): string;
176
+ declare function harnessToolNames(designMode: DesignMode): string[];
177
+
127
178
  /**
128
179
  * Construct an Anthropic SDK client from a raw API key string.
129
180
  *
@@ -187,4 +238,4 @@ declare const EFFORT_DIALS: Readonly<Record<AppGenerationProfileEffort, EffortDi
187
238
  /** The dials for a named level; `undefined` when no level is named (the deployment's options stand). */
188
239
  declare function effortDials(effort: AppGenerationProfileEffort | undefined): EffortDials | undefined;
189
240
 
190
- export { CLAUDE_CODE_LOGIN_CREDENTIAL, CompileComponentCodeError, DesignMode, EFFORT_DIALS, EFFORT_TABLE_VERSION, type EffortDials, type UiGenBuild, compileComponentCode, createAnthropicClient, effortDials, withBrowserCompile };
241
+ export { CLAUDE_CODE_LOGIN_CREDENTIAL, CompileComponentCodeError, DesignMode, EFFORT_DIALS, EFFORT_TABLE_VERSION, type EffortDials, HARNESS_CODING_TOOLS, HARNESS_SCOPED_TOOLS, type InLoopEvaluationSwitches, type UiGenBuild, compileComponentCode, createAnthropicClient, effortDials, generatorBuild, harnessToolEntry, harnessToolNames, inLoopEvaluation, runsInLoopEvaluation, withBrowserCompile };