@ggui-ai/ui-gen 0.18.0 → 0.19.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 (62) hide show
  1. package/dist/adapters/generation-dispatch.d.ts +1 -1
  2. package/dist/adapters/generation-dispatch.js +197 -86
  3. package/dist/adapters/generation-dispatch.js.map +1 -1
  4. package/dist/adapters/index.js +4 -6
  5. package/dist/adapters/index.js.map +1 -1
  6. package/dist/advanced/index.d.ts +2 -2
  7. package/dist/advanced/index.js +131 -22
  8. package/dist/advanced/index.js.map +1 -1
  9. package/dist/boilerplate.js +2 -2
  10. package/dist/boilerplate.js.map +1 -1
  11. package/dist/check/index.d.ts +1 -1
  12. package/dist/check/index.js.map +1 -1
  13. package/dist/{create-ui-generator-C8Ki9Wz1.d.ts → create-ui-generator-CxPvudbs.d.ts} +1 -1
  14. package/dist/{dispatch-D2htzi9h.d.ts → dispatch-N8wdNOX-.d.ts} +4 -2
  15. package/dist/evaluation/axis-checks/index.d.ts +3 -3
  16. package/dist/evaluation/axis-checks/index.js +97 -3
  17. package/dist/evaluation/axis-checks/index.js.map +1 -1
  18. package/dist/evaluation/axis-checks/registry.d.ts +1 -1
  19. package/dist/evaluation/axis-checks/registry.js +92 -1
  20. package/dist/evaluation/axis-checks/registry.js.map +1 -1
  21. package/dist/evaluation/index.d.ts +3 -3
  22. package/dist/evaluation/index.js +167 -84
  23. package/dist/evaluation/index.js.map +1 -1
  24. package/dist/harness/check/runtime-render/index.d.ts +1 -1
  25. package/dist/harness/index.d.ts +1 -1
  26. package/dist/harness/index.js +64 -61
  27. package/dist/harness/index.js.map +1 -1
  28. package/dist/harness/prompts.js +1 -1
  29. package/dist/harness/prompts.js.map +1 -1
  30. package/dist/harness/result-types.d.ts +1 -1
  31. package/dist/harness/runtime.d.ts +1 -1
  32. package/dist/harness/runtime.js +4 -4
  33. package/dist/harness/runtime.js.map +1 -1
  34. package/dist/harness/types-public.d.ts +8 -1
  35. package/dist/harness/types-public.js +64 -61
  36. package/dist/harness/types-public.js.map +1 -1
  37. package/dist/harness/validator-trace-sink.d.ts +1 -1
  38. package/dist/index.d.ts +2 -2
  39. package/dist/index.js +131 -22
  40. package/dist/index.js.map +1 -1
  41. package/dist/patch.d.ts +1 -1
  42. package/dist/{types-public-DVSssdc-.d.ts → types-public-DKR_h70H.d.ts} +9 -0
  43. package/dist/validation/index.d.ts +1 -1
  44. package/dist/validation/index.js +1 -1
  45. package/dist/validation/index.js.map +1 -1
  46. package/dist/workflows.d.ts +1 -1
  47. package/package.json +12 -12
  48. package/src/adapters/google/sdk.ts +11 -7
  49. package/src/boilerplate/hard-sections.ts +1 -1
  50. package/src/boilerplate/system-prompt.ts +1 -1
  51. package/src/coding-agent/tools.ts +58 -6
  52. package/src/contract-context.ts +1 -1
  53. package/src/create-harness.ts +1 -0
  54. package/src/evaluation/axis-checks/checks/universal.ts +115 -1
  55. package/src/evaluation/axis-checks/dispatch.ts +8 -1
  56. package/src/evaluation/types-public.ts +9 -0
  57. package/src/harness/coding/generate-task-runner.ts +1 -0
  58. package/src/harness/coding/run-coding-turn.ts +14 -0
  59. package/src/harness/types-public.ts +7 -0
  60. package/src/run-check.ts +2 -0
  61. package/src/tools/get-wire.ts +1 -1
  62. package/src/validation/primitives.ts +1 -1
@@ -4,7 +4,7 @@ import { JsonObject, DataContract } from '@ggui-ai/protocol';
4
4
  import { RuntimeRenderCheck } from '../../types-public.js';
