/** Known fixed artifact names produced by codegen. * * Artifact names mirror their on-disk path under `.uds/` (minus extension), so * a name like `studio/styles-full` resolves to `.uds/studio/styles-full.css`. * * Subdirectory conventions — each artifact's prefix tells you who reads it: * * top-level → consumed by the host app at build time. Apps' bundlers * import `components/.tsx` / * `components/_style-props.ts` / `styles.css` / `types/` * directly. `manifest.json` is the one cross-cutting * artifact — Studio reads it for runtime config * introspection, apps can read it for the same. * * `studio/` → consumed only by the Studio runtime — the canvas iframe * loads `preview-bundle.js`, and the canvas CSS reads from * `styles-full.css` (full unoptimized CSS so all tokens are * available for dynamic styling). * * `playground/` → emitted only with `uds dev --playground`. The playground * bundle imports `previews.tsx` directly to render each * component's authored `.preview({...})` default state. * * `mcp/` → consumed only by the local MCP server (`uds dev`) — served * as resources to the connected agent. * * `debug/` → emitted only with `uds build --debug` / `uds dev --debug`, * for codegen-developer inspection of normally in-memory * sources. Never uploaded, never read by anything. */ export type ArtifactName = 'config' | 'theme-native' | 'native/preview-manifest' | 'native/preview-bundle-ios' | 'native/preview-bundle-android' | `native/preview-asset-${string}` | 'components-native-runtime' | 'components-motion' | 'components-composites' | 'components-style-props' | 'components-render-map' | 'components-tokens' | 'styles-css' | 'react-catalog' | 'types' | `component-${string}` | `motion-component-${string}` | 'studio/preview-bundle' | 'anatomy/bundle' | `studio/component-js/${string}` | `studio/package-js/${string}` | 'studio/preview-bundle-native' | 'studio/styles-full' | 'playground/previews' | 'playground/pages' | 'mcp/jsx-guide' | 'mcp/uds-skill' | 'debug/react-registry' | 'debug/react-providers' | 'debug/react-renderer'; /** * The directory prefix an artifact name carries, if any — `studio/preview-bundle` → `studio`. * * Derived from {@link ArtifactName} rather than listed, so a prefix added there is selectable here * without this being edited to notice, and one that does not exist cannot be typed. */ type ArtifactPrefix = N extends `${infer P}/${string}` ? P : never; /** * How a caller says which artifacts it wants: `*` for all of them, `studio/*` for one consumer's * whole set, or an exact name. * * A prefix rather than a list is usually what a caller means — an artifact's prefix names its * consumer, so a set that grows should reach the consumer that reads it without every call site * having to be updated. */ export type ArtifactSelector = '*' | `${ArtifactPrefix}/*` | ArtifactName; export {};