@ggui-ai/ui-gen 0.23.0 → 0.24.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 (67) hide show
  1. package/dist/adapter-Du7P_5Fx.d.ts +201 -0
  2. package/dist/adapters/generation-dispatch.d.ts +33 -12
  3. package/dist/adapters/generation-dispatch.js +510 -128
  4. package/dist/adapters/generation-dispatch.js.map +1 -1
  5. package/dist/adapters/index.js.map +1 -1
  6. package/dist/advanced/index.d.ts +5 -3
  7. package/dist/advanced/index.js +551 -142
  8. package/dist/advanced/index.js.map +1 -1
  9. package/dist/blueprint-validator.js +153 -59
  10. package/dist/blueprint-validator.js.map +1 -1
  11. package/dist/boilerplate.js.map +1 -1
  12. package/dist/check/index.d.ts +2 -1
  13. package/dist/check/index.js +47 -1
  14. package/dist/check/index.js.map +1 -1
  15. package/dist/{create-ui-generator-D0kbWwln.d.ts → create-ui-generator-GIhzx08x.d.ts} +34 -10
  16. package/dist/{dispatch-wxaIMwZt.d.ts → dispatch-BnAH56p4.d.ts} +1 -1
  17. package/dist/evaluation/axis-checks/index.d.ts +4 -3
  18. package/dist/evaluation/axis-checks/index.js.map +1 -1
  19. package/dist/evaluation/axis-checks/registry.d.ts +2 -1
  20. package/dist/evaluation/index.d.ts +4 -3
  21. package/dist/evaluation/index.js.map +1 -1
  22. package/dist/harness/check/runtime-render/index.d.ts +29 -10
  23. package/dist/harness/check/runtime-render/index.js +203 -60
  24. package/dist/harness/check/runtime-render/index.js.map +1 -1
  25. package/dist/harness/check/runtime-render/render-check-worker.d.ts +8 -1
  26. package/dist/harness/check/runtime-render/render-check-worker.js +72 -32
  27. package/dist/harness/check/runtime-render/render-check-worker.js.map +1 -1
  28. package/dist/harness/index.d.ts +2 -1
  29. package/dist/harness/index.js.map +1 -1
  30. package/dist/harness/prompts.js.map +1 -1
  31. package/dist/harness/result-types.d.ts +2 -1
  32. package/dist/harness/runtime.d.ts +2 -1
  33. package/dist/harness/runtime.js.map +1 -1
  34. package/dist/harness/types-public.d.ts +11 -2
  35. package/dist/harness/types-public.js.map +1 -1
  36. package/dist/harness/validator-trace-sink.d.ts +2 -1
  37. package/dist/index.d.ts +38 -3
  38. package/dist/index.js +553 -143
  39. package/dist/index.js.map +1 -1
  40. package/dist/patch.d.ts +2 -1
  41. package/dist/policy.d.ts +7 -4
  42. package/dist/policy.js.map +1 -1
  43. package/dist/tools/render-check-worker.d.ts +7 -1
  44. package/dist/tools/render-check-worker.js +55 -23
  45. package/dist/tools/render-check-worker.js.map +1 -1
  46. package/dist/{types-public-Ow-tNtFE.d.ts → types-public-Bk6d1WLN.d.ts} +77 -11
  47. package/dist/workflows.d.ts +2 -1
  48. package/package.json +12 -12
  49. package/src/adapters/generation-dispatch.ts +137 -96
  50. package/src/check/run-tier0.ts +80 -1
  51. package/src/create-ui-generator.ts +185 -95
  52. package/src/evaluation/types-public.ts +73 -11
  53. package/src/harness/check/runtime-render/adapter.ts +221 -75
  54. package/src/harness/check/runtime-render/index.ts +75 -2
  55. package/src/harness/check/runtime-render/render-check-host.ts +82 -19
  56. package/src/harness/check/runtime-render/render-check-worker.ts +83 -29
  57. package/src/harness/check/runtime-render/render-check.ts +154 -117
  58. package/src/harness/coding/generate-task-runner.ts +57 -4
  59. package/src/harness/coding/init-session.ts +13 -0
  60. package/src/harness/coding/run-eval-round.ts +238 -15
  61. package/src/harness/policy.ts +11 -0
  62. package/src/harness/primitive-slice.ts +104 -0
  63. package/src/harness/types-public.ts +9 -1
  64. package/src/index.ts +4 -0
  65. package/src/policy.ts +7 -4
  66. package/src/tools/render-check-worker.ts +74 -23
  67. package/dist/render-check-Blwj8gB6.d.ts +0 -105
@@ -1,7 +1,8 @@
1
1
  import { DataContract, JsonObject, PropsSpec, ActionSpec, StreamSpec } from '@ggui-ai/protocol';
2
2
  import { D as DesignMode } from '../design-mode-DLufhrNp.js';
