Spaces:
Configuration error
Configuration error
Download cursor-server.js from carefullycraftedtree/cc_site_maker: direct link, hf CLI and curl.
- Browser
- Download file 1.09 kB
-
https://huggingface.co/spaces/carefullycraftedtree/cc_site_maker/resolve/main/cursor-server.js
- Command line
-
hf download hf://spaces/carefullycraftedtree/cc_site_maker/cursor-server.js
-
curl -L -o cursor-server.js https://huggingface.co/spaces/carefullycraftedtree/cc_site_maker/resolve/main/cursor-server.js
1.09 kB
| // cursor-client.js | |
| class DeepSiteClient { | |
| constructor(mcpServerUrl, apiKey) { | |
| this.serverUrl = mcpServerUrl; | |
| this.apiKey = apiKey; | |
| } | |
| async generateComponent(prompt, options = {}) { | |
| try { | |
| const response = await fetch(`${this.serverUrl}/generate`, { | |
| method: 'POST', | |
| headers: { | |
| 'Content-Type': 'application/json', | |
| Authorization: `Bearer ${this.apiKey}` | |
| }, | |
| body: JSON.stringify({ | |
| prompt, | |
| componentType: options.componentType || 'component', | |
| framework: options.framework || 'react' | |
| }) | |
| }); | |
| if (!response.ok) { | |
| const errorData = await response.json(); | |
| throw new Error(errorData.error || 'Failed to generate component'); | |
| } | |
| return await response.json(); | |
| } catch (error) { | |
| console.error('Generation error:', error); | |
| throw error; | |
| } | |
| } | |
| async checkStatus() { | |
| const response = await fetch(`${this.serverUrl}/status`); | |
| return await response.json(); | |
| } | |
| } | |
| // Export for use in Cursor | |
| export default DeepSiteClient; | |