@lovable.dev/workflows-sdk 0.0.0-dev.36 → 0.0.0-dev.37
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/dist/{branch-metadata-eRlmrRnQ.js → branch-metadata-CCIvxHlb.js} +1 -1
- package/dist/{context-escapes-CLtvjxsX.js → context-escapes-BNgQ8k-0.js} +1 -1
- package/dist/{duplicate-ids-CtAxsacU.js → duplicate-ids-L4QQ5O8-.js} +1 -1
- package/dist/{generate-BMX9n68I.js → generate-B_IFHQxI.js} +15 -10
- package/dist/{graph-B463oJiq.js → graph-D85e8ozR.js} +26 -7
- package/dist/index.js +1 -1
- package/dist/{nested-operations-CIpBlQ9h.js → nested-operations-CXRroUwp.js} +1 -1
- package/dist/{operation-descriptions-L3RqiBP4.js → operation-descriptions-CjzBgppO.js} +1 -1
- package/dist/{step-metadata-C9RxmNhf.js → step-metadata-w170VNf9.js} +1 -1
- package/dist/vite.js +1 -1
- package/dist/{wait-deadlines-hNLFYBWD.js → wait-deadlines-DmQQqPNP.js} +1 -1
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { loadTypeScript, t as workflowHandlerSource } from "./graph-
|
|
1
|
+
import { loadTypeScript, t as workflowHandlerSource } from "./graph-D85e8ozR.js";
|
|
2
2
|
//#region src/manifests/duplicate-ids.ts
|
|
3
3
|
/** Where an explicit `{ id }` would sit for each operation. */
|
|
4
4
|
const optionsArgument = {
|
|
@@ -6626,7 +6626,7 @@ function listValueFromJson(listValue, json) {
|
|
|
6626
6626
|
}
|
|
6627
6627
|
//#endregion
|
|
6628
6628
|
//#region package.json
|
|
6629
|
-
var version = "0.0.0-dev.
|
|
6629
|
+
var version = "0.0.0-dev.37";
|
|
6630
6630
|
//#endregion
|
|
6631
6631
|
//#region src/proto/lovable/appworkflows/v1/workflow_manifest_pb.ts
|
|
6632
6632
|
/**
|
|
@@ -6758,6 +6758,11 @@ const WorkflowManifestOrderEdgeV1Schema = /*@__PURE__*/ messageDesc(file_lovable
|
|
|
6758
6758
|
* Use `create(WorkflowManifestBranchEdgeV1Schema)` to create a new message.
|
|
6759
6759
|
*/
|
|
6760
6760
|
const WorkflowManifestBranchEdgeV1Schema = /*@__PURE__*/ messageDesc(file_lovable_appworkflows_v1_workflow_manifest, 24);
|
|
6761
|
+
/**
|
|
6762
|
+
* Describes the message lovable.appworkflows.v1.WorkflowManifestLlmNodeV1.
|
|
6763
|
+
* Use `create(WorkflowManifestLlmNodeV1Schema)` to create a new message.
|
|
6764
|
+
*/
|
|
6765
|
+
const WorkflowManifestLlmNodeV1Schema = /*@__PURE__*/ messageDesc(file_lovable_appworkflows_v1_workflow_manifest, 25);
|
|
6761
6766
|
//#endregion
|
|
6762
6767
|
//#region src/manifests/json.ts
|
|
6763
6768
|
function toJson(value, jsonPath, ancestors = /* @__PURE__ */ new Set()) {
|
|
@@ -6819,15 +6824,15 @@ function serializeSchema(schema, direction, label) {
|
|
|
6819
6824
|
}
|
|
6820
6825
|
}
|
|
6821
6826
|
async function generateManifests(definition, options = {}) {
|
|
6822
|
-
const { extractWorkflowGraph } = await import("./graph-
|
|
6823
|
-
const { findBranchMetadataIssues } = await import("./branch-metadata-
|
|
6824
|
-
const { findWorkflowContextEscapes } = await import("./context-escapes-
|
|
6825
|
-
const { findDuplicateOperationIds } = await import("./duplicate-ids-
|
|
6827
|
+
const { extractWorkflowGraph } = await import("./graph-D85e8ozR.js");
|
|
6828
|
+
const { findBranchMetadataIssues } = await import("./branch-metadata-CCIvxHlb.js");
|
|
6829
|
+
const { findWorkflowContextEscapes } = await import("./context-escapes-BNgQ8k-0.js");
|
|
6830
|
+
const { findDuplicateOperationIds } = await import("./duplicate-ids-L4QQ5O8-.js");
|
|
6826
6831
|
const { DURABLE_ID_REQUIRED } = await import("./durable-ids-Cx341nJQ.js").then((n) => n.n);
|
|
6827
|
-
const { findNestedDurableOperations } = await import("./nested-operations-
|
|
6828
|
-
const { findOperationDescriptionIssues } = await import("./operation-descriptions-
|
|
6829
|
-
const { findStepMetadataIssues } = await import("./step-metadata-
|
|
6830
|
-
const { findWaitDeadlineIssues } = await import("./wait-deadlines-
|
|
6832
|
+
const { findNestedDurableOperations } = await import("./nested-operations-CXRroUwp.js");
|
|
6833
|
+
const { findOperationDescriptionIssues } = await import("./operation-descriptions-CjzBgppO.js");
|
|
6834
|
+
const { findStepMetadataIssues } = await import("./step-metadata-w170VNf9.js");
|
|
6835
|
+
const { findWaitDeadlineIssues } = await import("./wait-deadlines-DmQQqPNP.js");
|
|
6831
6836
|
const { WAIT_DEADLINE_REQUIRED } = await import("./wait-deadlines-DpK-Fgnd.js");
|
|
6832
6837
|
const collection = registerWorkflows(definition);
|
|
6833
6838
|
const manifests = [];
|
|
@@ -6935,4 +6940,4 @@ async function generateManifests(definition, options = {}) {
|
|
|
6935
6940
|
});
|
|
6936
6941
|
}
|
|
6937
6942
|
//#endregion
|
|
6938
|
-
export {
|
|
6943
|
+
export { createWorkflow$1 as C, daily as D, defineSchedule as E, hourly as O, createMiddleware as S, workflowVersions as T, WorkflowManifestStepNodeV1Schema as _, WorkflowManifestGraphEdgeV1Schema as a, WorkflowManifestWaitForEventNodeV1Schema as b, WorkflowManifestLlmNodeV1Schema as c, WorkflowManifestOrderEdgeV1Schema as d, WorkflowManifestParallelNodeV1Schema as f, WorkflowManifestStepExecutionPolicyV1Schema as g, WorkflowManifestSleepUntilNodeV1Schema as h, WorkflowManifestBranchNodeV1Schema as i, weekly as k, WorkflowManifestLoopNodeV1Schema as l, WorkflowManifestSleepNodeV1Schema as m, WorkflowManifestApproveNodeV1Schema as n, WorkflowManifestGraphNodeV1Schema as o, WorkflowManifestRepeatedStepV1Schema as p, WorkflowManifestBranchEdgeV1Schema as r, WorkflowManifestGraphV1Schema as s, generateManifests as t, WorkflowManifestNowNodeV1Schema as u, WorkflowManifestUnknownNodeV1Schema as v, registerWorkflows as w, create as x, WorkflowManifestUuidNodeV1Schema as y };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { _ as
|
|
1
|
+
import { _ as WorkflowManifestStepNodeV1Schema, a as WorkflowManifestGraphEdgeV1Schema, b as WorkflowManifestWaitForEventNodeV1Schema, c as WorkflowManifestLlmNodeV1Schema, d as WorkflowManifestOrderEdgeV1Schema, f as WorkflowManifestParallelNodeV1Schema, g as WorkflowManifestStepExecutionPolicyV1Schema, h as WorkflowManifestSleepUntilNodeV1Schema, i as WorkflowManifestBranchNodeV1Schema, l as WorkflowManifestLoopNodeV1Schema, m as WorkflowManifestSleepNodeV1Schema, n as WorkflowManifestApproveNodeV1Schema, o as WorkflowManifestGraphNodeV1Schema, p as WorkflowManifestRepeatedStepV1Schema, r as WorkflowManifestBranchEdgeV1Schema, s as WorkflowManifestGraphV1Schema, u as WorkflowManifestNowNodeV1Schema, v as WorkflowManifestUnknownNodeV1Schema, x as create, y as WorkflowManifestUuidNodeV1Schema } from "./generate-B_IFHQxI.js";
|
|
2
2
|
//#region src/manifests/handler-source.ts
|
|
3
3
|
const nativeFunctionSource = /\{\s*\[native code\]\s*\}\s*$/;
|
|
4
4
|
function workflowHandlerSource(handler) {
|
|
@@ -9,6 +9,7 @@ function workflowHandlerSource(handler) {
|
|
|
9
9
|
//#region src/manifests/graph.ts
|
|
10
10
|
const durableMethods = {
|
|
11
11
|
step: 0,
|
|
12
|
+
llm: 0,
|
|
12
13
|
approve: 0,
|
|
13
14
|
waitForEvent: 0,
|
|
14
15
|
sleep: 0,
|
|
@@ -214,7 +215,7 @@ async function extractWorkflowGraph(workflow) {
|
|
|
214
215
|
}
|
|
215
216
|
function operationMeta(call) {
|
|
216
217
|
const method = call.expression.name.text;
|
|
217
|
-
const optionsIndex = method === "step" ? 2 : method === "sleep" || method === "sleepUntil" || method === "waitForEvent" ? 1 : 0;
|
|
218
|
+
const optionsIndex = method === "step" ? 2 : method === "llm" || method === "sleep" || method === "sleepUntil" || method === "waitForEvent" ? 1 : 0;
|
|
218
219
|
return readableOptions(option(readableOptions(call.arguments[optionsIndex]), "meta"));
|
|
219
220
|
}
|
|
220
221
|
function operationBranches(call) {
|
|
@@ -236,8 +237,7 @@ async function extractWorkflowGraph(workflow) {
|
|
|
236
237
|
}
|
|
237
238
|
};
|
|
238
239
|
}
|
|
239
|
-
function stepExecutionPolicy(
|
|
240
|
-
const options = readableOptions(call.arguments[2]);
|
|
240
|
+
function stepExecutionPolicy(options) {
|
|
241
241
|
const retryNode = option(options, "retry");
|
|
242
242
|
let retryPolicy = runtimeRetry(workflow.defaultStepRetry);
|
|
243
243
|
if (retryNode) {
|
|
@@ -289,7 +289,7 @@ async function extractWorkflowGraph(workflow) {
|
|
|
289
289
|
if (stepId === void 0) return unknown("Dynamic step IDs are not supported yet", parents);
|
|
290
290
|
const metadata = stepMetadata(call);
|
|
291
291
|
if (!metadata) return unknown("Step descriptions must be static strings", parents);
|
|
292
|
-
const executionPolicy = stepExecutionPolicy(call);
|
|
292
|
+
const executionPolicy = stepExecutionPolicy(readableOptions(call.arguments[2]));
|
|
293
293
|
return addNode(stepId, {
|
|
294
294
|
case: "step",
|
|
295
295
|
value: create(WorkflowManifestStepNodeV1Schema, {
|
|
@@ -299,6 +299,25 @@ async function extractWorkflowGraph(workflow) {
|
|
|
299
299
|
})
|
|
300
300
|
}, parents);
|
|
301
301
|
}
|
|
302
|
+
if (method === "llm") {
|
|
303
|
+
const options = readableOptions(call.arguments[1]);
|
|
304
|
+
const stepId = durableStepId(call.arguments[1], options);
|
|
305
|
+
if (stepId === void 0) return unknown("ctx.llm needs a static { id }", parents);
|
|
306
|
+
const description = operationDescription(options);
|
|
307
|
+
if (description === void 0) return unknown("LLM descriptions must be static strings", parents);
|
|
308
|
+
const model = stringLiteral(option(readableOptions(call.arguments[0]), "model"));
|
|
309
|
+
const executionPolicy = stepExecutionPolicy(options);
|
|
310
|
+
if (executionPolicy) executionPolicy.timeoutMs = Math.min(executionPolicy.timeoutMs ?? 12e4, 6e5);
|
|
311
|
+
return addNode(stepId, {
|
|
312
|
+
case: "llm",
|
|
313
|
+
value: create(WorkflowManifestLlmNodeV1Schema, {
|
|
314
|
+
stepId,
|
|
315
|
+
description,
|
|
316
|
+
...executionPolicy === void 0 ? {} : { executionPolicy },
|
|
317
|
+
...model === void 0 ? {} : { model }
|
|
318
|
+
})
|
|
319
|
+
}, parents);
|
|
320
|
+
}
|
|
302
321
|
if (method === "approve") {
|
|
303
322
|
const options = readableOptions(call.arguments[0]);
|
|
304
323
|
const title = stringLiteral(option(options, "title"));
|
|
@@ -450,7 +469,7 @@ async function extractWorkflowGraph(workflow) {
|
|
|
450
469
|
const mapped = mappedStep(argument);
|
|
451
470
|
if (mapped !== void 0) {
|
|
452
471
|
const metadata = stepMetadata(mapped.call);
|
|
453
|
-
const executionPolicy = stepExecutionPolicy(mapped.call);
|
|
472
|
+
const executionPolicy = stepExecutionPolicy(readableOptions(mapped.call.arguments[2]));
|
|
454
473
|
const tails = metadata?.group ? addNode(metadata.group.label, {
|
|
455
474
|
case: "parallel",
|
|
456
475
|
value: create(WorkflowManifestParallelNodeV1Schema, {
|
|
@@ -607,7 +626,7 @@ async function extractWorkflowGraph(workflow) {
|
|
|
607
626
|
if (repeated) {
|
|
608
627
|
const iterable = expression(statement.expression, parents);
|
|
609
628
|
const metadata = stepMetadata(repeated.call);
|
|
610
|
-
const executionPolicy = stepExecutionPolicy(repeated.call);
|
|
629
|
+
const executionPolicy = stepExecutionPolicy(readableOptions(repeated.call.arguments[2]));
|
|
611
630
|
const tails = metadata?.group ? addNode(metadata.group.label, {
|
|
612
631
|
case: "loop",
|
|
613
632
|
value: create(WorkflowManifestLoopNodeV1Schema, {
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as DURABLE_ID_REQUIRED } from "./durable-ids-Cx341nJQ.js";
|
|
2
|
-
import { C as
|
|
2
|
+
import { C as createWorkflow, D as daily, E as defineSchedule, O as hourly, S as createMiddleware, T as workflowVersions, k as weekly, t as generateManifests, w as registerWorkflows } from "./generate-B_IFHQxI.js";
|
|
3
3
|
import { WorkflowRequestParseError, inMemoryRunStore, parseWorkflowRequest, runWorkflow } from "@tanstack/workflow-core";
|
|
4
4
|
//#region src/stacks/tanstack/sse.ts
|
|
5
5
|
const HEADERS = {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { loadTypeScript, t as workflowHandlerSource } from "./graph-
|
|
1
|
+
import { loadTypeScript, t as workflowHandlerSource } from "./graph-D85e8ozR.js";
|
|
2
2
|
//#region src/manifests/step-metadata.ts
|
|
3
3
|
async function findStepMetadataIssues(handler) {
|
|
4
4
|
const api = await loadTypeScript();
|
package/dist/vite.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as generateManifests } from "./generate-
|
|
1
|
+
import { t as generateManifests } from "./generate-B_IFHQxI.js";
|
|
2
2
|
import { dirname, isAbsolute, join, relative, resolve, sep } from "node:path";
|
|
3
3
|
import { createServer } from "vite";
|
|
4
4
|
import { lstat, mkdir, mkdtemp, readdir, rename, rm, writeFile } from "node:fs/promises";
|