cyrus-studio 1.0.6 → 1.0.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (39) hide show
  1. package/README.md +107 -65
  2. package/bin/mcp-server.js +394 -0
  3. package/dist/index.cjs +1167 -0
  4. package/dist/index.d.ts +351 -0
  5. package/dist/index.js +41 -0
  6. package/dist/index.mjs +1137 -0
  7. package/dist/protocol.d.ts +35 -0
  8. package/dist/protocol.js +31 -0
  9. package/dist/src/index.d.ts +1176 -0
  10. package/dist/src/index.js +41 -0
  11. package/package.json +39 -50
  12. package/dist/assets/AuthDialog-bjTyuBr7.js +0 -1
  13. package/dist/assets/CanvaSaveModal-BfM3xRxS.js +0 -1
  14. package/dist/assets/CodingWorkspace-BKcqDIZx.js +0 -6
  15. package/dist/assets/CreateAppDialog-D8utCQ_b.js +0 -1236
  16. package/dist/assets/CreateProjectDialog-BVn3XyiE.js +0 -1
  17. package/dist/assets/HistoryTimelineDialog-B6LM34kT.js +0 -1
  18. package/dist/assets/ImportModal-B5pjYSjk.js +0 -83
  19. package/dist/assets/KeyboardShortcutsDialog-azy2kfng.js +0 -1
  20. package/dist/assets/LiveRuntimeWorkspace-CFPr1I0-.js +0 -1
  21. package/dist/assets/ShareExportDialog-BrQois88.js +0 -1
  22. package/dist/assets/UserProfileDialog-B2TENVlq.js +0 -1
  23. package/dist/assets/WelcomeOnboardingModal-Dyig1GK1.js +0 -1
  24. package/dist/assets/index-Cc_706Lp.css +0 -2
  25. package/dist/assets/index-DM7S-Aaa.js +0 -793
  26. package/dist/assets/reactTsGenerator-CpUD2_5K.js +0 -1330
  27. package/dist/assets/rolldown-runtime-Dd_uD5pT.js +0 -1
  28. package/dist/assets/themes-Iute1uX4.js +0 -1
  29. package/dist/assets/typechecker-BbGTunMD.js +0 -2
  30. package/dist/assets/vendor-firebase-DNMzpOGz.js +0 -32
  31. package/dist/assets/vendor-icons-CT-OIlA-.js +0 -13
  32. package/dist/assets/vendor-jszip-BhaZ3FnA.js +0 -2
  33. package/dist/assets/vendor-react-DVnpuVEx.js +0 -227
  34. package/dist/assets/vendor-utils-BqqQ8OQf.js +0 -1
  35. package/dist/favicon.svg +0 -1
  36. package/dist/icons.svg +0 -24
  37. package/dist/index.html +0 -50
  38. package/dist/login-bg.png +0 -0
  39. package/dist/test-sdk-sandbox.html +0 -125
@@ -0,0 +1,35 @@
1
+ export interface CyrusIRElement {
2
+ id?: string;
3
+ type: string;
4
+ name?: string;
5
+ x?: number;
6
+ y?: number;
7
+ width?: number;
8
+ height?: number;
9
+ styles?: Record<string, any>;
10
+ content?: Record<string, any>;
11
+ children?: CyrusIRElement[];
12
+ }
13
+ export interface CyrusIRPage {
14
+ id?: string;
15
+ name?: string;
16
+ slug?: string;
17
+ backgroundColor?: string;
18
+ elements: CyrusIRElement[];
19
+ }
20
+ export interface CyrusIRDocument {
21
+ version: '1.0';
22
+ projectTitle: string;
23
+ type?: 'webapp' | 'website' | 'dashboard' | 'landing' | 'mobile';
24
+ theme?: 'light' | 'dark' | 'system';
25
+ palette?: {
26
+ primary?: string;
27
+ secondary?: string;
28
+ background?: string;
29
+ surface?: string;
30
+ text?: string;
31
+ };
32
+ pages: CyrusIRPage[];
33
+ }
34
+ export declare function validateAndRepairCyrusIR(rawInput: any): CyrusIRDocument;
35
+ export declare function getCyrusLLMSystemPrompt(): string;
@@ -0,0 +1,31 @@
1
+ export function validateAndRepairCyrusIR(rawInput) {
2
+ let doc = rawInput;
3
+ if (typeof rawInput === 'string') {
4
+ try {
5
+ const cleaned = rawInput.replace(/```json\s*/gi, '').replace(/```\s*$/gi, '').trim();
6
+ doc = JSON.parse(cleaned);
7
+ }
8
+ catch {
9
+ return { version: '1.0', projectTitle: 'AI Application', pages: [{ name: 'Page 1', elements: [] }] };
10
+ }
11
+ }
12
+ if (!doc || typeof doc !== 'object') {
13
+ return { version: '1.0', projectTitle: 'AI Application', pages: [{ name: 'Page 1', elements: [] }] };
14
+ }
15
+ const pages = Array.isArray(doc.pages) ? doc.pages : [{ name: 'Home', elements: doc.elements || [] }];
16
+ return {
17
+ version: '1.0',
18
+ projectTitle: String(doc.projectTitle || doc.name || 'AI Application'),
19
+ type: doc.type || 'webapp',
20
+ theme: doc.theme || 'light',
21
+ palette: doc.palette || { primary: '#0071e3', secondary: '#7d2ae8', background: '#ffffff', surface: '#f5f5f7', text: '#1d1d1f' },
22
+ pages: pages.map((p, idx) => ({
23
+ name: p.name || `Page ${idx + 1}`,
24
+ slug: p.slug || `page-${idx + 1}`,
25
+ elements: Array.isArray(p.elements) ? p.elements : [],
26
+ })),
27
+ };
28
+ }
29
+ export function getCyrusLLMSystemPrompt() {
30
+ return `Output your designs strictly in the Cyrus IR JSON format:\n{\n "version": "1.0",\n "projectTitle": "Title",\n "type": "webapp",\n "theme": "light",\n "pages": [\n { "name": "Home", "elements": [{ "type": "navbar" }, { "type": "heading" }, { "type": "button" }] }\n ]\n}`;
31
+ }