@lovable.dev/workflows-sdk 0.0.0-dev.39 → 0.0.0-dev.40

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-CWWU6Avq.js";
1
+ import { loadTypeScript, t as workflowHandlerSource } from "./graph-oG4uFJ0o.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-CWWU6Avq.js";
1
+ import { loadTypeScript, t as workflowHandlerSource } from "./graph-oG4uFJ0o.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-CWWU6Avq.js";
1
+ import { loadTypeScript, t as workflowHandlerSource } from "./graph-oG4uFJ0o.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.39";
6629
+ var version = "0.0.0-dev.40";
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-CWWU6Avq.js");
6828
- const { findBranchMetadataIssues } = await import("./branch-metadata-9Q7SwqWV.js");
6829
- const { findWorkflowContextEscapes } = await import("./context-escapes-BjjLSFn5.js");
6830
- const { findDuplicateOperationIds } = await import("./duplicate-ids-Bh4Pmuqo.js");
6827
+ const { extractWorkflowGraph } = await import("./graph-oG4uFJ0o.js");
6828
+ const { findBranchMetadataIssues } = await import("./branch-metadata-7KoYCvVR.js");
6829
+ const { findWorkflowContextEscapes } = await import("./context-escapes-5F9gQw59.js");
6830
+ const { findDuplicateOperationIds } = await import("./duplicate-ids-CJTxhI0b.js");
6831
6831
  const { DURABLE_ID_REQUIRED } = await import("./durable-ids-Cx341nJQ.js").then((n) => n.n);
