wrangler 4.105.0 → 4.107.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/bin/wrangler.js CHANGED
@@ -25,7 +25,6 @@ Consider using a Node.js version manager such as https://volta.sh/ or https://gi
25
25
  process.execPath,
26
26
  [
27
27
  "--no-warnings",
28
- "--experimental-vm-modules",
29
28
  ...process.execArgv,
30
29
  path.join(__dirname, "../wrangler-dist/cli.js"),
31
30
  ...process.argv.slice(2),
@@ -113,6 +113,12 @@
113
113
  "markdownDescription": "A list of migrations that should be uploaded with your Worker.\n\nThese define changes in your Durable Object declarations.\n\nMore details at https://developers.cloudflare.com/workers/learning/using-durable-objects#configuring-durable-object-classes-with-migrations",
114
114
  "default": []
115
115
  },
116
+ "exports": {
117
+ "$ref": "#/definitions/Exports",
118
+ "description": "Declarative exports configuration — a map of class name to export configuration.\n\nThe configuration of Durable Objects via `exports` is mutually exclusive with `migrations`.",
119
+ "markdownDescription": "Declarative exports configuration — a map of class name to export configuration.\n\nThe configuration of Durable Objects via `exports` is mutually exclusive with `migrations`.",
120
+ "default": {}
121
+ },
116
122
  "triggers": {
117
123
  "type": "object",
118
124
  "properties": {
@@ -1825,6 +1831,12 @@
1825
1831
  "markdownDescription": "A list of migrations that should be uploaded with your Worker.\n\nThese define changes in your Durable Object declarations.\n\nMore details at https://developers.cloudflare.com/workers/learning/using-durable-objects#configuring-durable-object-classes-with-migrations",
1826
1832
  "default": []
1827
1833
  },
1834
+ "exports": {
1835
+ "$ref": "#/definitions/Exports",
1836
+ "description": "Declarative exports configuration — a map of class name to export configuration.\n\nThe configuration of Durable Objects via `exports` is mutually exclusive with `migrations`.",
1837
+ "markdownDescription": "Declarative exports configuration — a map of class name to export configuration.\n\nThe configuration of Durable Objects via `exports` is mutually exclusive with `migrations`.",
1838
+ "default": {}
1839
+ },
1828
1840
  "triggers": {
1829
1841
  "type": "object",
1830
1842
  "properties": {
@@ -3481,6 +3493,175 @@
3481
3493
  "description": "Configuration in wrangler for Durable Object Migrations",
3482
3494
  "markdownDescription": "Configuration in wrangler for Durable Object Migrations"
3483
3495
  },
3496
+ "Exports": {
3497
+ "type": "object",
3498
+ "additionalProperties": {
3499
+ "$ref": "#/definitions/ConfiguredExport"
3500
+ },
3501
+ "description": "The declarative `exports` map keyed by export name. Durable Object exports are mutually exclusive with `migrations` at the wrangler config layer.",
3502
+ "markdownDescription": "The declarative `exports` map keyed by export name. Durable Object exports\nare mutually exclusive with `migrations` at the wrangler config layer."
3503
+ },
3504
+ "ConfiguredExport": {
3505
+ "anyOf": [
3506
+ {
3507
+ "$ref": "#/definitions/DurableObjectExport"
3508
+ },
3509
+ {
3510
+ "$ref": "#/definitions/WorkerEntrypointExport"
3511
+ }
3512
+ ]
3513
+ },
3514
+ "DurableObjectExport": {
3515
+ "anyOf": [
3516
+ {
3517
+ "type": "object",
3518
+ "properties": {
3519
+ "type": {
3520
+ "type": "string",
3521
+ "const": "durable-object"
3522
+ },
3523
+ "state": {
3524
+ "type": "string",
3525
+ "const": "created"
3526
+ },
3527
+ "storage": {
3528
+ "$ref": "#/definitions/DurableObjectExportStorage"
3529
+ }
3530
+ },
3531
+ "required": [
3532
+ "type",
3533
+ "storage"
3534
+ ],
3535
+ "additionalProperties": false
3536
+ },
3537
+ {
3538
+ "type": "object",
3539
+ "properties": {
3540
+ "type": {
3541
+ "type": "string",
3542
+ "const": "durable-object"
3543
+ },
3544
+ "state": {
3545
+ "type": "string",
3546
+ "const": "deleted"
3547
+ }
3548
+ },
3549
+ "required": [
3550
+ "type",
3551
+ "state"
3552
+ ],
3553
+ "additionalProperties": false
3554
+ },
3555
+ {
3556
+ "type": "object",
3557
+ "properties": {
3558
+ "type": {
3559
+ "type": "string",
3560
+ "const": "durable-object"
3561
+ },
3562
+ "state": {
3563
+ "type": "string",
3564
+ "const": "renamed"
3565
+ },
3566
+ "renamed_to": {
3567
+ "type": "string"
3568
+ }
3569
+ },
3570
+ "required": [
3571
+ "type",
3572
+ "state",
3573
+ "renamed_to"
3574
+ ],
3575
+ "additionalProperties": false
3576
+ },
3577
+ {
3578
+ "type": "object",
3579
+ "properties": {
3580
+ "type": {
3581
+ "type": "string",
3582
+ "const": "durable-object"
3583
+ },
3584
+ "state": {
3585
+ "type": "string",
3586
+ "const": "transferred"
3587
+ },
3588
+ "transferred_to": {
3589
+ "type": "string"
3590
+ }
3591
+ },
3592
+ "required": [
3593
+ "type",
3594
+ "state",
3595
+ "transferred_to"
3596
+ ],
3597
+ "additionalProperties": false
3598
+ },
3599
+ {
3600
+ "type": "object",
3601
+ "properties": {
3602
+ "type": {
3603
+ "type": "string",
3604
+ "const": "durable-object"
3605
+ },
3606
+ "state": {
3607
+ "type": "string",
3608
+ "const": "expecting-transfer"
3609
+ },
3610
+ "storage": {
3611
+ "$ref": "#/definitions/DurableObjectExportStorage"
3612
+ },
3613
+ "transfer_from": {
3614
+ "type": "string"
3615
+ }
3616
+ },
3617
+ "required": [
3618
+ "type",
3619
+ "state",
3620
+ "storage",
3621
+ "transfer_from"
3622
+ ],
3623
+ "additionalProperties": false
3624
+ }
3625
+ ],
3626
+ "description": "A single declarative Durable Object export entry in the `exports` config map. `type` is reserved for the export kind. `state` carries the Durable Object lifecycle and defaults to `\"created\"` (live) when omitted.\n\nMutually exclusive with {@link DurableObjectMigration } at the config- validation boundary.\n\n - `created` (default, live): `storage` is required. - `deleted` (tombstone): retire a provisioned namespace whose class has been removed from code. - `renamed` (tombstone): rewrite a provisioned namespace's class name to `renamed_to`. The target name must also appear as a live (state `\"created\"`) `durable-object` entry in the same map. - `transferred` (tombstone): hand ownership of the namespace to another script in the same account (`transferred_to`). Two-phase commit; the target must first deploy an `expecting-transfer` entry naming this script via `transfer_from`. - `expecting-transfer` (live): receiving side of a two-phase transfer; `storage` and `transfer_from` are both required.",
3627
+ "markdownDescription": "A single declarative Durable Object export entry in the `exports` config\nmap. `type` is reserved for the export kind. `state` carries the Durable\nObject lifecycle and defaults to `\"created\"` (live) when omitted.\n\nMutually exclusive with {@link DurableObjectMigration } at the config-\nvalidation boundary.\n\n - `created` (default, live): `storage` is required.\n - `deleted` (tombstone): retire a provisioned namespace whose class has\n been removed from code.\n - `renamed` (tombstone): rewrite a provisioned namespace's class name to\n `renamed_to`. The target name must also appear as a live (state\n `\"created\"`) `durable-object` entry in the same map.\n - `transferred` (tombstone): hand ownership of the namespace to another\n script in the same account (`transferred_to`). Two-phase commit;\n the target must first deploy an `expecting-transfer` entry naming this\n script via `transfer_from`.\n - `expecting-transfer` (live): receiving side of a two-phase transfer;\n `storage` and `transfer_from` are both required."
3628
+ },
3629
+ "DurableObjectExportStorage": {
3630
+ "type": "string",
3631
+ "enum": [
3632
+ "sqlite",
3633
+ "legacy-kv"
3634
+ ],
3635
+ "description": "Storage backend for a declarative Durable Object export. See {@link DurableObjectExport } .",
3636
+ "markdownDescription": "Storage backend for a declarative Durable Object export. See\n {@link DurableObjectExport } ."
3637
+ },
3638
+ "WorkerEntrypointExport": {
3639
+ "type": "object",
3640
+ "properties": {
3641
+ "type": {
3642
+ "type": "string",
3643
+ "const": "worker"
3644
+ },
3645
+ "cache": {
3646
+ "type": "object",
3647
+ "properties": {
3648
+ "enabled": {
3649
+ "type": "boolean",
3650
+ "description": "Whether cache is enabled for this entrypoint.",
3651
+ "markdownDescription": "Whether cache is enabled for this entrypoint."
3652
+ }
3653
+ },
3654
+ "required": [
3655
+ "enabled"
3656
+ ],
3657
+ "additionalProperties": false
3658
+ }
3659
+ },
3660
+ "required": [
3661
+ "type"
3662
+ ],
3663
+ "additionalProperties": false
3664
+ },
3484
3665
  "UserLimits": {
3485
3666
  "type": "object",
3486
3667
  "properties": {
@@ -3673,6 +3854,11 @@
3673
3854
  "type": "boolean",
3674
3855
  "description": "If cache is enabled for this Worker",
3675
3856
  "markdownDescription": "If cache is enabled for this Worker"
3857
+ },
3858
+ "cross_version_cache": {
3859
+ "type": "boolean",
3860
+ "description": "Whether cached assets may be reused across Worker versions.",
3861
+ "markdownDescription": "Whether cached assets may be reused across Worker versions."
3676
3862
  }
3677
3863
  },
3678
3864
  "required": [
@@ -3685,16 +3871,16 @@
3685
3871
  "additionalProperties": false,
3686
3872
  "properties": {
3687
3873
  "logpush": {
3688
- "$ref": "#/definitions/interface-769040647-8409-18279-769040647-0-501432004818536"
3874
+ "$ref": "#/definitions/interface-769040647-10589-20711-769040647-0-526752004818536"
3689
3875
  },
3690
3876
  "observability": {
3691
- "$ref": "#/definitions/interface-769040647-8409-18279-769040647-0-501432004818536"
3877
+ "$ref": "#/definitions/interface-769040647-10589-20711-769040647-0-526752004818536"
3692
3878
  },
3693
3879
  "limits": {
3694
- "$ref": "#/definitions/interface-769040647-8409-18279-769040647-0-501432004818536"
3880
+ "$ref": "#/definitions/interface-769040647-10589-20711-769040647-0-526752004818536"
3695
3881
  },
3696
3882
  "cache": {
3697
- "$ref": "#/definitions/interface-769040647-8409-18279-769040647-0-501432004818536"
3883
+ "$ref": "#/definitions/interface-769040647-10589-20711-769040647-0-526752004818536"
3698
3884
  },
3699
3885
  "define": {
3700
3886
  "type": "object",
@@ -4956,7 +5142,7 @@
4956
5142
  "description": "Configuration for Worker Previews.\n\nThis defines the settings used when creating Preview deployments. Previews are branches of your Worker's main instance used to test features during feature development outside of production.\n\nThe `previews` block contains any intentionally divergent configuration intended solely for Previews, including:\n- All non-inheritable properties (environment variables and bindings like KV, D1, R2, etc.)\n- Select inheritable properties: `logpush`, `observability`, `limits`, `cache`",
4957
5143
  "markdownDescription": "Configuration for Worker Previews.\n\nThis defines the settings used when creating Preview deployments.\nPreviews are branches of your Worker's main instance used to test features\nduring feature development outside of production.\n\nThe `previews` block contains any intentionally divergent configuration intended solely for Previews, including:\n- All non-inheritable properties (environment variables and bindings like KV, D1, R2, etc.)\n- Select inheritable properties: `logpush`, `observability`, `limits`, `cache`"
4958
5144
  },
4959
- "interface-769040647-8409-18279-769040647-0-501432004818536": {
5145
+ "interface-769040647-10589-20711-769040647-0-526752004818536": {
4960
5146
  "type": "object",
4961
5147
  "properties": {
4962
5148
  "name": {
@@ -5054,6 +5240,12 @@
5054
5240
  "markdownDescription": "A list of migrations that should be uploaded with your Worker.\n\nThese define changes in your Durable Object declarations.\n\nMore details at https://developers.cloudflare.com/workers/learning/using-durable-objects#configuring-durable-object-classes-with-migrations",
5055
5241
  "default": []
5056
5242
  },
5243
+ "exports": {
5244
+ "$ref": "#/definitions/Exports",
5245
+ "description": "Declarative exports configuration — a map of class name to export configuration.\n\nThe configuration of Durable Objects via `exports` is mutually exclusive with `migrations`.",
5246
+ "markdownDescription": "Declarative exports configuration — a map of class name to export configuration.\n\nThe configuration of Durable Objects via `exports` is mutually exclusive with `migrations`.",
5247
+ "default": {}
5248
+ },
5057
5249
  "triggers": {
5058
5250
  "type": "object",
5059
5251
  "properties": {
@@ -5318,6 +5510,7 @@
5318
5510
  "jsx_factory",
5319
5511
  "jsx_fragment",
5320
5512
  "migrations",
5513
+ "exports",
5321
5514
  "triggers",
5322
5515
  "rules",
5323
5516
  "build",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wrangler",
3
- "version": "4.105.0",
3
+ "version": "4.107.0",
4
4
  "description": "Command-line interface for all things Cloudflare Workers",
5
5
  "keywords": [
6
6
  "assembly",
@@ -66,16 +66,16 @@
66
66
  "esbuild": "0.28.1",
67
67
  "path-to-regexp": "6.3.0",
68
68
  "unenv": "2.0.0-rc.24",
69
- "workerd": "1.20260625.1",
69
+ "workerd": "1.20260701.1",
70
70
  "@cloudflare/kv-asset-handler": "0.5.0",
71
71
  "@cloudflare/unenv-preset": "2.16.1",
72
- "miniflare": "4.20260625.0"
72
+ "miniflare": "4.20260701.0"
73
73
  },
74
74
  "devDependencies": {
75
75
  "@aws-sdk/client-s3": "^3.721.0",
76
76
  "@bomb.sh/tab": "^0.0.12",
77
77
  "@cloudflare/types": "6.18.4",
78
- "@cloudflare/workers-types": "^4.20260625.1",
78
+ "@cloudflare/workers-types": "^4.20260701.1",
79
79
  "@cspotcode/source-map-support": "0.8.1",
80
80
  "@netlify/build-info": "^10.5.1",
81
81
  "@sentry/node": "^7.86.0",
@@ -156,21 +156,21 @@
156
156
  "yaml": "^2.8.1",
157
157
  "yargs": "^17.7.2",
158
158
  "zod": "^4.4.3",
159
- "@cloudflare/autoconfig": "0.1.1",
160
- "@cloudflare/cli-shared-helpers": "0.1.10",
159
+ "@cloudflare/autoconfig": "0.1.2",
160
+ "@cloudflare/cli-shared-helpers": "0.1.11",
161
+ "@cloudflare/codemod": "1.1.0",
161
162
  "@cloudflare/config": "0.0.0",
162
163
  "@cloudflare/containers-shared": "0.16.0",
163
- "@cloudflare/deploy-helpers": "0.2.4",
164
- "@cloudflare/pages-shared": "^0.13.150",
164
+ "@cloudflare/pages-shared": "^0.13.152",
165
+ "@cloudflare/deploy-helpers": "0.3.0",
166
+ "@cloudflare/workers-auth": "0.4.0",
165
167
  "@cloudflare/workers-shared": "0.19.7",
166
- "@cloudflare/workers-utils": "0.24.0",
167
168
  "@cloudflare/workers-tsconfig": "0.0.0",
168
- "@cloudflare/workers-auth": "0.3.2",
169
- "@cloudflare/workflows-shared": "0.11.2",
170
- "@cloudflare/codemod": "1.1.0"
169
+ "@cloudflare/workers-utils": "0.25.0",
170
+ "@cloudflare/workflows-shared": "0.11.2"
171
171
  },
172
172
  "peerDependencies": {
173
- "@cloudflare/workers-types": "^4.20260625.1"
173
+ "@cloudflare/workers-types": "^4.20260701.1"
174
174
  },
175
175
  "peerDependenciesMeta": {
176
176
  "@cloudflare/workers-types": {
@@ -1,4 +1,4 @@
1
- import { Rule as Rule$1, CfModule, Environment as Environment$1, Entry, CfModuleType, StartDevWorkerInput, NodeJSCompatMode, CfScriptFormat, Config as Config$1, AsyncHook, CfAccount as CfAccount$1, AssetsOptions as AssetsOptions$1, Binding, ConfigBindingFieldName, RawConfig as RawConfig$1, NormalizeAndValidateConfigArgs, ResolveConfigPathOptions, ApiCredentials, ParseError, LoggerLevel, ComplianceConfig, UserError, FatalError } from '@cloudflare/workers-utils';
1
+ import { Rule as Rule$1, CfModule, Environment as Environment$1, Entry, CfModuleType, StartDevWorkerInput, Config as Config$1, NodeJSCompatMode, CfScriptFormat, AsyncHook, CfAccount as CfAccount$1, AssetsOptions as AssetsOptions$1, Binding, ConfigBindingFieldName, RawConfig as RawConfig$1, NormalizeAndValidateConfigArgs, ResolveConfigPathOptions, ApiCredentials, ParseError, LoggerLevel, ComplianceConfig, UserError, FatalError } from '@cloudflare/workers-utils';
2
2
  export { Binding, experimental_patchConfig, experimental_readRawConfig, defaultWranglerConfig as unstable_defaultWranglerConfig } from '@cloudflare/workers-utils';
3
3
  import { Json as Json$1, WorkerdStructuredLog, DispatchFetch, Miniflare, WorkerRegistry, MiniflareOptions, Mutex, Response as Response$1, RemoteProxyConnectionString, WorkerOptions, ModuleRule, Request } from 'miniflare';
4
4
  import * as undici from 'undici';
@@ -8,6 +8,7 @@ import Protocol from 'devtools-protocol/types/protocol-mapping';
8
8
  import { EventEmitter } from 'node:events';
9
9
  import { ContainerNormalizedConfig } from '@cloudflare/containers-shared';
10
10
  import { FetcherScheduledOptions, FetcherScheduledResult, IncomingRequestCfProperties } from '@cloudflare/workers-types/experimental';
11
+ import { Rpc, ExportedHandler, D1Database, Workflow, Service } from '@cloudflare/workers-types/latest';
11
12
  import { RouterConfig, AssetConfig } from '@cloudflare/workers-shared';
12
13
  export { printBindings as unstable_printBindings } from '@cloudflare/deploy-helpers';
13
14
  import { URLSearchParams } from 'node:url';
@@ -335,6 +336,7 @@ type EsbuildBundle = {
335
336
  declare class ConfigController extends Controller {
336
337
  #private;
337
338
  latestInput?: StartDevWorkerInput;
339
+ latestWranglerConfig?: Config$1;
338
340
  latestConfig?: StartDevWorkerOptions;
339
341
  set(input: StartDevWorkerInput, throwErrors?: boolean): Promise<StartDevWorkerOptions | undefined>;
340
342
  patch(input: Partial<StartDevWorkerInput>): Promise<StartDevWorkerOptions | undefined>;
@@ -613,6 +615,7 @@ declare const dev: {
613
615
  experimentalProvision: boolean | undefined;
614
616
  experimentalAutoCreate: boolean;
615
617
  installSkills: boolean;
618
+ profile: string | undefined;
616
619
  script: string | undefined;
617
620
  name: string | undefined;
618
621
  compatibilityDate: string | undefined;
@@ -711,7 +714,7 @@ type AdditionalDevProps = {
711
714
  rules?: Rule$1[];
712
715
  showInteractiveDevSession?: boolean;
713
716
  };
714
- type DevArguments = Omit<(typeof dev)["args"], "installSkills">;
717
+ type DevArguments = Omit<(typeof dev)["args"], "installSkills" | "profile">;
715
718
  type StartDevOptions = DevArguments & AdditionalDevProps & {
716
719
  forceLocal?: boolean;
717
720
  accountId?: string;
@@ -727,6 +730,42 @@ type StartDevOptions = DevArguments & AdditionalDevProps & {
727
730
 
728
731
  declare function convertConfigBindingsToStartWorkerBindings(configBindings: Partial<Pick<Config$1, ConfigBindingFieldName>>): StartDevWorkerOptions["bindings"];
729
732
 
733
+ type WorkflowStepSelector = {
734
+ name: string;
735
+ index?: number;
736
+ };
737
+ type WorkflowInstanceModifier = {
738
+ disableSleeps(steps?: WorkflowStepSelector[]): Promise<void>;
739
+ disableRetryDelays(steps?: WorkflowStepSelector[]): Promise<void>;
740
+ mockStepResult(step: WorkflowStepSelector, stepResult: unknown): Promise<void>;
741
+ mockStepError(step: WorkflowStepSelector, error: Error, times?: number): Promise<void>;
742
+ forceStepTimeout(step: WorkflowStepSelector, times?: number): Promise<void>;
743
+ mockEvent(event: {
744
+ type: string;
745
+ payload: unknown;
746
+ }): Promise<void>;
747
+ forceEventTimeout(step: WorkflowStepSelector): Promise<void>;
748
+ };
749
+ type ModifierCallback = (modifier: WorkflowInstanceModifier) => Promise<void>;
750
+ interface WorkflowInstanceIntrospector {
751
+ modify(fn: ModifierCallback): Promise<WorkflowInstanceIntrospector>;
752
+ waitForStepResult(step: WorkflowStepSelector): Promise<unknown>;
753
+ waitForStatus(status: string): Promise<void>;
754
+ getOutput(): Promise<unknown>;
755
+ getError(): Promise<{
756
+ name: string;
757
+ message: string;
758
+ }>;
759
+ dispose(): Promise<void>;
760
+ [Symbol.asyncDispose](): Promise<void>;
761
+ }
762
+ interface WorkflowIntrospector {
763
+ modifyAll(fn: ModifierCallback): Promise<void>;
764
+ get(): Promise<WorkflowInstanceIntrospector[]>;
765
+ dispose(): Promise<void>;
766
+ [Symbol.asyncDispose](): Promise<void>;
767
+ }
768
+
730
769
  type TestHarnessOptions = {
731
770
  /**
732
771
  * Base directory used to resolve relative worker config paths.
@@ -738,7 +777,19 @@ type TestHarnessOptions = {
738
777
  */
739
778
  workers: WorkerInput[];
740
779
  };
741
- type WorkerHandle<Env = Record<string, any>> = {
780
+ type BindingName<Env, Type> = string extends keyof Env ? string : Extract<{
781
+ [K in keyof Env]-?: NonNullable<Env[K]> extends Type ? K : never;
782
+ }[keyof Env], string>;
783
+ type WorkerModule = {
784
+ default: WorkerExport;
785
+ [key: string]: WorkerExport | undefined;
786
+ };
787
+ type AnyExportedHandler = ExportedHandler<any, any, any, any>;
788
+ type AnyEnv = Record<string, any>;
789
+ type WorkerExport = (new (...args: any[]) => Rpc.WorkerEntrypointBranded) | Rpc.WorkerEntrypointBranded | AnyExportedHandler;
790
+ type WorkerHandle<Env = AnyEnv, Module extends WorkerModule = {
791
+ default: AnyExportedHandler;
792
+ }> = {
742
793
  /**
743
794
  * Dispatches a fetch event directly to this worker.
744
795
  * Relative URL inputs are resolved against the URL returned by `listen()`.
@@ -777,6 +828,38 @@ type WorkerHandle<Env = Record<string, any>> = {
777
828
  * ```
778
829
  */
779
830
  getEnv(): Promise<Env>;
831
+ /**
832
+ * Applies D1 migration files that have not already run to a D1 binding on this Worker.
833
+ *
834
+ * @example
835
+ * ```ts
836
+ * beforeEach(async () => {
837
+ * await worker.applyD1Migrations("DATABASE");
838
+ * });
839
+ * ```
840
+ */
841
+ applyD1Migrations(bindingName: BindingName<Env, D1Database>): Promise<void>;
842
+ /**
843
+ * Creates an introspector for a specific Workflow instance.
844
+ */
845
+ introspectWorkflowInstance(bindingName: BindingName<Env, Workflow>, instanceId: string): Promise<WorkflowInstanceIntrospector>;
846
+ /**
847
+ * Creates an introspector for Workflow instances created after this method is called.
848
+ */
849
+ introspectWorkflow(bindingName: BindingName<Env, Workflow>): Promise<WorkflowIntrospector>;
850
+ /**
851
+ * Returns the default Worker export, including JSRPC methods.
852
+ *
853
+ * @example
854
+ * ```ts
855
+ * type ApiWorkerModule = typeof import("../src/api-worker");
856
+ *
857
+ * const worker = server.getWorker<Cloudflare.Env, ApiWorkerModule>("api-worker");
858
+ * const api = await worker.getExport();
859
+ * api.getMessage();
860
+ * ```
861
+ */
862
+ getExport(): Promise<Service<Module["default"]>>;
780
863
  };
781
864
  type TestHarness = {
782
865
  /**
@@ -825,7 +908,9 @@ type TestHarness = {
825
908
  * When no name is provided, this returns the primary Worker, which is the first
826
909
  * Worker in the server's `workers` options.
827
910
  */
828
- getWorker<Env = Record<string, any>>(name?: string): WorkerHandle<Env>;
911
+ getWorker<Env = AnyEnv, Module extends WorkerModule = {
912
+ default: AnyExportedHandler;
913
+ }>(name?: string): WorkerHandle<Env, Module>;
829
914
  /**
830
915
  * Returns captured Workers runtime logs since the current server session
831
916
  * started or `clearLogs()` was last called.
@@ -879,6 +964,11 @@ type WorkerInput = {
879
964
  * Test-only secrets that override values loaded from `.dev.vars` and `.env` files.
880
965
  */
881
966
  secrets?: Record<string, string>;
967
+ /**
968
+ * Test-only service binding overrides. Keys are binding names in this
969
+ * Worker's environment, and values are Worker names in this test harness.
970
+ */
971
+ bindingOverrides?: Record<string, string>;
882
972
  } | {
883
973
  /**
884
974
  * Inline Wrangler config for this Worker.
@@ -918,12 +1008,12 @@ type ReadConfigOptions = ResolveConfigPathOptions & {
918
1008
  declare function readConfig(args: ReadConfigCommandArgs, options?: ReadConfigOptions): Config$1;
919
1009
 
920
1010
  /**
921
- * Based on the migrations, infer what the current Durable Object class names are.
922
- * This includes unbound (ctx.exports) and bound DOs.
923
- * Returns class name mapped to whether it uses SQLite storage.
924
- * This is imperfect because you can delete a migration after it has been applied.
1011
+ * Infer Durable Object class names and storage backends from migrations and
1012
+ * live declarative `exports` entries.
1013
+ *
1014
+ * In practice only one of `migrations` or `exports` will have the Durable Object configuration.
925
1015
  */
926
- declare function getDurableObjectClassNameToUseSQLiteMap(migrations: Config$1["migrations"] | undefined): Map<string, boolean>;
1016
+ declare function getDurableObjectClassNameToUseSQLiteMap(migrations: Config$1["migrations"] | undefined, exports?: Config$1["exports"] | undefined): Map<string, boolean>;
927
1017
 
928
1018
  /**
929
1019
  * Note about this file:
@@ -1284,6 +1374,66 @@ type DurableObjectMigration = {
1284
1374
  /** The Durable Objects being removed. */
1285
1375
  deleted_classes?: string[];
1286
1376
  };
1377
+ /**
1378
+ * Storage backend for a declarative Durable Object export. See
1379
+ * {@link DurableObjectExport}.
1380
+ */
1381
+ type DurableObjectExportStorage = "sqlite" | "legacy-kv";
1382
+ /**
1383
+ * A single declarative Durable Object export entry in the `exports` config
1384
+ * map. `type` is reserved for the export kind. `state` carries the Durable
1385
+ * Object lifecycle and defaults to `"created"` (live) when omitted.
1386
+ *
1387
+ * Mutually exclusive with {@link DurableObjectMigration} at the config-
1388
+ * validation boundary.
1389
+ *
1390
+ * - `created` (default, live): `storage` is required.
1391
+ * - `deleted` (tombstone): retire a provisioned namespace whose class has
1392
+ * been removed from code.
1393
+ * - `renamed` (tombstone): rewrite a provisioned namespace's class name to
1394
+ * `renamed_to`. The target name must also appear as a live (state
1395
+ * `"created"`) `durable-object` entry in the same map.
1396
+ * - `transferred` (tombstone): hand ownership of the namespace to another
1397
+ * script in the same account (`transferred_to`). Two-phase commit;
1398
+ * the target must first deploy an `expecting-transfer` entry naming this
1399
+ * script via `transfer_from`.
1400
+ * - `expecting-transfer` (live): receiving side of a two-phase transfer;
1401
+ * `storage` and `transfer_from` are both required.
1402
+ */
1403
+ type DurableObjectExport = {
1404
+ type: "durable-object";
1405
+ state?: "created";
1406
+ storage: DurableObjectExportStorage;
1407
+ } | {
1408
+ type: "durable-object";
1409
+ state: "deleted";
1410
+ } | {
1411
+ type: "durable-object";
1412
+ state: "renamed";
1413
+ renamed_to: string;
1414
+ } | {
1415
+ type: "durable-object";
1416
+ state: "transferred";
1417
+ transferred_to: string;
1418
+ } | {
1419
+ type: "durable-object";
1420
+ state: "expecting-transfer";
1421
+ storage: DurableObjectExportStorage;
1422
+ transfer_from: string;
1423
+ };
1424
+ interface WorkerEntrypointExport {
1425
+ type: "worker";
1426
+ cache?: {
1427
+ /** Whether cache is enabled for this entrypoint. */
1428
+ enabled: boolean;
1429
+ };
1430
+ }
1431
+ type ConfiguredExport = DurableObjectExport | WorkerEntrypointExport;
1432
+ /**
1433
+ * The declarative `exports` map keyed by export name. Durable Object exports
1434
+ * are mutually exclusive with `migrations` at the wrangler config layer.
1435
+ */
1436
+ type Exports = Record<string, ConfiguredExport>;
1287
1437
  /**
1288
1438
  * The `EnvironmentInheritable` interface declares all the configuration fields for an environment
1289
1439
  * that can be inherited (and overridden) from the top-level environment.
@@ -1425,6 +1575,15 @@ interface EnvironmentInheritable {
1425
1575
  * @inheritable
1426
1576
  */
1427
1577
  migrations: DurableObjectMigration[];
1578
+ /**
1579
+ * Declarative exports configuration — a map of class name to export configuration.
1580
+ *
1581
+ * The configuration of Durable Objects via `exports` is mutually exclusive with `migrations`.
1582
+ *
1583
+ * @default {}
1584
+ * @inheritable
1585
+ */
1586
+ exports: Exports;
1428
1587
  /**
1429
1588
  * "Cron" definitions to trigger a Worker's "scheduled" function.
1430
1589
  *
@@ -2508,6 +2667,8 @@ interface Observability {
2508
2667
  interface CacheOptions {
2509
2668
  /** If cache is enabled for this Worker */
2510
2669
  enabled: boolean;
2670
+ /** Whether cached assets may be reused across Worker versions. */
2671
+ cross_version_cache?: boolean;
2511
2672
  }
2512
2673
  type DockerConfiguration = {
2513
2674
  /** Socket used by miniflare to communicate with Docker */
@@ -3141,6 +3302,7 @@ interface CommonYargsOptions {
3141
3302
  "experimental-provision": boolean | undefined;
3142
3303
  "experimental-auto-create": boolean;
3143
3304
  "install-skills": boolean;
3305
+ profile: string | undefined;
3144
3306
  }
3145
3307
  type CommonYargsArgv = Argv<CommonYargsOptions>;
3146
3308
  type RemoveIndex<T> = {
@@ -3176,7 +3338,8 @@ type Teams =
3176
3338
  | "Product: Tunnels"
3177
3339
  | "Product: Email Service"
3178
3340
  | "Product: Browser Run"
3179
- | "Product: Artifacts";
3341
+ | "Product: Artifacts"
3342
+ | "Product: Flagship";
3180
3343
 
3181
3344
  /** Convert literal string types like 'foo-bar' to 'FooBar' */
3182
3345
  type PascalCase<S extends string> = string extends S ? string : S extends `${infer T}-${infer U}` ? `${Capitalize<T>}${PascalCase<U>}` : Capitalize<S>;
@@ -3340,6 +3503,14 @@ type CommandDefinition<NamedArgDefs extends NamedArgDefinitions = NamedArgDefini
3340
3503
  * @default false
3341
3504
  */
3342
3505
  supportTemporary?: boolean;
3506
+ /**
3507
+ * By default, the banner will print "Active profile: <name>" when a non-default
3508
+ * profile is resolved. Set to `false` to suppress this line while still printing
3509
+ * the rest of the banner.
3510
+ *
3511
+ * @default true
3512
+ */
3513
+ printActiveProfile?: boolean;
3343
3514
  };
3344
3515
  /**
3345
3516
  * A plain key-value object describing the CLI args for this command.
@@ -3509,6 +3680,11 @@ declare function createCLIParser(argv: string[]): {
3509
3680
  readonly type: "boolean";
3510
3681
  readonly default: false;
3511
3682
  };
3683
+ readonly profile: {
3684
+ readonly describe: "Use a specific auth profile";
3685
+ readonly type: "string";
3686
+ readonly requiresArg: true;
3687
+ };
3512
3688
  };
3513
3689
  showHelpWithCategories: () => Promise<void>;
3514
3690
  };