@workflow/world-testing 5.0.0-beta.26 → 5.0.0-beta.27
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/.well-known/workflow/v1/flow.mjs +9004 -7877
- package/dist/.well-known/workflow/v1/manifest.json +995 -137
- package/dist/.well-known/workflow/v1/step.mjs +428 -223
- package/package.json +5 -5
|
@@ -515,8 +515,6 @@ Caused by: ${options.cause.stack}`;
|
|
|
515
515
|
static {
|
|
516
516
|
__name(this, "RuntimeDecryptionError");
|
|
517
517
|
}
|
|
518
|
-
/** Optional structured context about the failed encrypt/decrypt call. */
|
|
519
|
-
context;
|
|
520
518
|
constructor(message, options) {
|
|
521
519
|
super(message, {
|
|
522
520
|
cause: options?.cause,
|
|
@@ -16494,7 +16492,7 @@ var init_serialization = __esm({
|
|
|
16494
16492
|
});
|
|
16495
16493
|
|
|
16496
16494
|
// ../world/dist/events.js
|
|
16497
|
-
var EventTypeSchema, BaseEventSchema, StepCompletedEventSchema, StepFailedEventSchema, StepRetryingEventSchema, StepStartedEventSchema, StepCreatedEventSchema, HookCreatedEventSchema, HookReceivedEventSchema, HookDisposedEventSchema, HookConflictEventSchema, WaitCreatedEventSchema, WaitCompletedEventSchema, AttributeWriterSchema, AttrSetEventSchema, RunCreatedEventSchema, RunStartedEventSchema, RunCompletedEventSchema, RunFailedEventSchema, RunCancelledEventSchema, CreateEventSchema, AllEventsSchema, EventSchema;
|
|
16495
|
+
var EventTypeSchema, TerminalRunEventTypeSchema, TERMINAL_RUN_EVENT_TYPES, BaseEventSchema, StepCompletedEventSchema, StepFailedEventSchema, StepRetryingEventSchema, StepStartedEventSchema, StepCreatedEventSchema, HookCreatedEventSchema, HookReceivedEventSchema, HookDisposedEventSchema, HookConflictEventSchema, WaitCreatedEventSchema, WaitCompletedEventSchema, AttributeWriterSchema, AttrSetEventSchema, RunCreatedEventSchema, RunStartedEventSchema, RunCompletedEventSchema, RunFailedEventSchema, RunCancelledEventSchema, CreateEventSchema, AllEventsSchema, EventSchema;
|
|
16498
16496
|
var init_events = __esm({
|
|
16499
16497
|
"../world/dist/events.js"() {
|
|
16500
16498
|
"use strict";
|
|
@@ -16525,6 +16523,12 @@ var init_events = __esm({
|
|
|
16525
16523
|
"wait_created",
|
|
16526
16524
|
"wait_completed"
|
|
16527
16525
|
]);
|
|
16526
|
+
TerminalRunEventTypeSchema = EventTypeSchema.extract([
|
|
16527
|
+
"run_completed",
|
|
16528
|
+
"run_failed",
|
|
16529
|
+
"run_cancelled"
|
|
16530
|
+
]);
|
|
16531
|
+
TERMINAL_RUN_EVENT_TYPES = TerminalRunEventTypeSchema.options;
|
|
16528
16532
|
BaseEventSchema = external_exports.object({
|
|
16529
16533
|
eventType: EventTypeSchema,
|
|
16530
16534
|
correlationId: external_exports.string().optional(),
|
|
@@ -16753,134 +16757,8 @@ var init_events = __esm({
|
|
|
16753
16757
|
}
|
|
16754
16758
|
});
|
|
16755
16759
|
|
|
16756
|
-
// ../world/dist/hooks.js
|
|
16757
|
-
var HookSchema;
|
|
16758
|
-
var init_hooks = __esm({
|
|
16759
|
-
"../world/dist/hooks.js"() {
|
|
16760
|
-
"use strict";
|
|
16761
|
-
init_zod();
|
|
16762
|
-
init_serialization();
|
|
16763
|
-
HookSchema = external_exports.object({
|
|
16764
|
-
runId: external_exports.string(),
|
|
16765
|
-
hookId: external_exports.string(),
|
|
16766
|
-
token: external_exports.string(),
|
|
16767
|
-
ownerId: external_exports.string(),
|
|
16768
|
-
projectId: external_exports.string(),
|
|
16769
|
-
environment: external_exports.string(),
|
|
16770
|
-
metadata: SerializedDataSchema.optional(),
|
|
16771
|
-
createdAt: external_exports.coerce.date(),
|
|
16772
|
-
// Optional in database for backwards compatibility, defaults to 1 (legacy) when reading
|
|
16773
|
-
specVersion: external_exports.number().optional(),
|
|
16774
|
-
isWebhook: external_exports.boolean().optional(),
|
|
16775
|
-
isSystem: external_exports.boolean().optional()
|
|
16776
|
-
});
|
|
16777
|
-
}
|
|
16778
|
-
});
|
|
16779
|
-
|
|
16780
|
-
// ../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/classic/index.js
|
|
16781
|
-
var init_classic = __esm({
|
|
16782
|
-
"../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/classic/index.js"() {
|
|
16783
|
-
"use strict";
|
|
16784
|
-
init_external();
|
|
16785
|
-
init_external();
|
|
16786
|
-
}
|
|
16787
|
-
});
|
|
16788
|
-
|
|
16789
|
-
// ../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/index.js
|
|
16790
|
-
var init_v4 = __esm({
|
|
16791
|
-
"../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/index.js"() {
|
|
16792
|
-
"use strict";
|
|
16793
|
-
init_classic();
|
|
16794
|
-
init_classic();
|
|
16795
|
-
}
|
|
16796
|
-
});
|
|
16797
|
-
|
|
16798
|
-
// ../world/dist/queue.js
|
|
16799
|
-
function resolveQueueNamespace(namespace) {
|
|
16800
|
-
return namespace ?? process.env.WORKFLOW_QUEUE_NAMESPACE ?? void 0;
|
|
16801
|
-
}
|
|
16802
|
-
function getQueueTopicPrefix(kind, namespace) {
|
|
16803
|
-
if (namespace !== void 0) {
|
|
16804
|
-
QueueNamespace.parse(namespace);
|
|
16805
|
-
return `__${namespace}_wkf_${kind}_`;
|
|
16806
|
-
}
|
|
16807
|
-
return `__wkf_${kind}_`;
|
|
16808
|
-
}
|
|
16809
|
-
var QueuePrefix, ValidQueueName, QueueNamespace, MessageId, TraceCarrierSchema, RunInputSchema, WorkflowInvokePayloadSchema, StepInvokePayloadSchema, HealthCheckPayloadSchema, QueuePayloadSchema;
|
|
16810
|
-
var init_queue = __esm({
|
|
16811
|
-
"../world/dist/queue.js"() {
|
|
16812
|
-
"use strict";
|
|
16813
|
-
init_v4();
|
|
16814
|
-
QueuePrefix = external_exports.string().regex(/^__(?:[a-z][a-z0-9]*_)?wkf_(?:workflow|step)_$/, "Must match __wkf_{workflow|step}_ or __{namespace}_wkf_{workflow|step}_");
|
|
16815
|
-
ValidQueueName = external_exports.string().regex(/^__(?:[a-z][a-z0-9]*_)?wkf_(?:workflow|step)_.+$/, "Must be a valid queue name with a recognized prefix");
|
|
16816
|
-
QueueNamespace = external_exports.string().regex(/^[a-z][a-z0-9]*$/, "Must be lowercase alphanumeric, starting with a letter");
|
|
16817
|
-
__name(resolveQueueNamespace, "resolveQueueNamespace");
|
|
16818
|
-
__name(getQueueTopicPrefix, "getQueueTopicPrefix");
|
|
16819
|
-
MessageId = external_exports.string().brand().describe("A stored queue message ID");
|
|
16820
|
-
TraceCarrierSchema = external_exports.record(external_exports.string(), external_exports.string());
|
|
16821
|
-
RunInputSchema = external_exports.object({
|
|
16822
|
-
input: external_exports.unknown(),
|
|
16823
|
-
deploymentId: external_exports.string(),
|
|
16824
|
-
workflowName: external_exports.string(),
|
|
16825
|
-
specVersion: external_exports.number(),
|
|
16826
|
-
executionContext: external_exports.record(external_exports.string(), external_exports.any()).optional(),
|
|
16827
|
-
/** Initial plaintext run attributes, for resilient run creation. */
|
|
16828
|
-
attributes: external_exports.record(external_exports.string(), external_exports.string()).optional(),
|
|
16829
|
-
/**
|
|
16830
|
-
* Permits reserved `$`-prefixed keys in `attributes`, mirrored from the
|
|
16831
|
-
* `start()` option so resilient run creation validates the same way as
|
|
16832
|
-
* the original `run_created` attempt.
|
|
16833
|
-
*/
|
|
16834
|
-
allowReservedAttributes: external_exports.literal(true).optional()
|
|
16835
|
-
});
|
|
16836
|
-
WorkflowInvokePayloadSchema = external_exports.object({
|
|
16837
|
-
runId: external_exports.string(),
|
|
16838
|
-
traceCarrier: TraceCarrierSchema.optional(),
|
|
16839
|
-
requestedAt: external_exports.coerce.date().optional(),
|
|
16840
|
-
/** Consecutive replay divergences in this recovery chain and latest position. */
|
|
16841
|
-
replayDivergence: external_exports.object({
|
|
16842
|
-
eventId: external_exports.string(),
|
|
16843
|
-
count: external_exports.number().int().positive()
|
|
16844
|
-
}).optional(),
|
|
16845
|
-
/** Number of times this message has been re-enqueued due to server errors (5xx) */
|
|
16846
|
-
serverErrorRetryCount: external_exports.number().int().optional(),
|
|
16847
|
-
/** Step ID for inline step execution in combined handler. If provided, the flow execution
|
|
16848
|
-
* will jump directly to execute the step with the given ID before doing an event replay. */
|
|
16849
|
-
stepId: external_exports.string().optional(),
|
|
16850
|
-
/** Step name, sent alongside stepId to avoid loading the event log just to resolve the name. */
|
|
16851
|
-
stepName: external_exports.string().optional(),
|
|
16852
|
-
/** Run creation data, only present on the first queue delivery from start() */
|
|
16853
|
-
runInput: RunInputSchema.optional()
|
|
16854
|
-
});
|
|
16855
|
-
StepInvokePayloadSchema = external_exports.object({
|
|
16856
|
-
workflowName: external_exports.string(),
|
|
16857
|
-
workflowRunId: external_exports.string(),
|
|
16858
|
-
workflowStartedAt: external_exports.number(),
|
|
16859
|
-
stepId: external_exports.string(),
|
|
16860
|
-
traceCarrier: TraceCarrierSchema.optional(),
|
|
16861
|
-
requestedAt: external_exports.coerce.date().optional()
|
|
16862
|
-
});
|
|
16863
|
-
HealthCheckPayloadSchema = external_exports.object({
|
|
16864
|
-
__healthCheck: external_exports.literal(true),
|
|
16865
|
-
correlationId: external_exports.string()
|
|
16866
|
-
});
|
|
16867
|
-
QueuePayloadSchema = external_exports.union([
|
|
16868
|
-
WorkflowInvokePayloadSchema,
|
|
16869
|
-
StepInvokePayloadSchema,
|
|
16870
|
-
HealthCheckPayloadSchema
|
|
16871
|
-
]);
|
|
16872
|
-
}
|
|
16873
|
-
});
|
|
16874
|
-
|
|
16875
|
-
// ../world/dist/recovery.js
|
|
16876
|
-
var init_recovery = __esm({
|
|
16877
|
-
"../world/dist/recovery.js"() {
|
|
16878
|
-
"use strict";
|
|
16879
|
-
}
|
|
16880
|
-
});
|
|
16881
|
-
|
|
16882
16760
|
// ../world/dist/runs.js
|
|
16883
|
-
var WorkflowRunStatusSchema, WorkflowRunBaseSchema, WorkflowRunSchema;
|
|
16761
|
+
var WorkflowRunStatusSchema, TerminalWorkflowRunStatusSchema, TERMINAL_WORKFLOW_RUN_STATUSES, WorkflowRunBaseSchema, WorkflowRunSchema;
|
|
16884
16762
|
var init_runs = __esm({
|
|
16885
16763
|
"../world/dist/runs.js"() {
|
|
16886
16764
|
"use strict";
|
|
@@ -16893,6 +16771,12 @@ var init_runs = __esm({
|
|
|
16893
16771
|
"failed",
|
|
16894
16772
|
"cancelled"
|
|
16895
16773
|
]);
|
|
16774
|
+
TerminalWorkflowRunStatusSchema = WorkflowRunStatusSchema.extract([
|
|
16775
|
+
"completed",
|
|
16776
|
+
"failed",
|
|
16777
|
+
"cancelled"
|
|
16778
|
+
]);
|
|
16779
|
+
TERMINAL_WORKFLOW_RUN_STATUSES = TerminalWorkflowRunStatusSchema.options;
|
|
16896
16780
|
WorkflowRunBaseSchema = external_exports.object({
|
|
16897
16781
|
runId: external_exports.string(),
|
|
16898
16782
|
status: WorkflowRunStatusSchema,
|
|
@@ -16997,50 +16881,8 @@ var init_runs = __esm({
|
|
|
16997
16881
|
}
|
|
16998
16882
|
});
|
|
16999
16883
|
|
|
17000
|
-
// ../world/dist/shared.js
|
|
17001
|
-
var zodJsonSchema, StructuredErrorSchema;
|
|
17002
|
-
var init_shared = __esm({
|
|
17003
|
-
"../world/dist/shared.js"() {
|
|
17004
|
-
"use strict";
|
|
17005
|
-
init_zod();
|
|
17006
|
-
zodJsonSchema = external_exports.lazy(() => {
|
|
17007
|
-
return external_exports.union([
|
|
17008
|
-
external_exports.string(),
|
|
17009
|
-
external_exports.number(),
|
|
17010
|
-
external_exports.boolean(),
|
|
17011
|
-
external_exports.null(),
|
|
17012
|
-
external_exports.array(zodJsonSchema),
|
|
17013
|
-
external_exports.record(external_exports.string(), zodJsonSchema)
|
|
17014
|
-
]);
|
|
17015
|
-
});
|
|
17016
|
-
StructuredErrorSchema = external_exports.object({
|
|
17017
|
-
message: external_exports.string(),
|
|
17018
|
-
stack: external_exports.string().optional(),
|
|
17019
|
-
code: external_exports.string().optional()
|
|
17020
|
-
});
|
|
17021
|
-
}
|
|
17022
|
-
});
|
|
17023
|
-
|
|
17024
|
-
// ../world/dist/spec-version.js
|
|
17025
|
-
function isLegacySpecVersion(v) {
|
|
17026
|
-
return v === void 0 || v === null || v <= SPEC_VERSION_LEGACY;
|
|
17027
|
-
}
|
|
17028
|
-
var SPEC_VERSION_LEGACY, SPEC_VERSION_SUPPORTS_EVENT_SOURCING, SPEC_VERSION_SUPPORTS_CBOR_QUEUE_TRANSPORT, SPEC_VERSION_SUPPORTS_ATTRIBUTES, SPEC_VERSION_SUPPORTS_COMPRESSION, SPEC_VERSION_CURRENT;
|
|
17029
|
-
var init_spec_version = __esm({
|
|
17030
|
-
"../world/dist/spec-version.js"() {
|
|
17031
|
-
"use strict";
|
|
17032
|
-
SPEC_VERSION_LEGACY = 1;
|
|
17033
|
-
SPEC_VERSION_SUPPORTS_EVENT_SOURCING = 2;
|
|
17034
|
-
SPEC_VERSION_SUPPORTS_CBOR_QUEUE_TRANSPORT = 3;
|
|
17035
|
-
SPEC_VERSION_SUPPORTS_ATTRIBUTES = 4;
|
|
17036
|
-
SPEC_VERSION_SUPPORTS_COMPRESSION = 5;
|
|
17037
|
-
SPEC_VERSION_CURRENT = SPEC_VERSION_SUPPORTS_COMPRESSION;
|
|
17038
|
-
__name(isLegacySpecVersion, "isLegacySpecVersion");
|
|
17039
|
-
}
|
|
17040
|
-
});
|
|
17041
|
-
|
|
17042
16884
|
// ../world/dist/steps.js
|
|
17043
|
-
var StepStatusSchema, StepSchema;
|
|
16885
|
+
var StepStatusSchema, StepSchema, TerminalStepStatusSchema, TERMINAL_STEP_STATUSES;
|
|
17044
16886
|
var init_steps = __esm({
|
|
17045
16887
|
"../world/dist/steps.js"() {
|
|
17046
16888
|
"use strict";
|
|
@@ -17104,6 +16946,342 @@ var init_steps = __esm({
|
|
|
17104
16946
|
// Optional in database for backwards compatibility, defaults to 1 (legacy) when reading
|
|
17105
16947
|
specVersion: external_exports.number().optional()
|
|
17106
16948
|
});
|
|
16949
|
+
TerminalStepStatusSchema = StepStatusSchema.extract([
|
|
16950
|
+
"completed",
|
|
16951
|
+
"failed",
|
|
16952
|
+
"cancelled"
|
|
16953
|
+
]);
|
|
16954
|
+
TERMINAL_STEP_STATUSES = TerminalStepStatusSchema.options;
|
|
16955
|
+
}
|
|
16956
|
+
});
|
|
16957
|
+
|
|
16958
|
+
// ../world/dist/waits.js
|
|
16959
|
+
var WaitStatusSchema, WaitSchema;
|
|
16960
|
+
var init_waits = __esm({
|
|
16961
|
+
"../world/dist/waits.js"() {
|
|
16962
|
+
"use strict";
|
|
16963
|
+
init_zod();
|
|
16964
|
+
WaitStatusSchema = external_exports.enum([
|
|
16965
|
+
"waiting",
|
|
16966
|
+
"completed"
|
|
16967
|
+
]);
|
|
16968
|
+
WaitSchema = external_exports.object({
|
|
16969
|
+
waitId: external_exports.string(),
|
|
16970
|
+
runId: external_exports.string(),
|
|
16971
|
+
status: WaitStatusSchema,
|
|
16972
|
+
resumeAt: external_exports.coerce.date().optional(),
|
|
16973
|
+
completedAt: external_exports.coerce.date().optional(),
|
|
16974
|
+
createdAt: external_exports.coerce.date(),
|
|
16975
|
+
updatedAt: external_exports.coerce.date(),
|
|
16976
|
+
specVersion: external_exports.number().optional()
|
|
16977
|
+
});
|
|
16978
|
+
}
|
|
16979
|
+
});
|
|
16980
|
+
|
|
16981
|
+
// ../world/dist/analytics.js
|
|
16982
|
+
var NullableDateSchema, NullableStringSchema, NullableBooleanSchema, AnalyticsRunSchema, AnalyticsStepSchema, AnalyticsEventSchema, AnalyticsHookSchema, AnalyticsWaitSchema;
|
|
16983
|
+
var init_analytics = __esm({
|
|
16984
|
+
"../world/dist/analytics.js"() {
|
|
16985
|
+
"use strict";
|
|
16986
|
+
init_zod();
|
|
16987
|
+
init_events();
|
|
16988
|
+
init_runs();
|
|
16989
|
+
init_steps();
|
|
16990
|
+
init_waits();
|
|
16991
|
+
NullableDateSchema = external_exports.coerce.date().nullable().optional();
|
|
16992
|
+
NullableStringSchema = external_exports.string().nullable().optional();
|
|
16993
|
+
NullableBooleanSchema = external_exports.boolean().nullable().optional();
|
|
16994
|
+
AnalyticsRunSchema = external_exports.object({
|
|
16995
|
+
runId: external_exports.string(),
|
|
16996
|
+
status: WorkflowRunStatusSchema,
|
|
16997
|
+
deploymentId: external_exports.string(),
|
|
16998
|
+
workflowName: external_exports.string(),
|
|
16999
|
+
specVersion: external_exports.coerce.number().optional(),
|
|
17000
|
+
attributes: external_exports.record(external_exports.string(), external_exports.string()).default({}),
|
|
17001
|
+
createdAt: external_exports.coerce.date(),
|
|
17002
|
+
updatedAt: external_exports.coerce.date(),
|
|
17003
|
+
startedAt: NullableDateSchema,
|
|
17004
|
+
completedAt: NullableDateSchema,
|
|
17005
|
+
errorCode: NullableStringSchema,
|
|
17006
|
+
workflowCoreVersion: NullableStringSchema,
|
|
17007
|
+
workflowEncryptionEnabled: NullableBooleanSchema
|
|
17008
|
+
});
|
|
17009
|
+
AnalyticsStepSchema = external_exports.object({
|
|
17010
|
+
runId: external_exports.string(),
|
|
17011
|
+
stepId: external_exports.string(),
|
|
17012
|
+
stepName: NullableStringSchema,
|
|
17013
|
+
status: StepStatusSchema,
|
|
17014
|
+
attempt: external_exports.number().optional(),
|
|
17015
|
+
createdAt: external_exports.coerce.date(),
|
|
17016
|
+
updatedAt: external_exports.coerce.date(),
|
|
17017
|
+
startedAt: NullableDateSchema,
|
|
17018
|
+
completedAt: NullableDateSchema,
|
|
17019
|
+
retryAfter: NullableDateSchema,
|
|
17020
|
+
errorCode: NullableStringSchema,
|
|
17021
|
+
workflowCoreVersion: NullableStringSchema,
|
|
17022
|
+
workflowEncryptionEnabled: NullableBooleanSchema
|
|
17023
|
+
});
|
|
17024
|
+
AnalyticsEventSchema = external_exports.object({
|
|
17025
|
+
runId: external_exports.string(),
|
|
17026
|
+
eventId: external_exports.string(),
|
|
17027
|
+
eventType: EventTypeSchema,
|
|
17028
|
+
correlationId: NullableStringSchema,
|
|
17029
|
+
entityId: NullableStringSchema,
|
|
17030
|
+
stepName: NullableStringSchema,
|
|
17031
|
+
workflowName: external_exports.string(),
|
|
17032
|
+
deploymentId: external_exports.string(),
|
|
17033
|
+
specVersion: external_exports.coerce.number().optional(),
|
|
17034
|
+
runCreatedAt: external_exports.coerce.date(),
|
|
17035
|
+
createdAt: external_exports.coerce.date(),
|
|
17036
|
+
region: NullableStringSchema,
|
|
17037
|
+
vercelId: NullableStringSchema,
|
|
17038
|
+
requestId: NullableStringSchema,
|
|
17039
|
+
resumeAt: NullableDateSchema,
|
|
17040
|
+
retryAfter: NullableDateSchema,
|
|
17041
|
+
errorCode: NullableStringSchema,
|
|
17042
|
+
workflowCoreVersion: NullableStringSchema,
|
|
17043
|
+
isWebhook: NullableBooleanSchema,
|
|
17044
|
+
isSystem: NullableBooleanSchema,
|
|
17045
|
+
workflowEncryptionEnabled: NullableBooleanSchema
|
|
17046
|
+
});
|
|
17047
|
+
AnalyticsHookSchema = external_exports.object({
|
|
17048
|
+
runId: external_exports.string(),
|
|
17049
|
+
hookId: external_exports.string(),
|
|
17050
|
+
status: external_exports.enum([
|
|
17051
|
+
"created",
|
|
17052
|
+
"received",
|
|
17053
|
+
"disposed",
|
|
17054
|
+
"conflict"
|
|
17055
|
+
]),
|
|
17056
|
+
createdAt: external_exports.coerce.date(),
|
|
17057
|
+
updatedAt: external_exports.coerce.date(),
|
|
17058
|
+
receivedAt: NullableDateSchema,
|
|
17059
|
+
disposedAt: NullableDateSchema,
|
|
17060
|
+
isWebhook: NullableBooleanSchema,
|
|
17061
|
+
isSystem: NullableBooleanSchema,
|
|
17062
|
+
workflowCoreVersion: NullableStringSchema,
|
|
17063
|
+
workflowEncryptionEnabled: NullableBooleanSchema
|
|
17064
|
+
});
|
|
17065
|
+
AnalyticsWaitSchema = external_exports.object({
|
|
17066
|
+
runId: external_exports.string(),
|
|
17067
|
+
waitId: external_exports.string(),
|
|
17068
|
+
status: WaitStatusSchema,
|
|
17069
|
+
resumeAt: NullableDateSchema,
|
|
17070
|
+
createdAt: external_exports.coerce.date(),
|
|
17071
|
+
updatedAt: external_exports.coerce.date(),
|
|
17072
|
+
completedAt: NullableDateSchema,
|
|
17073
|
+
workflowCoreVersion: NullableStringSchema,
|
|
17074
|
+
workflowEncryptionEnabled: NullableBooleanSchema
|
|
17075
|
+
});
|
|
17076
|
+
}
|
|
17077
|
+
});
|
|
17078
|
+
|
|
17079
|
+
// ../world/dist/env-config.js
|
|
17080
|
+
function warnOnce(key, message) {
|
|
17081
|
+
if (warnedEnvValues.has(key)) return;
|
|
17082
|
+
warnedEnvValues.add(key);
|
|
17083
|
+
console.warn(`[workflow] ${message}`);
|
|
17084
|
+
}
|
|
17085
|
+
function envNumber(name, fallback, options = {}) {
|
|
17086
|
+
const raw = process.env[name];
|
|
17087
|
+
if (raw === void 0 || raw === "") return fallback;
|
|
17088
|
+
const { min = 0, max, integer: integer2 = false } = options;
|
|
17089
|
+
const parsed = Number(raw);
|
|
17090
|
+
if (!Number.isFinite(parsed) || integer2 && !Number.isInteger(parsed)) {
|
|
17091
|
+
warnOnce(`${name}=${raw}`, `Ignoring ${name}: not a ${integer2 ? "finite integer" : "finite number"}; using default ${fallback}`);
|
|
17092
|
+
return fallback;
|
|
17093
|
+
}
|
|
17094
|
+
if (parsed < min) {
|
|
17095
|
+
warnOnce(`${name}=${raw}`, `${name} below minimum ${min}; clamped`);
|
|
17096
|
+
return min;
|
|
17097
|
+
}
|
|
17098
|
+
if (max !== void 0 && parsed > max) {
|
|
17099
|
+
warnOnce(`${name}=${raw}`, `${name} above maximum ${max}; clamped`);
|
|
17100
|
+
return max;
|
|
17101
|
+
}
|
|
17102
|
+
return parsed;
|
|
17103
|
+
}
|
|
17104
|
+
var warnedEnvValues;
|
|
17105
|
+
var init_env_config = __esm({
|
|
17106
|
+
"../world/dist/env-config.js"() {
|
|
17107
|
+
"use strict";
|
|
17108
|
+
warnedEnvValues = /* @__PURE__ */ new Set();
|
|
17109
|
+
__name(warnOnce, "warnOnce");
|
|
17110
|
+
__name(envNumber, "envNumber");
|
|
17111
|
+
}
|
|
17112
|
+
});
|
|
17113
|
+
|
|
17114
|
+
// ../world/dist/hooks.js
|
|
17115
|
+
var HookSchema;
|
|
17116
|
+
var init_hooks = __esm({
|
|
17117
|
+
"../world/dist/hooks.js"() {
|
|
17118
|
+
"use strict";
|
|
17119
|
+
init_zod();
|
|
17120
|
+
init_serialization();
|
|
17121
|
+
HookSchema = external_exports.object({
|
|
17122
|
+
runId: external_exports.string(),
|
|
17123
|
+
hookId: external_exports.string(),
|
|
17124
|
+
token: external_exports.string(),
|
|
17125
|
+
ownerId: external_exports.string(),
|
|
17126
|
+
projectId: external_exports.string(),
|
|
17127
|
+
environment: external_exports.string(),
|
|
17128
|
+
metadata: SerializedDataSchema.optional(),
|
|
17129
|
+
createdAt: external_exports.coerce.date(),
|
|
17130
|
+
// Optional in database for backwards compatibility, defaults to 1 (legacy) when reading
|
|
17131
|
+
specVersion: external_exports.number().optional(),
|
|
17132
|
+
isWebhook: external_exports.boolean().optional(),
|
|
17133
|
+
isSystem: external_exports.boolean().optional()
|
|
17134
|
+
});
|
|
17135
|
+
}
|
|
17136
|
+
});
|
|
17137
|
+
|
|
17138
|
+
// ../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/classic/index.js
|
|
17139
|
+
var init_classic = __esm({
|
|
17140
|
+
"../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/classic/index.js"() {
|
|
17141
|
+
"use strict";
|
|
17142
|
+
init_external();
|
|
17143
|
+
init_external();
|
|
17144
|
+
}
|
|
17145
|
+
});
|
|
17146
|
+
|
|
17147
|
+
// ../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/index.js
|
|
17148
|
+
var init_v4 = __esm({
|
|
17149
|
+
"../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/index.js"() {
|
|
17150
|
+
"use strict";
|
|
17151
|
+
init_classic();
|
|
17152
|
+
init_classic();
|
|
17153
|
+
}
|
|
17154
|
+
});
|
|
17155
|
+
|
|
17156
|
+
// ../world/dist/queue.js
|
|
17157
|
+
function resolveQueueNamespace(namespace) {
|
|
17158
|
+
return namespace ?? process.env.WORKFLOW_QUEUE_NAMESPACE ?? void 0;
|
|
17159
|
+
}
|
|
17160
|
+
function getQueueTopicPrefix(kind, namespace) {
|
|
17161
|
+
if (namespace !== void 0) {
|
|
17162
|
+
QueueNamespace.parse(namespace);
|
|
17163
|
+
return `__${namespace}_wkf_${kind}_`;
|
|
17164
|
+
}
|
|
17165
|
+
return `__wkf_${kind}_`;
|
|
17166
|
+
}
|
|
17167
|
+
var QueuePrefix, ValidQueueName, QueueNamespace, MessageId, TraceCarrierSchema, RunInputSchema, WorkflowInvokePayloadSchema, StepInvokePayloadSchema, HealthCheckPayloadSchema, QueuePayloadSchema;
|
|
17168
|
+
var init_queue = __esm({
|
|
17169
|
+
"../world/dist/queue.js"() {
|
|
17170
|
+
"use strict";
|
|
17171
|
+
init_v4();
|
|
17172
|
+
QueuePrefix = external_exports.string().regex(/^__(?:[a-z][a-z0-9]*_)?wkf_(?:workflow|step)_$/, "Must match __wkf_{workflow|step}_ or __{namespace}_wkf_{workflow|step}_");
|
|
17173
|
+
ValidQueueName = external_exports.string().regex(/^__(?:[a-z][a-z0-9]*_)?wkf_(?:workflow|step)_.+$/, "Must be a valid queue name with a recognized prefix");
|
|
17174
|
+
QueueNamespace = external_exports.string().regex(/^[a-z][a-z0-9]*$/, "Must be lowercase alphanumeric, starting with a letter");
|
|
17175
|
+
__name(resolveQueueNamespace, "resolveQueueNamespace");
|
|
17176
|
+
__name(getQueueTopicPrefix, "getQueueTopicPrefix");
|
|
17177
|
+
MessageId = external_exports.string().brand().describe("A stored queue message ID");
|
|
17178
|
+
TraceCarrierSchema = external_exports.record(external_exports.string(), external_exports.string());
|
|
17179
|
+
RunInputSchema = external_exports.object({
|
|
17180
|
+
input: external_exports.unknown(),
|
|
17181
|
+
deploymentId: external_exports.string(),
|
|
17182
|
+
workflowName: external_exports.string(),
|
|
17183
|
+
specVersion: external_exports.number(),
|
|
17184
|
+
executionContext: external_exports.record(external_exports.string(), external_exports.any()).optional(),
|
|
17185
|
+
/** Initial plaintext run attributes, for resilient run creation. */
|
|
17186
|
+
attributes: external_exports.record(external_exports.string(), external_exports.string()).optional(),
|
|
17187
|
+
/**
|
|
17188
|
+
* Permits reserved `$`-prefixed keys in `attributes`, mirrored from the
|
|
17189
|
+
* `start()` option so resilient run creation validates the same way as
|
|
17190
|
+
* the original `run_created` attempt.
|
|
17191
|
+
*/
|
|
17192
|
+
allowReservedAttributes: external_exports.literal(true).optional()
|
|
17193
|
+
});
|
|
17194
|
+
WorkflowInvokePayloadSchema = external_exports.object({
|
|
17195
|
+
runId: external_exports.string(),
|
|
17196
|
+
traceCarrier: TraceCarrierSchema.optional(),
|
|
17197
|
+
requestedAt: external_exports.coerce.date().optional(),
|
|
17198
|
+
/** Consecutive replay divergences in this recovery chain and latest position. */
|
|
17199
|
+
replayDivergence: external_exports.object({
|
|
17200
|
+
eventId: external_exports.string(),
|
|
17201
|
+
count: external_exports.number().int().positive()
|
|
17202
|
+
}).optional(),
|
|
17203
|
+
/** Number of times this message has been re-enqueued due to server errors (5xx) */
|
|
17204
|
+
serverErrorRetryCount: external_exports.number().int().optional(),
|
|
17205
|
+
/** Step ID for inline step execution in combined handler. If provided, the flow execution
|
|
17206
|
+
* will jump directly to execute the step with the given ID before doing an event replay. */
|
|
17207
|
+
stepId: external_exports.string().optional(),
|
|
17208
|
+
/** Step name, sent alongside stepId to avoid loading the event log just to resolve the name. */
|
|
17209
|
+
stepName: external_exports.string().optional(),
|
|
17210
|
+
/** Run creation data, only present on the first queue delivery from start() */
|
|
17211
|
+
runInput: RunInputSchema.optional()
|
|
17212
|
+
});
|
|
17213
|
+
StepInvokePayloadSchema = external_exports.object({
|
|
17214
|
+
workflowName: external_exports.string(),
|
|
17215
|
+
workflowRunId: external_exports.string(),
|
|
17216
|
+
workflowStartedAt: external_exports.number(),
|
|
17217
|
+
stepId: external_exports.string(),
|
|
17218
|
+
traceCarrier: TraceCarrierSchema.optional(),
|
|
17219
|
+
requestedAt: external_exports.coerce.date().optional()
|
|
17220
|
+
});
|
|
17221
|
+
HealthCheckPayloadSchema = external_exports.object({
|
|
17222
|
+
__healthCheck: external_exports.literal(true),
|
|
17223
|
+
correlationId: external_exports.string()
|
|
17224
|
+
});
|
|
17225
|
+
QueuePayloadSchema = external_exports.union([
|
|
17226
|
+
WorkflowInvokePayloadSchema,
|
|
17227
|
+
StepInvokePayloadSchema,
|
|
17228
|
+
HealthCheckPayloadSchema
|
|
17229
|
+
]);
|
|
17230
|
+
}
|
|
17231
|
+
});
|
|
17232
|
+
|
|
17233
|
+
// ../world/dist/recovery.js
|
|
17234
|
+
var init_recovery = __esm({
|
|
17235
|
+
"../world/dist/recovery.js"() {
|
|
17236
|
+
"use strict";
|
|
17237
|
+
}
|
|
17238
|
+
});
|
|
17239
|
+
|
|
17240
|
+
// ../world/dist/shared.js
|
|
17241
|
+
var zodJsonSchema, PageInfoSchema, StructuredErrorSchema;
|
|
17242
|
+
var init_shared = __esm({
|
|
17243
|
+
"../world/dist/shared.js"() {
|
|
17244
|
+
"use strict";
|
|
17245
|
+
init_zod();
|
|
17246
|
+
zodJsonSchema = external_exports.lazy(() => {
|
|
17247
|
+
return external_exports.union([
|
|
17248
|
+
external_exports.string(),
|
|
17249
|
+
external_exports.number(),
|
|
17250
|
+
external_exports.boolean(),
|
|
17251
|
+
external_exports.null(),
|
|
17252
|
+
external_exports.array(zodJsonSchema),
|
|
17253
|
+
external_exports.record(external_exports.string(), zodJsonSchema)
|
|
17254
|
+
]);
|
|
17255
|
+
});
|
|
17256
|
+
PageInfoSchema = external_exports.object({
|
|
17257
|
+
currentLookbackDays: external_exports.number(),
|
|
17258
|
+
maxLookbackDays: external_exports.number(),
|
|
17259
|
+
currentWindowStart: external_exports.coerce.date(),
|
|
17260
|
+
maxWindowStart: external_exports.coerce.date(),
|
|
17261
|
+
upgradeAvailable: external_exports.boolean()
|
|
17262
|
+
});
|
|
17263
|
+
StructuredErrorSchema = external_exports.object({
|
|
17264
|
+
message: external_exports.string(),
|
|
17265
|
+
stack: external_exports.string().optional(),
|
|
17266
|
+
code: external_exports.string().optional()
|
|
17267
|
+
});
|
|
17268
|
+
}
|
|
17269
|
+
});
|
|
17270
|
+
|
|
17271
|
+
// ../world/dist/spec-version.js
|
|
17272
|
+
function isLegacySpecVersion(v) {
|
|
17273
|
+
return v === void 0 || v === null || v <= SPEC_VERSION_LEGACY;
|
|
17274
|
+
}
|
|
17275
|
+
var SPEC_VERSION_LEGACY, SPEC_VERSION_SUPPORTS_CBOR_QUEUE_TRANSPORT, SPEC_VERSION_SUPPORTS_ATTRIBUTES, SPEC_VERSION_SUPPORTS_COMPRESSION, SPEC_VERSION_CURRENT;
|
|
17276
|
+
var init_spec_version = __esm({
|
|
17277
|
+
"../world/dist/spec-version.js"() {
|
|
17278
|
+
"use strict";
|
|
17279
|
+
SPEC_VERSION_LEGACY = 1;
|
|
17280
|
+
SPEC_VERSION_SUPPORTS_CBOR_QUEUE_TRANSPORT = 3;
|
|
17281
|
+
SPEC_VERSION_SUPPORTS_ATTRIBUTES = 4;
|
|
17282
|
+
SPEC_VERSION_SUPPORTS_COMPRESSION = 5;
|
|
17283
|
+
SPEC_VERSION_CURRENT = SPEC_VERSION_SUPPORTS_COMPRESSION;
|
|
17284
|
+
__name(isLegacySpecVersion, "isLegacySpecVersion");
|
|
17107
17285
|
}
|
|
17108
17286
|
});
|
|
17109
17287
|
|
|
@@ -17265,34 +17443,13 @@ var init_ulid = __esm({
|
|
|
17265
17443
|
}
|
|
17266
17444
|
});
|
|
17267
17445
|
|
|
17268
|
-
// ../world/dist/waits.js
|
|
17269
|
-
var WaitStatusSchema, WaitSchema;
|
|
17270
|
-
var init_waits = __esm({
|
|
17271
|
-
"../world/dist/waits.js"() {
|
|
17272
|
-
"use strict";
|
|
17273
|
-
init_zod();
|
|
17274
|
-
WaitStatusSchema = external_exports.enum([
|
|
17275
|
-
"waiting",
|
|
17276
|
-
"completed"
|
|
17277
|
-
]);
|
|
17278
|
-
WaitSchema = external_exports.object({
|
|
17279
|
-
waitId: external_exports.string(),
|
|
17280
|
-
runId: external_exports.string(),
|
|
17281
|
-
status: WaitStatusSchema,
|
|
17282
|
-
resumeAt: external_exports.coerce.date().optional(),
|
|
17283
|
-
completedAt: external_exports.coerce.date().optional(),
|
|
17284
|
-
createdAt: external_exports.coerce.date(),
|
|
17285
|
-
updatedAt: external_exports.coerce.date(),
|
|
17286
|
-
specVersion: external_exports.number().optional()
|
|
17287
|
-
});
|
|
17288
|
-
}
|
|
17289
|
-
});
|
|
17290
|
-
|
|
17291
17446
|
// ../world/dist/index.js
|
|
17292
17447
|
var init_dist4 = __esm({
|
|
17293
17448
|
"../world/dist/index.js"() {
|
|
17294
17449
|
"use strict";
|
|
17450
|
+
init_analytics();
|
|
17295
17451
|
init_attributes();
|
|
17452
|
+
init_env_config();
|
|
17296
17453
|
init_events();
|
|
17297
17454
|
init_hooks();
|
|
17298
17455
|
init_queue();
|
|
@@ -18082,7 +18239,7 @@ function pollWritableLock(writable, state) {
|
|
|
18082
18239
|
clearInterval(intervalId);
|
|
18083
18240
|
state.writablePollingInterval = void 0;
|
|
18084
18241
|
}
|
|
18085
|
-
},
|
|
18242
|
+
}, getLockPollIntervalMs());
|
|
18086
18243
|
state.writablePollingInterval = intervalId;
|
|
18087
18244
|
}
|
|
18088
18245
|
function pollReadableLock(readable, state) {
|
|
@@ -18101,7 +18258,7 @@ function pollReadableLock(readable, state) {
|
|
|
18101
18258
|
clearInterval(intervalId);
|
|
18102
18259
|
state.readablePollingInterval = void 0;
|
|
18103
18260
|
}
|
|
18104
|
-
},
|
|
18261
|
+
}, getLockPollIntervalMs());
|
|
18105
18262
|
state.readablePollingInterval = intervalId;
|
|
18106
18263
|
}
|
|
18107
18264
|
async function flushablePipe(source, sink, state) {
|
|
@@ -18153,13 +18310,18 @@ async function flushablePipe(source, sink, state) {
|
|
|
18153
18310
|
writer.releaseLock();
|
|
18154
18311
|
}
|
|
18155
18312
|
}
|
|
18156
|
-
var LOCK_POLL_INTERVAL_MS;
|
|
18313
|
+
var LOCK_POLL_INTERVAL_MS, getLockPollIntervalMs;
|
|
18157
18314
|
var init_flushable_stream = __esm({
|
|
18158
18315
|
"../core/dist/flushable-stream.js"() {
|
|
18159
18316
|
"use strict";
|
|
18160
18317
|
init_dist2();
|
|
18161
18318
|
init_dist();
|
|
18319
|
+
init_dist4();
|
|
18162
18320
|
LOCK_POLL_INTERVAL_MS = 10;
|
|
18321
|
+
getLockPollIntervalMs = /* @__PURE__ */ __name(() => envNumber("WORKFLOW_LOCK_POLL_INTERVAL_MS", LOCK_POLL_INTERVAL_MS, {
|
|
18322
|
+
integer: true,
|
|
18323
|
+
min: 1
|
|
18324
|
+
}), "getLockPollIntervalMs");
|
|
18163
18325
|
__name(createFlushableState, "createFlushableState");
|
|
18164
18326
|
__name(isWritableUnlockedNotClosed, "isWritableUnlockedNotClosed");
|
|
18165
18327
|
__name(isReadableUnlockedNotClosed, "isReadableUnlockedNotClosed");
|
|
@@ -18245,16 +18407,41 @@ var init_private = __esm({
|
|
|
18245
18407
|
}
|
|
18246
18408
|
});
|
|
18247
18409
|
|
|
18410
|
+
// ../core/dist/runtime/world-compatibility.js
|
|
18411
|
+
function assertWorldSupportsRuntimeProtocol(world) {
|
|
18412
|
+
if (world.specVersion === SPEC_VERSION_CURRENT) {
|
|
18413
|
+
return;
|
|
18414
|
+
}
|
|
18415
|
+
const supportedVersion = world.specVersion ?? "none";
|
|
18416
|
+
throw new WorkflowRuntimeError(`This Workflow runtime requires a World with matching spec version ${SPEC_VERSION_CURRENT}, but the configured World declares spec version ${supportedVersion}. Install a World package version compatible with the current Workflow runtime.`);
|
|
18417
|
+
}
|
|
18418
|
+
var init_world_compatibility = __esm({
|
|
18419
|
+
"../core/dist/runtime/world-compatibility.js"() {
|
|
18420
|
+
"use strict";
|
|
18421
|
+
init_dist2();
|
|
18422
|
+
init_dist4();
|
|
18423
|
+
__name(assertWorldSupportsRuntimeProtocol, "assertWorldSupportsRuntimeProtocol");
|
|
18424
|
+
}
|
|
18425
|
+
});
|
|
18426
|
+
|
|
18248
18427
|
// ../core/dist/runtime/get-world-lazy.js
|
|
18249
18428
|
async function getWorldLazy() {
|
|
18250
18429
|
const g = globalThis;
|
|
18251
|
-
if (g[WorldCacheKey])
|
|
18430
|
+
if (g[WorldCacheKey]) {
|
|
18431
|
+
assertWorldSupportsRuntimeProtocol(g[WorldCacheKey]);
|
|
18432
|
+
return g[WorldCacheKey];
|
|
18433
|
+
}
|
|
18252
18434
|
if (g[WorldCachePromiseKey]) {
|
|
18253
18435
|
g[WorldCacheKey] = await g[WorldCachePromiseKey];
|
|
18436
|
+
assertWorldSupportsRuntimeProtocol(g[WorldCacheKey]);
|
|
18254
18437
|
return g[WorldCacheKey];
|
|
18255
18438
|
}
|
|
18256
18439
|
const getWorldFn = g[GetWorldFnKey];
|
|
18257
|
-
if (getWorldFn)
|
|
18440
|
+
if (getWorldFn) {
|
|
18441
|
+
const world = await getWorldFn();
|
|
18442
|
+
assertWorldSupportsRuntimeProtocol(world);
|
|
18443
|
+
return world;
|
|
18444
|
+
}
|
|
18258
18445
|
const worldPath = [
|
|
18259
18446
|
"./world",
|
|
18260
18447
|
"js"
|
|
@@ -18266,6 +18453,7 @@ var WorldCacheKey, WorldCachePromiseKey, GetWorldFnKey;
|
|
|
18266
18453
|
var init_get_world_lazy = __esm({
|
|
18267
18454
|
"../core/dist/runtime/get-world-lazy.js"() {
|
|
18268
18455
|
"use strict";
|
|
18456
|
+
init_world_compatibility();
|
|
18269
18457
|
WorldCacheKey = /* @__PURE__ */ Symbol.for("@workflow/world//cache");
|
|
18270
18458
|
WorldCachePromiseKey = /* @__PURE__ */ Symbol.for("@workflow/world//cachePromise");
|
|
18271
18459
|
GetWorldFnKey = /* @__PURE__ */ Symbol.for("@workflow/world//getWorldFn");
|
|
@@ -21940,6 +22128,7 @@ var EventConsumerResult;
|
|
|
21940
22128
|
var init_events_consumer = __esm({
|
|
21941
22129
|
"../core/dist/events-consumer.js"() {
|
|
21942
22130
|
"use strict";
|
|
22131
|
+
init_dist4();
|
|
21943
22132
|
init_logger();
|
|
21944
22133
|
(function(EventConsumerResult2) {
|
|
21945
22134
|
EventConsumerResult2[EventConsumerResult2["Consumed"] = 0] = "Consumed";
|
|
@@ -24056,7 +24245,7 @@ var version2;
|
|
|
24056
24245
|
var init_version = __esm({
|
|
24057
24246
|
"../core/dist/version.js"() {
|
|
24058
24247
|
"use strict";
|
|
24059
|
-
version2 = "5.0.0-beta.
|
|
24248
|
+
version2 = "5.0.0-beta.27";
|
|
24060
24249
|
}
|
|
24061
24250
|
});
|
|
24062
24251
|
|
|
@@ -25791,14 +25980,16 @@ function createReconnectingFramedStream(runId, name, startIndex) {
|
|
|
25791
25980
|
currentStartIndex += consumedFrames;
|
|
25792
25981
|
consumedFrames = 0;
|
|
25793
25982
|
buffer2 = new Uint8Array(0);
|
|
25983
|
+
const maxReconnects = getFramedStreamMaxReconnects();
|
|
25984
|
+
const maxTotalReconnects = getFramedStreamMaxTotalReconnects();
|
|
25794
25985
|
for (; ; ) {
|
|
25795
25986
|
reconnectCount++;
|
|
25796
25987
|
totalReconnectCount++;
|
|
25797
|
-
if (reconnectCount >
|
|
25798
|
-
throw new Error(`Stream "${name}" exceeded maximum reconnection attempts (${
|
|
25988
|
+
if (reconnectCount > maxReconnects) {
|
|
25989
|
+
throw new Error(`Stream "${name}" exceeded maximum reconnection attempts (${maxReconnects})`);
|
|
25799
25990
|
}
|
|
25800
|
-
if (totalReconnectCount >
|
|
25801
|
-
throw new Error(`Stream "${name}" exceeded maximum total reconnection attempts (${
|
|
25991
|
+
if (totalReconnectCount > maxTotalReconnects) {
|
|
25992
|
+
throw new Error(`Stream "${name}" exceeded maximum total reconnection attempts (${maxTotalReconnects})`);
|
|
25802
25993
|
}
|
|
25803
25994
|
try {
|
|
25804
25995
|
await connect();
|
|
@@ -26691,11 +26882,12 @@ function getStreamAndRequestRevivers(allRevivers) {
|
|
|
26691
26882
|
}
|
|
26692
26883
|
return extra;
|
|
26693
26884
|
}
|
|
26694
|
-
var defaultUlid, FRAME_HEADER_SIZE, MAX_FRAME_SIZE, WorkflowServerReadableStream, FRAMED_STREAM_MAX_RECONNECTS, FRAMED_STREAM_MAX_TOTAL_RECONNECTS, STREAM_FLUSH_INTERVAL_MS, WorkflowServerWritableStream, STREAM_AND_REQUEST_KEYS;
|
|
26885
|
+
var defaultUlid, FRAME_HEADER_SIZE, MAX_FRAME_SIZE, WorkflowServerReadableStream, FRAMED_STREAM_MAX_RECONNECTS, getFramedStreamMaxReconnects, FRAMED_STREAM_MAX_TOTAL_RECONNECTS, getFramedStreamMaxTotalReconnects, STREAM_FLUSH_INTERVAL_MS, getStreamFlushIntervalMs, WorkflowServerWritableStream, STREAM_AND_REQUEST_KEYS;
|
|
26695
26886
|
var init_serialization2 = __esm({
|
|
26696
26887
|
"../core/dist/serialization.js"() {
|
|
26697
26888
|
"use strict";
|
|
26698
26889
|
init_dist2();
|
|
26890
|
+
init_dist4();
|
|
26699
26891
|
init_devalue();
|
|
26700
26892
|
init_node();
|
|
26701
26893
|
init_encryption();
|
|
@@ -26771,9 +26963,20 @@ var init_serialization2 = __esm({
|
|
|
26771
26963
|
}
|
|
26772
26964
|
};
|
|
26773
26965
|
FRAMED_STREAM_MAX_RECONNECTS = 50;
|
|
26966
|
+
getFramedStreamMaxReconnects = /* @__PURE__ */ __name(() => envNumber("WORKFLOW_FRAMED_STREAM_MAX_RECONNECTS", FRAMED_STREAM_MAX_RECONNECTS, {
|
|
26967
|
+
integer: true,
|
|
26968
|
+
min: 1
|
|
26969
|
+
}), "getFramedStreamMaxReconnects");
|
|
26774
26970
|
FRAMED_STREAM_MAX_TOTAL_RECONNECTS = 1e3;
|
|
26971
|
+
getFramedStreamMaxTotalReconnects = /* @__PURE__ */ __name(() => envNumber("WORKFLOW_FRAMED_STREAM_MAX_TOTAL_RECONNECTS", FRAMED_STREAM_MAX_TOTAL_RECONNECTS, {
|
|
26972
|
+
integer: true,
|
|
26973
|
+
min: 1
|
|
26974
|
+
}), "getFramedStreamMaxTotalReconnects");
|
|
26775
26975
|
__name(createReconnectingFramedStream, "createReconnectingFramedStream");
|
|
26776
26976
|
STREAM_FLUSH_INTERVAL_MS = 10;
|
|
26977
|
+
getStreamFlushIntervalMs = /* @__PURE__ */ __name(() => envNumber("WORKFLOW_STREAM_FLUSH_INTERVAL_MS", STREAM_FLUSH_INTERVAL_MS, {
|
|
26978
|
+
integer: true
|
|
26979
|
+
}), "getStreamFlushIntervalMs");
|
|
26777
26980
|
WorkflowServerWritableStream = class extends WritableStream {
|
|
26778
26981
|
static {
|
|
26779
26982
|
__name(this, "WorkflowServerWritableStream");
|
|
@@ -26819,7 +27022,7 @@ var init_serialization2 = __esm({
|
|
|
26819
27022
|
const chunksToFlush = buffer2.slice();
|
|
26820
27023
|
const world = await worldPromise;
|
|
26821
27024
|
if (resolvedFlushIntervalMs === void 0) {
|
|
26822
|
-
resolvedFlushIntervalMs = world.streamFlushIntervalMs ??
|
|
27025
|
+
resolvedFlushIntervalMs = world.streamFlushIntervalMs ?? getStreamFlushIntervalMs();
|
|
26823
27026
|
}
|
|
26824
27027
|
if (typeof world.streams.writeMulti === "function" && chunksToFlush.length > 1) {
|
|
26825
27028
|
await world.streams.writeMulti(runId, name, chunksToFlush);
|
|
@@ -26842,7 +27045,7 @@ var init_serialization2 = __esm({
|
|
|
26842
27045
|
}, (err) => {
|
|
26843
27046
|
for (const w of currentWaiters) w.reject(err);
|
|
26844
27047
|
});
|
|
26845
|
-
}, resolvedFlushIntervalMs ??
|
|
27048
|
+
}, resolvedFlushIntervalMs ?? getStreamFlushIntervalMs());
|
|
26846
27049
|
}, "scheduleFlush");
|
|
26847
27050
|
super({
|
|
26848
27051
|
async write(chunk) {
|
|
@@ -27110,6 +27313,7 @@ init_version();
|
|
|
27110
27313
|
init_get_world_lazy();
|
|
27111
27314
|
init_helpers();
|
|
27112
27315
|
init_wait_until();
|
|
27316
|
+
init_world_compatibility();
|
|
27113
27317
|
var CROSS_DEPLOYMENT_CAPABILITY_PROBE_TIMEOUT_MS = 2e3;
|
|
27114
27318
|
var ulid3 = monotonicFactory();
|
|
27115
27319
|
var hasWarnedLatestNoOp = false;
|
|
@@ -27137,7 +27341,8 @@ async function start(workflow, argsOrOptions, options) {
|
|
|
27137
27341
|
span?.setAttributes({
|
|
27138
27342
|
...WorkflowArgumentsCount(args.length)
|
|
27139
27343
|
});
|
|
27140
|
-
const world = opts
|
|
27344
|
+
const world = opts.world ?? await getWorldLazy();
|
|
27345
|
+
assertWorldSupportsRuntimeProtocol(world);
|
|
27141
27346
|
const currentDeploymentId = await world.getDeploymentId();
|
|
27142
27347
|
let deploymentId = opts.deploymentId ?? currentDeploymentId;
|
|
27143
27348
|
if (deploymentId === "latest") {
|
|
@@ -27173,7 +27378,7 @@ async function start(workflow, argsOrOptions, options) {
|
|
|
27173
27378
|
const ops = [];
|
|
27174
27379
|
const runId = `wrun_${ulid3()}`;
|
|
27175
27380
|
const traceCarrier = await serializeTraceCarrier();
|
|
27176
|
-
const specVersion = opts.specVersion ?? world.specVersion
|
|
27381
|
+
const specVersion = opts.specVersion ?? world.specVersion;
|
|
27177
27382
|
const v1Compat = isLegacySpecVersion(specVersion);
|
|
27178
27383
|
const allowReservedAttributes = opts.allowReservedAttributes === true;
|
|
27179
27384
|
let attributes;
|
|
@@ -27297,7 +27502,7 @@ __name(start, "start");
|
|
|
27297
27502
|
value: "start",
|
|
27298
27503
|
configurable: true
|
|
27299
27504
|
});
|
|
27300
|
-
})(start, "step//@workflow/core/runtime/start@5.0.0-beta.
|
|
27505
|
+
})(start, "step//@workflow/core/runtime/start@5.0.0-beta.27//start");
|
|
27301
27506
|
|
|
27302
27507
|
// ../core/dist/runtime/runs.js
|
|
27303
27508
|
async function wakeUpRun(world, runId, options) {
|
|
@@ -27624,7 +27829,7 @@ var Run = class _Run {
|
|
|
27624
27829
|
value: "wakeUp",
|
|
27625
27830
|
configurable: true
|
|
27626
27831
|
});
|
|
27627
|
-
})(Run.prototype["wakeUp"], "step//@workflow/core/runtime/run@5.0.0-beta.
|
|
27832
|
+
})(Run.prototype["wakeUp"], "step//@workflow/core/runtime/run@5.0.0-beta.27//Run#wakeUp");
|
|
27628
27833
|
(function(__wf_fn, __wf_id) {
|
|
27629
27834
|
var __wf_sym = /* @__PURE__ */ Symbol.for("@workflow/core//registeredSteps"), __wf_reg = globalThis[__wf_sym] || (globalThis[__wf_sym] = /* @__PURE__ */ new Map());
|
|
27630
27835
|
__wf_reg.set(__wf_id, __wf_fn);
|
|
@@ -27633,7 +27838,7 @@ var Run = class _Run {
|
|
|
27633
27838
|
value: "cancel",
|
|
27634
27839
|
configurable: true
|
|
27635
27840
|
});
|
|
27636
|
-
})(Run.prototype["cancel"], "step//@workflow/core/runtime/run@5.0.0-beta.
|
|
27841
|
+
})(Run.prototype["cancel"], "step//@workflow/core/runtime/run@5.0.0-beta.27//Run#cancel");
|
|
27637
27842
|
(function(__wf_fn, __wf_id) {
|
|
27638
27843
|
var __wf_sym = /* @__PURE__ */ Symbol.for("@workflow/core//registeredSteps"), __wf_reg = globalThis[__wf_sym] || (globalThis[__wf_sym] = /* @__PURE__ */ new Map());
|
|
27639
27844
|
__wf_reg.set(__wf_id, __wf_fn);
|
|
@@ -27642,7 +27847,7 @@ var Run = class _Run {
|
|
|
27642
27847
|
value: "getReadable",
|
|
27643
27848
|
configurable: true
|
|
27644
27849
|
});
|
|
27645
|
-
})(Run.prototype["getReadable"], "step//@workflow/core/runtime/run@5.0.0-beta.
|
|
27850
|
+
})(Run.prototype["getReadable"], "step//@workflow/core/runtime/run@5.0.0-beta.27//Run#getReadable");
|
|
27646
27851
|
(function(__wf_fn, __wf_id) {
|
|
27647
27852
|
var __wf_sym = /* @__PURE__ */ Symbol.for("@workflow/core//registeredSteps"), __wf_reg = globalThis[__wf_sym] || (globalThis[__wf_sym] = /* @__PURE__ */ new Map());
|
|
27648
27853
|
__wf_reg.set(__wf_id, __wf_fn);
|
|
@@ -27651,7 +27856,7 @@ var Run = class _Run {
|
|
|
27651
27856
|
value: "exists",
|
|
27652
27857
|
configurable: true
|
|
27653
27858
|
});
|
|
27654
|
-
})(Object.getOwnPropertyDescriptor(Run.prototype, "exists").get, "step//@workflow/core/runtime/run@5.0.0-beta.
|
|
27859
|
+
})(Object.getOwnPropertyDescriptor(Run.prototype, "exists").get, "step//@workflow/core/runtime/run@5.0.0-beta.27//Run#exists");
|
|
27655
27860
|
(function(__wf_fn, __wf_id) {
|
|
27656
27861
|
var __wf_sym = /* @__PURE__ */ Symbol.for("@workflow/core//registeredSteps"), __wf_reg = globalThis[__wf_sym] || (globalThis[__wf_sym] = /* @__PURE__ */ new Map());
|
|
27657
27862
|
__wf_reg.set(__wf_id, __wf_fn);
|
|
@@ -27660,7 +27865,7 @@ var Run = class _Run {
|
|
|
27660
27865
|
value: "status",
|
|
27661
27866
|
configurable: true
|
|
27662
27867
|
});
|
|
27663
|
-
})(Object.getOwnPropertyDescriptor(Run.prototype, "status").get, "step//@workflow/core/runtime/run@5.0.0-beta.
|
|
27868
|
+
})(Object.getOwnPropertyDescriptor(Run.prototype, "status").get, "step//@workflow/core/runtime/run@5.0.0-beta.27//Run#status");
|
|
27664
27869
|
(function(__wf_fn, __wf_id) {
|
|
27665
27870
|
var __wf_sym = /* @__PURE__ */ Symbol.for("@workflow/core//registeredSteps"), __wf_reg = globalThis[__wf_sym] || (globalThis[__wf_sym] = /* @__PURE__ */ new Map());
|
|
27666
27871
|
__wf_reg.set(__wf_id, __wf_fn);
|
|
@@ -27669,7 +27874,7 @@ var Run = class _Run {
|
|
|
27669
27874
|
value: "returnValue",
|
|
27670
27875
|
configurable: true
|
|
27671
27876
|
});
|
|
27672
|
-
})(Object.getOwnPropertyDescriptor(Run.prototype, "returnValue").get, "step//@workflow/core/runtime/run@5.0.0-beta.
|
|
27877
|
+
})(Object.getOwnPropertyDescriptor(Run.prototype, "returnValue").get, "step//@workflow/core/runtime/run@5.0.0-beta.27//Run#returnValue");
|
|
27673
27878
|
(function(__wf_fn, __wf_id) {
|
|
27674
27879
|
var __wf_sym = /* @__PURE__ */ Symbol.for("@workflow/core//registeredSteps"), __wf_reg = globalThis[__wf_sym] || (globalThis[__wf_sym] = /* @__PURE__ */ new Map());
|
|
27675
27880
|
__wf_reg.set(__wf_id, __wf_fn);
|
|
@@ -27678,7 +27883,7 @@ var Run = class _Run {
|
|
|
27678
27883
|
value: "workflowName",
|
|
27679
27884
|
configurable: true
|
|
27680
27885
|
});
|
|
27681
|
-
})(Object.getOwnPropertyDescriptor(Run.prototype, "workflowName").get, "step//@workflow/core/runtime/run@5.0.0-beta.
|
|
27886
|
+
})(Object.getOwnPropertyDescriptor(Run.prototype, "workflowName").get, "step//@workflow/core/runtime/run@5.0.0-beta.27//Run#workflowName");
|
|
27682
27887
|
(function(__wf_fn, __wf_id) {
|
|
27683
27888
|
var __wf_sym = /* @__PURE__ */ Symbol.for("@workflow/core//registeredSteps"), __wf_reg = globalThis[__wf_sym] || (globalThis[__wf_sym] = /* @__PURE__ */ new Map());
|
|
27684
27889
|
__wf_reg.set(__wf_id, __wf_fn);
|
|
@@ -27687,7 +27892,7 @@ var Run = class _Run {
|
|
|
27687
27892
|
value: "createdAt",
|
|
27688
27893
|
configurable: true
|
|
27689
27894
|
});
|
|
27690
|
-
})(Object.getOwnPropertyDescriptor(Run.prototype, "createdAt").get, "step//@workflow/core/runtime/run@5.0.0-beta.
|
|
27895
|
+
})(Object.getOwnPropertyDescriptor(Run.prototype, "createdAt").get, "step//@workflow/core/runtime/run@5.0.0-beta.27//Run#createdAt");
|
|
27691
27896
|
(function(__wf_fn, __wf_id) {
|
|
27692
27897
|
var __wf_sym = /* @__PURE__ */ Symbol.for("@workflow/core//registeredSteps"), __wf_reg = globalThis[__wf_sym] || (globalThis[__wf_sym] = /* @__PURE__ */ new Map());
|
|
27693
27898
|
__wf_reg.set(__wf_id, __wf_fn);
|
|
@@ -27696,7 +27901,7 @@ var Run = class _Run {
|
|
|
27696
27901
|
value: "startedAt",
|
|
27697
27902
|
configurable: true
|
|
27698
27903
|
});
|
|
27699
|
-
})(Object.getOwnPropertyDescriptor(Run.prototype, "startedAt").get, "step//@workflow/core/runtime/run@5.0.0-beta.
|
|
27904
|
+
})(Object.getOwnPropertyDescriptor(Run.prototype, "startedAt").get, "step//@workflow/core/runtime/run@5.0.0-beta.27//Run#startedAt");
|
|
27700
27905
|
(function(__wf_fn, __wf_id) {
|
|
27701
27906
|
var __wf_sym = /* @__PURE__ */ Symbol.for("@workflow/core//registeredSteps"), __wf_reg = globalThis[__wf_sym] || (globalThis[__wf_sym] = /* @__PURE__ */ new Map());
|
|
27702
27907
|
__wf_reg.set(__wf_id, __wf_fn);
|
|
@@ -27705,7 +27910,7 @@ var Run = class _Run {
|
|
|
27705
27910
|
value: "completedAt",
|
|
27706
27911
|
configurable: true
|
|
27707
27912
|
});
|
|
27708
|
-
})(Object.getOwnPropertyDescriptor(Run.prototype, "completedAt").get, "step//@workflow/core/runtime/run@5.0.0-beta.
|
|
27913
|
+
})(Object.getOwnPropertyDescriptor(Run.prototype, "completedAt").get, "step//@workflow/core/runtime/run@5.0.0-beta.27//Run#completedAt");
|
|
27709
27914
|
(function(__wf_cls, __wf_id) {
|
|
27710
27915
|
var __wf_sym = /* @__PURE__ */ Symbol.for("workflow-class-registry"), __wf_reg = globalThis[__wf_sym] || (globalThis[__wf_sym] = /* @__PURE__ */ new Map());
|
|
27711
27916
|
__wf_reg.set(__wf_id, __wf_cls);
|
|
@@ -27715,7 +27920,7 @@ var Run = class _Run {
|
|
|
27715
27920
|
enumerable: false,
|
|
27716
27921
|
configurable: false
|
|
27717
27922
|
});
|
|
27718
|
-
})(Run, "class//@workflow/core/runtime/run@5.0.0-beta.
|
|
27923
|
+
})(Run, "class//@workflow/core/runtime/run@5.0.0-beta.27//Run");
|
|
27719
27924
|
|
|
27720
27925
|
// ../workflow/dist/stdlib.js
|
|
27721
27926
|
async function fetch2(...args) {
|