@lovable.dev/sdk 1.4.1 → 1.6.1
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 +21 -2
- package/dist/index.d.ts +2969 -1187
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/schemas.d.ts +590 -178
- package/dist/schemas.js +293 -90
- package/dist/schemas.js.map +1 -1
- package/dist/workflows.d.ts +233 -0
- package/dist/workflows.js +1250 -0
- package/dist/workflows.js.map +1 -0
- package/package.json +5 -1
- package/src/client.ts +6 -4
- package/src/generated/paths.ts +2856 -1080
- package/src/generated/zod/zod.gen.ts +322 -95
- package/src/types.ts +9 -3
package/README.md
CHANGED
|
@@ -53,6 +53,26 @@ const published = await client.waitForProjectPublished(project.id);
|
|
|
53
53
|
console.log(published.url); // Live public URL
|
|
54
54
|
```
|
|
55
55
|
|
|
56
|
+
### Code-first workflows
|
|
57
|
+
|
|
58
|
+
Use the `workflows` subpath to define compute-only durable workflows for the Cloudflare runtime:
|
|
59
|
+
|
|
60
|
+
```typescript
|
|
61
|
+
import { defineWorkflow, toWorker } from "@lovable.dev/sdk/workflows";
|
|
62
|
+
|
|
63
|
+
const workflow = defineWorkflow<{ message: string }, { message: string; runId: string }>(
|
|
64
|
+
"project-showcase",
|
|
65
|
+
async (ctx) => {
|
|
66
|
+
const message = await ctx.step.run("normalize", () => ctx.input.message.trim());
|
|
67
|
+
return { message, runId: await ctx.uuid("run") };
|
|
68
|
+
},
|
|
69
|
+
);
|
|
70
|
+
|
|
71
|
+
export default toWorker(workflow);
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
Bundle the static ESM module and register it through the workflow service. Connector and internal-service access remain disabled until workflow workload identity and platform egress are available.
|
|
75
|
+
|
|
56
76
|
### Remixing a project at a specific message
|
|
57
77
|
|
|
58
78
|
```typescript
|
|
@@ -162,7 +182,6 @@ Send a chat message to a project's AI agent.
|
|
|
162
182
|
Options:
|
|
163
183
|
|
|
164
184
|
- `message` (required): The message to send
|
|
165
|
-
- `variantId` (optional): Variant ID from `createVariant()`. Omit to send the message to the project's main agent
|
|
166
185
|
- `files` (optional): Array of files to attach (browser `File` objects or `FileInput` objects)
|
|
167
186
|
- `continuation` (optional): Override prompt cache continuation behavior (`"force"` | `"fresh_build"` | `"allow_expired_cache"`). API-key auth only. See [Continuation override](#continuation-override)
|
|
168
187
|
|
|
@@ -187,7 +206,7 @@ Options:
|
|
|
187
206
|
|
|
188
207
|
Returns:
|
|
189
208
|
|
|
190
|
-
- `variant_id` (string): The variant
|
|
209
|
+
- `variant_id` (string): The variant's identifier
|
|
191
210
|
- `label` (string): The variant's display name
|
|
192
211
|
- `branch` (string): The git branch attached to the variant
|
|
193
212
|
- `thread_id` (string): The trajectory thread driving the variant
|