3
- import { b as EvalResult, E as EvalIssue } from '../types-public-Ow-tNtFE.js';
3
+ import { b as EvalResult, E as EvalIssue } from '../types-public-Bk6d1WLN.js';
4
4
  export { j as jsonSchemaTypeToTs } from '../json-schema-ts-CbB78b3n.js';
5
+ import '@ggui-ai/mcp-server-core';
5
6
  import '../axes-CzLEMDeB.js';
6
7
  import '../types-BOvHNG7K.js';
7
8
 
@@ -1024,6 +1024,52 @@ function detectCertainDoubleWiredActions(sourceCode, actionBindings, designMode
1024
1024
  return issues;
1025
1025
  }
1026
1026
  var MANIFEST_TOKENS = new Set(consumedTokenManifest);
1027
+ var RETIRED_TOKEN_SUCCESSORS = /* @__PURE__ */ new Map([
1028
+ ["--ggui-color-surface", "--ggui-color-container"],
1029
+ ["--ggui-color-onSurface", "--ggui-color-onContainer"],
1030
+ ["--ggui-color-surfaceVariant", "--ggui-color-sunken"],
1031
+ ["--ggui-color-onSurfaceVariant", "--ggui-color-onSunken"]
1032
+ ]);
1033
+ function suggestManifestTokens(name) {
1034
+ const successor = RETIRED_TOKEN_SUCCESSORS.get(name);
1035
+ if (successor !== void 0) return [successor];
1036
+ const segments = name.split("-").filter((segment) => segment.length > 0);
1037
+ const own = name.endsWith("-") ? segments.length : segments.length - 1;
1038
+ for (let n = own; n >= 2; n--) {
1039
+ const prefix = `--${segments.slice(0, n).join("-")}-`;
1040
+ const family = consumedTokenManifest.filter((token) => token.startsWith(prefix));
1041
+ if (family.length > 0) return wordHitsFirst(name, rolesFirst(family));
1042
+ }
1043
+ const words = new Set(
1044
+ segments.slice(1).filter((segment) => segment.length >= 4).map((segment) => segment.toLowerCase())
1045
+ );
1046
+ return rolesFirst(
1047
+ consumedTokenManifest.filter(
1048
+ (token) => token.split("-").some((segment) => words.has(segment.toLowerCase()))
1049
+ )
1050
+ );
1051
+ }
1052
+ function wordHitsFirst(name, family) {
1053
+ const word = name.slice(name.lastIndexOf("-") + 1).toLowerCase();
1054
+ if (word.length < 4) return family;
1055
+ const hit = (token) => token.slice(token.lastIndexOf("-") + 1).toLowerCase().includes(word);
1056
+ return [...family.filter(hit), ...family.filter((token) => !hit(token))];
1057
+ }
1058
+ function rolesFirst(tokens) {
1059
+ const isRole = (token) => !/^\d+$/.test(token.slice(token.lastIndexOf("-") + 1));
1060
+ return [...tokens.filter(isRole), ...tokens.filter((token) => !isRole(token))];
1061
+ }
1062
+ function offManifestHint(name) {
1063
+ const successor = RETIRED_TOKEN_SUCCESSORS.get(name);
1064
+ if (successor !== void 0) {
1065
+ return `"${name}" was retired (ggui#987); the current name is var(${successor}). `;
1066
+ }
1067
+ const near = suggestManifestTokens(name);
1068
+ if (near.length === 0) return "";
1069
+ const shown = near.slice(0, 8).map((token) => `var(${token})`).join(", ");
1070
+ const more = near.length > 8 ? ` (and ${near.length - 8} more in that family)` : "";
1071
+ return `Nearest names in the manifest: ${shown}${more}. `;
1072
+ }
1027
1073
  var TOKEN_REF_RE = /var\(\s*(--ggui-[a-zA-Z0-9-]+)/g;
1028
1074
  var HOOK_NAME_FOR = {
1029
1075
  action: "useAction",
@@ -1257,7 +1303,7 @@ ${errorDetail}`,
1257
1303
  subcategory: "off-manifest-token",
1258
1304
  severity: "critical",
1259
1305
  description: `Token "${name}" is not in the design system's token manifest \u2014 no theme defines it, so it renders unset.`,
1260
- fix: `Choose a token that exists: the closed vocabulary is the manifest the design-system docs list (colors: var(--ggui-color-primary-500), var(--ggui-color-onContainer), \u2026; spacing: var(--ggui-spacing-4); type: var(--ggui-font-size-sm)). Never invent a name and never add a literal fallback.`,
1306
+ fix: `${offManifestHint(name)}Choose a token that exists: the closed vocabulary is the manifest the design-system docs list (colors: var(--ggui-color-primary-500), var(--ggui-color-onContainer), \u2026; spacing: var(--ggui-spacing-4); type: var(--ggui-font-size-sm)). Never invent a name and never add a literal fallback.`,
1261
1307
  line: lineNum
1262
1308
  });
1263
1309
  }