index.ts 2.48 KB
// ============= All Types Export =============
// Export all types for internal use and advanced users
export * from './types/index';

// ============= SKILL API Exports =============
// Export all skill-api utilities for IDE integration (Cursor, Claude Code, etc.)
// This includes:
// - Type exports: Protocol, FrameData, FigmaFrameInfo, FigmaUrlInfo, WorkspaceStructure
// - Initial agent: INITIAL_AGENT_SYSTEM_PROMPT, initialAgentInstruction
// - Figma processing: executeFigmaAndImagesActions, figmaTool
// - Protocol utilities: extractNodePositionsHierarchical, postProcessStructure, etc.
// - Prompt generation: generateStructurePrompt, extractDataListPrompt
// - Helper functions: extractComponentGroups, prepareComponentDataForAI, etc.
// - JSON parser: extractJSON
// - Naming utilities: toKebabCase
export * from './skill-api';

// ============= Engine API Exports =============
// The primary entry point used by the orchestration backend (apps/server) to
// generate a React project from a Figma URL. `Design2CodeOptions` accepts an
// optional `modelConfig` so the backend can inject credentials at runtime.
export { design2code } from './graph';
export type { Design2CodeOptions } from './graph';

// ============= Project Profile (画像) Support =============
// Lets the orchestration backend describe the target project's bespoke
// component library / tokens / utils / conventions so generated code matches
// the team's existing codebase instead of a generic scaffold.
export type {
    ProjectProfile,
    TokenMapping,
    ComponentMapping,
    UtilMapping,
    TokenCategory,
} from './types/project-profile';
export { emptyProfile } from './types/project-profile';
export {
    setProjectProfile,
    getProjectProfile,
    clearProjectProfile,
    loadProjectProfile,
    renderProfileConstraint,
} from './utils/project-profile';

// ============= Orchestration Backend Support =============
// Helpers the apps/server backend needs so it can own credentials, stream logs,
// and drive generation without reaching into internal modules.
export { subscribeLogs, logger } from './utils/logger';
export type { LogEntry, LogLevel } from './utils/logger';
export {
    loadConfig,
    configExists,
    getConfigPath,
    saveConfig,
    setRuntimeConfig,
    clearRuntimeConfig,
    getRuntimeConfig,
} from './utils/config';
export type { ModelConfig, FigmaConfig } from './utils/config';
export { patchEvoltagentStreamingForceOff } from './utils/patch-evoltagent';
export { parseFigmaUrl } from './utils/url-parser';