@vite-hub/workflow 0.7.0 → 0.9.0
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 +1 -1
- package/dist/{client-CPxPxsl5.js → client-EqfVxh7z.js} +14 -25
- package/dist/{cloudflare-concurrency-counter-CDHHiMfn.js → cloudflare-concurrency-counter-ClJbAi_S.js} +1 -1
- package/dist/{cloudflare-env-DHhzRZOs.js → cloudflare-env-CiI2UtWD.js} +0 -4
- package/dist/{config-CwCwuZqv.js → config-BmCUU0cM.js} +6 -6
- package/dist/definition.d.ts +1 -1
- package/dist/definition.js +1 -1
- package/dist/{delay-JrpW40UF.js → delay-p5EJWtCp.js} +4 -4
- package/dist/durability.d.ts +1 -1
- package/dist/{error-diagnostics-35AEmfve.js → error-diagnostics-BDtBsCLZ.js} +1 -1
- package/dist/{execute-CLmIXnON.js → execute-B47oa9GC.js} +5 -7
- package/dist/index.d.ts +1 -1
- package/dist/index.js +3 -3
- package/dist/{openworkflow-BiwPTYEz.js → openworkflow-B-Mkb0RK.js} +11 -14
- package/dist/{openworkflow-C65AWQSJ.d.ts → openworkflow-DHuxMJQB.d.ts} +2 -2
- package/dist/{operations-DyaGK9zW.js → operations-DfcC--r7.js} +4 -4
- package/dist/operations.d.ts +1 -1
- package/dist/operations.js +1 -2
- package/dist/{results-DBp_bmUP.d.ts → results-DqbEUMCH.d.ts} +1 -1
- package/dist/{run-error-8p4BtTMv.js → run-error-zZh1_IBo.js} +5 -21
- package/dist/runtime/cloudflare-concurrency.d.ts +1 -1
- package/dist/runtime/cloudflare-concurrency.js +1 -1
- package/dist/runtime/cloudflare-runner.d.ts +1 -1
- package/dist/runtime/cloudflare-runner.js +5 -5
- package/dist/runtime/cloudflare-shared.js +1 -1
- package/dist/runtime/cloudflare-vite.d.ts +1 -1
- package/dist/runtime/cloudflare-vite.js +2 -2
- package/dist/runtime/execute.d.ts +1 -1
- package/dist/runtime/execute.js +1 -1
- package/dist/runtime/openworkflow-worker.d.ts +2 -2
- package/dist/runtime/openworkflow-worker.js +5 -6
- package/dist/runtime/openworkflow.d.ts +1 -1
- package/dist/runtime/openworkflow.js +1 -1
- package/dist/runtime/state.d.ts +1 -1
- package/dist/runtime/state.js +2 -2
- package/dist/runtime/vercel-vite.d.ts +1 -1
- package/dist/runtime/vercel-vite.js +1 -1
- package/dist/{signals-CdaxRNjN.js → signals-DpdrHuD3.js} +1 -1
- package/dist/{types-CvyOEp0V.d.ts → types-DrhUXMsE.d.ts} +1 -0
- package/dist/{vercel-ADMH2MK8.js → vercel-5t11Q1sg.js} +6 -6
- package/dist/vite.d.ts +2 -1
- package/dist/vite.js +427 -140
- package/package.json +4 -3
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as resolveAppFetch } from "../app-Cpa9qCXr.js";
|
|
2
2
|
import { runWithWorkflowRuntimeEvent, setWorkflowRuntimeConfig, setWorkflowRuntimeRegistry } from "./state.js";
|
|
3
|
-
import { i as setVercelWorkflowRuntimeModules } from "../vercel-
|
|
3
|
+
import { i as setVercelWorkflowRuntimeModules } from "../vercel-5t11Q1sg.js";
|
|
4
4
|
import { waitUntil } from "@vercel/functions";
|
|
5
5
|
import { H3 } from "h3";
|
|
6
6
|
// ../internal/src/runtime/vercel-hosted.ts
|
|
@@ -334,6 +334,7 @@ interface DiscoveredWorkflowDefinition {
|
|
|
334
334
|
handler: string;
|
|
335
335
|
name: string;
|
|
336
336
|
source?: "agent-workflow" | "agent-workflow-recovery" | "inline" | "server-workflows" | "vite-suffix";
|
|
337
|
+
sourceRootDir?: string;
|
|
337
338
|
steps?: string[];
|
|
338
339
|
}
|
|
339
340
|
export { WorkflowSteps as $, WorkflowProviderStep as A, WorkflowSharedOptions as B, WorkflowHandle as C, WorkflowOptions as D, WorkflowName as E, WorkflowRunError as F, WorkflowStartOptions as G, WorkflowSignalResult as H, WorkflowRunName as I, WorkflowStepContext as J, WorkflowStep as K, WorkflowRunStatus as L, WorkflowResult as M, WorkflowResultErrorCode as N, WorkflowPayload as O, WorkflowRun as P, WorkflowStepRetries as Q, WorkflowRunStep as R, WorkflowExecutionContext as S, WorkflowModuleDriverOptions as T, WorkflowStartArguments as U, WorkflowSignal as V, WorkflowStartDelay as W, WorkflowStepOptions as X, WorkflowStepFunction as Y, WorkflowStepRegistry as Z, WorkflowDefinitionRegistry as _, DiscoveredWorkflowDefinition as a, WorkflowDuration as b, OpenWorkflowDriverOptions as c, ResolvedWorkflowOptions as d, VercelWorkflowDriverOptions as f, WorkflowDefinitionOptions as g, WorkflowDefinition as h, CloudflareWorkflowInstance as i, WorkflowRegistry as j, WorkflowProviderContext as k, OpenWorkflowPostgresOptions as l, WorkflowCreateOptions as m, CloudflareWorkflowBinding as n, InferredWorkflowDriverOptions as o, WorkflowConcurrencySlots as p, WorkflowStepBackoff as q, CloudflareWorkflowDriverOptions as r, NamedWorkflowRun as s, AgentWorkflowRegistry as t, OpenWorkflowWorkerOptions as u, WorkflowDriver as v, WorkflowHandler as w, WorkflowDurationUnit as x, WorkflowDriverOptions as y, WorkflowRuntimeConfigValue as z };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { n as createWorkflowError } from "./errors-CZf7oz4k.js";
|
|
2
|
-
import { s as workflowStartAtKey } from "./delay-
|
|
3
|
-
import { a as safeWorkflowName, i as runWorkflowProviderOperation, r as isWorkflowBoundaryError, t as toWorkflowRunError } from "./run-error-
|
|
4
|
-
import { t as workflowErrorDiagnostics } from "./error-diagnostics-
|
|
2
|
+
import { s as workflowStartAtKey } from "./delay-p5EJWtCp.js";
|
|
3
|
+
import { a as safeWorkflowName, i as runWorkflowProviderOperation, r as isWorkflowBoundaryError, t as toWorkflowRunError } from "./run-error-zZh1_IBo.js";
|
|
4
|
+
import { t as workflowErrorDiagnostics } from "./error-diagnostics-BDtBsCLZ.js";
|
|
5
5
|
import { deserializeResponse, isSerializedResponse } from "@vite-hub/runtime/internal/response";
|
|
6
6
|
// src/runtime/vercel.ts
|
|
7
7
|
async function loadVercelWorkflowRuntime() {
|
|
@@ -152,7 +152,7 @@ async function readVercelRunError(run) {
|
|
|
152
152
|
try {
|
|
153
153
|
await run.returnValue;
|
|
154
154
|
} catch (error) {
|
|
155
|
-
const cause = typeof error === "object" && error !== null &&
|
|
155
|
+
const cause = typeof error === "object" && error !== null && "name" in error && error.name === "WorkflowRunFailedError" && "cause" in error ? error.cause : void 0;
|
|
156
156
|
return toWorkflowRunError(cause ?? error);
|
|
157
157
|
}
|
|
158
158
|
return toWorkflowRunError(void 0);
|
|
@@ -192,7 +192,7 @@ async function inspectVercelWorkflowRun(name, definition, id, payload) {
|
|
|
192
192
|
};
|
|
193
193
|
}), runWorkflowProviderOperation("vercel", "list-steps", async () => normalizeSteps(await runtime.listSteps(id)))]);
|
|
194
194
|
const output = snapshot.status === "completed" ? await runWorkflowProviderOperation("vercel", "get-run", () => run.returnValue) : void 0;
|
|
195
|
-
const result = definition.native &&
|
|
195
|
+
const result = definition.native && "~vitehubGeneratedRootStep" in definition.native && definition.native["~vitehubGeneratedRootStep"] === true && isSerializedResponse(output) ? deserializeResponse(output) : output;
|
|
196
196
|
const error = snapshot.status === "failed" ? await readVercelRunError(run) : void 0;
|
|
197
197
|
return {
|
|
198
198
|
completedAt: snapshot.completedAt,
|
|
@@ -217,7 +217,7 @@ async function startVercelWorkflow(name, definition, payload, observeSettlement,
|
|
|
217
217
|
provider: "vercel"
|
|
218
218
|
}
|
|
219
219
|
});
|
|
220
|
-
if (startAt !== void 0 &&
|
|
220
|
+
if (startAt !== void 0 && !("~vitehubGenerated" in native && native["~vitehubGenerated"] === true)) throw createWorkflowError({
|
|
221
221
|
code: "WORKFLOW_OPERATION_UNSUPPORTED",
|
|
222
222
|
details: {
|
|
223
223
|
operation: "delay",
|
package/dist/vite.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { n as OperationContributionEntry } from "./operations-Blwi3jQF.js";
|
|
2
|
-
import { D as WorkflowOptions, a as DiscoveredWorkflowDefinition } from "./types-
|
|
2
|
+
import { D as WorkflowOptions, a as DiscoveredWorkflowDefinition } from "./types-DrhUXMsE.js";
|
|
3
3
|
import { Plugin, ResolvedConfig, Rolldown, UserConfig } from "vite";
|
|
4
4
|
type WorkflowRuntimeModuleName = "cloudflare-concurrency" | "cloudflare-runner" | "cloudflare-vite" | "dev-runs" | "execute" | "openworkflow-worker" | "state" | "vercel-vite";
|
|
5
5
|
/**
|
|
@@ -149,6 +149,7 @@ type NitroPackageLoadingOptions = {
|
|
|
149
149
|
};
|
|
150
150
|
export declare function discoverWorkflowDefinitions(options: {
|
|
151
151
|
mode?: "vite-suffix" | "standalone";
|
|
152
|
+
projectRoot?: string;
|
|
152
153
|
rootDir: string;
|
|
153
154
|
scanDirs?: string[];
|
|
154
155
|
serverDirs?: string[];
|