5
5
  import '../../../styling-profile-CxfvV48g.js';
6
6
  import '../../../axes-CzLEMDeB.js';
7
- import '../../../types-public-DVSssdc-.js';
7
+ import '../../../types-public-DKR_h70H.js';
8
8
  import '../../../design-mode-DLufhrNp.js';
9
9
  import '../../../types-BOvHNG7K.js';
10
10
  import '../../../llm.js';
@@ -10,7 +10,7 @@ export { computeHarnessId, computeHarnessName, hashClassification } from '../has
10
10
  import '@ggui-ai/protocol';
11
11
  import '../styling-profile-CxfvV48g.js';
12
12
  import '../axes-CzLEMDeB.js';
13
- import '../types-public-DVSssdc-.js';
13
+ import '../types-public-DKR_h70H.js';
14
14
  import '../design-mode-DLufhrNp.js';
15
15
  import '../types-BOvHNG7K.js';
16
16
  import '../llm.js';
@@ -203,6 +203,61 @@ function truncateSourceForTrace(source) {
203
203
  function newValidatorTraceId() {
204
204
  return Date.now().toString(36) + Math.random().toString(36).slice(2, 10);
205
205
  }
206
+
207
+ // src/design-mode.ts
208
+ var DEFAULT_DESIGN_MODE = "constrained";
209
+ function canvasDisplayModeForShell(shell) {
210
+ return shell === "chat" || shell === "inline" ? "inline" : "fullscreen";
211
+ }
212
+ function canvasForRendering(shellType, screen) {
213
+ const shell = shellType ?? "fullscreen";
214
+ if (canvasDisplayModeForShell(shell) === "inline") return "xs-chat-card";
215
+ if (shell === "spatial") return "md";
216
+ switch (screen ?? "universal") {
217
+ case "mobile":
218
+ return "mobile-fullscreen-small";
219
+ case "tablet":
220
+ return "md";
221
+ default:
222
+ return "lg";
223
+ }
224
+ }
225
+ var CANVAS_DESCRIPTORS = {
226
+ "xs-chat-card": {
227
+ label: "extra-small chat card",
228
+ minWidthPx: 320,
229
+ maxWidthPx: 480,
230
+ host: "an inline card inside a chat message bubble \u2014 the host draws the card border, shadow and rounded corners; the component fills the bubble width and takes its natural height"
231
+ },
232
+ "mobile-fullscreen-small": {
233
+ label: "small mobile fullscreen",
234
+ minWidthPx: 320,
235
+ maxWidthPx: 599,
236
+ host: "a phone-sized viewport the component owns edge to edge \u2014 single column, touch targets at least 44px, the component manages its own scroll"
237
+ },
238
+ md: {
239
+ label: "medium panel",
240
+ minWidthPx: 600,
241
+ maxWidthPx: 1023,
242
+ host: "a tablet viewport or a floating panel (spatial / picture-in-picture) \u2014 one or two columns, medium density"
243
+ },
244
+ lg: {
245
+ label: "large fullscreen",
246
+ minWidthPx: 1024,
247
+ maxWidthPx: 1439,
248
+ host: "a desktop viewport the component owns edge to edge \u2014 multi-column layouts, hover states and pointer interactions are available"
249
+ },
250
+ xl: {
251
+ label: "extra-large fullscreen",
252
+ minWidthPx: 1440,
253
+ maxWidthPx: 1920,
254
+ host: "a wide desktop viewport the component owns edge to edge \u2014 cap content width or use the extra room deliberately; never stretch a single column across the whole width"
255
+ }
256
+ };
257
+ function describeCanvas(canvas) {
258
+ const d = CANVAS_DESCRIPTORS[canvas];
259
+ return `This component renders on the \`${canvas}\` canvas (${d.label}): ${d.minWidthPx}\u2013${d.maxWidthPx}px wide, ${d.host}. Design for the whole range \u2014 the host may size the iframe anywhere inside it, and the host owns the height: size to your content, never to the viewport.`;
260
+ }
206
261
  function axisCheckTraceEnabled() {
207
262
  return process.env["GGUI_AXIS_CHECK_TRACE"] === "1";
208
263
  }
@@ -468,7 +523,9 @@ function traceFacts(input) {
468
523
  designMode: input.designMode ?? "constrained",
469
524
  classification: input.classification.vector,
470
525
  propsSpecKeys: Object.keys(propsSpec ?? {}),
471
- propsSpecPropertyKeys: Object.keys(propsSpec?.properties ?? {})
526
+ propsSpecPropertyKeys: Object.keys(propsSpec?.properties ?? {}),
527
+ // No default here, unlike designMode: an absent canvas is a fact about the caller, not a guess to paper over.
528
+ ...input.canvas !== void 0 ? { canvas: input.canvas } : {}
472
529
  };
473
530
  }
