@lovable.dev/workflows-sdk 0.0.0-dev.42 → 0.0.0-dev.43

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.
@@ -1,4 +1,4 @@
1
- import { loadTypeScript, t as workflowHandlerSource } from "./graph-3gOUq6Fj.js";
1
+ import { loadTypeScript, t as workflowHandlerSource } from "./graph-C34bH2ul.js";
2
2
  //#region src/manifests/branch-metadata.ts
3
3
  const optionsArgument = {
4
4
  step: 2,
@@ -1,4 +1,4 @@
1
- import { loadTypeScript, t as workflowHandlerSource } from "./graph-3gOUq6Fj.js";
1
+ import { loadTypeScript, t as workflowHandlerSource } from "./graph-C34bH2ul.js";
2
2
  //#region src/manifests/context-escapes.ts
3
3
  const durableMethods = /* @__PURE__ */ new Set([
4
4
  "step",
@@ -1,4 +1,4 @@
1
- import { loadTypeScript, t as workflowHandlerSource } from "./graph-3gOUq6Fj.js";
1
+ import { loadTypeScript, t as workflowHandlerSource } from "./graph-C34bH2ul.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.42";
6629
+ var version = "0.0.0-dev.43";
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-3gOUq6Fj.js");
6828
- const { findBranchMetadataIssues } = await import("./branch-metadata-B_AYFR_q.js");
6829
- const { findWorkflowContextEscapes } = await import("./context-escapes-BDFqA3Vj.js");
6830
- const { findDuplicateOperationIds } = await import("./duplicate-ids-DKz9hLiV.js");
6827
+ const { extractWorkflowGraph } = await import("./graph-C34bH2ul.js");
6828
+ const { findBranchMetadataIssues } = await import("./branch-metadata-B6uZRRY3.js");
6829
+ const { findWorkflowContextEscapes } = await import("./context-escapes-Bk0DN2MM.js");
6830
+ const { findDuplicateOperationIds } = await import("./duplicate-ids-CB-xAZH3.js");
6831
6831
  const { DURABLE_ID_REQUIRED } = await import("./durable-ids-Cx341nJQ.js").then((n) => n.n);
6832
- const { findNestedDurableOperations } = await import("./nested-operations-Brojvxz6.js");
6833
- const { findOperationDescriptionIssues } = await import("./operation-descriptions-t_polWSM.js");
6834
- const { findStepMetadataIssues } = await import("./step-metadata-CsJWX9X4.js");
6835
- const { findWaitDeadlineIssues } = await import("./wait-deadlines-BVlkmfZO.js");
6832
+ const { findNestedDurableOperations } = await import("./nested-operations-CWaP7rOJ.js");
6833
+ const { findOperationDescriptionIssues } = await import("./operation-descriptions-Ca6Wprd9.js");
6834
+ const { findStepMetadataIssues } = await import("./step-metadata-nQwvzDPb.js");
6835
+ const { findWaitDeadlineIssues } = await import("./wait-deadlines-BHDEShlG.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-BFIKNu5F.js";
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-BlCztUNP.js";
2
2
  //#region src/manifests/handler-source.ts
3
3
  const nativeFunctionSource = /\{\s*\[native code\]\s*\}\s*$/;
4
4
  function workflowHandlerSource(handler) {
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-BFIKNu5F.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-BlCztUNP.js";
3
3
  import { WorkflowRequestParseError, inMemoryRunStore, parseWorkflowRequest, runWorkflow } from "@tanstack/workflow-core";
4
4
  //#region src/stacks/tanstack/sse.ts
5
5
  const HEADERS = {
@@ -541,17 +541,19 @@ function memoDelta(before, after) {
541
541
  }
542
542
  function respond(runId, inputHash, workflowVersion, before, outcome, executed) {
543
543
  const { steps, emitted, output, error } = outcome;
544
+ const nextDisposition = disposition(outcome);
545
+ const deferred = executed?.status === "completed" && nextDisposition !== "fork";
544
546
  return json(200, {
545
547
  runId,
546
548
  inputHash,
547
549
  workflowVersion,
548
- disposition: disposition(outcome),
550
+ disposition: deferred ? "advanced" : nextDisposition,
549
551
  memoDelta: memoDelta(before, outcome.memo),
550
- next: steps,
552
+ next: deferred && nextDisposition === "waiting" ? [] : steps,
551
553
  ...executed === void 0 ? {} : { executed },
552
554
  ...emitted.length > 0 ? { emitted } : {},
553
- ...output === void 0 ? {} : { output },
554
- ...error === void 0 ? {} : { error }
555
+ ...deferred || output === void 0 ? {} : { output },
556
+ ...deferred || error === void 0 ? {} : { error }
555
557
  });
556
558
  }
557
559
  function prepare(collection, options) {
@@ -586,7 +588,7 @@ async function validateInput(workflow, input) {
586
588
  return { input: result.value };
587
589
  }
588
590
  async function validateOutput(workflow, outcome) {
589
- if (outcome.status !== "completed" || !workflow.outputSchema) return outcome;
591
+ if (outcome.status !== "completed" || !workflow.outputSchema || outcome.results.some((result) => result.kind === "step" && result.status === "completed")) return outcome;
590
592
  let result;
591
593
  try {
592
594
  result = await validateSchema(workflow.outputSchema, outcome.output);
@@ -1,4 +1,4 @@
1
- import { loadTypeScript, t as workflowHandlerSource } from "./graph-3gOUq6Fj.js";
1
+ import { loadTypeScript, t as workflowHandlerSource } from "./graph-C34bH2ul.js";
2
2
  //#region src/manifests/nested-operations.ts
3
3
  const durableMethods = [
4
4
  "step",
@@ -1,4 +1,4 @@
1
- import { loadTypeScript, t as workflowHandlerSource } from "./graph-3gOUq6Fj.js";
1
+ import { loadTypeScript, t as workflowHandlerSource } from "./graph-C34bH2ul.js";
2
2
  //#region src/manifests/operation-descriptions.ts
3
3
  const optionsArgument = {
4
4
  approve: 0,
@@ -1,4 +1,4 @@
1
- import { loadTypeScript, t as workflowHandlerSource } from "./graph-3gOUq6Fj.js";
1
+ import { loadTypeScript, t as workflowHandlerSource } from "./graph-C34bH2ul.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-BFIKNu5F.js";
1
+ import { t as generateManifests } from "./generate-BlCztUNP.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";
@@ -1,4 +1,4 @@
1
- import { loadTypeScript, t as workflowHandlerSource } from "./graph-3gOUq6Fj.js";
1
+ import { loadTypeScript, t as workflowHandlerSource } from "./graph-C34bH2ul.js";
2
2
  //#region src/manifests/wait-deadlines.ts
3
3
  const optionsArgument = {
4
4
  approve: 0,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lovable.dev/workflows-sdk",
3
- "version": "0.0.0-dev.42",
3
+ "version": "0.0.0-dev.43",
4
4
  "publishConfig": {
5
5
  "access": "public",
6
6
  "tag": "dev",