index.ts
2.46 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
// ============= 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,
} from './utils/config';
export type { ModelConfig, FigmaConfig } from './utils/config';
export { patchEvoltagentStreamingForceOff } from './utils/patch-evoltagent';
export { parseFigmaUrl } from './utils/url-parser';