@ggui-ai/ui-gen 0.12.0 → 0.14.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/adapters/generation-dispatch.d.ts +2 -2
- package/dist/adapters/generation-dispatch.js +190 -57
- package/dist/adapters/generation-dispatch.js.map +1 -1
- package/dist/adapters/index.js +5 -8
- package/dist/adapters/index.js.map +1 -1
- package/dist/advanced/index.d.ts +3 -3
- package/dist/advanced/index.js +190 -57
- package/dist/advanced/index.js.map +1 -1
- package/dist/blueprint-validator.js +2 -7
- package/dist/blueprint-validator.js.map +1 -1
- package/dist/boilerplate.js +4 -4
- package/dist/boilerplate.js.map +1 -1
- package/dist/check/index.d.ts +1 -1
- package/dist/check/index.js +55 -15
- package/dist/check/index.js.map +1 -1
- package/dist/{create-ui-generator-CF0EL0Li.d.ts → create-ui-generator-D6TKuv9V.d.ts} +2 -2
- package/dist/{dispatch-D75M-OfZ.d.ts → dispatch-BuZfTh9r.d.ts} +1 -1
- package/dist/evaluation/axis-checks/index.d.ts +3 -3
- package/dist/evaluation/axis-checks/index.js.map +1 -1
- package/dist/evaluation/axis-checks/registry.d.ts +1 -1
- package/dist/evaluation/index.d.ts +3 -3
- package/dist/evaluation/index.js +79 -16
- package/dist/evaluation/index.js.map +1 -1
- package/dist/harness/check/runtime-render/index.d.ts +1 -1
- package/dist/harness/check/runtime-render/index.js +2 -7
- package/dist/harness/check/runtime-render/index.js.map +1 -1
- package/dist/harness/index.d.ts +2 -2
- package/dist/harness/index.js +64 -19
- package/dist/harness/index.js.map +1 -1
- package/dist/harness/prompts.js +2 -0
- package/dist/harness/prompts.js.map +1 -1
- package/dist/harness/result-types.d.ts +1 -1
- package/dist/harness/runtime.d.ts +2 -2
- package/dist/harness/runtime.js +5 -5
- package/dist/harness/runtime.js.map +1 -1
- package/dist/harness/types-public.d.ts +1 -1
- package/dist/harness/types-public.js +4 -4
- package/dist/harness/types-public.js.map +1 -1
- package/dist/harness/validator-trace-sink.d.ts +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.js +190 -57
- package/dist/index.js.map +1 -1
- package/dist/{llm-router-BEVtbAb9.d.ts → llm-router-D7fjBhtr.d.ts} +39 -0
- package/dist/patch.d.ts +1 -1
- package/dist/provider-adapter-contract.js +1017 -731
- package/dist/provider-adapter-contract.js.map +1 -1
- package/dist/{types-public-DIpjC-OA.d.ts → types-public-CkNWEov9.d.ts} +64 -1
- 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 +1 -1
- package/package.json +22 -22
- package/src/adapters/provider-router.ts +9 -0
- package/src/boilerplate/system-prompt.ts +4 -4
- package/src/check/run-tier0.ts +109 -22
- package/src/evaluation/index.ts +4 -0
- package/src/evaluation/llm-evaluator.ts +52 -8
- package/src/evaluation/types-public.ts +79 -0
- package/src/evaluation/visual-evaluator.ts +27 -5
- package/src/harness/coding/run-eval-round.ts +32 -6
- package/src/harness/llm-router.ts +128 -2
- package/src/validation/primitives.ts +1 -1
package/dist/check/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { DataContract, JsonObject, PropsSpec, ActionSpec, StreamSpec } from '@ggui-ai/protocol';
|
|
2
|
-
import { b as EvalResult, E as EvalIssue } from '../types-public-
|
|
2
|
+
import { b as EvalResult, E as EvalIssue } from '../types-public-CkNWEov9.js';
|
|
3
3
|
export { j as jsonSchemaTypeToTs } from '../json-schema-ts-CbB78b3n.js';
|
|
4
4
|
import '../axes-CzLEMDeB.js';
|
|
5
5
|
import '../types-BOvHNG7K.js';
|
package/dist/check/index.js
CHANGED
|
@@ -4,6 +4,7 @@ import path from 'path';
|
|
|
4
4
|
import { createRequire } from 'module';
|
|
5
5
|
import { Linter } from 'eslint';
|
|
6
6
|
import { listContractGadgets, HOOK_NAME_RE } from '@ggui-ai/protocol';
|
|
7
|
+
import { consumedTokenManifest } from '@ggui-ai/design/themes';
|
|
7
8
|
|
|
8
9
|
// src/check/extract-wire-calls.ts
|
|
9
10
|
var HOOK_TO_KIND = {
|
|
@@ -1014,6 +1015,8 @@ function detectCertainDoubleWiredActions(sourceCode, actionBindings) {
|
|
|
1014
1015
|
visit(sf);
|
|
1015
1016
|
return issues;
|
|
1016
1017
|
}
|
|
1018
|
+
var MANIFEST_TOKENS = new Set(consumedTokenManifest);
|
|
1019
|
+
var TOKEN_REF_RE = /var\(\s*(--ggui-[a-zA-Z0-9-]+)/g;
|
|
1017
1020
|
var HOOK_NAME_FOR = {
|
|
1018
1021
|
action: "useAction",
|
|
1019
1022
|
stream: "useStream",
|
|
@@ -1129,23 +1132,25 @@ ${errorDetail}`,
|
|
|
1129
1132
|
});
|
|
1130
1133
|
}
|
|
1131
1134
|
}
|
|
1135
|
+
const literalFallbackMatch = line.match(
|
|
1136
|
+
/var\(\s*(--ggui-[a-zA-Z0-9-]+)\s*,\s*([^)]+)\)/
|
|
1137
|
+
);
|
|
1138
|
+
const literalFallback = literalFallbackMatch !== null && !literalFallbackMatch[2].trim().startsWith("var(") ? { token: literalFallbackMatch[1], literal: literalFallbackMatch[2].trim() } : null;
|
|
1139
|
+
if (literalFallback !== null && !assetEscapedLines.has(lineNum)) {
|
|
1140
|
+
issues.push({
|
|
1141
|
+
tier: 0,
|
|
1142
|
+
result: "fail",
|
|
1143
|
+
category: "tokens",
|
|
1144
|
+
subcategory: "token-fallback",
|
|
1145
|
+
severity: "critical",
|
|
1146
|
+
description: `Literal fallback "${literalFallback.literal}" inside a token reference \u2014 the runtime injects every token, and the fallback paints the wrong value exactly when the theme matters most.`,
|
|
1147
|
+
fix: `Drop the fallback: write var(${literalFallback.token}) bare. If the token might not exist, that is a vocabulary problem to fix by choosing a token from the design-system docs, never by a literal.`,
|
|
1148
|
+
line: lineNum
|
|
1149
|
+
});
|
|
1150
|
+
}
|
|
1132
1151
|
const hexMatch = line.match(/#[0-9a-fA-F]{3,8}\b/);
|
|
1133
1152
|
if (hexMatch && !assetEscapedLines.has(lineNum)) {
|
|
1134
|
-
|
|
1135
|
-
/var\((--ggui-[a-zA-Z0-9-]+)\s*,[^)]*#[0-9a-fA-F]{3,8}/
|
|
1136
|
-
);
|
|
1137
|
-
if (fallbackVarMatch) {
|
|
1138
|
-
issues.push({
|
|
1139
|
-
tier: 0,
|
|
1140
|
-
result: "fail",
|
|
1141
|
-
category: "tokens",
|
|
1142
|
-
subcategory: "token-fallback",
|
|
1143
|
-
severity: "critical",
|
|
1144
|
-
description: `Literal fallback "${hexMatch[0]}" inside a token reference \u2014 the runtime injects every token, and the fallback paints the wrong brand exactly when the theme matters most.`,
|
|
1145
|
-
fix: `Drop the fallback: write var(${fallbackVarMatch[1]}) bare. If the token might not exist, that is a vocabulary problem to fix by choosing a token from the design-system docs, never by a literal.`,
|
|
1146
|
-
line: lineNum
|
|
1147
|
-
});
|
|
1148
|
-
} else if (!line.includes("// fallback")) {
|
|
1153
|
+
if (literalFallback !== null && literalFallback.literal.includes(hexMatch[0])) ; else if (!line.includes("// fallback")) {
|
|
1149
1154
|
issues.push({
|
|
1150
1155
|
tier: 0,
|
|
1151
1156
|
result: "fail",
|
|
@@ -1171,6 +1176,23 @@ ${errorDetail}`,
|
|
|
1171
1176
|
line: lineNum
|
|
1172
1177
|
});
|
|
1173
1178
|
}
|
|
1179
|
+
const offManifest = /* @__PURE__ */ new Set();
|
|
1180
|
+
for (const m of line.matchAll(TOKEN_REF_RE)) {
|
|
1181
|
+
const name = m[1];
|
|
1182
|
+
if (!MANIFEST_TOKENS.has(name)) offManifest.add(name);
|
|
1183
|
+
}
|
|
1184
|
+
for (const name of offManifest) {
|
|
1185
|
+
issues.push({
|
|
1186
|
+
tier: 0,
|
|
1187
|
+
result: "fail",
|
|
1188
|
+
category: "tokens",
|
|
1189
|
+
subcategory: "off-manifest-token",
|
|
1190
|
+
severity: "critical",
|
|
1191
|
+
description: `Token "${name}" is not in the design system's token manifest \u2014 no theme defines it, so it renders unset.`,
|
|
1192
|
+
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-onSurface), \u2026; spacing: var(--ggui-spacing-4); type: var(--ggui-font-size-sm)). Never invent a name and never add a literal fallback.`,
|
|
1193
|
+
line: lineNum
|
|
1194
|
+
});
|
|
1195
|
+
}
|
|
1174
1196
|
const rawSpacingMatch = line.match(
|
|
1175
1197
|
/\b(gap|padding|paddingX|paddingY|margin|radius)\s*=\s*["'][\d.]+(?:px|rem|em)["']/
|
|
1176
1198
|
);
|
|
@@ -1332,6 +1354,24 @@ ${errorDetail}`,
|
|
|
1332
1354
|
...detectCertainDoubleWiredActions(sourceCode, actionBindings)
|
|
1333
1355
|
);
|
|
1334
1356
|
}
|
|
1357
|
+
if (/\buseRender\s*\(/.test(sourceCode)) {
|
|
1358
|
+
const suppressionRe = /(?<![\w-])disabled\s*=\s*\{([^}]*)\}/gs;
|
|
1359
|
+
for (const m of sourceCode.matchAll(suppressionRe)) {
|
|
1360
|
+
const expr = m[1];
|
|
1361
|
+
if (!/\bisConnected\b/.test(expr)) continue;
|
|
1362
|
+
const attrLine = sourceCode.slice(0, m.index ?? 0).split("\n").length;
|
|
1363
|
+
issues.push({
|
|
1364
|
+
tier: 0,
|
|
1365
|
+
result: "fail",
|
|
1366
|
+
category: "interactivity",
|
|
1367
|
+
subcategory: "connection-suppression",
|
|
1368
|
+
severity: "critical",
|
|
1369
|
+
description: `\`disabled\` is bound to the connection state (\`${expr.trim().replace(/\s+/g, " ")}\`) \u2014 that strips the click handler, and the click is how the runtime detects that the host can relay actions again. The control stays dead after recovery.`,
|
|
1370
|
+
fix: "Leave the control enabled \u2014 never bind `disabled` to the connection state. The runtime presents the dead zone itself (a standing notice, then a per-gesture cue) and the attempt is how it detects recovery; a suppressed control stays dead after the host recovers.",
|
|
1371
|
+
line: attrLine
|
|
1372
|
+
});
|
|
1373
|
+
}
|
|
1374
|
+
}
|
|
1335
1375
|
const propsInterfaceMatch = sourceCode.match(/interface Props\s*\{([^}]+)\}/);
|
|
1336
1376
|
if (propsInterfaceMatch) {
|
|
1337
1377
|
const propsBody = propsInterfaceMatch[1];
|