export interface BuilderDesignSystemIndexFile { name: string; data: Uint8Array; mimeType?: string; } export interface BuilderDesignSystemCodeFileInput { filename: string; content: string; mimeType?: string; /** * How `content` is encoded. Defaults to `"utf8"` (existing behavior, * unchanged for every current text-file caller). Pass `"base64"` for * binary files -- most importantly `.fig` (a zip/kiwi binary container, * never valid UTF-8 text). Without this, a `.fig` upload silently * corrupts: `mimeTypeForBuilderDesignSystemFilename` already special-cases * `.fig` as `application/octet-stream`, but the actual byte pipeline ran * every file through `TextEncoder().encode()` regardless, which mangles * any byte >= 0x80 in a binary-as-string payload (or, if the caller * base64-encoded first with no decode step here, stores the literal * base64 text instead of the decoded binary). Callers sending `.fig`/PDF/ * other binary bytes must base64-encode `content` and set this to * `"base64"`. */ encoding?: "utf8" | "base64"; } export interface BuildBuilderDesignSystemIndexFilesOptions { codeFiles?: BuilderDesignSystemCodeFileInput[]; designMd?: string; designMdFilename?: string; maxCodeFiles?: number; maxTotalCodeBytes?: number; /** Default keeps legacy best-effort code indexing; upload/chat surfaces should fail loudly. */ overflowBehavior?: "skip" | "throw"; } export interface BuilderDesignSystemProxyFieldsOptions { result: BuilderDesignSystemIndexResult; projectName?: string; description?: string; surface: "design" | "slides"; } export interface BuilderDesignSystemProxyFields { title: string; description: string; data: string; customInstructions: string; } export interface BuilderDesignSystemProxyReference { source: "builder"; builderDesignSystemId: string; builderJobId: string; builderProjectId?: string; builderUrl?: string; builderStatus?: string; } export interface BuilderDesignSystemDocsOptions { page?: number; pageSize?: number; minimal?: boolean; type?: string; } export interface BuilderDesignSystemDocument { id?: string; name?: string; type?: string; description?: string; content?: string; tokenValues?: Record; rawTokens?: string[]; relevantFiles?: string[]; relatedComponents?: string[]; } export interface BuilderDesignSystemHydratedReference extends BuilderDesignSystemProxyReference { docs: BuilderDesignSystemDocument[]; tokenValues: Record; docCount: number; } export interface BuilderDesignSystemIndexOptions { projectName?: string; description?: string; githubRepoUrl?: string; connectedProjectId?: string; files?: BuilderDesignSystemIndexFile[]; selection?: Record; devToolsVersion?: string; } export interface BuilderDesignSystemIndexResult { ok: true; source: "builder"; projectId: string; jobId: string; designSystemId: string; suggestedTitle: string | null; builderUrl: string; status: "in-progress"; } export declare function getBuilderDesignSystemsBaseUrl(): string; export declare function mimeTypeForBuilderDesignSystemFilename(filename: string, explicit?: string): string; export declare function buildBuilderDesignSystemIndexFiles({ codeFiles, designMd, designMdFilename, maxCodeFiles, maxTotalCodeBytes, overflowBehavior, }: BuildBuilderDesignSystemIndexFilesOptions): BuilderDesignSystemIndexFile[]; export declare function builderDesignSystemUrl(designSystemId?: string | null): string; export declare function localBuilderDesignSystemId(builderDesignSystemId: string): string; export declare function createBuilderDesignSystemProxyFields({ result, projectName, description, surface, }: BuilderDesignSystemProxyFieldsOptions): BuilderDesignSystemProxyFields; export declare function parseBuilderDesignSystemProxyReference(data: unknown): BuilderDesignSystemProxyReference | null; export declare function fetchBuilderDesignSystemDocs(designSystemId: string, options?: BuilderDesignSystemDocsOptions): Promise; export declare function hydrateBuilderDesignSystemReference(reference: BuilderDesignSystemProxyReference, options?: BuilderDesignSystemDocsOptions): Promise; export declare function startBuilderDesignSystemIndex(options: BuilderDesignSystemIndexOptions): Promise; //# sourceMappingURL=builder-design-systems.d.ts.map