474
531
 
@@ -523,7 +580,9 @@ async function runCheck(input) {
523
580
  contract,
524
581
  originalPrompt: prompt,
525
582
  classification: harness.classification,
526
- designMode: harness.designMode
583
+ designMode: harness.designMode,
584
+ // ggui#1117: the canvas the harness was built for, when it has one — never a default.
585
+ ...harness.canvas !== void 0 ? { canvas: harness.canvas } : {}
527
586
  };
528
587
  const axisRun = runGatedAxisChecks(check.axisChecks, axisInput);
529
588
  issues.push(...axisRun.issues);
@@ -1153,63 +1212,6 @@ function compose(classification) {
1153
1212
  fragments: matched
1154
1213
  };
1155
1214
  }
1156
-
1157
- // src/design-mode.ts
1158
- var DEFAULT_DESIGN_MODE = "constrained";
1159
- function canvasDisplayModeForShell(shell) {
1160
- return shell === "chat" || shell === "inline" ? "inline" : "fullscreen";
1161
- }
1162
- function canvasForRendering(shellType, screen) {
1163
- const shell = shellType ?? "fullscreen";
1164
- if (canvasDisplayModeForShell(shell) === "inline") return "xs-chat-card";
1165
- if (shell === "spatial") return "md";
1166
- switch (screen ?? "universal") {
1167
- case "mobile":
1168
- return "mobile-fullscreen-small";
1169
- case "tablet":
1170
- return "md";
1171
- default:
1172
- return "lg";
1173
- }
1174
- }
1175
- var CANVAS_DESCRIPTORS = {
1176
- "xs-chat-card": {
1177
- label: "extra-small chat card",
1178
- minWidthPx: 320,
1179
- maxWidthPx: 480,
1180
- host: "an inline card inside a chat message bubble \u2014 the host draws the card border, shadow and rounded corners; the component fills the bubble width and takes its natural height"
1181
- },
1182
- "mobile-fullscreen-small": {
1183
- label: "small mobile fullscreen",
1184
- minWidthPx: 320,
1185
- maxWidthPx: 599,
1186
- host: "a phone-sized viewport the component owns edge to edge \u2014 single column, touch targets at least 44px, the component manages its own scroll"
1187
- },
1188
- md: {
1189
- label: "medium panel",
1190
- minWidthPx: 600,
1191
- maxWidthPx: 1023,
1192
- host: "a tablet viewport or a floating panel (spatial / picture-in-picture) \u2014 one or two columns, medium density"
1193
- },
1194
- lg: {
1195
- label: "large fullscreen",
1196
- minWidthPx: 1024,
1197
- maxWidthPx: 1439,
1198
- host: "a desktop viewport the component owns edge to edge \u2014 multi-column layouts, hover states and pointer interactions are available"
1199
- },
1200
- xl: {
1201
- label: "extra-large fullscreen",
1202
- minWidthPx: 1440,
1203
- maxWidthPx: 1920,
1204
- host: "a wide desktop viewport the component owns edge to edge \u2014 cap content width or use the extra room deliberately; never stretch a single column across the whole width"
1205
- }
1206
- };
1207
- function describeCanvas(canvas) {
1208
- const d = CANVAS_DESCRIPTORS[canvas];
1209
- return `This component renders on the \`${canvas}\` canvas (${d.label}): ${d.minWidthPx}\u2013${d.maxWidthPx}px wide, ${d.host}. Design for the whole range \u2014 the host may size the iframe anywhere inside it, and the host owns the height: size to your content, never to the viewport.`;
1210
- }
1211
-
1212
- // src/boilerplate/render.ts
1213
1215
  var __dirname$1 = dirname(fileURLToPath(import.meta.url));
