@spektrum-ai/sdk 0.0.3 → 0.0.5
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.
- package/README.md +15 -40
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -51,9 +51,9 @@ const { project } = await spektrum.createProject("my-awesome-app")
|
|
|
51
51
|
|
|
52
52
|
// Describe what you want to build
|
|
53
53
|
const { task } = await spektrum.createTask(
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
54
|
+
project.id,
|
|
55
|
+
"E-commerce landing page",
|
|
56
|
+
"Build a modern landing page with hero section, product grid, testimonials, and newsletter signup",
|
|
57
57
|
)
|
|
58
58
|
|
|
59
59
|
// Generate code and deploy
|
|
@@ -64,7 +64,7 @@ const appUrl = await spektrum.getAppUrl(project.id)
|
|
|
64
64
|
console.log(`🎉 Live at: ${appUrl}`)
|
|
65
65
|
```
|
|
66
66
|
|
|
67
|
-
##
|
|
67
|
+
## Live Monitoring on JigJoy Platform
|
|
68
68
|
|
|
69
69
|
Every task you run via the SDK can be monitored in real-time on the [JigJoy Platform](https://platform.jigjoy.ai). Watch as your application gets built step-by-step:
|
|
70
70
|
|
|
@@ -74,7 +74,6 @@ Every task you run via the SDK can be monitored in real-time on the [JigJoy Plat
|
|
|
74
74
|
- **Logs & debugging** — Access detailed logs when needed
|
|
75
75
|
- **App history** — View all your deployed apps and their versions
|
|
76
76
|
|
|
77
|
-
|
|
78
77
|
<img width="2842" height="1747" alt="Screenshot from 2026-03-07 22-12-03" src="https://github.com/user-attachments/assets/8ba0ed0e-e4b3-49df-b64f-595478a31c47" />
|
|
79
78
|
|
|
80
79
|
## API Reference
|
|
@@ -94,9 +93,9 @@ Creates a task describing what to build. Be as detailed as you want — the more
|
|
|
94
93
|
|
|
95
94
|
```typescript
|
|
96
95
|
const { task } = await spektrum.createTask(
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
96
|
+
project.id,
|
|
97
|
+
"Dashboard",
|
|
98
|
+
"Create an analytics dashboard with charts, filters, and data export",
|
|
100
99
|
)
|
|
101
100
|
```
|
|
102
101
|
|
|
@@ -122,37 +121,19 @@ const url = await spektrum.getAppUrl(project.id)
|
|
|
122
121
|
Add feedback or request changes to an existing task. Then call `codeAndDeploy` again to apply them.
|
|
123
122
|
|
|
124
123
|
```typescript
|
|
125
|
-
const { task: updatedTask } = await spektrum.leaveComment(
|
|
126
|
-
task.id,
|
|
127
|
-
"Add dark mode support",
|
|
128
|
-
"user-123"
|
|
129
|
-
)
|
|
124
|
+
const { task: updatedTask } = await spektrum.leaveComment(task.id, "Add dark mode support", "user-123")
|
|
130
125
|
await spektrum.codeAndDeploy(updatedTask)
|
|
131
126
|
```
|
|
132
127
|
|
|
133
128
|
## SDK Methods Summary
|
|
134
129
|
|
|
135
|
-
| Method
|
|
136
|
-
|
|
137
|
-
| `createProject(name)`
|
|
138
|
-
| `createTask(projectId, title, description)` | Defines what to build
|
|
139
|
-
| `codeAndDeploy(task)`
|
|
140
|
-
| `getAppUrl(projectId)`
|
|
141
|
-
| `leaveComment(taskId, comment, authorId)`
|
|
142
|
-
|
|
143
|
-
## Error Handling
|
|
144
|
-
|
|
145
|
-
```typescript
|
|
146
|
-
import { SpektrumSDK, SpektrumError } from "@spektrum-ai/sdk"
|
|
147
|
-
|
|
148
|
-
try {
|
|
149
|
-
await spektrum.codeAndDeploy(task)
|
|
150
|
-
} catch (error) {
|
|
151
|
-
if (error instanceof SpektrumError) {
|
|
152
|
-
console.error(`API Error [${error.status}]: ${error.message}`)
|
|
153
|
-
}
|
|
154
|
-
}
|
|
155
|
-
```
|
|
130
|
+
| Method | Description |
|
|
131
|
+
| ------------------------------------------- | -------------------------- |
|
|
132
|
+
| `createProject(name)` | Creates a new project |
|
|
133
|
+
| `createTask(projectId, title, description)` | Defines what to build |
|
|
134
|
+
| `codeAndDeploy(task)` | Generates code and deploys |
|
|
135
|
+
| `getAppUrl(projectId)` | Returns the live app URL |
|
|
136
|
+
| `leaveComment(taskId, comment, authorId)` | Requests changes to a task |
|
|
156
137
|
|
|
157
138
|
## Complete Example
|
|
158
139
|
|
|
@@ -162,12 +143,6 @@ For a full working example with step-by-step instructions, check out:
|
|
|
162
143
|
|
|
163
144
|
Clone it, run `npm install`, add your API key, and you'll have a deployed finance dashboard in seconds.
|
|
164
145
|
|
|
165
|
-
## Links
|
|
166
|
-
|
|
167
|
-
- [JigJoy Platform](https://platform.jigjoy.ai) — Get your API key and monitor your apps
|
|
168
|
-
- [Working Example](https://github.com/jigjoy-ai/spektrum-sdk-example) — Clone and run in seconds
|
|
169
|
-
- [npm Package](https://www.npmjs.com/package/@spektrum-ai/sdk) — Latest version
|
|
170
|
-
|
|
171
146
|
## License
|
|
172
147
|
|
|
173
148
|
MIT
|