@ggui-ai/ui-gen 0.23.0 → 0.25.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-Cg_rkpGq.d.ts +201 -0
- package/dist/adapters/generation-dispatch.d.ts +58 -15
- package/dist/adapters/generation-dispatch.js +1418 -180
- package/dist/adapters/generation-dispatch.js.map +1 -1
- package/dist/adapters/index.js +3 -1
- package/dist/adapters/index.js.map +1 -1
- package/dist/advanced/index.d.ts +12 -8
- package/dist/advanced/index.js +1467 -239
- package/dist/advanced/index.js.map +1 -1
- package/dist/{axes-CzLEMDeB.d.ts → axes-CKVCzR_x.d.ts} +1 -1
- package/dist/bank-CT4eEkta.d.ts +118 -0
- package/dist/blueprint-validator.js +153 -59
- package/dist/blueprint-validator.js.map +1 -1
- package/dist/boilerplate.js +24 -12
- package/dist/boilerplate.js.map +1 -1
- package/dist/check/index.d.ts +12 -4
- package/dist/check/index.js +94 -2
- package/dist/check/index.js.map +1 -1
- package/dist/classifier/index.d.ts +2 -2
- package/dist/compose.d.ts +2 -2
- package/dist/{create-ui-generator-D0kbWwln.d.ts → create-ui-generator-DFnnArrv.d.ts} +43 -11
- package/dist/{dispatch-wxaIMwZt.d.ts → dispatch-CStl9eAw.d.ts} +5 -3
- package/dist/evaluation/axis-checks/index.d.ts +6 -5
- package/dist/evaluation/axis-checks/index.js +90 -2
- package/dist/evaluation/axis-checks/index.js.map +1 -1
- package/dist/evaluation/axis-checks/registry.d.ts +4 -3
- package/dist/evaluation/axis-checks/registry.js +88 -1
- package/dist/evaluation/axis-checks/registry.js.map +1 -1
- package/dist/evaluation/index.d.ts +301 -23
- package/dist/evaluation/index.js +746 -30
- package/dist/evaluation/index.js.map +1 -1
- package/dist/evaluation/types.d.ts +9 -1
- package/dist/evaluation/types.js.map +1 -1
- package/dist/fragments/index.d.ts +3 -3
- package/dist/harness/check/runtime-render/index.d.ts +30 -11
- package/dist/harness/check/runtime-render/index.js +203 -60
- 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 +5 -4
- package/dist/harness/index.js +33 -15
- package/dist/harness/index.js.map +1 -1
- package/dist/harness/prompts.js.map +1 -1
- package/dist/harness/result-types.d.ts +4 -3
- package/dist/harness/runtime.d.ts +11 -4
- package/dist/harness/runtime.js +26 -14
- package/dist/harness/runtime.js.map +1 -1
- package/dist/harness/types-public.d.ts +13 -4
- package/dist/harness/types-public.js +33 -15
- package/dist/harness/types-public.js.map +1 -1
- package/dist/harness/validator-trace-sink.d.ts +4 -3
- package/dist/hash.d.ts +1 -1
- package/dist/index.d.ts +59 -8
- package/dist/index.js +1476 -241
- package/dist/index.js.map +1 -1
- package/dist/{llm-router-DwwUK1bz.d.ts → llm-router-nfO7wPec.d.ts} +3 -1
- package/dist/patch.d.ts +4 -3
- package/dist/policy.d.ts +8 -5
- 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-BOvHNG7K.d.ts → types-Dh1s4K9j.d.ts} +1 -1
- package/dist/{types-public-Ow-tNtFE.d.ts → types-public-BJTLpzWn.d.ts} +208 -15
- 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 +4 -3
- package/package.json +12 -12
- package/src/adapters/generation-dispatch.ts +173 -98
- package/src/adapters/tools.ts +2 -1
- package/src/boilerplate/free-design-prompt.ts +1 -1
- package/src/boilerplate/generate.ts +26 -1
- package/src/boilerplate/hard-sections.ts +13 -13
- package/src/boilerplate/system-prompt.ts +1 -1
- package/src/check/index.ts +1 -0
- package/src/check/run-tier0.ts +80 -1
- package/src/check/sample-props.ts +63 -0
- package/src/coding-agent/tools.ts +4 -1
- package/src/create-harness.ts +3 -3
- package/src/create-ui-generator.ts +204 -95
- package/src/evaluation/__fixtures__/png.ts +100 -0
- package/src/evaluation/axis-checks/checks/state-merge.ts +1 -1
- package/src/evaluation/axis-checks/checks/universal.ts +111 -0
- package/src/evaluation/axis-checks/dispatch.ts +4 -1
- package/src/evaluation/criteria/bank.ts +85 -0
- package/src/evaluation/criteria/context.ts +52 -0
- package/src/evaluation/criteria/resolve.ts +159 -0
- package/src/evaluation/criteria/select.ts +79 -0
- package/src/evaluation/index.ts +23 -0
- package/src/evaluation/ink-extent.ts +200 -0
- package/src/evaluation/theme-css.ts +12 -5
- package/src/evaluation/types-public.ts +200 -11
- package/src/evaluation/types.ts +9 -0
- package/src/evaluation/visual-evaluator.ts +636 -30
- package/src/harness/check/runtime-render/adapter.ts +221 -75
- package/src/harness/check/runtime-render/index.ts +75 -2
- package/src/harness/check/runtime-render/render-check-host.ts +82 -19
- package/src/harness/check/runtime-render/render-check-worker.ts +83 -29
- package/src/harness/check/runtime-render/render-check.ts +154 -117
- package/src/harness/coding/generate-task-runner.ts +60 -4
- package/src/harness/coding/init-session.ts +13 -0
- package/src/harness/coding/run-coding-turn.ts +7 -3
- package/src/harness/coding/run-eval-round.ts +257 -15
- package/src/harness/policy.ts +11 -0
- package/src/harness/primitive-slice.ts +104 -0
- package/src/harness/runtime.ts +5 -0
- package/src/harness/types-public.ts +9 -1
- package/src/harness-tool-names.ts +38 -0
- package/src/index.ts +16 -0
- package/src/policy.ts +7 -4
- package/src/run-check.ts +2 -0
- package/src/tools/get-primitives-ts.ts +1 -1
- package/src/tools/get-wire.ts +1 -1
- package/src/tools/render-check-worker.ts +74 -23
- package/src/tools/render-check.ts +0 -60
- package/src/tools.ts +11 -1
- package/src/validation/primitives.ts +1 -1
- package/dist/render-check-Blwj8gB6.d.ts +0 -105
|
@@ -30,68 +30,8 @@ import { pathToFileURL, fileURLToPath } from 'node:url';
|
|
|
30
30
|
import { runSandboxed } from '@ggui-ai/sandbox';
|
|
31
31
|
import type {
|
|
32
32
|
JsonObject,
|
|
33
|
-
JsonSchema,
|
|
34
|
-
JsonValue,
|
|
35
|
-
PropsSpec,
|
|
36
33
|
} from '@ggui-ai/protocol';
|
|
37
34
|
|
|
38
|
-
/**
|
|
39
|
-
* Generate sample props from a PropsSpec contract.
|
|
40
|
-
* Uses `example` values from each PropEntry when available,
|
|
41
|
-
* otherwise synthesizes plausible defaults from the JSON Schema.
|
|
42
|
-
*/
|
|
43
|
-
export function generateSampleProps(spec: PropsSpec): JsonObject {
|
|
44
|
-
const props: JsonObject = {};
|
|
45
|
-
|
|
46
|
-
for (const [name, entry] of Object.entries(spec.properties)) {
|
|
47
|
-
// Prefer explicit example value
|
|
48
|
-
if (entry.example !== undefined) {
|
|
49
|
-
props[name] = entry.example;
|
|
50
|
-
continue;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
// Prefer explicit default value
|
|
54
|
-
if (entry.default !== undefined) {
|
|
55
|
-
props[name] = entry.default;
|
|
56
|
-
continue;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
// Synthesize from JSON Schema
|
|
60
|
-
props[name] = synthesizeFromSchema(entry.schema);
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
return props;
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
function synthesizeFromSchema(schema: JsonSchema): JsonValue | undefined {
|
|
67
|
-
// Draft-07 type arrays (`['string','null']`) synthesize from the
|
|
68
|
-
// first non-null member — the canonical nullability form the
|
|
69
|
-
// enforced-props-schema emission produces.
|
|
70
|
-
const declared = Array.isArray(schema.type)
|
|
71
|
-
? schema.type.find((t) => t !== 'null')
|
|
72
|
-
: schema.type;
|
|
73
|
-
switch (declared) {
|
|
74
|
-
case 'string': return 'sample';
|
|
75
|
-
case 'number':
|
|
76
|
-
case 'integer': return 0;
|
|
77
|
-
case 'boolean': return false;
|
|
78
|
-
case 'null': return null;
|
|
79
|
-
case 'array': {
|
|
80
|
-
if (schema.items) return [synthesizeFromSchema(schema.items) ?? null];
|
|
81
|
-
return [];
|
|
82
|
-
}
|
|
83
|
-
case 'object': {
|
|
84
|
-
const obj: JsonObject = {};
|
|
85
|
-
if (schema.properties) {
|
|
86
|
-
for (const [k, v] of Object.entries(schema.properties)) {
|
|
87
|
-
obj[k] = synthesizeFromSchema(v);
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
return obj;
|
|
91
|
-
}
|
|
92
|
-
default: return undefined;
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
35
|
|
|
96
36
|
/**
|
|
97
37
|
* Timeout for a single render smoke test. Generous — some LLM-
|
package/src/tools.ts
CHANGED
|
@@ -256,11 +256,21 @@ export const APPLY_CHANGES_HASHLINE_TOOL_FLAT: LLMToolDef = {
|
|
|
256
256
|
},
|
|
257
257
|
};
|
|
258
258
|
|
|
259
|
+
/**
|
|
260
|
+
* What to do when the name you wanted is not in the icon list (ggui#1183): the
|
|
261
|
+
* list is complete and constant, so a second call is the same exchange — and
|
|
262
|
+
* three of those end the run (`SAME_EXCHANGE_BREAK_AT`). Said ONCE, on the
|
|
263
|
+
* tool's description and appended to every result, because the model that
|
|
264
|
+
* looped had never been told the list would not change.
|
|
265
|
+
*/
|
|
266
|
+
export const ICON_LIST_NO_MATCH_GUIDANCE =
|
|
267
|
+
"This list is complete and constant — calling again returns exactly it. If the name you wanted is not here, pick the nearest listed name (or a neutral one such as `circle`) and continue with apply_changes; never call this tool twice.";
|
|
259
268
|
/** Helper icon-lookup tool — not a patch grammar, attached to the same LLM turn. */
|
|
260
269
|
export const GET_ICONS_TOOL: LLMToolDef = {
|
|
261
270
|
name: "get_available_icons",
|
|
262
271
|
description:
|
|
263
|
-
'List every Lucide icon name the <Icon name="..."> component renders (kebab-case). A name outside this list renders nothing — check before choosing.'
|
|
272
|
+
'List every Lucide icon name the <Icon name="..."> component renders (kebab-case). A name outside this list renders nothing — check before choosing. ' +
|
|
273
|
+
ICON_LIST_NO_MATCH_GUIDANCE,
|
|
264
274
|
parameters: { type: "object", properties: {} },
|
|
265
275
|
};
|
|
266
276
|
|