@vite-hub/workflow 0.5.0 → 0.6.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/dist/{app-2Y7sBAG6.js → app-DXUHElAz.js} +2 -3
- package/dist/{app-BojnC_yf.d.ts → app-wkVFd7m-.d.ts} +0 -2
- package/dist/{client-CgBcDlGn.js → client-CbBg4HlH.js} +17 -22
- package/dist/{cloudflare-Datj_znU.js → cloudflare-Sgywkm1N.js} +3 -5
- package/dist/{cloudflare-env-CGLx7lUd.js → cloudflare-env-DHhzRZOs.js} +2 -4
- package/dist/cloudflare-env-lookup-BqomAHN5.d.ts +2 -0
- package/dist/{cloudflare-shared-CTqh_a2s.d.ts → cloudflare-shared-B9cY3-jD.d.ts} +1 -3
- package/dist/{config-z1651xc2.js → config-CizNRTMi.js} +4 -7
- package/dist/definition.d.ts +2 -4
- package/dist/definition.js +3 -4
- package/dist/{delay-CHN4tv3i.js → delay-CtT3442d.js} +2 -3
- package/dist/{dev-recorder-CTN5Fkao.js → dev-recorder-Dltdmlkv.js} +1 -2
- package/dist/durability.d.ts +2 -4
- package/dist/durability.js +2 -3
- package/dist/{error-diagnostics-DMeaFmQD.js → error-diagnostics--2cV_ER1.js} +1 -2
- package/dist/{error-diagnostics-C0KyI408.js → error-diagnostics-kKXseq8d.js} +5 -2
- package/dist/{errors-D-fNDVg0.d.ts → errors-CJZuvOcx.d.ts} +0 -2
- package/dist/{errors-BNxEeeCO.js → errors-CZf7oz4k.js} +1 -2
- package/dist/index.d.ts +2 -8
- package/dist/index.js +5 -6
- package/dist/{inspect-B72iFyj-.js → inspect-NBCAwsxi.js} +1 -2
- package/dist/{object-Da1zyPCR.js → object-CAK6UYR5.js} +1 -2
- package/dist/{openworkflow-BoaENgh9.d.ts → openworkflow-CdKbUGGa.d.ts} +1 -3
- package/dist/{openworkflow-defaults-DDig2M4s.js → openworkflow-defaults-DfQWtSRU.js} +2 -4
- package/dist/{openworkflow-storage-Dj9zUAsk.js → openworkflow-storage-Dde_f0es.js} +1 -2
- package/dist/openworkflow.js +1 -2
- package/dist/{operation-definition-CI2PJGqu.d.ts → operation-definition-CqZkx1Rm.d.ts} +0 -4
- package/dist/{operations-CYntpf-T.js → operations-BBTmDm2H.js} +8 -10
- package/dist/operations.d.ts +2 -6
- package/dist/operations.js +8 -13
- package/dist/{out-DxLKolA0.js → out-r9T3bhTE.js} +2933 -2301
- package/dist/{rolldown-runtime-B4iAMlE-.js → rolldown-runtime-DYf_mQCB.js} +2 -3
- package/dist/{run-error-Ctn50EYz.js → run-error-8p4BtTMv.js} +5 -7
- package/dist/{run-failed-gVGo1BaF.js → run-failed-BcSjSU2t.js} +1 -2
- package/dist/runtime/cloudflare-runner.d.ts +3 -5
- package/dist/runtime/cloudflare-runner.js +6 -7
- package/dist/runtime/cloudflare-shared.d.ts +2 -2
- package/dist/runtime/cloudflare-shared.js +1 -2
- package/dist/runtime/cloudflare-vite.d.ts +5 -7
- package/dist/runtime/cloudflare-vite.js +5 -7
- package/dist/runtime/dev-runs.d.ts +1 -3
- package/dist/runtime/dev-runs.js +2 -3
- package/dist/runtime/execute.d.ts +3 -5
- package/dist/runtime/execute.js +5 -6
- package/dist/runtime/openworkflow-worker.d.ts +3 -4
- package/dist/runtime/openworkflow-worker.js +5 -6
- package/dist/runtime/openworkflow.d.ts +1 -1
- package/dist/runtime/openworkflow.js +8 -9
- package/dist/runtime/state.d.ts +2 -4
- package/dist/runtime/state.js +4 -5
- package/dist/runtime/vercel-vite.d.ts +3 -6
- package/dist/runtime/vercel-vite.js +4 -6
- package/dist/{signals-C1iolifd.js → signals-BHQdxoJo.js} +2 -3
- package/dist/{types-BWPHeugk.d.ts → types-DvYcvbPG.d.ts} +0 -2
- package/dist/{vercel-BIkBFrQQ.js → vercel-Cw_Z9-j4.js} +5 -6
- package/dist/vite.d.ts +3 -25
- package/dist/vite.js +1448 -933
- package/package.json +13 -13
- package/dist/cloudflare-env-lookup-CfX6wZKb.d.ts +0 -4
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { t as internalErrorDiagnostics } from "./error-diagnostics-
|
|
2
|
-
|
|
1
|
+
import { t as internalErrorDiagnostics } from "./error-diagnostics-kKXseq8d.js";
|
|
2
|
+
// ../internal/src/runtime/app.ts
|
|
3
3
|
function resolveAppFetch(label, app) {
|
|
4
4
|
if (!app) return;
|
|
5
5
|
if (typeof app === "function") return app;
|
|
@@ -7,5 +7,4 @@ function resolveAppFetch(label, app) {
|
|
|
7
7
|
if (typeof app.fetch === "function") return app.fetch.bind(app);
|
|
8
8
|
throw internalErrorDiagnostics.INTERNAL_R0011({ message: `Invalid ${label} app. Expected an h3 app or a fetch-compatible handler.` });
|
|
9
9
|
}
|
|
10
|
-
//#endregion
|
|
11
10
|
export { resolveAppFetch as t };
|
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
//#region ../internal/src/runtime/app.d.ts
|
|
2
1
|
type AppHandler = (request: Request, context?: Record<string, unknown>) => Response | Promise<Response>;
|
|
3
2
|
type VitehubApp = AppHandler | {
|
|
4
3
|
fetch?: AppHandler;
|
|
5
4
|
request?: (request: Request, options?: RequestInit, context?: Record<string, unknown>) => Response | Promise<Response>;
|
|
6
5
|
};
|
|
7
|
-
//#endregion
|
|
8
6
|
export { VitehubApp as t };
|
|
@@ -1,33 +1,31 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { i as toCloudflareStartParams, r as resolveWorkflowStartAt } from "./delay-
|
|
7
|
-
import { t as getWorkflowDevRecorder } from "./dev-recorder-
|
|
8
|
-
import { i as readWorkflowSignalToken, o as resumeInlineWorkflowSignal } from "./signals-C1iolifd.js";
|
|
1
|
+
import { a as getCloudflareEnv, n as resolveWaitUntil } from "./cloudflare-env-DHhzRZOs.js";
|
|
2
|
+
import { t as normalizeWorkflowOptions } from "./config-CizNRTMi.js";
|
|
3
|
+
import { n as createWorkflowError } from "./errors-CZf7oz4k.js";
|
|
4
|
+
import { t as workflowErrorDiagnostics } from "./error-diagnostics--2cV_ER1.js";
|
|
5
|
+
import { a as encodeNameHex, n as getCloudflareWorkflowBindingName } from "./cloudflare-Sgywkm1N.js";
|
|
6
|
+
import { i as toCloudflareStartParams, r as resolveWorkflowStartAt } from "./delay-CtT3442d.js";
|
|
7
|
+
import { t as getWorkflowDevRecorder } from "./dev-recorder-Dltdmlkv.js";
|
|
9
8
|
import { runSerializedWorkflowHandler } from "./runtime/execute.js";
|
|
10
|
-
import { t as emitWorkflowFailed } from "./run-failed-gVGo1BaF.js";
|
|
11
|
-
import { getInlineWorkflowDefinitions, getWorkflowRunState, getWorkflowRuntimeConfig, getWorkflowRuntimeEvent, getWorkflowRuntimeRegistry, loadWorkflowDefinition, registerInlineWorkflowDefinition, runWithWorkflowRuntimeEvent, setWorkflowRun } from "./runtime/state.js";
|
|
12
9
|
import { cloudflareSignalEventType } from "./runtime/cloudflare-runner.js";
|
|
13
|
-
import { a as safeWorkflowName, i as runWorkflowProviderOperation, t as toWorkflowRunError } from "./run-error-Ctn50EYz.js";
|
|
14
10
|
import { cancelOpenWorkflowRun, getOpenWorkflowRun, resumeOpenWorkflowSignal, runOpenWorkflow } from "./runtime/openworkflow.js";
|
|
15
|
-
import { a as
|
|
11
|
+
import { a as safeWorkflowName, i as runWorkflowProviderOperation, t as toWorkflowRunError } from "./run-error-8p4BtTMv.js";
|
|
12
|
+
import { t as emitWorkflowFailed } from "./run-failed-BcSjSU2t.js";
|
|
13
|
+
import { i as readWorkflowSignalToken, o as resumeInlineWorkflowSignal } from "./signals-BHQdxoJo.js";
|
|
14
|
+
import { getInlineWorkflowDefinitions, getWorkflowRunState, getWorkflowRuntimeConfig, getWorkflowRuntimeEvent, getWorkflowRuntimeRegistry, loadWorkflowDefinition, registerInlineWorkflowDefinition, runWithWorkflowRuntimeEvent, setWorkflowRun } from "./runtime/state.js";
|
|
15
|
+
import { a as startVercelWorkflow, n as inspectVercelWorkflowRun, r as resumeVercelWorkflowSignal, t as cancelVercelWorkflow } from "./vercel-Cw_Z9-j4.js";
|
|
16
16
|
import { getViteHubErrorShape, isRuntimeDiagnostic, toResultError } from "@vite-hub/runtime";
|
|
17
17
|
import { getViteHubTestMode } from "@vite-hub/runtime/internal/test-mode";
|
|
18
18
|
import { deserializeResponse, isSerializedResponse } from "@vite-hub/runtime/internal/response";
|
|
19
|
-
|
|
19
|
+
// ../internal/src/runtime/random.ts
|
|
20
20
|
function randomId(prefix) {
|
|
21
21
|
const body = `${Date.now().toString(36)}_${Math.random().toString(36).slice(2, 10)}`;
|
|
22
22
|
return prefix ? `${prefix}_${body}` : body;
|
|
23
23
|
}
|
|
24
|
-
|
|
25
|
-
//#region src/integrations/vercel.ts
|
|
24
|
+
// src/integrations/vercel.ts
|
|
26
25
|
function getVercelWorkflowName(name) {
|
|
27
26
|
return `workflow--${encodeNameHex(name)}`;
|
|
28
27
|
}
|
|
29
|
-
|
|
30
|
-
//#region src/runtime/adapters.ts
|
|
28
|
+
// src/runtime/adapters.ts
|
|
31
29
|
async function resumeViteHubSignal(config, token, payload, durable) {
|
|
32
30
|
const address = readWorkflowSignalToken(token);
|
|
33
31
|
if (!address) throw workflowErrorDiagnostics.WORKFLOW_SIGNAL_TOKEN_INVALID({ provider: config.driver });
|
|
@@ -479,8 +477,7 @@ function getWorkflowRuntimeAdapter(config) {
|
|
|
479
477
|
if (config.driver === "openworkflow") return createOpenWorkflowAdapter(config);
|
|
480
478
|
return createVercelAdapter(config);
|
|
481
479
|
}
|
|
482
|
-
|
|
483
|
-
//#region src/runtime/test-client.ts
|
|
480
|
+
// src/runtime/test-client.ts
|
|
484
481
|
/** The started runs of the current test. `vite-hub/test` reads the same list. */
|
|
485
482
|
function workflowTestRuns(test) {
|
|
486
483
|
return test.backend("workflow", () => []);
|
|
@@ -519,8 +516,7 @@ function getWorkflowTestRun(test, provider, name, id, cancel = false) {
|
|
|
519
516
|
if (cancel) run.status = "cancelled";
|
|
520
517
|
return toWorkflowRun(run, provider);
|
|
521
518
|
}
|
|
522
|
-
|
|
523
|
-
//#region src/runtime/client.ts
|
|
519
|
+
// src/runtime/client.ts
|
|
524
520
|
const resultErrorCodes = /* @__PURE__ */ new Set([
|
|
525
521
|
"RUNTIME_DURATION_INVALID",
|
|
526
522
|
"WORKFLOW_CLOUDFLARE_RUN_ID_INVALID",
|
|
@@ -729,5 +725,4 @@ function deferWorkflowStart(name, start) {
|
|
|
729
725
|
function deferWorkflow(...[name, payload, options = {}]) {
|
|
730
726
|
deferWorkflowStart(name, () => startWorkflowRun(name, payload, options, true));
|
|
731
727
|
}
|
|
732
|
-
//#endregion
|
|
733
728
|
export { resumeWorkflow as a, getWorkflowRun as i, createWorkflow as n, startWorkflow as o, deferWorkflow as r, cancelWorkflow as t };
|
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
import { t as workflowErrorDiagnostics } from "./error-diagnostics
|
|
2
|
-
|
|
1
|
+
import { t as workflowErrorDiagnostics } from "./error-diagnostics--2cV_ER1.js";
|
|
2
|
+
// ../internal/src/integrations/hex.ts
|
|
3
3
|
const textEncoder = new TextEncoder();
|
|
4
4
|
new TextDecoder();
|
|
5
5
|
function encodeNameHex(name) {
|
|
6
6
|
return [...textEncoder.encode(name)].map((byte) => byte.toString(16).padStart(2, "0")).join("");
|
|
7
7
|
}
|
|
8
|
-
|
|
9
|
-
//#region src/integrations/cloudflare.ts
|
|
8
|
+
// src/integrations/cloudflare.ts
|
|
10
9
|
const cloudflareWorkflowNameMaxLength = 64;
|
|
11
10
|
function shortHash(value) {
|
|
12
11
|
let hash = 14695981039346656037n;
|
|
@@ -55,5 +54,4 @@ function createCloudflareWorkflowBindings(definitions, options) {
|
|
|
55
54
|
name: configurable.length === 1 && configurable[0] === definition && options ? options.name || getCloudflareWorkflowName(definition.name) : getCloudflareWorkflowName(definition.name)
|
|
56
55
|
}));
|
|
57
56
|
}
|
|
58
|
-
//#endregion
|
|
59
57
|
export { encodeNameHex as a, getLegacyCloudflareWorkflowClassName as i, getCloudflareWorkflowBindingName as n, getCloudflareWorkflowClassName as r, createCloudflareWorkflowBindings as t };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { AsyncLocalStorage } from "node:async_hooks";
|
|
2
|
-
|
|
2
|
+
// ../internal/src/runtime/cloudflare-env-lookup.ts
|
|
3
3
|
/** The key of the AsyncLocalStorage store on `globalThis`. Every bundled copy of this module shares the store. */
|
|
4
4
|
const activeEnvStorageKey = Symbol.for("vitehub.cloudflare.env-storage");
|
|
5
5
|
let activeEnv;
|
|
@@ -39,8 +39,7 @@ function getCloudflareEnv(event, options = {}) {
|
|
|
39
39
|
for (const candidate of [ownValue(target, "env"), ...cloudflareOwners(target).map((owner) => ownValue(owner, "env"))]) if (candidate) return candidate;
|
|
40
40
|
return options.fallback === false ? void 0 : getActiveCloudflareEnv();
|
|
41
41
|
}
|
|
42
|
-
|
|
43
|
-
//#region ../internal/src/runtime/cloudflare-env.ts
|
|
42
|
+
// ../internal/src/runtime/cloudflare-env.ts
|
|
44
43
|
const runtimeGlobal = globalThis;
|
|
45
44
|
const activeEnvStorage = runtimeGlobal[activeEnvStorageKey] ||= new AsyncLocalStorage();
|
|
46
45
|
const globalEnvProbe = Symbol("vitehub.cloudflare.global-env-probe");
|
|
@@ -111,5 +110,4 @@ function createCloudflareRuntimeEvent(env, context) {
|
|
|
111
110
|
waitUntil
|
|
112
111
|
};
|
|
113
112
|
}
|
|
114
|
-
//#endregion
|
|
115
113
|
export { getCloudflareEnv as a, setActiveCloudflareEnv as i, resolveWaitUntil as n, runWithActiveCloudflareEnv as r, createCloudflareRuntimeEvent as t };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { t as CloudflareWorkerEnv } from "./cloudflare-env-lookup-
|
|
2
|
-
//#region ../internal/src/runtime/cloudflare-env.d.ts
|
|
1
|
+
import { t as CloudflareWorkerEnv } from "./cloudflare-env-lookup-BqomAHN5.js";
|
|
3
2
|
interface CloudflareWorkerExecutionContext {
|
|
4
3
|
waitUntil?: (promise: Promise<unknown>) => void;
|
|
5
4
|
}
|
|
@@ -18,5 +17,4 @@ interface CloudflareRuntimeEvent {
|
|
|
18
17
|
waitUntil?: WaitUntilFn;
|
|
19
18
|
}
|
|
20
19
|
declare function createCloudflareRuntimeEvent(env: CloudflareWorkerEnv, context: CloudflareWorkerExecutionContext | undefined): CloudflareRuntimeEvent;
|
|
21
|
-
//#endregion
|
|
22
20
|
export { setActiveCloudflareEnv as i, createCloudflareRuntimeEvent as n, runWithActiveCloudflareEnv as r, CloudflareWorkerExecutionContext as t };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { t as isRecord } from "./object-
|
|
2
|
-
import { t as workflowErrorDiagnostics } from "./error-diagnostics
|
|
1
|
+
import { t as isRecord } from "./object-CAK6UYR5.js";
|
|
2
|
+
import { t as workflowErrorDiagnostics } from "./error-diagnostics--2cV_ER1.js";
|
|
3
3
|
import { defu } from "defu";
|
|
4
4
|
/** Maps a host name or a Nitro preset name, such as `cloudflare-module` or `node-server`, to its ViteHub host. */
|
|
5
5
|
function hostFromNitroPreset(value) {
|
|
@@ -11,8 +11,7 @@ function hostFromNitroPreset(value) {
|
|
|
11
11
|
if (normalized === "node" || normalized.startsWith("node-")) return "node";
|
|
12
12
|
if (normalized.startsWith("vercel")) return "vercel";
|
|
13
13
|
}
|
|
14
|
-
|
|
15
|
-
//#region ../internal/src/hosting.ts
|
|
14
|
+
// ../internal/src/hosting.ts
|
|
16
15
|
function normalizeHosting(hosting) {
|
|
17
16
|
const normalized = hosting?.trim().toLowerCase().replaceAll("_", "-") || "";
|
|
18
17
|
if (normalized === "cloudflare") return "cloudflare-module";
|
|
@@ -23,8 +22,7 @@ function getHostingProvider(hosting) {
|
|
|
23
22
|
const host = hostFromNitroPreset(hosting);
|
|
24
23
|
if (host === "cloudflare" || host === "netlify" || host === "vercel") return host;
|
|
25
24
|
}
|
|
26
|
-
|
|
27
|
-
//#region src/config.ts
|
|
25
|
+
// src/config.ts
|
|
28
26
|
const knownDrivers = /* @__PURE__ */ new Set([
|
|
29
27
|
"cloudflare",
|
|
30
28
|
"openworkflow",
|
|
@@ -141,5 +139,4 @@ function normalizeWorkflowOptions(options, input = {}) {
|
|
|
141
139
|
if (options && Object.hasOwn(options, "database") && options.database !== void 0) throw workflowErrorDiagnostics.WORKFLOW_C0017({ message: "`workflow.database` is not supported. Set `workflow.sqlite.path` or `workflow.postgres.url` explicitly." });
|
|
142
140
|
return resolveDriver(options || {}, normalizeHosting(input.hosting), input.inline === true);
|
|
143
141
|
}
|
|
144
|
-
//#endregion
|
|
145
142
|
export { getHostingProvider as n, normalizeHosting as r, normalizeWorkflowOptions as t };
|
package/dist/definition.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { f as WorkflowDefinition } from "./types-
|
|
2
|
-
//#region src/definition.d.ts
|
|
1
|
+
import { f as WorkflowDefinition } from "./types-DvYcvbPG.js";
|
|
3
2
|
/**
|
|
4
3
|
* Defines a Workflow from one object: `defineWorkflow({ handler, ...options })`. The file path is the Workflow name.
|
|
5
4
|
* The handler receives one object, `{ payload, steps, sleep, ...context }`. Pass the payload type as the type argument.
|
|
@@ -14,5 +13,4 @@ import { f as WorkflowDefinition } from "./types-BWPHeugk.js";
|
|
|
14
13
|
* })
|
|
15
14
|
* ```
|
|
16
15
|
*/
|
|
17
|
-
export declare function defineWorkflow<TPayload = undefined, TResult = unknown>(definition: WorkflowDefinition<TPayload, TResult>, ...removed: unknown[]): WorkflowDefinition<TPayload, TResult>;
|
|
18
|
-
//#endregion
|
|
16
|
+
export declare function defineWorkflow<TPayload = undefined, TResult = unknown>(definition: WorkflowDefinition<TPayload, TResult>, ...removed: unknown[]): WorkflowDefinition<TPayload, TResult>;
|
package/dist/definition.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { t as isRecord } from "./object-
|
|
2
|
-
import { t as workflowErrorDiagnostics } from "./error-diagnostics
|
|
3
|
-
|
|
1
|
+
import { t as isRecord } from "./object-CAK6UYR5.js";
|
|
2
|
+
import { t as workflowErrorDiagnostics } from "./error-diagnostics--2cV_ER1.js";
|
|
3
|
+
// src/definition.ts
|
|
4
4
|
const workflowDefinitionKeys = /* @__PURE__ */ new Set([
|
|
5
5
|
"handler",
|
|
6
6
|
"native",
|
|
@@ -29,5 +29,4 @@ function defineWorkflow(definition, ...removed) {
|
|
|
29
29
|
if (definition.native !== void 0 && typeof definition.native !== "function") throw workflowErrorDiagnostics.WORKFLOW_C0016({ message: "`defineWorkflow()` native entry must be a workflow handler." });
|
|
30
30
|
return definition;
|
|
31
31
|
}
|
|
32
|
-
//#endregion
|
|
33
32
|
export { defineWorkflow };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { t as workflowErrorDiagnostics } from "./error-diagnostics
|
|
1
|
+
import { t as workflowErrorDiagnostics } from "./error-diagnostics--2cV_ER1.js";
|
|
2
2
|
import { parseDuration } from "@vite-hub/runtime";
|
|
3
|
-
|
|
3
|
+
// src/runtime/delay.ts
|
|
4
4
|
const maximumTime = 864e13;
|
|
5
5
|
function isDate(value) {
|
|
6
6
|
return Object.prototype.toString.call(value) === "[object Date]";
|
|
@@ -41,5 +41,4 @@ function fromCloudflareStartParams(params) {
|
|
|
41
41
|
startAt
|
|
42
42
|
};
|
|
43
43
|
}
|
|
44
|
-
//#endregion
|
|
45
44
|
export { workflowStartAtKey as a, toCloudflareStartParams as i, generatedNativeEntryKey as n, resolveWorkflowStartAt as r, fromCloudflareStartParams as t };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/runtime/dev-recorder.ts
|
|
2
2
|
let recorder;
|
|
3
3
|
function setWorkflowDevRecorder(value) {
|
|
4
4
|
recorder = value;
|
|
@@ -6,5 +6,4 @@ function setWorkflowDevRecorder(value) {
|
|
|
6
6
|
function getWorkflowDevRecorder() {
|
|
7
7
|
return recorder;
|
|
8
8
|
}
|
|
9
|
-
//#endregion
|
|
10
9
|
export { setWorkflowDevRecorder as n, getWorkflowDevRecorder as t };
|
package/dist/durability.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { P as WorkflowRuntimeConfigValue } from "./types-
|
|
1
|
+
import { P as WorkflowRuntimeConfigValue } from "./types-DvYcvbPG.js";
|
|
2
2
|
import { Durability, DurabilityContext } from "@vite-hub/runtime/durability";
|
|
3
|
-
//#region src/durability.d.ts
|
|
4
3
|
/** What the build passes to `workflowDurability()`. The storage values may name runtime environment variables. */
|
|
5
4
|
export interface WorkflowDurabilityInput {
|
|
6
5
|
/** OpenWorkflow uses the Postgres Default Database after the explicit storage and its environment variables. */
|
|
@@ -19,5 +18,4 @@ export declare function workflowDurability(input: WorkflowDurabilityInput, conte
|
|
|
19
18
|
* A Postgres URL for the durability input, which the build writes into the server. The reporter only needs to know
|
|
20
19
|
* that it is set: environment variable names stay, and a literal URL or default becomes `set`.
|
|
21
20
|
*/
|
|
22
|
-
export declare function workflowDurabilityUrl(value: WorkflowRuntimeConfigValue): WorkflowRuntimeConfigValue;
|
|
23
|
-
//#endregion
|
|
21
|
+
export declare function workflowDurabilityUrl(value: WorkflowRuntimeConfigValue): WorkflowRuntimeConfigValue;
|
package/dist/durability.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { t as resolveOpenWorkflowStorage } from "./openworkflow-storage-
|
|
1
|
+
import { t as resolveOpenWorkflowStorage } from "./openworkflow-storage-Dde_f0es.js";
|
|
2
2
|
import { resolveDurabilityValue } from "@vite-hub/runtime/durability";
|
|
3
|
-
|
|
3
|
+
// src/durability.ts
|
|
4
4
|
const sqliteFix = "Set OPENWORKFLOW_POSTGRES_URL to a Postgres URL, or set `workflow.postgres.url`.";
|
|
5
5
|
function sqlite(path) {
|
|
6
6
|
return [{
|
|
@@ -58,5 +58,4 @@ function workflowDurabilityUrl(value) {
|
|
|
58
58
|
default: "set"
|
|
59
59
|
} : value;
|
|
60
60
|
}
|
|
61
|
-
//#endregion
|
|
62
61
|
export { workflowDurability, workflowDurabilityUrl };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineDiagnostics } from "nostics";
|
|
2
|
-
|
|
2
|
+
// src/error-diagnostics.ts
|
|
3
3
|
const dynamicError = { why: ({ message }) => message === void 0 ? "" : String(message) };
|
|
4
4
|
const workflowErrorDiagnostics = /*#__PURE__*/ defineDiagnostics({
|
|
5
5
|
docsBase: "https://vitehub.dev/docs/workflows/diagnostics",
|
|
@@ -331,5 +331,4 @@ const workflowErrorDiagnostics = /*#__PURE__*/ defineDiagnostics({
|
|
|
331
331
|
}
|
|
332
332
|
}
|
|
333
333
|
});
|
|
334
|
-
//#endregion
|
|
335
334
|
export { workflowErrorDiagnostics as t };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineDiagnostics } from "nostics";
|
|
2
|
-
|
|
2
|
+
// ../internal/src/error-diagnostics.ts
|
|
3
3
|
const dynamicError = { why: ({ message }) => message === void 0 ? "" : String(message) };
|
|
4
4
|
const internalErrorDiagnostics = /*#__PURE__*/ defineDiagnostics({
|
|
5
5
|
docsBase: "https://vitehub.dev/docs/development/diagnostics",
|
|
@@ -256,6 +256,10 @@ const internalErrorDiagnostics = /*#__PURE__*/ defineDiagnostics({
|
|
|
256
256
|
why: ({ minimum }) => `[vitehub] VITEHUB_SECRET must be at least ${minimum} characters. Generate one with \`openssl rand -base64 32\`.`,
|
|
257
257
|
fix: "Set `VITEHUB_SECRET` to the output of `openssl rand -base64 32`, which has 44 characters."
|
|
258
258
|
},
|
|
259
|
+
INTERNAL_SITE_TOKEN_TOO_LONG: {
|
|
260
|
+
why: ({ length, maximum }) => `The Site access token is ${length} characters, and an app accepts ${maximum}.`,
|
|
261
|
+
fix: "Open the app with a shorter path, or give the person and the project shorter names, so that the Site access token fits."
|
|
262
|
+
},
|
|
259
263
|
INTERNAL_SQLITE_ARGUMENT_INVALID: {
|
|
260
264
|
why: ({ value }) => value === "undefined" ? "undefined cannot be passed as argument to the database" : "Only finite numbers (not Infinity or NaN) can be passed as arguments",
|
|
261
265
|
fix: "Pass query arguments as finite numbers, strings, booleans, bigints, dates, byte arrays, or null. Replace undefined with null, and check numbers with `Number.isFinite()` before the query."
|
|
@@ -270,5 +274,4 @@ const internalErrorDiagnostics = /*#__PURE__*/ defineDiagnostics({
|
|
|
270
274
|
}
|
|
271
275
|
}
|
|
272
276
|
});
|
|
273
|
-
//#endregion
|
|
274
277
|
export { internalErrorDiagnostics as t };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { ViteHubError } from "@vite-hub/runtime";
|
|
2
|
-
//#region src/errors.d.ts
|
|
3
2
|
declare const workflowErrorMessages: {
|
|
4
3
|
readonly OPENWORKFLOW_BACKEND_CLOSE_FAILED: "OpenWorkflow backend cleanup failed.";
|
|
5
4
|
readonly OPENWORKFLOW_RUNTIME_RESET: "OpenWorkflow runtime was reset while it was being acquired.";
|
|
@@ -58,5 +57,4 @@ declare class NonRetryableError extends Error {
|
|
|
58
57
|
readonly isRetryable = false;
|
|
59
58
|
readonly fatal = true;
|
|
60
59
|
}
|
|
61
|
-
//#endregion
|
|
62
60
|
export { WorkflowProviderFailure as a, WorkflowOperationName as i, WorkflowErrorCode as n, WorkflowProviderName as o, WorkflowErrorDetails as r, NonRetryableError as t };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ViteHubError } from "@vite-hub/runtime";
|
|
2
|
-
|
|
2
|
+
// src/errors.ts
|
|
3
3
|
const workflowErrorMessages = {
|
|
4
4
|
OPENWORKFLOW_BACKEND_CLOSE_FAILED: "OpenWorkflow backend cleanup failed.",
|
|
5
5
|
OPENWORKFLOW_RUNTIME_RESET: "OpenWorkflow runtime was reset while it was being acquired.",
|
|
@@ -27,5 +27,4 @@ function isNonRetryableError(error) {
|
|
|
27
27
|
if (typeof error !== "object" || error === null) return false;
|
|
28
28
|
return typeof Reflect.get(error, "message") === "string" && (Reflect.get(error, "isRetryable") === false || Reflect.get(error, "name") === "NonRetryableError");
|
|
29
29
|
}
|
|
30
|
-
//#endregion
|
|
31
30
|
export { createWorkflowError as n, isNonRetryableError as r, NonRetryableError as t };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,11 +1,8 @@
|
|
|
1
|
-
import { A as WorkflowRun, B as WorkflowStartOptions, C as WorkflowName, D as WorkflowProviderStep, E as WorkflowProviderContext, F as WorkflowSharedOptions, G as WorkflowStepOptions, H as WorkflowStepBackoff, I as WorkflowSignal, J as WorkflowSteps, K as WorkflowStepRegistry, L as WorkflowSignalResult, M as WorkflowRunStatus, N as WorkflowRunStep, O as WorkflowRegistry, R as WorkflowStartArguments, S as WorkflowModuleDriverOptions, T as WorkflowPayload, U as WorkflowStepContext, V as WorkflowStep, W as WorkflowStepFunction, _ as WorkflowDuration, a as InferredWorkflowDriverOptions, b as WorkflowHandle, c as OpenWorkflowWorkerOptions, d as WorkflowCreateOptions, f as WorkflowDefinition, g as WorkflowDriverOptions, h as WorkflowDriver, i as DiscoveredWorkflowDefinition, j as WorkflowRunError, k as WorkflowResultErrorCode, l as ResolvedWorkflowOptions, m as WorkflowDefinitionRegistry, n as CloudflareWorkflowDriverOptions, o as OpenWorkflowDriverOptions, p as WorkflowDefinitionOptions, q as WorkflowStepRetries, r as CloudflareWorkflowInstance, s as OpenWorkflowPostgresOptions, t as CloudflareWorkflowBinding, u as VercelWorkflowDriverOptions, v as WorkflowDurationUnit, w as WorkflowOptions, x as WorkflowHandler, y as WorkflowExecutionContext, z as WorkflowStartDelay } from "./types-BWPHeugk.js";
|
|
2
1
|
import { defineWorkflow } from "./definition.js";
|
|
3
|
-
import { a as WorkflowProviderFailure, i as WorkflowOperationName, n as WorkflowErrorCode, o as WorkflowProviderName, r as WorkflowErrorDetails, t as NonRetryableError } from "./errors-
|
|
2
|
+
import { a as WorkflowProviderFailure, i as WorkflowOperationName, n as WorkflowErrorCode, o as WorkflowProviderName, r as WorkflowErrorDetails, t as NonRetryableError } from "./errors-CJZuvOcx.js";
|
|
3
|
+
import { A as WorkflowRun, B as WorkflowStartOptions, C as WorkflowName, D as WorkflowProviderStep, E as WorkflowProviderContext, F as WorkflowSharedOptions, G as WorkflowStepOptions, H as WorkflowStepBackoff, I as WorkflowSignal, J as WorkflowSteps, K as WorkflowStepRegistry, L as WorkflowSignalResult, M as WorkflowRunStatus, N as WorkflowRunStep, O as WorkflowRegistry, R as WorkflowStartArguments, S as WorkflowModuleDriverOptions, T as WorkflowPayload, U as WorkflowStepContext, V as WorkflowStep, W as WorkflowStepFunction, _ as WorkflowDuration, a as InferredWorkflowDriverOptions, b as WorkflowHandle, c as OpenWorkflowWorkerOptions, d as WorkflowCreateOptions, f as WorkflowDefinition, g as WorkflowDriverOptions, h as WorkflowDriver, i as DiscoveredWorkflowDefinition, j as WorkflowRunError, k as WorkflowResultErrorCode, l as ResolvedWorkflowOptions, m as WorkflowDefinitionRegistry, n as CloudflareWorkflowDriverOptions, o as OpenWorkflowDriverOptions, p as WorkflowDefinitionOptions, q as WorkflowStepRetries, r as CloudflareWorkflowInstance, s as OpenWorkflowPostgresOptions, t as CloudflareWorkflowBinding, u as VercelWorkflowDriverOptions, v as WorkflowDurationUnit, w as WorkflowOptions, x as WorkflowHandler, y as WorkflowExecutionContext, z as WorkflowStartDelay } from "./types-DvYcvbPG.js";
|
|
4
4
|
import { Result } from "@vite-hub/runtime";
|
|
5
|
-
//#region src/integrations/cloudflare.d.ts
|
|
6
5
|
export declare function getCloudflareWorkflowBindingName(name: string): string;
|
|
7
|
-
//#endregion
|
|
8
|
-
//#region src/runtime/client.d.ts
|
|
9
6
|
export declare function createWorkflow<TPayload = unknown, TResult = unknown>(options: WorkflowCreateOptions<TPayload, TResult> & {
|
|
10
7
|
handler: WorkflowHandler<TPayload, TResult>;
|
|
11
8
|
name: string;
|
|
@@ -47,8 +44,6 @@ export declare function resumeWorkflow<TPayload = unknown>(token: string, payloa
|
|
|
47
44
|
* Call `startWorkflow()` when the caller needs the run ID or the start error.
|
|
48
45
|
*/
|
|
49
46
|
export declare function deferWorkflow(...[name, payload, options]: WorkflowStartCall): void;
|
|
50
|
-
//#endregion
|
|
51
|
-
//#region src/runtime/payload.d.ts
|
|
52
47
|
interface PayloadSchema<T> {
|
|
53
48
|
safeParse: (payload: unknown) => {
|
|
54
49
|
success: boolean;
|
|
@@ -64,5 +59,4 @@ type PayloadValidator<T> = PayloadSchema<T> | ParsePayloadSchema<T> | ((payload:
|
|
|
64
59
|
export declare function readRequestPayload(request: Request): Promise<unknown>;
|
|
65
60
|
export declare function validatePayload<T>(payload: unknown, schema: PayloadValidator<T>): Promise<T>;
|
|
66
61
|
export declare function readValidatedPayload<T>(request: Request, schema: PayloadValidator<T>): Promise<T>;
|
|
67
|
-
//#endregion
|
|
68
62
|
export { type CloudflareWorkflowBinding, type CloudflareWorkflowDriverOptions, type CloudflareWorkflowInstance, type DiscoveredWorkflowDefinition, type InferredWorkflowDriverOptions, NonRetryableError, type OpenWorkflowDriverOptions, type OpenWorkflowPostgresOptions, type OpenWorkflowWorkerOptions, type ResolvedWorkflowOptions, type VercelWorkflowDriverOptions, type WorkflowCreateOptions, type WorkflowDefinition, type WorkflowDefinitionOptions, type WorkflowDefinitionRegistry, type WorkflowDriver, type WorkflowDriverOptions, type WorkflowDuration, type WorkflowDurationUnit, type WorkflowErrorCode, type WorkflowErrorDetails, type WorkflowExecutionContext, type WorkflowHandle, type WorkflowHandler, type WorkflowModuleDriverOptions, type WorkflowName, type WorkflowOperationName, type WorkflowOptions, type WorkflowPayload, type WorkflowProviderContext, type WorkflowProviderFailure, type WorkflowProviderName, type WorkflowProviderStep, type WorkflowRegistry, type WorkflowResultErrorCode, type WorkflowRun, type WorkflowRunError, type WorkflowRunStatus, type WorkflowRunStep, type WorkflowSharedOptions, type WorkflowSignal, type WorkflowSignalResult, type WorkflowStartDelay, type WorkflowStartOptions, type WorkflowStep, type WorkflowStepBackoff, type WorkflowStepContext, type WorkflowStepFunction, type WorkflowStepOptions, type WorkflowStepRegistry, type WorkflowStepRetries, type WorkflowSteps, defineWorkflow };
|
package/dist/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { t as workflowErrorDiagnostics } from "./error-diagnostics-DMeaFmQD.js";
|
|
2
1
|
import { defineWorkflow } from "./definition.js";
|
|
3
|
-
import { t as NonRetryableError } from "./errors-
|
|
4
|
-
import { n as getCloudflareWorkflowBindingName } from "./cloudflare-
|
|
5
|
-
import { a as resumeWorkflow, i as getWorkflowRun, n as createWorkflow, o as startWorkflow, r as deferWorkflow, t as cancelWorkflow } from "./client-
|
|
6
|
-
|
|
2
|
+
import { t as NonRetryableError } from "./errors-CZf7oz4k.js";
|
|
3
|
+
import { n as getCloudflareWorkflowBindingName } from "./cloudflare-Sgywkm1N.js";
|
|
4
|
+
import { a as resumeWorkflow, i as getWorkflowRun, n as createWorkflow, o as startWorkflow, r as deferWorkflow, t as cancelWorkflow } from "./client-CbBg4HlH.js";
|
|
5
|
+
import { t as workflowErrorDiagnostics } from "./error-diagnostics--2cV_ER1.js";
|
|
6
|
+
// src/runtime/payload.ts
|
|
7
7
|
/** Reads a JSON body as parsed JSON and any other body as text. The value is not checked: pass it to `validatePayload()`. */
|
|
8
8
|
async function readRequestPayload(request) {
|
|
9
9
|
const contentType = request.headers.get("content-type")?.split(";", 1)[0]?.trim().toLowerCase();
|
|
@@ -40,5 +40,4 @@ function hasSchemaMethod(value, key) {
|
|
|
40
40
|
async function readValidatedPayload(request, schema) {
|
|
41
41
|
return await validatePayload(await readRequestPayload(request), schema);
|
|
42
42
|
}
|
|
43
|
-
//#endregion
|
|
44
43
|
export { NonRetryableError, cancelWorkflow, createWorkflow, deferWorkflow, defineWorkflow, getCloudflareWorkflowBindingName, getWorkflowRun, readRequestPayload, readValidatedPayload, resumeWorkflow, startWorkflow, validatePayload };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { relative } from "pathe";
|
|
2
|
-
|
|
2
|
+
// ../internal/src/inspect.ts
|
|
3
3
|
function relativeDefinitionFile(projectRoot, file) {
|
|
4
4
|
return relative(projectRoot, file).replaceAll("\\", "/");
|
|
5
5
|
}
|
|
@@ -66,5 +66,4 @@ function redactInspectionValue(value, key) {
|
|
|
66
66
|
}
|
|
67
67
|
return visit(value, key);
|
|
68
68
|
}
|
|
69
|
-
//#endregion
|
|
70
69
|
export { redactInspectionValue as n, relativeDefinitionFile as r, redactInspectionText as t };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// ../internal/src/object.ts
|
|
2
2
|
/** A non-null object that is not an array. Functions do not pass. */
|
|
3
3
|
function isRecord(value) {
|
|
4
4
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
@@ -7,5 +7,4 @@ function isRecord(value) {
|
|
|
7
7
|
function isRecordOrFunction(value) {
|
|
8
8
|
return Object(value) === value && !Array.isArray(value);
|
|
9
9
|
}
|
|
10
|
-
//#endregion
|
|
11
10
|
export { isRecordOrFunction as n, isRecord as t };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { A as WorkflowRun, B as WorkflowStartOptions, f as WorkflowDefinition, l as ResolvedWorkflowOptions } from "./types-
|
|
2
|
-
//#region src/runtime/openworkflow.d.ts
|
|
1
|
+
import { A as WorkflowRun, B as WorkflowStartOptions, f as WorkflowDefinition, l as ResolvedWorkflowOptions } from "./types-DvYcvbPG.js";
|
|
3
2
|
type OpenWorkflowModule = typeof import("openworkflow");
|
|
4
3
|
type OpenWorkflowPostgresModule = typeof import("openworkflow/postgres");
|
|
5
4
|
type OpenWorkflowSqliteModule = typeof import("openworkflow/sqlite");
|
|
@@ -47,5 +46,4 @@ declare function resetOpenWorkflowRuntime(): Promise<void>;
|
|
|
47
46
|
*/
|
|
48
47
|
declare function detachOpenWorkflowRuntimes(): () => Promise<void>;
|
|
49
48
|
declare function setOpenWorkflowImporter(importer: OpenWorkflowImporter): void;
|
|
50
|
-
//#endregion
|
|
51
49
|
export { getOpenWorkflowRun as a, resetOpenWorkflowRuntime as c, setOpenWorkflowDatabaseUrl as d, setOpenWorkflowImporter as f, detachOpenWorkflowRuntimes as i, resumeOpenWorkflowSignal as l, cancelOpenWorkflowRun as n, getOpenWorkflowRuntime as o, describeOpenWorkflowStorage as r, registerOpenWorkflowDefinition as s, OpenWorkflowStorageSource as t, runOpenWorkflow as u };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineDiagnostics } from "nostics";
|
|
2
|
-
|
|
2
|
+
// ../internal/src/invariant.ts
|
|
3
3
|
const invariantDiagnostics = /*#__PURE__*/ defineDiagnostics({
|
|
4
4
|
docsBase: "https://vitehub.dev/docs/development/diagnostics",
|
|
5
5
|
codes: { INTERNAL_INVARIANT_FAILED: {
|
|
@@ -18,9 +18,7 @@ function invariantError(what) {
|
|
|
18
18
|
function invariant(condition, what) {
|
|
19
19
|
if (!condition) throw invariantError(what);
|
|
20
20
|
}
|
|
21
|
-
|
|
22
|
-
//#region src/internal/openworkflow-defaults.ts
|
|
21
|
+
// src/internal/openworkflow-defaults.ts
|
|
23
22
|
/** The SQLite file that OpenWorkflow uses without configured storage, relative to the working directory of the server. */
|
|
24
23
|
const defaultOpenWorkflowSqlitePath = ".vitehub/data/openworkflow.sqlite.db";
|
|
25
|
-
//#endregion
|
|
26
24
|
export { invariant as n, invariantError as r, defaultOpenWorkflowSqlitePath as t };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/internal/openworkflow-storage.ts
|
|
2
2
|
/** Select storage once for both the OpenWorkflow runtime and its durability report. Values are already resolved. */
|
|
3
3
|
function resolveOpenWorkflowStorage(input, readEnv) {
|
|
4
4
|
const sqlitePath = input.sqlitePath || (!input.postgresUrl ? readEnv("OPENWORKFLOW_SQLITE_PATH") : void 0);
|
|
@@ -24,5 +24,4 @@ function resolveOpenWorkflowStorage(input, readEnv) {
|
|
|
24
24
|
source: "default"
|
|
25
25
|
};
|
|
26
26
|
}
|
|
27
|
-
//#endregion
|
|
28
27
|
export { resolveOpenWorkflowStorage as t };
|
package/dist/openworkflow.js
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export { createOpenWorkflowWorker, installOpenWorkflow, startOpenWorkflowWorker };
|
|
1
|
+
export { createOpenWorkflowWorker, installOpenWorkflow, startOpenWorkflowWorker } from "./runtime/openworkflow-worker.js";
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
//#region ../../node_modules/.pnpm/@standard-schema+spec@1.1.0/node_modules/@standard-schema/spec/dist/index.d.ts
|
|
2
1
|
/** The Standard Typed interface. This is a base type extended by other specs. */
|
|
3
2
|
interface StandardTypedV1<Input = unknown, Output = Input> {
|
|
4
3
|
/** The Standard properties. */
|
|
@@ -74,8 +73,6 @@ declare namespace StandardSchemaV1 {
|
|
|
74
73
|
/** Infers the output type of a Standard. */
|
|
75
74
|
type InferOutput<Schema extends StandardTypedV1> = StandardTypedV1.InferOutput<Schema>;
|
|
76
75
|
}
|
|
77
|
-
//#endregion
|
|
78
|
-
//#region ../internal/src/operation-definition.d.ts
|
|
79
76
|
/** `read` never changes state. `write` changes state. `destructive` deletes or publishes. */
|
|
80
77
|
type OperationKind = "read" | "write" | "destructive";
|
|
81
78
|
/** The signed-in user of a call. */
|
|
@@ -241,5 +238,4 @@ interface OperationContributionEntry {
|
|
|
241
238
|
/** `false`: the app already has these operations at runtime. Only tools such as the CLI and `vitehub inspect` read the entry. */
|
|
242
239
|
runtime?: false;
|
|
243
240
|
}
|
|
244
|
-
//#endregion
|
|
245
241
|
export { OperationContributionEntry as n, AnyOperation as t };
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { t as
|
|
2
|
-
import { t as
|
|
3
|
-
import {
|
|
4
|
-
import { t as
|
|
1
|
+
import { n as redactInspectionValue, t as redactInspectionText } from "./inspect-NBCAwsxi.js";
|
|
2
|
+
import { t as isRecord } from "./object-CAK6UYR5.js";
|
|
3
|
+
import { t as workflowErrorDiagnostics } from "./error-diagnostics--2cV_ER1.js";
|
|
4
|
+
import { a as resumeWorkflow, i as getWorkflowRun, o as startWorkflow, t as cancelWorkflow } from "./client-CbBg4HlH.js";
|
|
5
|
+
import { t as getWorkflowDevRecorder } from "./dev-recorder-Dltdmlkv.js";
|
|
6
|
+
import { t as toWorkflowRunError } from "./run-error-8p4BtTMv.js";
|
|
5
7
|
import { getInlineWorkflowDefinitions, getWorkflowRuntimeConfig, getWorkflowRuntimeRegistry } from "./runtime/state.js";
|
|
6
|
-
import { n as redactInspectionValue, t as redactInspectionText } from "./inspect-B72iFyj-.js";
|
|
7
|
-
import { t as toWorkflowRunError } from "./run-error-Ctn50EYz.js";
|
|
8
8
|
import { deserializeResponse, isSerializedResponse } from "@vite-hub/runtime/internal/response";
|
|
9
|
-
|
|
9
|
+
// src/results.ts
|
|
10
10
|
const inlineRunNote = "Runs the Workflow inline in the Nitro runtime, as the app does in development. Inline runs are not durable and have no retries.";
|
|
11
11
|
/**
|
|
12
12
|
* Operations that each provider supports. A supported operation can still fail when the runtime decides, for example
|
|
@@ -68,8 +68,7 @@ function resolveWorkflowOperationSupport(provider) {
|
|
|
68
68
|
}
|
|
69
69
|
};
|
|
70
70
|
}
|
|
71
|
-
|
|
72
|
-
//#region src/runtime/operations.ts
|
|
71
|
+
// src/runtime/operations.ts
|
|
73
72
|
const maxRememberedRuns = 1024;
|
|
74
73
|
const operationStatus = {
|
|
75
74
|
VERCEL_WORKFLOW_SDK_LOAD_FAILED: 501,
|
|
@@ -318,5 +317,4 @@ async function listWorkflowRuns(input) {
|
|
|
318
317
|
function clearWorkflowRuns() {
|
|
319
318
|
return { cleared: devRecorder().clear() };
|
|
320
319
|
}
|
|
321
|
-
//#endregion
|
|
322
320
|
export { clearWorkflowRuns, listWorkflowRuns, runWorkflowOperation, toWorkflowRunView };
|
package/dist/operations.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
//#region src/results.d.ts
|
|
1
|
+
import { t as AnyOperation } from "./operation-definition-CqZkx1Rm.js";
|
|
2
|
+
import { M as WorkflowRunStatus, h as WorkflowDriver } from "./types-DvYcvbPG.js";
|
|
4
3
|
/** One Workflow run as the operations return it. The start payload is not included. */
|
|
5
4
|
interface WorkflowRunView {
|
|
6
5
|
completedAt?: string;
|
|
@@ -57,12 +56,9 @@ interface WorkflowRunsClearResult {
|
|
|
57
56
|
interface WorkflowSignalResult {
|
|
58
57
|
signal: WorkflowSignalView;
|
|
59
58
|
}
|
|
60
|
-
//#endregion
|
|
61
|
-
//#region src/operations.d.ts
|
|
62
59
|
/**
|
|
63
60
|
* The `workflow.*` operations: start, get, cancel, resume, and the run history of `vite dev`. The Console,
|
|
64
61
|
* `vitehub workflow`, and agents run them.
|
|
65
62
|
*/
|
|
66
63
|
export declare const workflowOperations: readonly AnyOperation[];
|
|
67
|
-
//#endregion
|
|
68
64
|
export type { WorkflowRunDetailView, WorkflowRunResult, WorkflowRunStepView, WorkflowRunView, WorkflowRunsClearResult, WorkflowRunsListResult, WorkflowSignalResult, WorkflowSignalView };
|