diff --git a/apps/agent/package.json b/apps/agent/package.json index 96f77fe..67a4cae 100644 --- a/apps/agent/package.json +++ b/apps/agent/package.json @@ -16,7 +16,7 @@ "@aestheticfunction/dspack-emit": "^0.6.0", "@aestheticfunction/dspack-export": "^0.5.0", "@aestheticfunction/dspack-gen": "^0.3.1", - "@aestheticfunction/dspack-spec": "^0.4.2", + "@aestheticfunction/dspack-spec": "^0.4.4", "@dspack-studio/agui-bridge": "workspace:*", "@dspack-studio/composer-core": "workspace:*", "@dspack-studio/contracts": "workspace:*", diff --git a/apps/composer/app/demo-data.ts b/apps/composer/app/demo-data.ts index 041b9b5..0c50628 100644 --- a/apps/composer/app/demo-data.ts +++ b/apps/composer/app/demo-data.ts @@ -1,15 +1,29 @@ /** * The shipped demo project (honest magic: real files, pre-emitted at build - * time by scripts/demo-assets.mjs — the same published APIs the agent runs). + * time by scripts/demo-assets.mjs — the same published dspack-emit APIs the + * agent runs). + * + * The hosted demo is the **shadcn/ui v3** reference project: the production + * v3 contract (34 components) mapped through a v2-language profile (T1-T4 + + * A0), so composer.aesthetic-function.com demonstrates the representation + * work actually shipped — the T4 dialog/sheet, T1 label donation, T3 joins, + * A0 families — rendered through the wireframe registry. Its 14 worked + * surfaces emit 11 and refuse 3 on *declared casualties* (accordion, + * breadcrumb, pagination, tooltip), surfaced as acknowledged, not failure. + * + * Live authoring — connecting your own React library, saving edits, and AI + * generation — still requires the local agent (`pnpm --filter agent dev`); + * the hosted app states that plainly. */ -import demoContract from "../demo-project/acme-ui.dspack.json"; -import demoProfile from "../demo-project/acme.profile.json"; -import demoManifest from "../demo-project/project.json"; +import demoContract from "../shadcn-v3-project/shadcn-ui.dspack.json"; +import demoProfile from "../shadcn-v3-project/shadcn-v3.profile.json"; +import demoManifest from "../shadcn-v3-project/project.json"; import demoEmit from "./demo/generated/emit.json"; -import usesCasualty from "../demo-project/surfaces/uses-casualty.dsurface.json"; export const DEMO_CONTRACT = demoContract as unknown as Record; export const DEMO_PROFILE = demoProfile as unknown as Record; export const DEMO_MANIFEST = demoManifest as unknown as Record; export const DEMO_EMIT = demoEmit as unknown as Record; -export const DEMO_EXTRA_SURFACES = [{ name: "uses-casualty", surface: usesCasualty as unknown }]; +// The v3 contract's 14 examples ARE the worked surfaces (recomputeEmit emits +// contractSurfaces(doc)); the project carries no extra surfaces beyond them. +export const DEMO_EXTRA_SURFACES: Array<{ name: string; surface: unknown }> = []; diff --git a/apps/composer/app/views/mapper-view.tsx b/apps/composer/app/views/mapper-view.tsx index 53421db..7b4ae66 100644 --- a/apps/composer/app/views/mapper-view.tsx +++ b/apps/composer/app/views/mapper-view.tsx @@ -10,6 +10,15 @@ import { useState } from "react"; import { useComposer } from "../state"; +/** + * A contract enum member is either a plain string (v1) or a + * `{ value, description }` object (v3). Everything that treats an enum value + * as text — labels, valueMap keys, React children — must go through this; + * rendering the object directly is React error #31. + */ +const enumLabel = (v: unknown): string => + typeof v === "string" ? v : v && typeof v === "object" && "value" in v ? String((v as { value: unknown }).value) : String(v); + const field = { fontFamily: "var(--mono)", fontSize: 12, @@ -89,7 +98,7 @@ export function MapperView() { {name} - {cprop.values &&
[{cprop.values.join(", ")}]
} + {cprop.values &&
[{cprop.values.map(enumLabel).join(", ")}]
} {pp ? ( <> @@ -112,7 +121,12 @@ export function MapperView() { {pp.kind === "enum" && cprop.values ? (
- {cprop.values.map((v: string) => ( + {cprop.values.map((raw: unknown) => { + // v3 contracts carry enum members as {value, description}; + // v1 carries plain strings. Normalise to the value string — + // rendering the object directly is React error #31. + const v = enumLabel(raw); + return ( {v} →{" "}