@lovable.dev/workflows-sdk 0.0.0-dev.45 → 0.0.0-dev.46
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 +10 -0
- package/dist/{branch-metadata-G62WrSYO.js → branch-metadata-BwgoU3B3.js} +1 -1
- package/dist/{context-escapes-amNGeKeM.js → context-escapes-KxFzYeSZ.js} +1 -1
- package/dist/{duplicate-ids-DfN0cqRh.js → duplicate-ids-Bd_mn83C.js} +1 -1
- package/dist/{generate-BjN4ePEF.js → generate-DQ_hJH18.js} +9 -9
- package/dist/{graph-yRbzJp-c.js → graph-BbemsojK.js} +1 -1
- package/dist/index.d.ts +46 -45
- package/dist/index.js +2 -1
- package/dist/{nested-operations-BHCaoshq.js → nested-operations-D2pHgpWr.js} +1 -1
- package/dist/{operation-descriptions-D6eGQn7m.js → operation-descriptions-Cl3OO7_8.js} +1 -1
- package/dist/{step-metadata-DsDhO79e.js → step-metadata-DPUZQ-aG.js} +1 -1
- package/dist/vite.js +1 -1
- package/dist/{wait-deadlines-QkmYD9-l.js → wait-deadlines-B6E9n_0Z.js} +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -64,11 +64,21 @@ Every durable operation needs a static, user-facing description:
|
|
|
64
64
|
| Operation | Description field |
|
|
65
65
|
| --- | --- |
|
|
66
66
|
| `ctx.step` | Third argument: `meta.description` |
|
|
67
|
+
| `ctx.llm` | Second argument: `meta.description` |
|
|
67
68
|
| `ctx.sleep`, `ctx.sleepUntil` | Second argument: `meta.description` |
|
|
68
69
|
| `ctx.waitForEvent` | Second argument: `meta.description` |
|
|
69
70
|
| `ctx.now`, `ctx.uuid` | First argument: `meta.description` |
|
|
70
71
|
| `ctx.approve` | First argument: `description` |
|
|
71
72
|
|
|
73
|
+
`ctx.llm(request, options): Promise<string>` declares an LLM step. Pass a
|
|
74
|
+
provider-prefixed `model` and either `prompt` or text-only `messages`, with
|
|
75
|
+
a unique literal `options.id` and `options.meta.description`. The App Workflows
|
|
76
|
+
service currently saves and returns `"[Mock LLM] This is a placeholder response."`;
|
|
77
|
+
it makes no AI Gateway call. Saved results replay, and saved final errors throw
|
|
78
|
+
into the workflow's `try/catch`.
|
|
79
|
+
Run LLM workflows through the generated `/steps` route. The standalone
|
|
80
|
+
`createTanStackWorkflowHandler` uses TanStack's runtime and does not support LLM steps.
|
|
81
|
+
|
|
72
82
|
Both `ctx.approve` and `ctx.waitForEvent` require `timeoutMs`: a duration in
|
|
73
83
|
milliseconds, written as a finite numeric literal of at least 60000 (one minute) (for example,
|
|
74
84
|
`3600000` for one hour or `86400000` for one day). The Vite build fails if it
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { loadTypeScript, t as workflowHandlerSource } from "./graph-
|
|
1
|
+
import { loadTypeScript, t as workflowHandlerSource } from "./graph-BbemsojK.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.46";
|
|
6630
6630
|
//#endregion
|
|
6631
6631
|
//#region src/proto/lovable/appworkflows/v1/workflow_manifest_pb.ts
|
|
6632
6632
|
/**
|
|
@@ -6824,15 +6824,15 @@ function serializeSchema(schema, direction, label) {
|
|
|
6824
6824
|
}
|
|
6825
6825
|
}
|
|
6826
6826
|
async function generateManifests(definition, options = {}) {
|
|
6827
|
-
const { extractWorkflowGraph } = await import("./graph-
|
|
6828
|
-
const { findBranchMetadataIssues } = await import("./branch-metadata-
|
|
6829
|
-
const { findWorkflowContextEscapes } = await import("./context-escapes-
|
|
6830
|
-
const { findDuplicateOperationIds } = await import("./duplicate-ids-
|
|
6827
|
+
const { extractWorkflowGraph } = await import("./graph-BbemsojK.js");
|
|
6828
|
+
const { findBranchMetadataIssues } = await import("./branch-metadata-BwgoU3B3.js");
|
|
6829
|
+
const { findWorkflowContextEscapes } = await import("./context-escapes-KxFzYeSZ.js");
|
|
6830
|
+
const { findDuplicateOperationIds } = await import("./duplicate-ids-Bd_mn83C.js");
|
|
6831
6831
|
const { DURABLE_ID_REQUIRED } = await import("./durable-ids-Cx341nJQ.js").then((n) => n.n);
|
|
6832
|
-
const { findNestedDurableOperations } = await import("./nested-operations-
|
|
6833
|
-
const { findOperationDescriptionIssues } = await import("./operation-descriptions-
|
|
6834
|
-
const { findStepMetadataIssues } = await import("./step-metadata-
|
|
6835
|
-
const { findWaitDeadlineIssues } = await import("./wait-deadlines-
|
|
6832
|
+
const { findNestedDurableOperations } = await import("./nested-operations-D2pHgpWr.js");
|
|
6833
|
+
const { findOperationDescriptionIssues } = await import("./operation-descriptions-Cl3OO7_8.js");
|
|
6834
|
+
const { findStepMetadataIssues } = await import("./step-metadata-DPUZQ-aG.js");
|
|
6835
|
+
const { findWaitDeadlineIssues } = await import("./wait-deadlines-B6E9n_0Z.js");
|
|
6836
6836
|
const { WAIT_DEADLINE_REQUIRED } = await import("./wait-deadlines-DpK-Fgnd.js");
|
|
6837
6837
|
const collection = registerWorkflows(definition);
|
|
6838
6838
|
const manifests = [];
|
|
@@ -1,4 +1,4 @@
|
|
|
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-
|
|
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-DQ_hJH18.js";
|
|
2
2
|
import { n as assertLlmOptions, t as assertLlmModel } from "./llm-validation-89xbXKQw.js";
|
|
3
3
|
//#region src/manifests/handler-source.ts
|
|
4
4
|
const nativeFunctionSource = /\{\s*\[native code\]\s*\}\s*$/;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,49 @@
|
|
|
1
1
|
import { AccumulateExtensions, AnyMiddleware, AnyWorkflowDefinition, AnyWorkflowDefinition as AnyWorkflowDefinition$1, ApprovalResult, ApproveOptions as ApproveOptions$1, CreateWorkflowConfig, Ctx as Ctx$1, InferSchema, RunStore, SchemaInput, StepContext, StepOptions, WaitForEventOptions as WaitForEventOptions$1, WorkflowBuilder, WorkflowDefinition, WorkflowDefinition as WorkflowDefinition$1, WorkflowEvent, WorkflowInput, WorkflowInput as WorkflowInput$1, WorkflowMetadata, WorkflowOutput, WorkflowState, createMiddleware } from "@tanstack/workflow-core";
|
|
2
|
+
//#region src/core/step-metadata.d.ts
|
|
3
|
+
interface WorkflowStepGroup {
|
|
4
|
+
id: string;
|
|
5
|
+
label: string;
|
|
6
|
+
}
|
|
7
|
+
interface WorkflowBranchMetadata {
|
|
8
|
+
id: string;
|
|
9
|
+
description: string;
|
|
10
|
+
}
|
|
11
|
+
type WorkflowOperationMetadata = Record<string, unknown> & {
|
|
12
|
+
description: string;
|
|
13
|
+
branches?: WorkflowBranchMetadata[];
|
|
14
|
+
};
|
|
15
|
+
type WorkflowStepMetadata = WorkflowOperationMetadata & {
|
|
16
|
+
group?: WorkflowStepGroup;
|
|
17
|
+
};
|
|
18
|
+
//#endregion
|
|
19
|
+
//#region src/core/llm.d.ts
|
|
20
|
+
type LlmRequest = {
|
|
21
|
+
model: string;
|
|
22
|
+
system?: string;
|
|
23
|
+
maxTokens?: number;
|
|
24
|
+
} & ({
|
|
25
|
+
prompt: string;
|
|
26
|
+
messages?: never;
|
|
27
|
+
} | {
|
|
28
|
+
prompt?: never;
|
|
29
|
+
messages: {
|
|
30
|
+
role: "user" | "assistant";
|
|
31
|
+
content: string;
|
|
32
|
+
}[];
|
|
33
|
+
});
|
|
34
|
+
interface LlmStepOptions {
|
|
35
|
+
id: string;
|
|
36
|
+
meta: WorkflowStepMetadata;
|
|
37
|
+
timeout?: number;
|
|
38
|
+
retry?: {
|
|
39
|
+
maxAttempts: number;
|
|
40
|
+
backoff?: "fixed" | "exponential";
|
|
41
|
+
baseMs?: number;
|
|
42
|
+
shouldRetry?: never;
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
type LlmStep = (request: LlmRequest, options: LlmStepOptions) => Promise<string>;
|
|
46
|
+
//#endregion
|
|
2
47
|
//#region src/core/cadence.d.ts
|
|
3
48
|
type Weekday = "mon" | "tue" | "wed" | "thu" | "fri" | "sat" | "sun";
|
|
4
49
|
type Cadence = {
|
|
@@ -55,6 +100,7 @@ type WaitForEventOptions<TPayload = unknown> = Omit<WaitForEventOptions$1<TPaylo
|
|
|
55
100
|
deadline?: never;
|
|
56
101
|
};
|
|
57
102
|
type Ctx<TInput = unknown, TState = Record<string, unknown>, TExtensions = unknown> = Omit<Ctx$1<TInput, TState>, "approve" | "waitForEvent"> & {
|
|
103
|
+
llm: LlmStep;
|
|
58
104
|
approve: (options: ApproveOptions) => Promise<ApprovalResult>;
|
|
59
105
|
waitForEvent: <TPayload = unknown>(name: string, options: WaitForEventOptions<TPayload>) => Promise<TPayload>;
|
|
60
106
|
} & TExtensions;
|
|
@@ -73,51 +119,6 @@ declare function registerWorkflows<const TWorkflows extends readonly AnyWorkflow
|
|
|
73
119
|
triggers?: readonly TriggerDefinition[];
|
|
74
120
|
}): WorkflowsDefinition<TWorkflows[number]>;
|
|
75
121
|
//#endregion
|
|
76
|
-
//#region src/core/step-metadata.d.ts
|
|
77
|
-
interface WorkflowStepGroup {
|
|
78
|
-
id: string;
|
|
79
|
-
label: string;
|
|
80
|
-
}
|
|
81
|
-
interface WorkflowBranchMetadata {
|
|
82
|
-
id: string;
|
|
83
|
-
description: string;
|
|
84
|
-
}
|
|
85
|
-
type WorkflowOperationMetadata = Record<string, unknown> & {
|
|
86
|
-
description: string;
|
|
87
|
-
branches?: WorkflowBranchMetadata[];
|
|
88
|
-
};
|
|
89
|
-
type WorkflowStepMetadata = WorkflowOperationMetadata & {
|
|
90
|
-
group?: WorkflowStepGroup;
|
|
91
|
-
};
|
|
92
|
-
//#endregion
|
|
93
|
-
//#region src/core/llm.d.ts
|
|
94
|
-
type LlmRequest = {
|
|
95
|
-
model: string;
|
|
96
|
-
system?: string;
|
|
97
|
-
maxTokens?: number;
|
|
98
|
-
} & ({
|
|
99
|
-
prompt: string;
|
|
100
|
-
messages?: never;
|
|
101
|
-
} | {
|
|
102
|
-
prompt?: never;
|
|
103
|
-
messages: {
|
|
104
|
-
role: "user" | "assistant";
|
|
105
|
-
content: string;
|
|
106
|
-
}[];
|
|
107
|
-
});
|
|
108
|
-
interface LlmStepOptions {
|
|
109
|
-
id: string;
|
|
110
|
-
meta: WorkflowStepMetadata;
|
|
111
|
-
timeout?: number;
|
|
112
|
-
retry?: {
|
|
113
|
-
maxAttempts: number;
|
|
114
|
-
backoff?: "fixed" | "exponential";
|
|
115
|
-
baseMs?: number;
|
|
116
|
-
shouldRetry?: never;
|
|
117
|
-
};
|
|
118
|
-
}
|
|
119
|
-
type LlmStep = (request: LlmRequest, options: LlmStepOptions) => Promise<string>;
|
|
120
|
-
//#endregion
|
|
121
122
|
//#region ../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@bufbuild/protobuf/2.10.1/b0955b226816adda68977638196f96a6e65cec2605734621338f49f7ea29042e/node_modules/@bufbuild/protobuf/dist/esm/json-value.d.ts
|
|
122
123
|
/**
|
|
123
124
|
* Represents any possible JSON value:
|
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 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-
|
|
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-DQ_hJH18.js";
|
|
3
3
|
import { n as assertLlmOptions, r as assertLlmRequest } from "./llm-validation-89xbXKQw.js";
|
|
4
4
|
import { WorkflowRequestParseError, inMemoryRunStore, parseWorkflowRequest, runWorkflow } from "@tanstack/workflow-core";
|
|
5
5
|
//#region src/stacks/tanstack/sse.ts
|
|
@@ -323,6 +323,7 @@ async function replay(options) {
|
|
|
323
323
|
state,
|
|
324
324
|
signal: controller.signal,
|
|
325
325
|
runtime,
|
|
326
|
+
llm: operations.llm,
|
|
326
327
|
step: (id, fn, stepOptions) => durable("step", id, async () => fn({
|
|
327
328
|
id,
|
|
328
329
|
attempt: 1,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { loadTypeScript, t as workflowHandlerSource } from "./graph-
|
|
1
|
+
import { loadTypeScript, t as workflowHandlerSource } from "./graph-BbemsojK.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-DQ_hJH18.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";
|