@cloudflare/vitest-plugin 1.2.7 → 1.3.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.
@@ -1,4 +1,4 @@
1
- import { a as __toESM, c as __toESM$1, i as __require, n as __export, o as __commonJS$2, r as __name$3, s as __require$1, t as __commonJS$1 } from "./chunk-Q72B4Q5Z-izl5Qmnx.mjs";
1
+ import { a as __toESM, i as __require, n as __export, r as __name$3, t as __commonJS$1 } from "./chunk-U6NEESU5-BzWFpRaS.mjs";
2
2
  import * as nodeModule from "node:module";
3
3
  import { createRequire } from "node:module";
4
4
  import assert from "node:assert";
@@ -27,7 +27,35 @@ import P from "node:readline";
27
27
  import * as z$1 from "zod";
28
28
  import { z } from "zod";
29
29
 
30
- //#region ../workers-utils/dist/chunk-OWXQB7GP.mjs
30
+ //#region rolldown:runtime
31
+ var __create = Object.create;
32
+ var __defProp$3 = Object.defineProperty;
33
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
34
+ var __getOwnPropNames$1 = Object.getOwnPropertyNames;
35
+ var __getProtoOf = Object.getPrototypeOf;
36
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
37
+ var __commonJS$2 = (cb, mod) => function() {
38
+ return mod || (0, cb[__getOwnPropNames$1(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
39
+ };
40
+ var __copyProps = (to, from, except, desc) => {
41
+ if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames$1(from), i = 0, n = keys.length, key; i < n; i++) {
42
+ key = keys[i];
43
+ if (!__hasOwnProp.call(to, key) && key !== except) __defProp$3(to, key, {
44
+ get: ((k) => from[k]).bind(null, key),
45
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
46
+ });
47
+ }
48
+ return to;
49
+ };
50
+ var __toESM$1 = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp$3(target, "default", {
51
+ value: mod,
52
+ enumerable: true
53
+ }) : target, mod));
54
+ var __require$1 = /* @__PURE__ */ createRequire(import.meta.url);
55
+
56
+ //#endregion
57
+ //#region ../workers-utils/dist/chunk-PWC7WAOU.mjs
58
+ createRequire(import.meta.url || (typeof __filename === "string" ? __filename : "/"));
31
59
  var external_exports = {};
