@workflow/world-vercel 4.0.1-beta.8 → 4.1.0-beta.29
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/events.d.ts +2 -2
- package/dist/events.d.ts.map +1 -1
- package/dist/events.js +49 -12
- package/dist/events.js.map +1 -1
- package/dist/hooks.d.ts.map +1 -1
- package/dist/hooks.js +8 -13
- package/dist/hooks.js.map +1 -1
- package/dist/queue.d.ts.map +1 -1
- package/dist/queue.js +105 -30
- package/dist/queue.js.map +1 -1
- package/dist/runs.d.ts +23 -8
- package/dist/runs.d.ts.map +1 -1
- package/dist/runs.js +22 -95
- package/dist/runs.js.map +1 -1
- package/dist/steps.d.ts +53 -3
- package/dist/steps.d.ts.map +1 -1
- package/dist/steps.js +83 -31
- package/dist/steps.js.map +1 -1
- package/dist/storage.d.ts.map +1 -1
- package/dist/storage.js +7 -16
- package/dist/storage.js.map +1 -1
- package/dist/streamer.d.ts.map +1 -1
- package/dist/streamer.js +22 -7
- package/dist/streamer.js.map +1 -1
- package/dist/utils.d.ts +16 -13
- package/dist/utils.d.ts.map +1 -1
- package/dist/utils.js +139 -51
- package/dist/utils.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.d.ts.map +1 -1
- package/dist/version.js +1 -1
- package/dist/version.js.map +1 -1
- package/package.json +8 -6
- package/dist/backend.d.ts +0 -4
- package/dist/backend.d.ts.map +0 -1
- package/dist/backend.js +0 -18
- package/dist/backend.js.map +0 -1
package/dist/utils.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { type StructuredError } from '@workflow/world';
|
|
2
|
-
import {
|
|
2
|
+
import type { z } from 'zod';
|
|
3
3
|
export interface APIConfig {
|
|
4
|
-
baseUrl?: string;
|
|
5
4
|
token?: string;
|
|
6
5
|
headers?: RequestInit['headers'];
|
|
7
6
|
projectConfig?: {
|
|
@@ -11,7 +10,6 @@ export interface APIConfig {
|
|
|
11
10
|
};
|
|
12
11
|
}
|
|
13
12
|
export declare const DEFAULT_RESOLVE_DATA_OPTION = "all";
|
|
14
|
-
export declare function dateToStringReplacer(_key: string, value: unknown): unknown;
|
|
15
13
|
/**
|
|
16
14
|
* Helper to serialize error into a JSON string in the error field.
|
|
17
15
|
* The error field can be either:
|
|
@@ -25,19 +23,20 @@ export declare function serializeError<T extends {
|
|
|
25
23
|
};
|
|
26
24
|
/**
|
|
27
25
|
* Helper to deserialize error field from the backend into a StructuredError object.
|
|
28
|
-
* Handles
|
|
26
|
+
* Handles multiple formats from the backend:
|
|
27
|
+
* - If error is already a structured object → validate and use directly
|
|
29
28
|
* - If error is a JSON string with {message, stack, code} → parse into StructuredError
|
|
30
29
|
* - If error is a plain string → treat as error message with no stack
|
|
31
30
|
* - If no error → undefined
|
|
32
31
|
*
|
|
33
|
-
* This function transforms objects from wire format (where error
|
|
34
|
-
* to domain format (where error is a StructuredError object).
|
|
35
|
-
* parameter should be the expected output type (WorkflowRun or Step).
|
|
32
|
+
* This function transforms objects from wire format (where error may be a JSON string
|
|
33
|
+
* or already structured) to domain format (where error is a StructuredError object).
|
|
34
|
+
* The generic type parameter should be the expected output type (WorkflowRun or Step).
|
|
36
35
|
*
|
|
37
36
|
* Note: The type assertion is necessary because the wire format types from Zod schemas
|
|
38
|
-
* have `error?: string` while the domain types have complex error types
|
|
39
|
-
* unions with `error: void` or `error: StructuredError` depending on
|
|
40
|
-
* transformation preserves all other fields correctly.
|
|
37
|
+
* have `error?: string | StructuredError` while the domain types have complex error types
|
|
38
|
+
* (e.g., discriminated unions with `error: void` or `error: StructuredError` depending on
|
|
39
|
+
* status), but the transformation preserves all other fields correctly.
|
|
41
40
|
*/
|
|
42
41
|
export declare function deserializeError<T extends Record<string, any>>(obj: any): T;
|
|
43
42
|
export interface HttpConfig {
|
|
@@ -49,12 +48,16 @@ export declare const getHttpUrl: (config?: APIConfig) => {
|
|
|
49
48
|
baseUrl: string;
|
|
50
49
|
usingProxy: boolean;
|
|
51
50
|
};
|
|
52
|
-
export declare const getHeaders: (config
|
|
51
|
+
export declare const getHeaders: (config: APIConfig | undefined, options: {
|
|
52
|
+
usingProxy: boolean;
|
|
53
|
+
}) => Headers;
|
|
53
54
|
export declare function getHttpConfig(config?: APIConfig): Promise<HttpConfig>;
|
|
54
|
-
export declare function makeRequest<T>({ endpoint, options, config, schema, }: {
|
|
55
|
+
export declare function makeRequest<T>({ endpoint, options, config, schema, data, }: {
|
|
55
56
|
endpoint: string;
|
|
56
|
-
options?: RequestInit
|
|
57
|
+
options?: Omit<RequestInit, 'body'>;
|
|
57
58
|
config?: APIConfig;
|
|
58
59
|
schema: z.ZodSchema<T>;
|
|
60
|
+
/** Request body data - will be CBOR encoded */
|
|
61
|
+
data?: unknown;
|
|
59
62
|
}): Promise<T>;
|
|
60
63
|
//# sourceMappingURL=utils.d.ts.map
|
package/dist/utils.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,eAAe,EAAyB,MAAM,iBAAiB,CAAC;AAE9E,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAY7B,MAAM,WAAW,SAAS;IACxB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,WAAW,CAAC,SAAS,CAAC,CAAC;IACjC,aAAa,CAAC,EAAE;QACd,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,WAAW,CAAC,EAAE,MAAM,CAAC;KACtB,CAAC;CACH;AAED,eAAO,MAAM,2BAA2B,QAAQ,CAAC;AAEjD;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,CAAC,SAAS;IAAE,KAAK,CAAC,EAAE,eAAe,CAA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|
2
3
|
import { getVercelOidcToken } from '@vercel/oidc';
|
|
3
4
|
import { WorkflowAPIError } from '@workflow/errors';
|
|
4
5
|
import { StructuredErrorSchema } from '@workflow/world';
|
|
5
|
-
import {
|
|
6
|
+
import { decode, encode } from 'cbor-x';
|
|
6
7
|
import { version } from './version.js';
|
|
8
|
+
/**
|
|
9
|
+
* Hard-coded workflow-server URL override for testing.
|
|
10
|
+
* Set this to test against a different workflow-server version.
|
|
11
|
+
* Leave empty string for production (uses default vercel-workflow.com).
|
|
12
|
+
*
|
|
13
|
+
* Example: 'https://workflow-server-git-branch-name.vercel.sh'
|
|
14
|
+
*/
|
|
15
|
+
const WORKFLOW_SERVER_URL_OVERRIDE = '';
|
|
7
16
|
export const DEFAULT_RESOLVE_DATA_OPTION = 'all';
|
|
8
|
-
export function dateToStringReplacer(_key, value) {
|
|
9
|
-
if (value instanceof Date) {
|
|
10
|
-
return value.toISOString();
|
|
11
|
-
}
|
|
12
|
-
return value;
|
|
13
|
-
}
|
|
14
17
|
/**
|
|
15
18
|
* Helper to serialize error into a JSON string in the error field.
|
|
16
19
|
* The error field can be either:
|
|
@@ -34,59 +37,86 @@ export function serializeError(data) {
|
|
|
34
37
|
}
|
|
35
38
|
/**
|
|
36
39
|
* Helper to deserialize error field from the backend into a StructuredError object.
|
|
37
|
-
* Handles
|
|
40
|
+
* Handles multiple formats from the backend:
|
|
41
|
+
* - If error is already a structured object → validate and use directly
|
|
38
42
|
* - If error is a JSON string with {message, stack, code} → parse into StructuredError
|
|
39
43
|
* - If error is a plain string → treat as error message with no stack
|
|
40
44
|
* - If no error → undefined
|
|
41
45
|
*
|
|
42
|
-
* This function transforms objects from wire format (where error
|
|
43
|
-
* to domain format (where error is a StructuredError object).
|
|
44
|
-
* parameter should be the expected output type (WorkflowRun or Step).
|
|
46
|
+
* This function transforms objects from wire format (where error may be a JSON string
|
|
47
|
+
* or already structured) to domain format (where error is a StructuredError object).
|
|
48
|
+
* The generic type parameter should be the expected output type (WorkflowRun or Step).
|
|
45
49
|
*
|
|
46
50
|
* Note: The type assertion is necessary because the wire format types from Zod schemas
|
|
47
|
-
* have `error?: string` while the domain types have complex error types
|
|
48
|
-
* unions with `error: void` or `error: StructuredError` depending on
|
|
49
|
-
* transformation preserves all other fields correctly.
|
|
51
|
+
* have `error?: string | StructuredError` while the domain types have complex error types
|
|
52
|
+
* (e.g., discriminated unions with `error: void` or `error: StructuredError` depending on
|
|
53
|
+
* status), but the transformation preserves all other fields correctly.
|
|
50
54
|
*/
|
|
51
55
|
export function deserializeError(obj) {
|
|
52
56
|
const { error, ...rest } = obj;
|
|
53
57
|
if (!error) {
|
|
54
58
|
return obj;
|
|
55
59
|
}
|
|
56
|
-
//
|
|
57
|
-
|
|
58
|
-
const
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
60
|
+
// If error is already an object (new format), validate and use directly
|
|
61
|
+
if (typeof error === 'object' && error !== null) {
|
|
62
|
+
const result = StructuredErrorSchema.safeParse(error);
|
|
63
|
+
if (result.success) {
|
|
64
|
+
return {
|
|
65
|
+
...rest,
|
|
66
|
+
error: {
|
|
67
|
+
message: result.data.message,
|
|
68
|
+
stack: result.data.stack,
|
|
69
|
+
code: result.data.code,
|
|
70
|
+
},
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
// Fall through to treat as unknown format
|
|
67
74
|
}
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
75
|
+
// If error is a string, try to parse as structured error JSON
|
|
76
|
+
if (typeof error === 'string') {
|
|
77
|
+
try {
|
|
78
|
+
const parsed = StructuredErrorSchema.parse(JSON.parse(error));
|
|
79
|
+
return {
|
|
80
|
+
...rest,
|
|
81
|
+
error: {
|
|
82
|
+
message: parsed.message,
|
|
83
|
+
stack: parsed.stack,
|
|
84
|
+
code: parsed.code,
|
|
85
|
+
},
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
catch {
|
|
89
|
+
// Backwards compatibility: error is just a plain string
|
|
90
|
+
return {
|
|
91
|
+
...rest,
|
|
92
|
+
error: {
|
|
93
|
+
message: error,
|
|
94
|
+
},
|
|
95
|
+
};
|
|
96
|
+
}
|
|
76
97
|
}
|
|
98
|
+
// Unknown format - return as-is and let downstream handle it
|
|
99
|
+
return obj;
|
|
77
100
|
}
|
|
78
101
|
const getUserAgent = () => {
|
|
102
|
+
const deploymentId = process.env.VERCEL_DEPLOYMENT_ID;
|
|
103
|
+
if (deploymentId) {
|
|
104
|
+
return `@workflow/world-vercel/${version} node-${process.version} ${os.platform()} (${os.arch()}) ${deploymentId}`;
|
|
105
|
+
}
|
|
79
106
|
return `@workflow/world-vercel/${version} node-${process.version} ${os.platform()} (${os.arch()})`;
|
|
80
107
|
};
|
|
81
108
|
export const getHttpUrl = (config) => {
|
|
82
109
|
const projectConfig = config?.projectConfig;
|
|
83
|
-
const
|
|
110
|
+
const defaultHost = WORKFLOW_SERVER_URL_OVERRIDE || 'https://vercel-workflow.com';
|
|
84
111
|
const defaultProxyUrl = 'https://api.vercel.com/v1/workflow';
|
|
85
|
-
|
|
86
|
-
const
|
|
112
|
+
// Use proxy when we have project config (for authentication via Vercel API)
|
|
113
|
+
const usingProxy = Boolean(projectConfig?.projectId && projectConfig?.teamId);
|
|
114
|
+
// When using proxy, requests go through api.vercel.com (with x-vercel-workflow-api-url header if override is set)
|
|
115
|
+
// When not using proxy, use the default workflow-server URL (with /api path appended)
|
|
116
|
+
const baseUrl = usingProxy ? defaultProxyUrl : `${defaultHost}/api`;
|
|
87
117
|
return { baseUrl, usingProxy };
|
|
88
118
|
};
|
|
89
|
-
export const getHeaders = (config) => {
|
|
119
|
+
export const getHeaders = (config, options) => {
|
|
90
120
|
const projectConfig = config?.projectConfig;
|
|
91
121
|
const headers = new Headers(config?.headers);
|
|
92
122
|
headers.set('User-Agent', getUserAgent());
|
|
@@ -99,45 +129,103 @@ export const getHeaders = (config) => {
|
|
|
99
129
|
headers.set('x-vercel-team-id', projectConfig.teamId);
|
|
100
130
|
}
|
|
101
131
|
}
|
|
132
|
+
// Only set workflow-api-url header when using the proxy, since the proxy
|
|
133
|
+
// forwards it to the workflow-server. When not using proxy, requests go
|
|
134
|
+
// directly to the workflow-server so this header has no effect.
|
|
135
|
+
if (WORKFLOW_SERVER_URL_OVERRIDE && options.usingProxy) {
|
|
136
|
+
headers.set('x-vercel-workflow-api-url', WORKFLOW_SERVER_URL_OVERRIDE);
|
|
137
|
+
}
|
|
102
138
|
return headers;
|
|
103
139
|
};
|
|
104
140
|
export async function getHttpConfig(config) {
|
|
105
|
-
const
|
|
141
|
+
const { baseUrl, usingProxy } = getHttpUrl(config);
|
|
142
|
+
const headers = getHeaders(config, { usingProxy });
|
|
106
143
|
const token = config?.token ?? (await getVercelOidcToken());
|
|
107
144
|
if (token) {
|
|
108
145
|
headers.set('Authorization', `Bearer ${token}`);
|
|
109
146
|
}
|
|
110
|
-
const { baseUrl, usingProxy } = getHttpUrl(config);
|
|
111
147
|
return { baseUrl, headers, usingProxy };
|
|
112
148
|
}
|
|
113
|
-
export async function makeRequest({ endpoint, options = {}, config = {}, schema, }) {
|
|
149
|
+
export async function makeRequest({ endpoint, options = {}, config = {}, schema, data, }) {
|
|
114
150
|
const { baseUrl, headers } = await getHttpConfig(config);
|
|
115
|
-
headers.set('
|
|
151
|
+
headers.set('Accept', 'application/cbor');
|
|
152
|
+
// NOTE: Add a unique header to bypass RSC request memoization.
|
|
153
|
+
// See: https://github.com/vercel/workflow/issues/618
|
|
154
|
+
headers.set('X-Request-Time', Date.now().toString());
|
|
155
|
+
// Encode body as CBOR if data is provided
|
|
156
|
+
let body;
|
|
157
|
+
if (data !== undefined) {
|
|
158
|
+
headers.set('Content-Type', 'application/cbor');
|
|
159
|
+
body = encode(data);
|
|
160
|
+
}
|
|
116
161
|
const url = `${baseUrl}${endpoint}`;
|
|
117
|
-
const
|
|
162
|
+
const request = new Request(url, {
|
|
118
163
|
...options,
|
|
164
|
+
body,
|
|
119
165
|
headers,
|
|
120
166
|
});
|
|
167
|
+
const response = await fetch(request);
|
|
121
168
|
if (!response.ok) {
|
|
122
|
-
const errorData =
|
|
169
|
+
const errorData = await parseResponseBody(response)
|
|
170
|
+
.then((r) => r.data)
|
|
171
|
+
.catch(() => ({}));
|
|
123
172
|
if (process.env.DEBUG === '1') {
|
|
124
173
|
const stringifiedHeaders = Array.from(headers.entries())
|
|
125
174
|
.map(([key, value]) => `-H "${key}: ${value}"`)
|
|
126
175
|
.join(' ');
|
|
127
|
-
console.error(`Failed to fetch, reproduce with:\ncurl -X ${
|
|
176
|
+
console.error(`Failed to fetch, reproduce with:\ncurl -X ${request.method} ${stringifiedHeaders} "${url}"`);
|
|
128
177
|
}
|
|
129
178
|
throw new WorkflowAPIError(errorData.message ||
|
|
130
|
-
`${
|
|
179
|
+
`${request.method} ${endpoint} -> HTTP ${response.status}: ${response.statusText}`, { url, status: response.status, code: errorData.code });
|
|
131
180
|
}
|
|
181
|
+
// Parse the response body (CBOR or JSON)
|
|
182
|
+
let parseResult;
|
|
132
183
|
try {
|
|
133
|
-
|
|
134
|
-
return schema.parse(JSON.parse(text));
|
|
184
|
+
parseResult = await parseResponseBody(response);
|
|
135
185
|
}
|
|
136
186
|
catch (error) {
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
187
|
+
const contentType = response.headers.get('Content-Type') || 'unknown';
|
|
188
|
+
throw new WorkflowAPIError(`Failed to parse response body for ${request.method} ${endpoint} (Content-Type: ${contentType}):\n\n${error}`, { url, cause: error });
|
|
189
|
+
}
|
|
190
|
+
// Validate against the schema
|
|
191
|
+
const result = schema.safeParse(parseResult.data);
|
|
192
|
+
if (!result.success) {
|
|
193
|
+
throw new WorkflowAPIError(`Schema validation failed for ${request.method} ${endpoint}:\n\n${result.error}\n\nResponse context: ${parseResult.getDebugContext()}`, { url, cause: result.error });
|
|
194
|
+
}
|
|
195
|
+
return result.data;
|
|
196
|
+
}
|
|
197
|
+
/** Max length for response preview in error messages */
|
|
198
|
+
const MAX_PREVIEW_LENGTH = 500;
|
|
199
|
+
/**
|
|
200
|
+
* Create a truncated preview of data for error messages.
|
|
201
|
+
*/
|
|
202
|
+
function createPreview(data) {
|
|
203
|
+
const str = inspect(data, { depth: 3, maxArrayLength: 10, breakLength: 120 });
|
|
204
|
+
return str.length > MAX_PREVIEW_LENGTH
|
|
205
|
+
? `${str.slice(0, MAX_PREVIEW_LENGTH)}...`
|
|
206
|
+
: str;
|
|
207
|
+
}
|
|
208
|
+
/**
|
|
209
|
+
* Parse response body based on Content-Type header.
|
|
210
|
+
* Supports both CBOR and JSON responses.
|
|
211
|
+
* Returns parsed data along with a lazy debug context generator for error reporting.
|
|
212
|
+
*/
|
|
213
|
+
async function parseResponseBody(response) {
|
|
214
|
+
const contentType = response.headers.get('Content-Type') || '';
|
|
215
|
+
if (contentType.includes('application/cbor')) {
|
|
216
|
+
const buffer = await response.arrayBuffer();
|
|
217
|
+
const data = decode(new Uint8Array(buffer));
|
|
218
|
+
return {
|
|
219
|
+
data,
|
|
220
|
+
getDebugContext: () => `Content-Type: ${contentType}, ${buffer.byteLength} bytes (CBOR), preview: ${createPreview(data)}`,
|
|
221
|
+
};
|
|
141
222
|
}
|
|
223
|
+
// Fall back to JSON parsing
|
|
224
|
+
const text = await response.text();
|
|
225
|
+
const data = JSON.parse(text);
|
|
226
|
+
return {
|
|
227
|
+
data,
|
|
228
|
+
getDebugContext: () => `Content-Type: ${contentType}, ${text.length} bytes, preview: ${createPreview(data)}`,
|
|
229
|
+
};
|
|
142
230
|
}
|
|
143
231
|
//# sourceMappingURL=utils.js.map
|
package/dist/utils.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,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AAE,KAAK,EAAE,CAAC,EAAE,cAAc,EAAE,EAAE,EAAE,WAAW,EAAE,GAAG,EAAE,CAAC,CAAC;IAC9E,OAAO,GAAG,CAAC,MAAM,GAAG,kBAAkB;QACpC,CAAC,CAAC,GAAG,GAAG,CAAC,KAAK,CAAC,CAAC,EAAE,kBAAkB,CAAC,KAAK;QAC1C,CAAC,CAAC,GAAG,CAAC;AACV,CAAC;AAED;;;;GAIG;AACH,KAAK,UAAU,iBAAiB,CAAC,QAAkB;IACjD,MAAM,WAAW,GAAG,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,cAAc,CAAC,IAAI,EAAE,CAAC;IAE/D,IAAI,WAAW,CAAC,QAAQ,CAAC,kBAAkB,CAAC,EAAE,CAAC;QAC7C,MAAM,MAAM,GAAG,MAAM,QAAQ,CAAC,WAAW,EAAE,CAAC;QAC5C,MAAM,IAAI,GAAG,MAAM,CAAC,IAAI,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC;QAC5C,OAAO;YACL,IAAI;YACJ,eAAe,EAAE,GAAG,EAAE,CACpB,iBAAiB,WAAW,KAAK,MAAM,CAAC,UAAU,2BAA2B,aAAa,CAAC,IAAI,CAAC,EAAE;SACrG,CAAC;IACJ,CAAC;IAED,4BAA4B;IAC5B,MAAM,IAAI,GAAG,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC;IACnC,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IAC9B,OAAO;QACL,IAAI;QACJ,eAAe,EAAE,GAAG,EAAE,CACpB,iBAAiB,WAAW,KAAK,IAAI,CAAC,MAAM,oBAAoB,aAAa,CAAC,IAAI,CAAC,EAAE;KACxF,CAAC;AACJ,CAAC"}
|
package/dist/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const version = "4.0
|
|
1
|
+
export declare const version = "4.1.0-beta.29";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
package/dist/version.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,OAAO,
|
|
1
|
+
{"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,OAAO,kBAAkB,CAAA"}
|
package/dist/version.js
CHANGED
package/dist/version.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version.js","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":"AAAA,2BAA2B;AAC3B,MAAM,CAAC,MAAM,OAAO,GAAG,
|
|
1
|
+
{"version":3,"file":"version.js","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":"AAAA,2BAA2B;AAC3B,MAAM,CAAC,MAAM,OAAO,GAAG,eAAe,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@workflow/world-vercel",
|
|
3
|
-
"version": "4.0
|
|
3
|
+
"version": "4.1.0-beta.29",
|
|
4
4
|
"description": "Vercel platform World implementation for Workflow DevKit",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -23,22 +23,24 @@
|
|
|
23
23
|
}
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"@vercel/oidc": "
|
|
27
|
-
"@vercel/queue": "0.0.0-alpha.
|
|
26
|
+
"@vercel/oidc": "3.0.5",
|
|
27
|
+
"@vercel/queue": "0.0.0-alpha.34",
|
|
28
|
+
"cbor-x": "1.6.0",
|
|
28
29
|
"zod": "4.1.11",
|
|
29
|
-
"@workflow/
|
|
30
|
-
"@workflow/
|
|
30
|
+
"@workflow/errors": "4.1.0-beta.14",
|
|
31
|
+
"@workflow/world": "4.1.0-beta.1"
|
|
31
32
|
},
|
|
32
33
|
"devDependencies": {
|
|
33
34
|
"@types/node": "22.19.0",
|
|
34
35
|
"genversion": "3.2.0",
|
|
36
|
+
"vitest": "^3.2.4",
|
|
35
37
|
"@workflow/tsconfig": "4.0.1-beta.0"
|
|
36
38
|
},
|
|
37
39
|
"scripts": {
|
|
38
40
|
"build": "genversion --es6 src/version.ts && tsc",
|
|
39
41
|
"dev": "genversion --es6 src/version.ts && tsc --watch",
|
|
40
42
|
"clean": "tsc --build --clean && rm -rf dist src/version.ts",
|
|
41
|
-
"test": "
|
|
43
|
+
"test": "vitest",
|
|
42
44
|
"typecheck": "genversion --es6 src/version.ts && tsc --noEmit"
|
|
43
45
|
}
|
|
44
46
|
}
|
package/dist/backend.d.ts
DELETED
package/dist/backend.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"backend.d.ts","sourceRoot":"","sources":["../src/backend.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAGzD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAE5C,wBAAgB,YAAY,CAAC,MAAM,CAAC,EAAE,SAAS,GAAG,QAAQ,GAAG,OAAO,CAgBnE"}
|
package/dist/backend.js
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { createStorage } from './storage.js';
|
|
2
|
-
import { createStreamer } from './streamer.js';
|
|
3
|
-
export function createVercel(config) {
|
|
4
|
-
const storage = createStorage(config);
|
|
5
|
-
const streamer = createStreamer(config);
|
|
6
|
-
return {
|
|
7
|
-
// Streamer interface
|
|
8
|
-
writeToStream: streamer.writeToStream,
|
|
9
|
-
closeStream: streamer.closeStream,
|
|
10
|
-
readFromStream: streamer.readFromStream,
|
|
11
|
-
// Storage interface with namespaced methods
|
|
12
|
-
runs: storage.runs,
|
|
13
|
-
steps: storage.steps,
|
|
14
|
-
events: storage.events,
|
|
15
|
-
hooks: storage.hooks,
|
|
16
|
-
};
|
|
17
|
-
}
|
|
18
|
-
//# sourceMappingURL=backend.js.map
|
package/dist/backend.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"backend.js","sourceRoot":"","sources":["../src/backend.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAC7C,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAG/C,MAAM,UAAU,YAAY,CAAC,MAAkB;IAC7C,MAAM,OAAO,GAAG,aAAa,CAAC,MAAM,CAAC,CAAC;IACtC,MAAM,QAAQ,GAAG,cAAc,CAAC,MAAM,CAAC,CAAC;IAExC,OAAO;QACL,qBAAqB;QACrB,aAAa,EAAE,QAAQ,CAAC,aAAa;QACrC,WAAW,EAAE,QAAQ,CAAC,WAAW;QACjC,cAAc,EAAE,QAAQ,CAAC,cAAc;QAEvC,4CAA4C;QAC5C,IAAI,EAAE,OAAO,CAAC,IAAI;QAClB,KAAK,EAAE,OAAO,CAAC,KAAK;QACpB,MAAM,EAAE,OAAO,CAAC,MAAM;QACtB,KAAK,EAAE,OAAO,CAAC,KAAK;KACrB,CAAC;AACJ,CAAC"}
|