@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
@@ -2,7 +2,7 @@ import * as _ggui_ai_protocol from '@ggui-ai/protocol';
2
2
  import { JsonValue, DataContract, JsonObject, GadgetDescriptor } from '@ggui-ai/protocol';
3
3
  import { G as GenerationProfileInput } from '../styling-profile-CxfvV48g.js';
4
4
  import { C as Classification } from '../axes-CzLEMDeB.js';
5
- import { E as EvalIssue, R as RuntimeProbeStatus, A as AxisCheck, c as EvalTier } from '../types-public-DVSssdc-.js';
5
+ import { E as EvalIssue, R as RuntimeProbeStatus, A as AxisCheck, c as EvalTier } from '../types-public-DKR_h70H.js';
6
6
  import { LLMToolDef } from '../llm.js';
7
7
  import { H as HarnessFragment, a as CacheTier } from '../types-BOvHNG7K.js';
8
8
  import { ProcessMode, HarnessPolicy } from '../policy.js';
@@ -365,6 +365,13 @@ interface Harness {
365
365
  * into `free`.
366
366
  */
367
367
  readonly designMode: DesignMode;
368
+ /**
369
+ * The rendering canvas this harness was built for (ggui#1117) — threaded
370
+ * from `CreateHarnessInput.canvas` into the HOW leg (the `free` prompt
371
+ * states it) and, via `run-check.ts`, onto every axis check's input.
372
+ * ABSENT when the caller had no rendering context; never defaulted.
373
+ */
374
+ readonly canvas?: CanvasClass;
368
375
  /** The app's generation profile in force for this harness (#991), if any. */
369
376
  readonly profile?: GenerationProfileInput;
370
377
  readonly how: HowLeg;
@@ -65,6 +65,61 @@ function truncateSourceForTrace(source) {
65
65
  function newValidatorTraceId() {
66
66
  return Date.now().toString(36) + Math.random().toString(36).slice(2, 10);
67
67
  }
68
+
69
+ // src/design-mode.ts
70
+ var DEFAULT_DESIGN_MODE = "constrained";
71
+ function canvasDisplayModeForShell(shell) {
72
+ return shell === "chat" || shell === "inline" ? "inline" : "fullscreen";
73
+ }
74
+ function canvasForRendering(shellType, screen) {
75
+ const shell = shellType ?? "fullscreen";
76
+ if (canvasDisplayModeForShell(shell) === "inline") return "xs-chat-card";
77
+ if (shell === "spatial") return "md";
78
+ switch (screen ?? "universal") {
79
+ case "mobile":
80
+ return "mobile-fullscreen-small";
81
+ case "tablet":
82
+ return "md";
83
+ default:
84
+ return "lg";
85
+ }
86
+ }
87
+ var CANVAS_DESCRIPTORS = {
88
+ "xs-chat-card": {
89
+ label: "extra-small chat card",
90
+ minWidthPx: 320,
91
+ maxWidthPx: 480,
92
+ 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"
93
+ },
94
+ "mobile-fullscreen-small": {
95
+ label: "small mobile fullscreen",
96
+ minWidthPx: 320,
97
+ maxWidthPx: 599,
98
+ 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"
99
+ },
100
+ md: {
101
+ label: "medium panel",
102
+ minWidthPx: 600,
103
+ maxWidthPx: 1023,
104
+ host: "a tablet viewport or a floating panel (spatial / picture-in-picture) \u2014 one or two columns, medium density"
105
+ },
106
+ lg: {
107
+ label: "large fullscreen",
108
+ minWidthPx: 1024,
109
+ maxWidthPx: 1439,
110
+ host: "a desktop viewport the component owns edge to edge \u2014 multi-column layouts, hover states and pointer interactions are available"
111
+ },
112
+ xl: {
113
+ label: "extra-large fullscreen",
114
+ minWidthPx: 1440,
115
+ maxWidthPx: 1920,
116
+ 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"
117
+ }
118
+ };
119
+ function describeCanvas(canvas) {
120
+ const d = CANVAS_DESCRIPTORS[canvas];
121
+ 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.`;
122
+ }
68
123
  function axisCheckTraceEnabled() {
69
124
  return process.env["GGUI_AXIS_CHECK_TRACE"] === "1";
70
125
  }
@@ -330,7 +385,9 @@ function traceFacts(input) {
330
385
  designMode: input.designMode ?? "constrained",
331
386
  classification: input.classification.vector,
332
387
  propsSpecKeys: Object.keys(propsSpec ?? {}),
333
- propsSpecPropertyKeys: Object.keys(propsSpec?.properties ?? {})
388
+ propsSpecPropertyKeys: Object.keys(propsSpec?.properties ?? {}),
389
+ // No default here, unlike designMode: an absent canvas is a fact about the caller, not a guess to paper over.
390
+ ...input.canvas !== void 0 ? { canvas: input.canvas } : {}
334
391
  };
335
392
  }
336
393
 
@@ -368,7 +425,9 @@ async function runCheck(input) {
368
425
  contract,
369
426
  originalPrompt: prompt,
370
427
  classification: harness.classification,
371
- designMode: harness.designMode
428
+ designMode: harness.designMode,
429
+ // ggui#1117: the canvas the harness was built for, when it has one — never a default.
430
+ ...harness.canvas !== void 0 ? { canvas: harness.canvas } : {}
372
431
  };
373
432
  const axisRun = runGatedAxisChecks(check.axisChecks, axisInput);
374
433
  issues.push(...axisRun.issues);
@@ -984,63 +1043,6 @@ function compose(classification) {
984
1043
  fragments: matched
985
1044
  };
986
1045
  }
987
-
988
- // src/design-mode.ts
989
- var DEFAULT_DESIGN_MODE = "constrained";
990
- function canvasDisplayModeForShell(shell) {
991
- return shell === "chat" || shell === "inline" ? "inline" : "fullscreen";
992
- }
993
- function canvasForRendering(shellType, screen) {
994
- const shell = shellType ?? "fullscreen";
995
- if (canvasDisplayModeForShell(shell) === "inline") return "xs-chat-card";
996
- if (shell === "spatial") return "md";
997
- switch (screen ?? "universal") {
998
- case "mobile":
999
- return "mobile-fullscreen-small";
1000
- case "tablet":
1001
- return "md";
1002
- default:
1003
- return "lg";
1004
- }
1005
- }
1006
- var CANVAS_DESCRIPTORS = {
1007
- "xs-chat-card": {
1008
- label: "extra-small chat card",
1009
- minWidthPx: 320,
1010
- maxWidthPx: 480,
1011
- 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"
1012
- },
1013
- "mobile-fullscreen-small": {
1014
- label: "small mobile fullscreen",
1015
- minWidthPx: 320,
1016
- maxWidthPx: 599,
1017
- 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"
1018
- },
1019
- md: {
1020
- label: "medium panel",
1021
- minWidthPx: 600,
1022
- maxWidthPx: 1023,
1023
- host: "a tablet viewport or a floating panel (spatial / picture-in-picture) \u2014 one or two columns, medium density"
1024
- },
1025
- lg: {
1026
- label: "large fullscreen",
1027
- minWidthPx: 1024,
1028
- maxWidthPx: 1439,
1029
- host: "a desktop viewport the component owns edge to edge \u2014 multi-column layouts, hover states and pointer interactions are available"
1030
- },
1031
- xl: {
1032
- label: "extra-large fullscreen",
1033
- minWidthPx: 1440,
1034
- maxWidthPx: 1920,
1035
- 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"
1036
- }
1037
- };
1038
- function describeCanvas(canvas) {
1039
- const d = CANVAS_DESCRIPTORS[canvas];
1040
- 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.`;
1041
- }
1042
-
1043
- // src/boilerplate/render.ts
1044
1046
  var __dirname$1 = dirname(fileURLToPath(import.meta.url));
1045
1047
  var TEMPLATE_DIRS = [
1046
1048
  resolve(__dirname$1, "templates"),
@@ -1646,7 +1648,7 @@ Rules:
1646
1648
  1. All request-specific data \u2192 props with defaults. City names, tickers, user names, dates, counts.
1647
1649
  2. Layout and styling are universal. Colors, spacing, structure \u2014 these are the reusable part.
1648
1650
  3. Default values come from the current request \u2014 so the component renders correctly standalone.
1649
- 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.
1651
+ 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.
1650
1652
  5. Props interface must be typed and exported.`;
1651
1653
  var TERMINAL_ACTIONS = `## Actions the user means once
1652
1654
 
@@ -2493,7 +2495,7 @@ Don't render text-only metrics. A weather widget without a sun/cloud, a stock ca
2493
2495
  </Row>
2494
2496
  \`\`\`
2495
2497
 
2496
- 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.
2498
+ 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.
2497
2499
 
2498
2500
  ### Spacing \u2014 generosity beats compactness
2499
2501
 
@@ -2880,6 +2882,7 @@ function createHarness(input) {
2880
2882
  name,
2881
2883
  classification,
2882
2884
  designMode,
2885
+ ...input.canvas !== void 0 ? { canvas: input.canvas } : {},
2883
2886
  ...input.profile !== void 0 ? { profile: input.profile } : {},
2884
2887
  how,
2885
2888
  what,