@ggui-ai/ui-gen 0.22.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.
- package/dist/adapter-Du7P_5Fx.d.ts +201 -0
- package/dist/adapters/generation-dispatch.d.ts +33 -12
- package/dist/adapters/generation-dispatch.js +549 -129
- package/dist/adapters/generation-dispatch.js.map +1 -1
- package/dist/adapters/index.js +1 -1
- package/dist/adapters/index.js.map +1 -1
- package/dist/advanced/index.d.ts +5 -3
- package/dist/advanced/index.js +601 -144
- package/dist/advanced/index.js.map +1 -1
- package/dist/blueprint-validator.js +178 -54
- package/dist/blueprint-validator.js.map +1 -1
- package/dist/boilerplate.js +1 -0
- package/dist/boilerplate.js.map +1 -1
- package/dist/check/index.d.ts +2 -1
- package/dist/check/index.js +47 -1
- package/dist/check/index.js.map +1 -1
- package/dist/{create-ui-generator-BEkzEtNz.d.ts → create-ui-generator-GIhzx08x.d.ts} +34 -10
- package/dist/{dispatch-DJNpQ7DI.d.ts → dispatch-BnAH56p4.d.ts} +1 -1
- package/dist/evaluation/axis-checks/index.d.ts +4 -3
- package/dist/evaluation/axis-checks/index.js +19 -4
- package/dist/evaluation/axis-checks/index.js.map +1 -1
- package/dist/evaluation/axis-checks/registry.d.ts +2 -1
- package/dist/evaluation/axis-checks/registry.js +19 -4
- package/dist/evaluation/axis-checks/registry.js.map +1 -1
- package/dist/evaluation/index.d.ts +4 -3
- package/dist/evaluation/index.js +21 -6
- package/dist/evaluation/index.js.map +1 -1
- package/dist/harness/check/runtime-render/index.d.ts +27 -8
- package/dist/harness/check/runtime-render/index.js +217 -54
- package/dist/harness/check/runtime-render/index.js.map +1 -1
- package/dist/harness/check/runtime-render/render-check-worker.d.ts +8 -1
- package/dist/harness/check/runtime-render/render-check-worker.js +72 -32
- package/dist/harness/check/runtime-render/render-check-worker.js.map +1 -1
- package/dist/harness/index.d.ts +2 -1
- package/dist/harness/index.js +3 -2
- package/dist/harness/index.js.map +1 -1
- package/dist/harness/prompts.js.map +1 -1
- package/dist/harness/result-types.d.ts +2 -1
- package/dist/harness/runtime.d.ts +2 -1
- package/dist/harness/runtime.js +2 -1
- package/dist/harness/runtime.js.map +1 -1
- package/dist/harness/types-public.d.ts +18 -5
- package/dist/harness/types-public.js +1 -0
- package/dist/harness/types-public.js.map +1 -1
- package/dist/harness/validator-trace-sink.d.ts +2 -1
- package/dist/index.d.ts +38 -3
- package/dist/index.js +592 -144
- package/dist/index.js.map +1 -1
- package/dist/patch.d.ts +2 -1
- package/dist/policy.d.ts +7 -4
- package/dist/policy.js.map +1 -1
- package/dist/tools/get-primitives-ts.d.ts +1 -1
- package/dist/tools/get-primitives-ts.js +1 -1
- package/dist/tools/get-primitives-ts.js.map +1 -1
- package/dist/tools/render-check-worker.d.ts +7 -1
- package/dist/tools/render-check-worker.js +55 -23
- package/dist/tools/render-check-worker.js.map +1 -1
- package/dist/{types-public-mM_-1Yk3.d.ts → types-public-Bk6d1WLN.d.ts} +98 -9
- package/dist/validation/index.d.ts +1 -1
- package/dist/validation/index.js +1 -1
- package/dist/validation/index.js.map +1 -1
- package/dist/workflows.d.ts +2 -1
- package/package.json +12 -12
- package/src/adapters/generation-dispatch.ts +137 -96
- package/src/advanced/generator.ts +16 -1
- package/src/blueprint-validator.ts +21 -6
- package/src/boilerplate/hard-sections.ts +1 -0
- package/src/check/run-tier0.ts +80 -1
- package/src/coding-agent/tools.ts +6 -1
- package/src/create-ui-generator.ts +185 -95
- package/src/evaluation/axis-checks/checks/state-payload.ts +29 -4
- package/src/evaluation/types-public.ts +94 -8
- package/src/harness/check/runtime-render/adapter.ts +223 -58
- package/src/harness/check/runtime-render/index.ts +75 -2
- package/src/harness/check/runtime-render/render-check-host.ts +111 -26
- package/src/harness/check/runtime-render/render-check-worker.ts +83 -29
- package/src/harness/check/runtime-render/render-check.ts +173 -117
- package/src/harness/coding/generate-task-runner.ts +57 -4
- package/src/harness/coding/init-session.ts +13 -0
- package/src/harness/coding/run-eval-round.ts +238 -13
- package/src/harness/llm-router.ts +3 -3
- package/src/harness/policy.ts +11 -0
- package/src/harness/primitive-slice.ts +104 -0
- package/src/harness/types-public.ts +17 -5
- package/src/index.ts +4 -0
- package/src/policy.ts +7 -4
- package/src/tools/get-primitives-ts.ts +1 -1
- package/src/tools/render-check-worker.ts +74 -23
- package/src/validation/primitives.ts +1 -1
- package/dist/render-check-C0CqVceF.d.ts +0 -87
package/dist/check/index.d.ts
CHANGED
|
@@ -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-
|
|
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
|
|
package/dist/check/index.js
CHANGED
|
@@ -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:
|
|
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
|
}
|