6832
- const { findNestedDurableOperations } = await import("./nested-operations--JipkJYP.js");
6833
- const { findOperationDescriptionIssues } = await import("./operation-descriptions-CJkD92pD.js");
6834
- const { findStepMetadataIssues } = await import("./step-metadata-BKJlgrp_.js");
6835
- const { findWaitDeadlineIssues } = await import("./wait-deadlines-BLrZswzc.js");
6832
+ const { findNestedDurableOperations } = await import("./nested-operations-CiJJpl5w.js");
6833
+ const { findOperationDescriptionIssues } = await import("./operation-descriptions-CARt7Myx.js");
6834
+ const { findStepMetadataIssues } = await import("./step-metadata-CdZSDCpP.js");
6835
+ const { findWaitDeadlineIssues } = await import("./wait-deadlines-DTUJbmVC.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-Dz1fecvJ.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-Bv_Ep6yM.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.d.ts CHANGED
@@ -800,6 +800,59 @@ type TanStackWorkflowHandler = (ctx: TanStackRouteCtx) => Promise<Response>;
800
800
  /** Build a TanStack Start `POST` handler serving every workflow in the collection. */
801
801
  declare function createTanStackWorkflowHandler(collection: WorkflowCollection, options?: TanStackWorkflowHandlerOptions): TanStackWorkflowHandler;
802
802
  //#endregion
803
+ //#region src/proto/lovable/appworkflows/v1/external_operation_pb.d.ts
804
+ /**
805
+ * @generated from message lovable.appworkflows.v1.WorkflowExternalOperationV1
806
+ */
807
+ type WorkflowExternalOperationV1Json = {
808
+ /**
809
+ * @generated from field: lovable.appworkflows.v1.WorkflowAiGatewayParamsV1 ai_gateway = 1;
810
+ */
811
+ aiGateway?: WorkflowAiGatewayParamsV1Json;
812
+ };
813
+ /**
814
+ * @generated from message lovable.appworkflows.v1.WorkflowAiGatewayParamsV1
815
+ */
816
+ type WorkflowAiGatewayParamsV1Json = {
817
+ /**
818
+ * @generated from field: string model = 1;
819
+ */
820
+ model?: string;
821
+ /**
822
+ * LlmRequest requires prompt XOR nonempty messages; repeated fields cannot be in a oneof.
823
+ *
824
+ * @generated from field: optional string prompt = 2;
825
+ */
826
+ prompt?: string;
827
+ /**
828
+ * @generated from field: repeated lovable.appworkflows.v1.WorkflowAiGatewayMessageV1 messages = 3;
829
+ */
830
+ messages?: WorkflowAiGatewayMessageV1Json[];
831
+ /**
832
+ * @generated from field: optional string system = 4;
833
+ */
834
+ system?: string;
835
+ /**
836
+ * @generated from field: optional uint32 max_tokens = 5;
837
+ */
838
+ maxTokens?: number;
839
+ };
840
+ /**
841
+ * @generated from message lovable.appworkflows.v1.WorkflowAiGatewayMessageV1
842
+ */
843
+ type WorkflowAiGatewayMessageV1Json = {
844
+ /**
845
+ * LlmRequest permits only "user" and "assistant"; system instructions use the separate system field.
846
+ *
847
+ * @generated from field: string role = 1;
848
+ */
849
+ role?: string;
850
+ /**
851
+ * @generated from field: string content = 2;
852
+ */
853
+ content?: string;
854
+ };
855
+ //#endregion
803
856
  //#region src/runtime/types.d.ts
804
857
  /** Durable operations a replay can answer from the memo. */
805
858
  type StepKind = "step" | "llm" | "sleep" | "waitForEvent" | "approve" | "now" | "uuid";
@@ -828,11 +881,20 @@ interface StepIntentBase {
828
881
  meta?: WorkflowMetadata;
829
882
  }
830
883
  /** A durable operation the replay reached but could not answer. */
831
- type StepIntent = StepIntentBase & ({
832
- kind: "step";
833
- } | {
834
- kind: Exclude<StepKind, "step">;
835
- });
884
+ type StepIntent = StepIntentBase & {
885
+ kind: Exclude<StepKind, "llm">;
886
+ disposition?: never;
887
+ external?: never;
888
+ };
889
+ type ExternalOperation = Required<WorkflowExternalOperationV1Json> & {
890
+ aiGateway: LlmRequest;
891
+ };
892
+ type ExternalStep = Pick<StepIntentBase, "seq" | "stepId" | "meta"> & {
893
+ kind: "llm";
894
+ disposition: "external";
895
+ external: ExternalOperation;
896
+ };
897
+ type NextStep = StepIntent | ExternalStep;
836
898
  interface StepResult<K extends StepKind = StepKind> {
837
899
  seq: number;
838
900
  stepId: string;
@@ -893,14 +955,13 @@ type StepsRequest = StepsRequestBase & ({
893
955
  action: "execute";
894
956
  step: StepReference;
895
957
  });
896
- type StepsDisposition = "advanced" | "fork" | "waiting" | "completed" | "failed";
897
- interface StepsResponse {
958
+ type StepsDisposition = "advanced" | "external" | "fork" | "waiting" | "completed" | "failed";
959
+ interface StepsResponseBase {
898
960
  workflowVersion: string;
899
961
  runId: string;
900
962
  inputHash: string;
901
- disposition: StepsDisposition;
902
963
  memoDelta: MemoEntry[];
903
- next: StepIntent[];
964
+ next: NextStep[];
904
965
  executed?: StepResult<"step">;
905
966
  emitted?: {
906
967
  name: string;
@@ -909,6 +970,10 @@ interface StepsResponse {
909
970
  output?: unknown;
910
971
  error?: string;
911
972
  }
973
+ type StepsResponse = StepsResponseBase & ({
974
+ disposition: Exclude<StepsDisposition, "external">;
975
+ external?: never;
976
+ } | ExternalStep);
912
977
  declare function createStepsHandler(collection: WorkflowCollection, options?: StepsHandlerOptions): StepsHandler;
913
978
  //#endregion
914
979
  //#region src/stacks/tanstack/sse.d.ts
@@ -918,4 +983,4 @@ declare function createStepsHandler(collection: WorkflowCollection, options?: St
918
983
  */
919
984
  declare function toServerSentEventsResponse(events: AsyncIterable<WorkflowEvent>): Response;
920
985
  //#endregion
921
- export { type AnyWorkflowDefinition, type ApproveOptions, type Cadence, type Ctx, type LlmRequest, type LlmStep, type LlmStepOptions, type MemoEntry, type OverlapPolicy, type ReplayOutcome, type ResolvedSchedule, type ResolvedTrigger, type ScheduleDefinition, type StepContext, type StepIntent, type StepKind, type StepOptions, type StepReference, type StepResult, type StepsDisposition, type StepsHandler, type StepsHandlerOptions, type StepsRequest, type StepsResponse, type TanStackWorkflowHandler, type TanStackWorkflowHandlerOptions, type TriggerDefinition, type WaitForEventOptions, type Weekday, type WorkflowBranchMetadata, type WorkflowCollection, type WorkflowDefinition, type WorkflowInput, type WorkflowManifest, type WorkflowOperationMetadata, type WorkflowOutput, type WorkflowState, type WorkflowStepGroup, type WorkflowStepMetadata, type WorkflowsDefinition, createMiddleware, createStepsHandler, createTanStackWorkflowHandler, createWorkflow, daily, defineSchedule, generateManifests, hourly, registerWorkflows, toServerSentEventsResponse, weekly };
986
+ export { type AnyWorkflowDefinition, type ApproveOptions, type Cadence, type Ctx, type ExternalOperation, type ExternalStep, type LlmRequest, type LlmStep, type LlmStepOptions, type MemoEntry, type NextStep, type OverlapPolicy, type ReplayOutcome, type ResolvedSchedule, type ResolvedTrigger, type ScheduleDefinition, type StepContext, type StepIntent, type StepKind, type StepOptions, type StepReference, type StepResult, type StepsDisposition, type StepsHandler, type StepsHandlerOptions, type StepsRequest, type StepsResponse, type TanStackWorkflowHandler, type TanStackWorkflowHandlerOptions, type TriggerDefinition, type WaitForEventOptions, type Weekday, type WorkflowBranchMetadata, type WorkflowCollection, type WorkflowDefinition, type WorkflowInput, type WorkflowManifest, type WorkflowOperationMetadata, type WorkflowOutput, type WorkflowState, type WorkflowStepGroup, type WorkflowStepMetadata, type WorkflowsDefinition, createMiddleware, createStepsHandler, createTanStackWorkflowHandler, createWorkflow, daily, defineSchedule, generateManifests, hourly, registerWorkflows, toServerSentEventsResponse, weekly };
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-Dz1fecvJ.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-Bv_Ep6yM.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-CWWU6Avq.js";
1
+ import { loadTypeScript, t as workflowHandlerSource } from "./graph-oG4uFJ0o.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-CWWU6Avq.js";
1
+ import { loadTypeScript, t as workflowHandlerSource } from "./graph-oG4uFJ0o.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-CWWU6Avq.js";
1
+ import { loadTypeScript, t as workflowHandlerSource } from "./graph-oG4uFJ0o.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-Dz1fecvJ.js";
1
+ import { t as generateManifests } from "./generate-Bv_Ep6yM.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-CWWU6Avq.js";
1
+ import { loadTypeScript, t as workflowHandlerSource } from "./graph-oG4uFJ0o.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.39",
3
+ "version": "0.0.0-dev.40",
4
4
  "publishConfig": {
5
5
  "access": "public",
6
6
  "tag": "dev",