1214
1216
  var TEMPLATE_DIRS = [
1215
1217
  resolve(__dirname$1, "templates"),
@@ -1815,7 +1817,7 @@ Rules:
1815
1817
  1. All request-specific data \u2192 props with defaults. City names, tickers, user names, dates, counts.
1816
1818
  2. Layout and styling are universal. Colors, spacing, structure \u2014 these are the reusable part.
1817
1819
  3. Default values come from the current request \u2014 so the component renders correctly standalone.
1818
- 4. Copy comes from the props. NEVER invent display text the contract does not carry \u2014 no eyebrow / kicker / overline (a \`<Text caps>\` label), no helper line, no status text, no tagline. A caps label exists only when a prop supplies its text (\`<Text caps>{props.section}</Text>\`); a heading's fallback is the request's own words, never a slogan of your own. Text the agent cannot change is chatter on every render.
1820
+ 4. Copy comes from the props. NEVER invent display text the contract does not carry \u2014 no eyebrow / kicker / overline (a \`<Text caps>\` label), no helper line, no status text, no tagline. **Do NOT add a caps label above the heading** \u2014 not \`<Text caps>LET'S BEGIN</Text>\`, not \`WELCOME\`, not a section kicker like \`GETTING STARTED\` or \`OVERVIEW\` \u2014 UNLESS a prop supplies that exact text (\`<Text caps>{props.section}</Text>\`). When the request asks for a heading and a line, render the heading and the line and NOTHING above the heading. A heading's fallback is the request's own words, never a slogan of your own. Text the agent cannot change is chatter on every render, and a caps eyebrow you wrote is the most common form of it.
1819
1821
  5. Props interface must be typed and exported.`;
1820
1822
  var TERMINAL_ACTIONS = `## Actions the user means once
1821
1823
 
@@ -2662,7 +2664,7 @@ Don't render text-only metrics. A weather widget without a sun/cloud, a stock ca
2662
2664
  </Row>
2663
2665
  \`\`\`
2664
2666
 
2665
- Use \`<Icon name="..." />\` for line icons \u2014 ONLY the curated Lucide subset renders (call \`get_available_icons\` for the exact kebab-case names; a name outside it renders an empty box and fails the check); emoji directly for status/weather/mood. Both are valid. For per-stat tiny accents, use a small icon next to the label.
2667
+ Use \`<Icon name="..." />\` for line icons \u2014 ONLY the design system's curated set renders (~200 kebab-case Lucide names); a name OUTSIDE it renders an empty box and fails the check. On a single-pass render you cannot look the set up, so use ONLY a name you are sure is in it. Safe common names: \`check\` \`x\` \`plus\` \`minus\` \`search\` \`settings\` \`user\` \`users\` \`calendar\` \`clock\` \`arrow-right\` \`arrow-left\` \`chevron-right\` \`chevron-down\` \`trash-2\` \`edit\` \`info\` \`alert-circle\` \`bell\` \`home\` \`file\` \`file-text\` \`star\` \`heart\` \`mail\` \`send\` \`download\` \`upload\` \`external-link\` \`filter\` \`check-circle\`. The numbered variants (\`edit-2\`, \`edit-3\`) and synonyms (\`pencil\`, \`pen\`, \`trash\`, \`x-circle\`) are NOT in the set \u2014 use \`edit\` and \`trash-2\`. If the icon you want is not clearly one of these, OMIT it: a card with no icon beats one with an empty box. Emoji render directly for status/weather/mood. For per-stat tiny accents, use a small icon next to the label.
2666
2668
 
2667
2669
  ### Spacing \u2014 generosity beats compactness
2668
2670
 
@@ -3169,6 +3171,7 @@ function createHarness(input) {
3169
3171
  name,
3170
3172
  classification,
3171
3173
  designMode,
3174
+ ...input.canvas !== void 0 ? { canvas: input.canvas } : {},
3172
3175
  ...input.profile !== void 0 ? { profile: input.profile } : {},
3173
3176
  how,
3174
3177
  what,