@ggui-ai/ui-gen 0.5.0-rc.2 → 0.6.1
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/base.js +1 -0
- package/dist/adapters/base.js.map +1 -1
- package/dist/adapters/generation-dispatch.d.ts +1 -1
- package/dist/adapters/generation-dispatch.js +286 -168
- package/dist/adapters/generation-dispatch.js.map +1 -1
- package/dist/adapters/index.js +13 -2
- package/dist/adapters/index.js.map +1 -1
- package/dist/advanced/index.d.ts +2 -2
- package/dist/advanced/index.js +287 -168
- package/dist/advanced/index.js.map +1 -1
- package/dist/blueprint-validator.js +1 -1
- package/dist/blueprint-validator.js.map +1 -1
- package/dist/boilerplate.js +13 -24
- package/dist/boilerplate.js.map +1 -1
- package/dist/check/index.d.ts +3 -3
- package/dist/check/index.js.map +1 -1
- package/dist/classifier/index.d.ts +14 -17
- package/dist/classifier/index.js +3 -7
- package/dist/classifier/index.js.map +1 -1
- package/dist/{create-ui-generator-CQiyjb5D.d.ts → create-ui-generator-GX7tvbyH.d.ts} +1 -1
- package/dist/{dispatch-CzRfy1J7.d.ts → dispatch-Deo9qzrG.d.ts} +1 -1
- package/dist/evaluation/axis-checks/index.d.ts +3 -3
- package/dist/evaluation/axis-checks/registry.d.ts +1 -1
- package/dist/evaluation/index.d.ts +2 -2
- package/dist/evaluation/index.js +12 -4
- 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.map +1 -1
- package/dist/harness/index.d.ts +1 -1
- package/dist/harness/index.js +25 -28
- package/dist/harness/index.js.map +1 -1
- package/dist/harness/result-types.d.ts +1 -1
- package/dist/harness/runtime.d.ts +1 -1
- package/dist/harness/runtime.js +14 -25
- package/dist/harness/runtime.js.map +1 -1
- package/dist/harness/types-public.d.ts +1 -1
- package/dist/harness/types-public.js +13 -24
- package/dist/harness/types-public.js.map +1 -1
- package/dist/harness/validator-trace-sink.d.ts +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +288 -168
- package/dist/index.js.map +1 -1
- package/dist/patch.d.ts +1 -1
- package/dist/provider-adapter-contract.js +61 -44
- package/dist/provider-adapter-contract.js.map +1 -1
- package/dist/providers/index.d.ts +2 -2
- package/dist/providers/index.js.map +1 -1
- package/dist/{types-public-D9swfbNi.d.ts → types-public-C36k1q6s.d.ts} +1 -1
- package/dist/validation/index.d.ts +1 -1
- package/dist/validation/index.js +5 -0
- package/dist/validation/index.js.map +1 -1
- package/dist/workflows.d.ts +1 -1
- package/package.json +12 -12
- package/src/blueprint-validator.ts +1 -1
- package/src/boilerplate/generate.ts +20 -31
- package/src/boilerplate/system-prompt.ts +2 -2
- package/src/check/extract-wire-calls.ts +2 -2
- package/src/classifier/axes.ts +2 -2
- package/src/classifier/classifier.ts +2 -2
- package/src/classifier/infer-layout.ts +1 -1
- package/src/classifier/infer-render.ts +1 -1
- package/src/classifier/infer-tooling.ts +1 -1
- package/src/classifier/infer-trigger.ts +3 -12
- package/src/classifier/inspect.ts +7 -7
- package/src/coding-agent/self-check.ts +1 -1
- package/src/evaluation/cost-tracker.ts +39 -11
- package/src/harness/check/runtime-render/render-check.ts +4 -4
- package/src/harness/llm-router.ts +2 -2
- package/src/providers/bedrock.ts +2 -2
- package/src/tools/get-wire.ts +1 -1
- package/src/validation/primitives.ts +2 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as _ggui_ai_protocol from '@ggui-ai/protocol';
|
|
2
2
|
import { JsonValue, DataContract, JsonObject, GadgetDescriptor } from '@ggui-ai/protocol';
|
|
3
3
|
import { C as Classification } from '../axes-CzLEMDeB.js';
|
|
4
|
-
import {
|
|
4
|
+
import { E as EvalIssue, R as RuntimeProbeStatus, A as AxisCheck, f as EvalTier } from '../types-public-C36k1q6s.js';
|
|
5
5
|
import { LLMToolDef } from '../llm.js';
|
|
6
6
|
import { H as HarnessFragment, a as CacheTier } from '../types-BOvHNG7K.js';
|
|
7
7
|
import { ProcessMode, HarnessPolicy } from '../policy.js';
|
|
@@ -857,28 +857,17 @@ function inferTypeFromExample(example) {
|
|
|
857
857
|
}
|
|
858
858
|
function generateBoilerplate(_userPrompt, contract, shellType, screen, composedSections, appGadgets) {
|
|
859
859
|
const propsFields = [];
|
|
860
|
-
const
|
|
861
|
-
const
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
jsonSchemaTypeToTs(schema)
|
|
872
|
-
) : "unknown";
|
|
873
|
-
const fullType = nullable ? `${tsType} | null` : tsType;
|
|
874
|
-
const parts = [];
|
|
875
|
-
if (spec.description) parts.push(String(spec.description));
|
|
876
|
-
if (spec.default !== void 0) parts.push(`(default: ${JSON.stringify(spec.default)})`);
|
|
877
|
-
const desc = parts.length > 0 ? ` // ${parts.join(" ")}` : "";
|
|
878
|
-
propsFields.push(` ${key}${required ? "" : "?"}: ${fullType};${desc}`);
|
|
879
|
-
} else {
|
|
880
|
-
propsFields.push(` ${key}: ${typeof value === "string" ? value : "unknown"};`);
|
|
881
|
-
}
|
|
860
|
+
const propsProperties = contract?.propsSpec?.properties ?? {};
|
|
861
|
+
for (const [key, entry] of Object.entries(propsProperties)) {
|
|
862
|
+
const required = entry.required !== false;
|
|
863
|
+
const nullable = entry.schema.nullable === true;
|
|
864
|
+
const tsType = jsonSchemaTypeToTs(entry.schema);
|
|
865
|
+
const fullType = nullable ? `${tsType} | null` : tsType;
|
|
866
|
+
const parts = [];
|
|
867
|
+
if (entry.description) parts.push(entry.description);
|
|
868
|
+
if (entry.default !== void 0) parts.push(`(default: ${JSON.stringify(entry.default)})`);
|
|
869
|
+
const desc = parts.length > 0 ? ` // ${parts.join(" ")}` : "";
|
|
870
|
+
propsFields.push(` ${key}${required ? "" : "?"}: ${fullType};${desc}`);
|
|
882
871
|
}
|
|
883
872
|
const actionTypeAliases = [];
|
|
884
873
|
const actionHookCalls = [];
|
|
@@ -1624,10 +1613,10 @@ A \`DataContract\` declares everything a GguiSession exchanges with the outside
|
|
|
1624
1613
|
|
|
1625
1614
|
Props arrive via \`ggui_update\` and may be partial on first render. Stream channels start empty and fill over time. Context slots start at their declared default (often \`null\`). **Never assume a field exists before you read it.**
|
|
1626
1615
|
|
|
1627
|
-
- **Array iteration**: always default to \`[]\` before \`.map\`/\`.filter\`/\`.length\`. Use \`(props.items ?? []).map(...)\` not \`props.items.map(...)\`. Same for stream.
|
|
1616
|
+
- **Array iteration**: always default to \`[]\` before \`.map\`/\`.filter\`/\`.length\`. Use \`(props.items ?? []).map(...)\` not \`props.items.map(...)\`. Same for stream.all, stream.latest, etc.
|
|
1628
1617
|
- **Object access**: optional-chain through nested fields. \`props.user?.name ?? 'Anonymous'\` not \`props.user.name\`.
|
|
1629
1618
|
- **Number ops**: default before arithmetic. \`(props.count ?? 0) + 1\` not \`props.count + 1\`.
|
|
1630
|
-
- **Stream latest**: \`useStream\` returns \`{latest: T |
|
|
1619
|
+
- **Stream latest**: \`useStream\` returns \`{latest: T | null, all: T[], isComplete: boolean}\`. The default \`all\` is \`[]\` so it's safe to map; \`latest\` is null until the first frame arrives \u2014 guard before reading \`.foo\`.
|
|
1631
1620
|
- **Stream reconciliation**: when a stream event carries an \`action\` discriminant (e.g. \`create | move | edit | delete\`), the channel is a CRUD feed \u2014 your handler MUST branch on EVERY value: append on \`create\`, drop on \`delete\`, replace-by-id on \`move\` / \`edit\`. Merging only the "edit" case silently loses created and deleted items. Reconcile into the SAME state that seeds from \`props\` (e.g. \`useState(() => props.tasks ?? [])\`) so the seed data and the live feed render as one list \u2014 and handle an event whose id is not yet present (a \`create\` for an unknown item) by inserting it, not ignoring it.
|
|
1632
1621
|
- **Loading state**: while data is still absent, render \`<Skeleton>\` placeholders \u2014 never a blank screen. \`<Skeleton variant="text" />\` for a text line, \`variant="circle"\` for an avatar slot, default \`rect\` for a block.
|
|
1633
1622
|
- **Empty state**: when a list or results array is empty, render \`<EmptyState title="\u2026" description="\u2026" />\` \u2014 a region that renders nothing when empty looks broken to the user.
|