32
60
  __export(external_exports, {
33
61
  $brand: () => $brand,
@@ -13751,7 +13779,8 @@ function formatZodError(error51) {
13751
13779
  __name$3(formatZodError, "formatZodError");
13752
13780
 
13753
13781
  //#endregion
13754
- //#region ../workers-utils/dist/chunk-MCNIGVAF.mjs
13782
+ //#region ../workers-utils/dist/chunk-M3RITKR3.mjs
13783
+ createRequire(import.meta.url || (typeof __filename === "string" ? __filename : "/"));
13755
13784
  function dedent$1(templ) {
13756
13785
  var values = [];
13757
13786
  for (var _i = 1; _i < arguments.length; _i++) values[_i - 1] = arguments[_i];
@@ -13788,7 +13817,8 @@ __name$3(dedent$1, "dedent");
13788
13817
  var esm_default$1 = dedent$1;
13789
13818
 
13790
13819
  //#endregion
13791
- //#region ../workers-utils/dist/chunk-WO2IAW6M.mjs
13820
+ //#region ../workers-utils/dist/chunk-OWPFSLY6.mjs
13821
+ createRequire(import.meta.url || (typeof __filename === "string" ? __filename : "/"));
13792
13822
  var UserError$1 = class extends Error {
13793
13823
  static {
13794
13824
  __name$3(this, "UserError");
@@ -13846,7 +13876,8 @@ function createFatalError$1(message, isJson, options) {
13846
13876
  __name$3(createFatalError$1, "createFatalError");
13847
13877
 
13848
13878
  //#endregion
13849
- //#region ../workers-utils/dist/chunk-FLRJ77A6.mjs
13879
+ //#region ../workers-utils/dist/chunk-AUSY7DKT.mjs
13880
+ createRequire(import.meta.url || (typeof __filename === "string" ? __filename : "/"));
13850
13881
  function hasKnownExportType(entry) {
13851
13882
  const type = entry?.type;
13852
13883
  return type === "durable-object" || type === "worker" || type === "workflow";
@@ -16351,296 +16382,8 @@ function formatConfigSnippet(snippet, configPath, formatted = true) {
16351
16382
  __name$3(formatConfigSnippet, "formatConfigSnippet");
16352
16383
 
16353
16384
  //#endregion
16354
- //#region ../workers-utils/dist/chunk-DKSA7K25.mjs
16355
- var DEFAULT_COMPAT_DATE = "2026-09-23";
16356
- function assertNever(_value) {}
16357
- __name$3(assertNever, "assertNever");
16358
- function mapWorkerMetadataBindings(bindings) {
16359
- return bindings.filter((binding) => binding.type !== "secret_text").reduce((configObj, binding) => {
16360
- switch (binding.type) {
16361
- case "plain_text":
16362
- configObj.vars = {
16363
- ...configObj.vars ?? {},
16364
- [binding.name]: binding.text
16365
- };
16366
- break;
16367
- case "json":
16368
- configObj.vars = {
16369
- ...configObj.vars ?? {},
16370
- [binding.name]: binding.json
16371
- };
16372
- break;
16373
- case "kv_namespace":
16374
- configObj.kv_namespaces = [...configObj.kv_namespaces ?? [], {
16375
- id: binding.namespace_id,
16376
- binding: binding.name
16377
- }];
16378
- break;
16379
- case "durable_object_namespace":
16380
- configObj.durable_objects = { bindings: [...configObj.durable_objects?.bindings ?? [], {
16381
- name: binding.name,
16382
- class_name: binding.class_name,
16383
- script_name: binding.script_name,
16384
- environment: binding.environment
16385
- }] };
16386
- break;
16387
- case "d1":
16388
- configObj.d1_databases = [...configObj.d1_databases ?? [], {
16389
- binding: binding.name,
16390
- database_id: binding.id
16391
- }];
16392
- break;
16393
- case "browser":
16394
- configObj.browser = { binding: binding.name };
16395
- break;
16396
- case "ai":
16397
- configObj.ai = { binding: binding.name };
16398
- break;
16399
- case "images":
16400
- configObj.images = { binding: binding.name };
16401
- break;
16402
- case "stream":
16403
- configObj.stream = { binding: binding.name };
16404
- break;
16405
- case "media":
16406
- configObj.media = { binding: binding.name };
16407
- break;
16408
- case "r2_bucket":
16409
- configObj.r2_buckets = [...configObj.r2_buckets ?? [], {
16410
- binding: binding.name,
16411
- bucket_name: binding.bucket_name,
16412
- jurisdiction: binding.jurisdiction
16413
- }];
16414
- break;
16415
- case "secrets_store_secret":
16416
- configObj.secrets_store_secrets = [...configObj.secrets_store_secrets ?? [], {
16417
- binding: binding.name,
16418
- store_id: binding.store_id,
16419
- secret_name: binding.secret_name
16420
- }];
16421
- break;
16422
- case "artifacts":
16423
- configObj.artifacts = [...configObj.artifacts ?? [], {
16424
- binding: binding.name,
16425
- namespace: binding.namespace
16426
- }];
16427
- break;
16428
- case "unsafe_hello_world":
16429
- configObj.unsafe_hello_world = [...configObj.unsafe_hello_world ?? [], {
16430
- binding: binding.name,
16431
- enable_timer: binding.enable_timer
16432
- }];
16433
- break;
16434
- case "flagship":
16435
- configObj.flagship = [...configObj.flagship ?? [], {
16436
- binding: binding.name,
16437
- app_id: binding.app_id
16438
- }];
16439
- break;
16440
- case "service":
16441
- configObj.services = [...configObj.services ?? [], {
16442
- binding: binding.name,
16443
- service: binding.service,
16444
- environment: binding.environment,
16445
- entrypoint: binding.entrypoint
16446
- }];
16447
- break;
16448
- case "analytics_engine":
16449
- configObj.analytics_engine_datasets = [...configObj.analytics_engine_datasets ?? [], {
16450
- binding: binding.name,
16451
- dataset: binding.dataset
16452
- }];
16453
- break;
16454
- case "dispatch_namespace":
16455
- configObj.dispatch_namespaces = [...configObj.dispatch_namespaces ?? [], {
16456
- binding: binding.name,
16457
- namespace: binding.namespace,
16458
- ...binding.outbound && { outbound: {
16459
- service: binding.outbound.worker.service,
16460
- environment: binding.outbound.worker.environment,
16461
- parameters: binding.outbound.params?.map((p$1) => p$1.name) ?? []
16462
- } }
16463
- }];
16464
- break;
16465
- case "logfwdr":
16466
- configObj.logfwdr = { bindings: [...configObj.logfwdr?.bindings ?? [], {
16467
- name: binding.name,
16468
- destination: binding.destination
16469
- }] };
16470
- break;
16471
- case "wasm_module":
16472
- configObj.wasm_modules = {
16473
- ...configObj.wasm_modules ?? {},
16474
- [binding.name]: binding.part
16475
- };
16476
- break;
16477
- case "text_blob":
16478
- configObj.text_blobs = {
16479
- ...configObj.text_blobs ?? {},
16480
- [binding.name]: binding.part
16481
- };
16482
- break;
16483
- case "data_blob":
16484
- configObj.data_blobs = {
16485
- ...configObj.data_blobs ?? {},
16486
- [binding.name]: binding.part
16487
- };
16488
- break;
16489
- case "secret_text": break;
16490
- case "version_metadata":
16491
- configObj.version_metadata = { binding: binding.name };
16492
- break;
16493
- case "send_email":
16494
- configObj.send_email = [...configObj.send_email ?? [], {
16495
- name: binding.name,
16496
- destination_address: binding.destination_address,
16497
- allowed_destination_addresses: binding.allowed_destination_addresses,
16498
- allowed_sender_addresses: binding.allowed_sender_addresses
16499
- }];
16500
- break;
16501
- case "queue":
16502
- configObj.queues ??= { producers: [] };
16503
- configObj.queues.producers = [...configObj.queues.producers ?? [], {
16504
- binding: binding.name,
16505
- queue: binding.queue_name,
16506
- delivery_delay: binding.delivery_delay
16507
- }];
16508
- break;
16509
- case "vectorize":
16510
- configObj.vectorize = [...configObj.vectorize ?? [], {
16511
- binding: binding.name,
16512
- index_name: binding.index_name
16513
- }];
16514
- break;
16515
- case "ai_search_namespace":
16516
- configObj.ai_search_namespaces = [...configObj.ai_search_namespaces ?? [], {
16517
- binding: binding.name,
16518
- namespace: binding.namespace
16519
- }];
16520
- break;
16521
- case "ai_search":
16522
- configObj.ai_search = [...configObj.ai_search ?? [], {
16523
- binding: binding.name,
16524
- instance_name: binding.instance_name
16525
- }];
16526
- break;
16527
- case "agent_memory":
16528
- configObj.agent_memory = [...configObj.agent_memory ?? [], {
16529
- binding: binding.name,
16530
- namespace: binding.namespace
16531
- }];
16532
- break;
16533
- case "hyperdrive":
16534
- configObj.hyperdrive = [...configObj.hyperdrive ?? [], {
16535
- binding: binding.name,
16536
- id: binding.id
16537
- }];
16538
- break;
16539
- case "mtls_certificate":
16540
- configObj.mtls_certificates = [...configObj.mtls_certificates ?? [], {
16541
- binding: binding.name,
16542
- certificate_id: binding.certificate_id
16543
- }];
16544
- break;
16545
- case "pipelines":
16546
- configObj.pipelines = [...configObj.pipelines ?? [], {
16547
- binding: binding.name,
16548
- ...binding.stream && { stream: binding.stream },
16549
- ...binding.pipeline && { pipeline: binding.pipeline }
16550
- }];
16551
- break;
16552
- case "assets":
16553
- configObj.assets = { binding: binding.name };
16554
- break;
16555
- case "inherit":
16556
- configObj.unsafe = {
16557
- bindings: [...configObj.unsafe?.bindings ?? [], binding],
16558
- metadata: configObj.unsafe?.metadata ?? void 0
16559
- };
16560
- break;
16561
- case "workflow":
16562
- configObj.workflows = [...configObj.workflows ?? [], {
16563
- binding: binding.name,
16564
- name: binding.workflow_name,
16565
- class_name: binding.class_name,
16566
- script_name: binding.script_name
16567
- }];
16568
- break;
16569
- case "worker_loader":
16570
- configObj.worker_loaders = [...configObj.worker_loaders ?? [], { binding: binding.name }];
16571
- break;
16572
- case "ratelimit":
16573
- configObj.ratelimits = [...configObj.ratelimits ?? [], {
16574
- name: binding.name,
16575
- namespace_id: binding.namespace_id,
16576
- simple: {
16577
- limit: binding.simple.limit,
16578
- period: binding.simple.period
16579
- }
16580
- }];
16581
- break;
16582
- case "vpc_service":
16583
- configObj.vpc_services = [...configObj.vpc_services ?? [], {
16584
- binding: binding.name,
16585
- service_id: binding.service_id
16586
- }];
16587
- break;
16588
- case "vpc_network":
16589
- if (binding.tunnel_id !== void 0) configObj.vpc_networks = [...configObj.vpc_networks ?? [], {
16590
- binding: binding.name,
16591
- tunnel_id: binding.tunnel_id
16592
- }];
16593
- else if (binding.network_id !== void 0) configObj.vpc_networks = [...configObj.vpc_networks ?? [], {
16594
- binding: binding.name,
16595
- network_id: binding.network_id
16596
- }];
16597
- break;
16598
- default: configObj.unsafe = {
16599
- bindings: [...configObj.unsafe?.bindings ?? [], binding],
16600
- metadata: configObj.unsafe?.metadata ?? void 0
16601
- };
16602
- }
16603
- return configObj;
16604
- }, {});
16605
- }
16606
- __name$3(mapWorkerMetadataBindings, "mapWorkerMetadataBindings");
16607
- function constructWranglerConfig(config$1) {
16608
- const mappedBindings = mapWorkerMetadataBindings(config$1.bindings);
16609
- const durableObjectClassNames = config$1.bindings.filter((binding) => binding.type === "durable_object_namespace" && binding.script_name === config$1.name).map((durableObject) => durableObject.class_name);
16610
- const allRoutes = [...config$1.routes.map((r) => ({
16611
- pattern: r.pattern,
16612
- zone_name: r.zone_name
16613
- })), ...config$1.domains.map((c$1) => ({
16614
- pattern: c$1.hostname,
16615
- zone_name: c$1.zone_name,
16616
- custom_domain: true,
16617
- enabled: c$1.enabled,
16618
- previews_enabled: c$1.previews_enabled
16619
- }))];
16620
- return {
16621
- name: config$1.name,
16622
- main: config$1.entrypoint,
16623
- workers_dev: config$1.subdomain.enabled,
16624
- preview_urls: config$1.subdomain.previews_enabled,
16625
- compatibility_date: config$1.compatibility_date ?? DEFAULT_COMPAT_DATE,
16626
- compatibility_flags: config$1.compatibility_flags,
16627
- ...allRoutes.length ? { routes: allRoutes } : {},
16628
- placement: config$1.placement?.mode === "smart" ? { mode: "smart" } : void 0,
16629
- limits: config$1.limits,
16630
- ...durableObjectClassNames.length && config$1.migration_tag ? { migrations: [{
16631
- tag: config$1.migration_tag,
16632
- new_classes: durableObjectClassNames
16633
- }] } : {},
16634
- ...config$1.schedules.length ? { triggers: { crons: config$1.schedules.map((scheduled) => scheduled.cron) } } : {},
16635
- tail_consumers: config$1.tail_consumers ?? void 0,
16636
- observability: config$1.observability,
16637
- ...mappedBindings
16638
- };
16639
- }
16640
- __name$3(constructWranglerConfig, "constructWranglerConfig");
16641
-
16642
- //#endregion
16643
- //#region ../workers-utils/dist/chunk-C6O4ION7.mjs
16385
+ //#region ../workers-utils/dist/chunk-2Q77CKVU.mjs
16386
+ createRequire(import.meta.url || (typeof __filename === "string" ? __filename : "/"));
16644
16387
  function isCompatDate(str) {
16645
16388
  return /^\d{4}-\d{2}-\d{2}$/.test(str);
16646
16389
  }
@@ -16678,7 +16421,8 @@ function stripRedundantNodejsCompatFlags(compatibilityDate, compatibilityFlags)
16678
16421
  __name$3(stripRedundantNodejsCompatFlags, "stripRedundantNodejsCompatFlags");
16679
16422
 
16680
16423
  //#endregion
16681
- //#region ../workers-utils/dist/chunk-3IYLA2JH.mjs
16424
+ //#region ../workers-utils/dist/chunk-QSRIB43D.mjs
16425
+ createRequire(import.meta.url || (typeof __filename === "string" ? __filename : "/"));
16682
16426
  function getBooleanEnvironmentVariableFactory(options) {
16683
16427
  return () => {
16684
16428
  if (!(options.variableName in process.env) || process.env[options.variableName] === void 0) return typeof options.defaultValue === "function" ? options.defaultValue() : options.defaultValue;
@@ -16722,7 +16466,8 @@ var getDockerPath = getEnvironmentVariableFactory({
16722
16466
  });
16723
16467
 
16724
16468
  //#endregion
16725
- //#region ../workers-utils/dist/chunk-53IMCORZ.mjs
16469
+ //#region ../workers-utils/dist/chunk-MIA26B4M.mjs
16470
+ createRequire(import.meta.url || (typeof __filename === "string" ? __filename : "/"));
16726
16471
  function isDirectory$1(path$3) {
16727
16472
  return fs.statSync(path$3, { throwIfNoEntry: false })?.isDirectory() ?? false;
16728
16473
  }
@@ -16749,7 +16494,8 @@ function removeDirSync(dirPath) {
16749
16494
  __name$3(removeDirSync, "removeDirSync");
16750
16495
 
16751
16496
  //#endregion
16752
- //#region ../workers-utils/dist/chunk-34VZWBGB.mjs
16497
+ //#region ../workers-utils/dist/chunk-MV2OJK3L.mjs
16498
+ createRequire(import.meta.url || (typeof __filename === "string" ? __filename : "/"));
16753
16499
  function isWindows$1() {
16754
16500
  return /^win/i.test(process.platform);
16755
16501
  }
@@ -16880,7 +16626,8 @@ function getGlobalWranglerCachePath() {
16880
16626
  __name$3(getGlobalWranglerCachePath, "getGlobalWranglerCachePath");
16881
16627
 
16882
16628
  //#endregion
16883
- //#region ../workers-utils/dist/chunk-IYSONYTF.mjs
16629
+ //#region ../workers-utils/dist/chunk-FR75DWDU.mjs
16630
+ createRequire(import.meta.url || (typeof __filename === "string" ? __filename : "/"));
16884
16631
  var getC3CommandFromEnv = getEnvironmentVariableFactory({
16885
16632
  variableName: "WRANGLER_C3_COMMAND",
16886
16633
  defaultValue: /* @__PURE__ */ __name$3(() => "create cloudflare", "defaultValue")
@@ -39727,6 +39474,7 @@ var require_undici = /* @__PURE__ */ __commonJS$2({ "../../node_modules/.pnpm/un
39727
39474
  //#endregion
39728
39475
  //#region ../workers-utils/dist/index.mjs
39729
39476
  var import_undici$3 = require_undici();
39477
+ createRequire(import.meta.url || (typeof __filename === "string" ? __filename : "/"));
39730
39478
  var require_vendors$1 = __commonJS$1({ "../../node_modules/.pnpm/ci-info@4.4.0/node_modules/ci-info/vendors.json"(exports$1, module$1) {
39731
39479
  module$1.exports = [
39732
39480
  {
@@ -42656,7 +42404,13 @@ function normalizeAndValidateEnvironment(diagnostics, configPath, rawEnv, isDisp
42656
42404
  vars: notInheritable(diagnostics, topLevelEnv, rawConfig, rawEnv, envName, "vars", validateVars(envName), {}),
42657
42405
  secrets: notInheritable(diagnostics, topLevelEnv, rawConfig, rawEnv, envName, "secrets", validateSecrets(envName), void 0),
42658
42406
  define: notInheritable(diagnostics, topLevelEnv, rawConfig, rawEnv, envName, "define", validateDefines(envName), {}),
42659
- durable_objects: notInheritable(diagnostics, topLevelEnv, rawConfig, rawEnv, envName, "durable_objects", validateBindingsProperty(envName, validateDurableObjectBinding), { bindings: [] }),
42407
+ durable_objects: (() => {
42408
+ const durableObjects = notInheritable(diagnostics, topLevelEnv, rawConfig, rawEnv, envName, "durable_objects", validateDurableObjectsProperty(envName, true), { bindings: [] });
42409
+ return {
42410
+ ...durableObjects,
42411
+ bindings: durableObjects.bindings ?? []
42412
+ };
42413
+ })(),
42660
42414
  workflows: notInheritable(diagnostics, topLevelEnv, rawConfig, rawEnv, envName, "workflows", all(validateBindingArray(envName, validateWorkflowBinding), validateUniqueNameProperty), []),
42661
42415
  migrations: inheritable(diagnostics, topLevelEnv, rawEnv, "migrations", validateMigrations, []),
42662
42416
  exports: inheritable(diagnostics, topLevelEnv, rawEnv, "exports", validateExports, {}),
@@ -42918,6 +42672,48 @@ Please add a binding for each to "${fieldPath}.bindings":
42918
42672
  }
42919
42673
  return isValid;
42920
42674
  }, "validateBindingsProperty");
42675
+ var DURABLE_OBJECTS_CODE_UPDATE_MAX_DELAY_SECONDS = 1440 * 60;
42676
+ var MILLISECOND_PRECISION_TOLERANCE = 1e-6;
42677
+ var validateDurableObjectsProperty = /* @__PURE__ */ __name$3((envName, allowMissingBindings = false, allowCodeUpdateStrategy = true) => (diagnostics, field, value, config$1) => {
42678
+ const fieldPath = config$1 === void 0 ? `${field}` : `env.${envName}.${field}`;
42679
+ if (value === void 0) return true;
42680
+ if (typeof value !== "object" || value === null || Array.isArray(value)) {
42681
+ diagnostics.errors.push(`The field "${fieldPath}" should be an object but got ${JSON.stringify(value)}.`);
42682
+ return false;
42683
+ }
42684
+ validateAdditionalProperties(diagnostics, fieldPath, Object.keys(value), allowCodeUpdateStrategy ? ["bindings", "code_update_strategy"] : ["bindings"]);
42685
+ const bindingsContainer = allowMissingBindings && !hasProperty(value, "bindings") ? {
42686
+ ...value,
42687
+ bindings: []
42688
+ } : value;
42689
+ let isValid = validateBindingsProperty(envName, validateDurableObjectBinding)(diagnostics, field, bindingsContainer, config$1);
42690
+ if (!allowCodeUpdateStrategy) return isValid;
42691
+ if (!hasProperty(value, "code_update_strategy") || value.code_update_strategy === void 0) return isValid;
42692
+ const strategy = value.code_update_strategy;
42693
+ const strategyPath = `${fieldPath}.code_update_strategy`;
42694
+ if (typeof strategy !== "object" || strategy === null || Array.isArray(strategy)) {
42695
+ diagnostics.errors.push(`The field "${strategyPath}" should be an object but got ${JSON.stringify(strategy)}.`);
42696
+ return false;
42697
+ }
42698
+ validateAdditionalProperties(diagnostics, strategyPath, Object.keys(strategy), ["mode", "max_delay"]);
42699
+ isValid = validateRequiredProperty(diagnostics, strategyPath, "mode", hasProperty(strategy, "mode") ? strategy.mode : void 0, "string", ["immediate", "deferred"]) && isValid;
42700
+ const maxDelay = hasProperty(strategy, "max_delay") ? strategy.max_delay : void 0;
42701
+ const maxDelayHasValidType = validateOptionalProperty(diagnostics, strategyPath, "max_delay", maxDelay, "number");
42702
+ isValid = maxDelayHasValidType && isValid;
42703
+ if (maxDelayHasValidType && typeof maxDelay === "number" && (!Number.isFinite(maxDelay) || maxDelay < 0 || maxDelay > DURABLE_OBJECTS_CODE_UPDATE_MAX_DELAY_SECONDS)) {
42704
+ diagnostics.errors.push(`Expected "${strategyPath}.max_delay" to be between 0 and ${DURABLE_OBJECTS_CODE_UPDATE_MAX_DELAY_SECONDS} seconds but got ${JSON.stringify(maxDelay)}.`);
42705
+ isValid = false;
42706
+ }
42707
+ if (maxDelayHasValidType && typeof maxDelay === "number" && Number.isFinite(maxDelay) && maxDelay >= 0 && maxDelay <= DURABLE_OBJECTS_CODE_UPDATE_MAX_DELAY_SECONDS) {
42708
+ const milliseconds = maxDelay * 1e3;
42709
+ const roundedMilliseconds = Math.round(milliseconds);
42710
+ if (maxDelay > 0 && roundedMilliseconds === 0 || Math.abs(milliseconds - roundedMilliseconds) > MILLISECOND_PRECISION_TOLERANCE) {
42711
+ diagnostics.errors.push(`Expected "${strategyPath}.max_delay" to use millisecond precision but got ${JSON.stringify(maxDelay)}.`);
42712
+ isValid = false;
42713
+ }
42714
+ }
42715
+ return isValid;
42716
+ }, "validateDurableObjectsProperty");
42921
42717
  var validateUnsafeSettings = /* @__PURE__ */ __name$3((envName) => (diagnostics, field, value, config$1) => {
42922
42718
  const fieldPath = config$1 === void 0 ? `${field}` : `env.${envName}.${field}`;
42923
42719
  if (typeof value !== "object" || value === null || Array.isArray(value)) {
@@ -44581,7 +44377,7 @@ var validatePreviewsConfig = /* @__PURE__ */ __name$3((envName, configPath) => (
44581
44377
  isValid = validateVars(envName)(diagnostics, `${field}.vars`, previews.vars, void 0) && isValid;
44582
44378
  isValid = validateDefines(envName)(diagnostics, `${field}.define`, previews.define, void 0) && isValid;
44583
44379
  normalizeAndValidatePlacement(diagnostics, void 0, previews, `${field}.placement`);
44584
- isValid = validateBindingsProperty(envName, validateDurableObjectBinding)(diagnostics, `${field}.durable_objects`, previews.durable_objects, void 0) && isValid;
44380
+ isValid = validateDurableObjectsProperty(envName, false, false)(diagnostics, `${field}.durable_objects`, previews.durable_objects, void 0) && isValid;
44585
44381
  isValid = all(validateBindingArray(envName, validateWorkflowBinding), validateUniqueNameProperty)(diagnostics, `${field}.workflows`, previews.workflows, void 0) && isValid;
44586
44382
  isValid = validateBindingArray(envName, validateKVBinding)(diagnostics, `${field}.kv_namespaces`, previews.kv_namespaces, void 0) && isValid;
44587
44383
  isValid = validateBindingArray(envName, validateSendEmailBinding)(diagnostics, `${field}.send_email`, previews.send_email, void 0) && isValid;
@@ -45161,6 +44957,8 @@ function isDockerfile(imagePath, configPath) {
45161
44957
  return false;
45162
44958
  }
45163
44959
  __name$3(isDockerfile, "isDockerfile");
44960
+ function assertNever(_value) {}
44961
+ __name$3(assertNever, "assertNever");
45164
44962
  var BINDING_LOCAL_SUPPORT = {
45165
44963
  plain_text: "local-only",
45166
44964
  secret_text: "local-only",
@@ -45210,8 +45008,7 @@ function getBindingLocalSupport(type) {
45210
45008
  }
45211
45009
  __name$3(getBindingLocalSupport, "getBindingLocalSupport");
45212
45010
  function validateBindingRemoteSetting(type, remote, warn) {
45213
- const support = getBindingLocalSupport(type);
45214
- switch (support) {
45011
+ switch (getBindingLocalSupport(type)) {
45215
45012
  case "local-and-remote": return;
45216
45013
  case "local-only":
45217
45014
  if (remote === true) throw new UserError$1(`${getBindingTypeFriendlyName(type)} bindings do not support accessing remote resources.`, { telemetryMessage: "utils bindings unsupported remote resources" });
@@ -45224,7 +45021,6 @@ function validateBindingRemoteSetting(type, remote, warn) {
45224
45021
  if (remote === false) throw new UserError$1(`${getBindingTypeFriendlyName(type)} bindings do not support local development. You can set \`remote: true\` for the binding definition in your configuration file to access a remote version of the resource.`, { telemetryMessage: "utils bindings unsupported local development always remote" });
45225
45022
  if (remote === void 0) warn(`${getBindingTypeFriendlyName(type)} bindings always access remote resources, and so may incur usage charges even in local dev. To suppress this warning, set \`remote: true\` for the binding definition in your configuration file.`);
45226
45023
  return;
45227
- default: assertNever(support);
45228
45024
  }
45229
45025
  }
45230
45026
  __name$3(validateBindingRemoteSetting, "validateBindingRemoteSetting");
@@ -45356,6 +45152,290 @@ function findFileUp(name, startDir, lastDir) {
45356
45152
  }
45357
45153
  }
45358
45154
  __name$3(findFileUp, "findFileUp");
45155
+ function mapWorkerMetadataBindings(bindings) {
45156
+ return bindings.filter((binding) => binding.type !== "secret_text").reduce((configObj, binding) => {
45157
+ switch (binding.type) {
45158
+ case "plain_text":
45159
+ configObj.vars = {
45160
+ ...configObj.vars ?? {},
45161
+ [binding.name]: binding.text
45162
+ };
45163
+ break;
45164
+ case "json":
45165
+ configObj.vars = {
45166
+ ...configObj.vars ?? {},
45167
+ [binding.name]: binding.json
45168
+ };
45169
+ break;
45170
+ case "kv_namespace":
45171
+ configObj.kv_namespaces = [...configObj.kv_namespaces ?? [], {
45172
+ id: binding.namespace_id,
45173
+ binding: binding.name
45174
+ }];
45175
+ break;
45176
+ case "durable_object_namespace":
45177
+ configObj.durable_objects = { bindings: [...configObj.durable_objects?.bindings ?? [], {
45178
+ name: binding.name,
45179
+ class_name: binding.class_name,
45180
+ script_name: binding.script_name,
45181
+ environment: binding.environment
45182
+ }] };
45183
+ break;
45184
+ case "d1":
45185
+ configObj.d1_databases = [...configObj.d1_databases ?? [], {
45186
+ binding: binding.name,
45187
+ database_id: binding.id
45188
+ }];
45189
+ break;
45190
+ case "browser":
45191
+ configObj.browser = { binding: binding.name };
45192
+ break;
45193
+ case "ai":
45194
+ configObj.ai = { binding: binding.name };
45195
+ break;
45196
+ case "images":
45197
+ configObj.images = { binding: binding.name };
45198
+ break;
45199
+ case "stream":
45200
+ configObj.stream = { binding: binding.name };
45201
+ break;
45202
+ case "media":
45203
+ configObj.media = { binding: binding.name };
45204
+ break;
45205
+ case "r2_bucket":
45206
+ configObj.r2_buckets = [...configObj.r2_buckets ?? [], {
45207
+ binding: binding.name,
45208
+ bucket_name: binding.bucket_name,
45209
+ jurisdiction: binding.jurisdiction
45210
+ }];
45211
+ break;
45212
+ case "secrets_store_secret":
45213
+ configObj.secrets_store_secrets = [...configObj.secrets_store_secrets ?? [], {
45214
+ binding: binding.name,
45215
+ store_id: binding.store_id,
45216
+ secret_name: binding.secret_name
45217
+ }];
45218
+ break;
45219
+ case "artifacts":
45220
+ configObj.artifacts = [...configObj.artifacts ?? [], {
45221
+ binding: binding.name,
45222
+ namespace: binding.namespace
45223
+ }];
45224
+ break;
45225
+ case "unsafe_hello_world":
45226
+ configObj.unsafe_hello_world = [...configObj.unsafe_hello_world ?? [], {
45227
+ binding: binding.name,
45228
+ enable_timer: binding.enable_timer
45229
+ }];
45230
+ break;
45231
+ case "flagship":
45232
+ configObj.flagship = [...configObj.flagship ?? [], {
45233
+ binding: binding.name,
45234
+ app_id: binding.app_id
45235
+ }];
45236
+ break;
45237
+ case "service":
45238
+ configObj.services = [...configObj.services ?? [], {
45239
+ binding: binding.name,
45240
+ service: binding.service,
45241
+ environment: binding.environment,
45242
+ entrypoint: binding.entrypoint
45243
+ }];
45244
+ break;
45245
+ case "analytics_engine":
45246
+ configObj.analytics_engine_datasets = [...configObj.analytics_engine_datasets ?? [], {
45247
+ binding: binding.name,
45248
+ dataset: binding.dataset
45249
+ }];
45250
+ break;
45251
+ case "dispatch_namespace":
45252
+ configObj.dispatch_namespaces = [...configObj.dispatch_namespaces ?? [], {
45253
+ binding: binding.name,
45254
+ namespace: binding.namespace,
45255
+ ...binding.outbound && { outbound: {
45256
+ service: binding.outbound.worker.service,
45257
+ environment: binding.outbound.worker.environment,
45258
+ parameters: binding.outbound.params?.map((p$1) => p$1.name) ?? []
45259
+ } }
45260
+ }];
45261
+ break;
45262
+ case "logfwdr":
45263
+ configObj.logfwdr = { bindings: [...configObj.logfwdr?.bindings ?? [], {
45264
+ name: binding.name,
45265
+ destination: binding.destination
45266
+ }] };
45267
+ break;
45268
+ case "wasm_module":
45269
+ configObj.wasm_modules = {
45270
+ ...configObj.wasm_modules ?? {},
45271
+ [binding.name]: binding.part
45272
+ };
45273
+ break;
45274
+ case "text_blob":
45275
+ configObj.text_blobs = {
45276
+ ...configObj.text_blobs ?? {},
45277
+ [binding.name]: binding.part
45278
+ };
45279
+ break;
45280
+ case "data_blob":
45281
+ configObj.data_blobs = {
45282
+ ...configObj.data_blobs ?? {},
45283
+ [binding.name]: binding.part
45284
+ };
45285
+ break;
45286
+ case "secret_text": break;
45287
+ case "version_metadata":
45288
+ configObj.version_metadata = { binding: binding.name };
45289
+ break;
45290
+ case "send_email":
45291
+ configObj.send_email = [...configObj.send_email ?? [], {
45292
+ name: binding.name,
45293
+ destination_address: binding.destination_address,
45294
+ allowed_destination_addresses: binding.allowed_destination_addresses,
45295
+ allowed_sender_addresses: binding.allowed_sender_addresses
45296
+ }];
45297
+ break;
45298
+ case "queue":
45299
+ configObj.queues ??= { producers: [] };
45300
+ configObj.queues.producers = [...configObj.queues.producers ?? [], {
45301
+ binding: binding.name,
45302
+ queue: binding.queue_name,
45303
+ delivery_delay: binding.delivery_delay
45304
+ }];
45305
+ break;
45306
+ case "vectorize":
45307
+ configObj.vectorize = [...configObj.vectorize ?? [], {
45308
+ binding: binding.name,
45309
+ index_name: binding.index_name
45310
+ }];
45311
+ break;
45312
+ case "ai_search_namespace":
45313
+ configObj.ai_search_namespaces = [...configObj.ai_search_namespaces ?? [], {
45314
+ binding: binding.name,
45315
+ namespace: binding.namespace
45316
+ }];
45317
+ break;
45318
+ case "ai_search":
45319
+ configObj.ai_search = [...configObj.ai_search ?? [], {
45320
+ binding: binding.name,
45321
+ instance_name: binding.instance_name
45322
+ }];
45323
+ break;
45324
+ case "agent_memory":
45325
+ configObj.agent_memory = [...configObj.agent_memory ?? [], {
45326
+ binding: binding.name,
45327
+ namespace: binding.namespace
45328
+ }];
45329
+ break;
45330
+ case "hyperdrive":
45331
+ configObj.hyperdrive = [...configObj.hyperdrive ?? [], {
45332
+ binding: binding.name,
45333
+ id: binding.id
45334
+ }];
45335
+ break;
45336
+ case "mtls_certificate":
45337
+ configObj.mtls_certificates = [...configObj.mtls_certificates ?? [], {
45338
+ binding: binding.name,
45339
+ certificate_id: binding.certificate_id
45340
+ }];
45341
+ break;
45342
+ case "pipelines":
45343
+ configObj.pipelines = [...configObj.pipelines ?? [], {
45344
+ binding: binding.name,
45345
+ ...binding.stream && { stream: binding.stream },
45346
+ ...binding.pipeline && { pipeline: binding.pipeline }
45347
+ }];
45348
+ break;
45349
+ case "assets":
45350
+ configObj.assets = { binding: binding.name };
45351
+ break;
45352
+ case "inherit":
45353
+ configObj.unsafe = {
45354
+ bindings: [...configObj.unsafe?.bindings ?? [], binding],
45355
+ metadata: configObj.unsafe?.metadata ?? void 0
45356
+ };
45357
+ break;
45358
+ case "workflow":
45359
+ configObj.workflows = [...configObj.workflows ?? [], {
45360
+ binding: binding.name,
45361
+ name: binding.workflow_name,
45362
+ class_name: binding.class_name,
45363
+ script_name: binding.script_name
45364
+ }];
45365
+ break;
45366
+ case "worker_loader":
45367
+ configObj.worker_loaders = [...configObj.worker_loaders ?? [], { binding: binding.name }];
45368
+ break;
45369
+ case "ratelimit":
45370
+ configObj.ratelimits = [...configObj.ratelimits ?? [], {
45371
+ name: binding.name,
45372
+ namespace_id: binding.namespace_id,
45373
+ simple: {
45374
+ limit: binding.simple.limit,
45375
+ period: binding.simple.period
45376
+ }
45377
+ }];
45378
+ break;
45379
+ case "vpc_service":
45380
+ configObj.vpc_services = [...configObj.vpc_services ?? [], {
45381
+ binding: binding.name,
45382
+ service_id: binding.service_id
45383
+ }];
45384
+ break;
45385
+ case "vpc_network":
45386
+ if (binding.tunnel_id !== void 0) configObj.vpc_networks = [...configObj.vpc_networks ?? [], {
45387
+ binding: binding.name,
45388
+ tunnel_id: binding.tunnel_id
45389
+ }];
45390
+ else if (binding.network_id !== void 0) configObj.vpc_networks = [...configObj.vpc_networks ?? [], {
45391
+ binding: binding.name,
45392
+ network_id: binding.network_id
45393
+ }];
45394
+ break;
45395
+ default: configObj.unsafe = {
45396
+ bindings: [...configObj.unsafe?.bindings ?? [], binding],
45397
+ metadata: configObj.unsafe?.metadata ?? void 0
45398
+ };
45399
+ }
45400
+ return configObj;
45401
+ }, {});
45402
+ }
45403
+ __name$3(mapWorkerMetadataBindings, "mapWorkerMetadataBindings");
45404
+ var DEFAULT_COMPAT_DATE = "2026-09-26";
45405
+ function constructWranglerConfig(config$1) {
45406
+ const mappedBindings = mapWorkerMetadataBindings(config$1.bindings);
45407
+ const durableObjectClassNames = config$1.bindings.filter((binding) => binding.type === "durable_object_namespace" && binding.script_name === config$1.name).map((durableObject) => durableObject.class_name);
45408
+ const allRoutes = [...config$1.routes.map((r2) => ({
45409
+ pattern: r2.pattern,
45410
+ zone_name: r2.zone_name
45411
+ })), ...config$1.domains.map((c$1) => ({
45412
+ pattern: c$1.hostname,
45413
+ zone_name: c$1.zone_name,
45414
+ custom_domain: true,
45415
+ enabled: c$1.enabled,
45416
+ previews_enabled: c$1.previews_enabled
45417
+ }))];
45418
+ return {
45419
+ name: config$1.name,
45420
+ main: config$1.entrypoint,
45421
+ workers_dev: config$1.subdomain.enabled,
45422
+ preview_urls: config$1.subdomain.previews_enabled,
45423
+ compatibility_date: config$1.compatibility_date ?? DEFAULT_COMPAT_DATE,
45424
+ compatibility_flags: config$1.compatibility_flags,
45425
+ ...allRoutes.length ? { routes: allRoutes } : {},
45426
+ placement: config$1.placement?.mode === "smart" ? { mode: "smart" } : void 0,
45427
+ limits: config$1.limits,
45428
+ ...durableObjectClassNames.length && config$1.migration_tag ? { migrations: [{
45429
+ tag: config$1.migration_tag,
45430
+ new_classes: durableObjectClassNames
45431
+ }] } : {},
45432
+ ...config$1.schedules.length ? { triggers: { crons: config$1.schedules.map((scheduled) => scheduled.cron) } } : {},
45433
+ tail_consumers: config$1.tail_consumers ?? void 0,
45434
+ observability: config$1.observability,
45435
+ ...mappedBindings
45436
+ };
45437
+ }
45438
+ __name$3(constructWranglerConfig, "constructWranglerConfig");
45359
45439
  function assertNever2(_value) {}
45360
45440
  __name$3(assertNever2, "assertNever");
45361
45441
  function convertConfigToBindings(config$1, options) {
@@ -47403,7 +47483,7 @@ async function fetchLatestNpmVersion(name, version$2) {
47403
47483
  __name$3(fetchLatestNpmVersion, "fetchLatestNpmVersion");
47404
47484
  async function openInBrowser(url$2, logger$1) {
47405
47485
  try {
47406
- const { default: open } = await import("./open-PBXRGS4R-CzyP5HqI.mjs");
47486
+ const { default: open } = await import("./open-PCXX3ZDZ-DUIcTUjC.mjs");
47407
47487
  (await open(url$2)).on("error", (err) => {
47408
47488
  handleBrowserOpenError(url$2, err, logger$1);
47409
47489
  });
@@ -49629,7 +49709,7 @@ function ensurePosixLikePath(filePath) {
49629
49709
  }
49630
49710
  const __filename$2 = fileURLToPath(import.meta.url);
49631
49711
  const __dirname$1 = path.dirname(__filename$2);
49632
- const require$1 = createRequire(__filename$2);
49712
+ const require$2 = createRequire(__filename$2);
49633
49713
  const distPath = ensurePosixLikePath(path.resolve(__dirname$1, ".."));
49634
49714
  const libPath = posixPath.join(distPath, "worker", "lib");
49635
49715
  const emptyLibPath = posixPath.join(libPath, "cloudflare/empty-internal.cjs");
@@ -49775,7 +49855,7 @@ async function viteResolve(vite, specifier, referrer, isRequire) {
49775
49855
  custom: { "node-resolve": { isRequire } }
49776
49856
  });
49777
49857
  if (resolved === null) {
49778
- if (isRequire && specifier[0] === ".") return require$1.resolve(specifier, { paths: [referrer] });
49858
+ if (isRequire && specifier[0] === ".") return require$2.resolve(specifier, { paths: [referrer] });
49779
49859
  throw new Error("Not found");
49780
49860
  }
49781
49861
  if (resolved.id === "__vite-browser-external") return emptyLibPath;
@@ -52626,7 +52706,8 @@ const getConfirmRenderers = (config$1) => {
52626
52706
  };
52627
52707
 
52628
52708
  //#endregion
52629
- //#region ../workers-auth/dist/chunk-O6YSETKJ.mjs
52709
+ //#region ../workers-auth/dist/chunk-VAZEJK55.mjs
52710
+ createRequire(import.meta.url || (typeof __filename === "string" ? __filename : "/"));
52630
52711
  var __defProp$2 = Object.defineProperty;
52631
52712
  var __name$2 = (target, value) => __defProp$2(target, "name", {
52632
52713
  value,
@@ -52634,8 +52715,9 @@ var __name$2 = (target, value) => __defProp$2(target, "name", {
52634
52715
  });
52635
52716
 
52636
52717
  //#endregion
52637
- //#region ../workers-auth/dist/chunk-WMSASLDV.mjs
52718
+ //#region ../workers-auth/dist/chunk-RV27PEH3.mjs
52638
52719
  var import_undici$2 = require_undici();
52720
+ createRequire(import.meta.url || (typeof __filename === "string" ? __filename : "/"));
52639
52721
  var hasWarnedAboutDeprecatedV1ApiToken = false;
52640
52722
  function readStoredAuthState(options) {
52641
52723
  const { configOverride, warningLogger, storage } = options;
@@ -55080,7 +55162,8 @@ function scrubEncryptedCredentials(options) {
55080
55162
  __name$2(scrubEncryptedCredentials, "scrubEncryptedCredentials");
55081
55163
 
55082
55164
  //#endregion
55083
- //#region ../workers-auth/dist/chunk-V6MEAFHI.mjs
55165
+ //#region ../workers-auth/dist/chunk-2JQZNT7W.mjs
55166
+ createRequire(import.meta.url || (typeof __filename === "string" ? __filename : "/"));
55084
55167
  function createPreferences(getConfigPath) {
55085
55168
  function getUserPreferencesPath() {
55086
55169
  return path.resolve(getConfigPath(), "preferences.json");
@@ -56211,6 +56294,7 @@ __name$2(createAuthConfigFileHelpers, "createAuthConfigFileHelpers");
56211
56294
 
56212
56295
  //#endregion
56213
56296
  //#region ../workers-auth/dist/cf/index.mjs
56297
+ createRequire(import.meta.url || (typeof __filename === "string" ? __filename : "/"));
56214
56298
  var CF_KEYRING_SERVICE_NAME = "cloudflare";
56215
56299
  var CF_CLI_NAME = "cf";
56216
56300
  var CF_DISPLAY_NAME = "cf";
@@ -56799,6 +56883,7 @@ __name$2(setKeyringPreference$1, "setKeyringPreference");
56799
56883
 
56800
56884
  //#endregion
56801
56885
  //#region ../workers-auth/dist/wrangler/index.mjs
56886
+ createRequire(import.meta.url || (typeof __filename === "string" ? __filename : "/"));
56802
56887
  var DefaultScopes = {
56803
56888
  "account:read": "See your account info such as account details, analytics, and memberships.",
56804
56889
  "user:read": "See your user info such as name, email address, and account memberships.",
@@ -60500,7 +60585,8 @@ var import_websocket = /* @__PURE__ */ __toESM$1(require_websocket(), 1);
60500
60585
  var import_websocket_server = /* @__PURE__ */ __toESM$1(require_websocket_server(), 1);
60501
60586
 
60502
60587
  //#endregion
60503
- //#region ../deploy-helpers/dist/chunk-Q72B4Q5Z.mjs
60588
+ //#region ../deploy-helpers/dist/chunk-U6NEESU5.mjs
60589
+ const require$1 = createRequire(import.meta.url || (typeof __filename === "string" ? __filename : "/"));
60504
60590
  var __defProp$1 = Object.defineProperty;
60505
60591
  var __name$1 = (target, value) => __defProp$1(target, "name", {
60506
60592
  value,
@@ -60621,9 +60707,10 @@ var require_command_exists = /* @__PURE__ */ __commonJS$2({ "../../node_modules/
60621
60707
  }) });
60622
60708
 
60623
60709
  //#endregion
60624
- //#region ../deploy-helpers/dist/chunk-QBZBEHZB.mjs
60710
+ //#region ../deploy-helpers/dist/chunk-M77HNR46.mjs
60625
60711
  var import_undici$1 = require_undici();
60626
60712
  var import_command_exists = require_command_exists();
60713
+ createRequire(import.meta.url || (typeof __filename === "string" ? __filename : "/"));
60627
60714
  function handleUnsafeCapnp(capnp) {
60628
60715
  if (capnp.compiled_schema) return readFileSync(resolve(capnp.compiled_schema));
60629
60716
  const { base_path, source_schemas } = capnp;
@@ -60663,7 +60750,7 @@ function fromMimeType(mimeType) {
60663
60750
  __name$1(fromMimeType, "fromMimeType");
60664
60751
  function createWorkerUploadForm(worker, bindings, options) {
60665
60752
  const formData = new import_undici$1.FormData();
60666
- const { main, sourceMaps, migrations, exports: configuredExports, compatibility_date, compatibility_flags, keepVars, keepSecrets, keepBindings, logpush, placement, tail_consumers, streaming_tail_consumers, limits, annotations, keep_assets, assets, observability, cache: cache$1, package_dependencies } = worker;
60753
+ const { main, sourceMaps, migrations, code_update_strategy, exports: configuredExports, compatibility_date, compatibility_flags, keepVars, keepSecrets, keepBindings, logpush, placement, tail_consumers, streaming_tail_consumers, limits, annotations, keep_assets, assets, observability, cache: cache$1, package_dependencies } = worker;
60667
60754
  const assetConfig = {
60668
60755
  html_handling: assets?.assetConfig?.html_handling,
60669
60756
  not_found_handling: assets?.assetConfig?.not_found_handling,
@@ -61146,6 +61233,7 @@ function createWorkerUploadForm(worker, bindings, options) {
61146
61233
  ...compatibility_date && { compatibility_date },
61147
61234
  ...compatibility_flags && { compatibility_flags },
61148
61235
  ...migrations && { migrations },
61236
+ ...code_update_strategy && { code_update_strategy },
61149
61237
  ...configuredExports && Object.keys(configuredExports).length > 0 && { exports: configuredExports },
61150
61238
  capnp_schema: capnpSchemaOutputFile,
61151
61239
  ...keep_bindings && { keep_bindings },
@@ -61176,7 +61264,7 @@ __name$1(createWorkerUploadForm, "createWorkerUploadForm");
61176
61264
  //#endregion
61177
61265
  //#region ../remote-bindings/dist/index.mjs
61178
61266
  var import_undici = require_undici();
61179
- var version = "0.0.35";
61267
+ var version = "0.0.37";
61180
61268
  var NoDefaultValueProvided = class extends UserError$1 {
61181
61269
  constructor() {
61182
61270
  super("This command cannot be run in a non-interactive context", { telemetryMessage: "remote bindings prompt default missing" });
@@ -62118,6 +62206,12 @@ const WorkerBindingSchema = z$1.strictObject({
62118
62206
  props: z$1.record(z$1.string(), z$1.unknown()).optional(),
62119
62207
  dev: RemoteBindingDevSchema.optional()
62120
62208
  });
62209
+ const WorkflowBindingSchema = z$1.strictObject({
62210
+ type: z$1.literal("workflow"),
62211
+ name: z$1.string(),
62212
+ worker: z$1.string(),
62213
+ exportName: z$1.string()
62214
+ });
62121
62215
  const D1BindingSchema = z$1.strictObject({
62122
62216
  type: z$1.literal("d1"),
62123
62217
  name: z$1.string().optional(),
@@ -62282,7 +62376,8 @@ const KnownBindingSchema = z$1.discriminatedUnion("type", [
62282
62376
  return value.tunnelId !== void 0 && value.networkId !== void 0 ? `"vpc-network" bindings must specify exactly one of "tunnelId" or "networkId", not both` : `"vpc-network" bindings must specify either "tunnelId" or "networkId"`;
62283
62377
  } }),
62284
62378
  WorkerBindingSchema,
62285
- z$1.strictObject({ type: z$1.literal("worker-loader") })
62379
+ z$1.strictObject({ type: z$1.literal("worker-loader") }),
62380
+ WorkflowBindingSchema
62286
62381
  ]);
62287
62382
  const UnsafeBindingSchema = z$1.looseObject({
62288
62383
  type: z$1.templateLiteral(["unsafe:", z$1.string().min(1)]),
@@ -62507,9 +62602,9 @@ const WorkflowExportSchema = z$1.strictObject({
62507
62602
  limits: z$1.strictObject({ steps: z$1.number().int().min(1).optional() }).optional(),
62508
62603
  concurrency: z$1.strictObject({ limit: z$1.number().int().min(1).optional() }).optional(),
62509
62604
  schedules: z$1.union([z$1.string().min(1), z$1.array(z$1.string().min(1)).min(1)]).optional(),
62510
- default_retention: z$1.strictObject({
62511
- success_retention: WorkflowRetentionSchema.optional(),
62512
- error_retention: WorkflowRetentionSchema.optional()
62605
+ defaultRetention: z$1.strictObject({
62606
+ successRetention: WorkflowRetentionSchema.optional(),
62607
+ errorRetention: WorkflowRetentionSchema.optional()
62513
62608
  }).optional()
62514
62609
  });
62515
62610
  const DurableObjectCreatedSqliteExportSchema = DurableObjectCreatedExportSchema.extend({ storage: z$1.literal("sqlite") });
@@ -62752,11 +62847,13 @@ var import_dist = (/* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/ts-ded
62752
62847
  }
62753
62848
  exports$1.dedent = dedent$1$1;
62754
62849
  }) }))();
62850
+ createRequire(import.meta.url || (typeof __filename === "string" ? __filename : "/"));
62755
62851
  var __defProp = Object.defineProperty;
62756
62852
  var __name = (target, value) => __defProp(target, "name", {
62757
62853
  value,
62758
62854
  configurable: true
62759
62855
  });
62856
+ createRequire(import.meta.url || (typeof __filename === "string" ? __filename : "/"));
62760
62857
  var UserError = class extends Error {
62761
62858
  static {
62762
62859
  __name(this, "UserError");
@@ -63233,6 +63330,14 @@ function convertBindingsAndAssets(config$1, result) {
63233
63330
  case "worker-loader":
63234
63331
  workerLoaders.push({ binding: name });
63235
63332
  break;
63333
+ case "workflow":
63334
+ workflows.push({
63335
+ binding: name,
63336
+ name: binding.name,
63337
+ class_name: binding.exportName,
63338
+ script_name: binding.worker
63339
+ });
63340
+ break;
63236
63341
  }
63237
63342
  }
63238
63343
  if (kvNamespaces.length) result.kv_namespaces = kvNamespaces;
@@ -63284,10 +63389,21 @@ function convertExports(config$1, result) {
63284
63389
  const converted = {};
63285
63390
  const unknownExports = {};
63286
63391
  for (const [exportName, value] of Object.entries(exports$2)) {
63287
- if (value.type === "worker" || value.type === "workflow") {
63392
+ if (value.type === "worker") {
63288
63393
  converted[exportName] = value;
63289
63394
  continue;
63290
63395
  }
63396
+ if (value.type === "workflow") {
63397
+ const { defaultRetention,...workflow } = value;
63398
+ converted[exportName] = {
63399
+ ...workflow,
63400
+ ...defaultRetention !== void 0 && { default_retention: {
63401
+ ...defaultRetention.successRetention !== void 0 && { success_retention: defaultRetention.successRetention },
63402
+ ...defaultRetention.errorRetention !== void 0 && { error_retention: defaultRetention.errorRetention }
63403
+ } }
63404
+ };
63405
+ continue;
63406
+ }
63291
63407
  if (value.type !== "durable-object") {
63292
63408
  unknownExports[exportName] = value;
63293
63409
  continue;
@@ -64377,10 +64493,11 @@ function getDurableObjectClasses(worker) {
64377
64493
  return result;
64378
64494
  }
64379
64495
  /**
64380
- * Gets a set of class names for Workflows defined in the SELF Worker.
64496
+ * Gets a set of class names for Workflows defined in the SELF Worker, either
64497
+ * declared in its `exports` or bound to it.
64381
64498
  */
64382
64499
  function getWorkflowClasses(worker, configWorkerName) {
64383
- const result = /* @__PURE__ */ new Set();
64500
+ const result = new Set(Object.keys(worker.workflowExports ?? {}));
64384
64501
  if (worker.workflows === void 0) return result;
64385
64502
  for (const key of Object.keys(worker.workflows)) {
64386
64503
  const designator = worker.workflows[key];
@@ -64389,7 +64506,10 @@ function getWorkflowClasses(worker, configWorkerName) {
64389
64506
  else workerName = worker.name;
64390
64507
  if (isWorkflowDesignatorToSelf(designator, workerName)) {
64391
64508
  result.add(designator.className);
64392
- worker.workflows[key] = { ...designator };
64509
+ worker.workflows[key] = {
64510
+ ...designator,
64511
+ scriptName: void 0
64512
+ };
64393
64513
  }
64394
64514
  }
64395
64515
  return result;