wrangler 4.83.0 → 4.84.1

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.
@@ -1154,6 +1154,33 @@
1154
1154
  "description": "Specifies Secret Store bindings that are bound to this Worker environment.\n\nNOTE: This field is not automatically inherited from the top level environment, and so must be specified in every named environment.",
1155
1155
  "default": []
1156
1156
  },
1157
+ "artifacts": {
1158
+ "type": "array",
1159
+ "items": {
1160
+ "type": "object",
1161
+ "properties": {
1162
+ "binding": {
1163
+ "type": "string",
1164
+ "description": "The binding name used to refer to the Artifacts instance."
1165
+ },
1166
+ "namespace": {
1167
+ "type": "string",
1168
+ "description": "The namespace to use."
1169
+ },
1170
+ "remote": {
1171
+ "type": "boolean",
1172
+ "description": "Whether to use the remote Artifacts service in local dev."
1173
+ }
1174
+ },
1175
+ "required": [
1176
+ "binding",
1177
+ "namespace"
1178
+ ],
1179
+ "additionalProperties": false
1180
+ },
1181
+ "description": "Specifies Artifacts bindings that are bound to this Worker environment. Artifacts provides git-compatible file storage on Cloudflare Workers.\n\nNOTE: This field is not automatically inherited from the top level environment, and so must be specified in every named environment.",
1182
+ "default": []
1183
+ },
1157
1184
  "unsafe_hello_world": {
1158
1185
  "type": "array",
1159
1186
  "items": {
@@ -2574,6 +2601,33 @@
2574
2601
  "description": "Specifies Secret Store bindings that are bound to this Worker environment.\n\nNOTE: This field is not automatically inherited from the top level environment, and so must be specified in every named environment.",
2575
2602
  "default": []
2576
2603
  },
2604
+ "artifacts": {
2605
+ "type": "array",
2606
+ "items": {
2607
+ "type": "object",
2608
+ "properties": {
2609
+ "binding": {
2610
+ "type": "string",
2611
+ "description": "The binding name used to refer to the Artifacts instance."
2612
+ },
2613
+ "namespace": {
2614
+ "type": "string",
2615
+ "description": "The namespace to use."
2616
+ },
2617
+ "remote": {
2618
+ "type": "boolean",
2619
+ "description": "Whether to use the remote Artifacts service in local dev."
2620
+ }
2621
+ },
2622
+ "required": [
2623
+ "binding",
2624
+ "namespace"
2625
+ ],
2626
+ "additionalProperties": false
2627
+ },
2628
+ "description": "Specifies Artifacts bindings that are bound to this Worker environment. Artifacts provides git-compatible file storage on Cloudflare Workers.\n\nNOTE: This field is not automatically inherited from the top level environment, and so must be specified in every named environment.",
2629
+ "default": []
2630
+ },
2577
2631
  "unsafe_hello_world": {
2578
2632
  "type": "array",
2579
2633
  "items": {
@@ -3069,13 +3123,13 @@
3069
3123
  "additionalProperties": false,
3070
3124
  "properties": {
3071
3125
  "logpush": {
3072
- "$ref": "#/definitions/interface-769040647-7570-17452-769040647-0-464211758037888"
3126
+ "$ref": "#/definitions/interface-769040647-8028-17910-769040647-0-474721758037888"
3073
3127
  },
3074
3128
  "observability": {
3075
- "$ref": "#/definitions/interface-769040647-7570-17452-769040647-0-464211758037888"
3129
+ "$ref": "#/definitions/interface-769040647-8028-17910-769040647-0-474721758037888"
3076
3130
  },
3077
3131
  "limits": {
3078
- "$ref": "#/definitions/interface-769040647-7570-17452-769040647-0-464211758037888"
3132
+ "$ref": "#/definitions/interface-769040647-8028-17910-769040647-0-474721758037888"
3079
3133
  },
3080
3134
  "define": {
3081
3135
  "type": "object",
@@ -3905,6 +3959,33 @@
3905
3959
  "description": "Specifies Secret Store bindings that are bound to this Worker environment.\n\nNOTE: This field is not automatically inherited from the top level environment, and so must be specified in every named environment.",
3906
3960
  "default": []
3907
3961
  },
3962
+ "artifacts": {
3963
+ "type": "array",
3964
+ "items": {
3965
+ "type": "object",
3966
+ "properties": {
3967
+ "binding": {
3968
+ "type": "string",
3969
+ "description": "The binding name used to refer to the Artifacts instance."
3970
+ },
3971
+ "namespace": {
3972
+ "type": "string",
3973
+ "description": "The namespace to use."
3974
+ },
3975
+ "remote": {
3976
+ "type": "boolean",
3977
+ "description": "Whether to use the remote Artifacts service in local dev."
3978
+ }
3979
+ },
3980
+ "required": [
3981
+ "binding",
3982
+ "namespace"
3983
+ ],
3984
+ "additionalProperties": false
3985
+ },
3986
+ "description": "Specifies Artifacts bindings that are bound to this Worker environment. Artifacts provides git-compatible file storage on Cloudflare Workers.\n\nNOTE: This field is not automatically inherited from the top level environment, and so must be specified in every named environment.",
3987
+ "default": []
3988
+ },
3908
3989
  "unsafe_hello_world": {
3909
3990
  "type": "array",
3910
3991
  "items": {
@@ -4102,7 +4183,7 @@
4102
4183
  },
4103
4184
  "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`"
4104
4185
  },
4105
- "interface-769040647-7570-17452-769040647-0-464211758037888": {
4186
+ "interface-769040647-8028-17910-769040647-0-474721758037888": {
4106
4187
  "type": "object",
4107
4188
  "properties": {
4108
4189
  "name": {
@@ -4656,7 +4737,7 @@
4656
4737
  "description": "The instance type to be used for the container. Select from one of the following named instance types: - lite: 1/16 vCPU, 256 MiB memory, and 2 GB disk - basic: 1/4 vCPU, 1 GiB memory, and 4 GB disk - standard-1: 1/2 vCPU, 4 GiB memory, and 8 GB disk - standard-2: 1 vCPU, 6 GiB memory, and 12 GB disk - standard-3: 2 vCPU, 8 GiB memory, and 16 GB disk - standard-4: 4 vCPU, 12 GiB memory, and 20 GB disk - dev: 1/16 vCPU, 256 MiB memory, and 2 GB disk (deprecated, use \"lite\" instead) - standard: 1 vCPU, 4 GiB memory, and 4 GB disk (deprecated, use \"standard-1\" instead)\n\nCustomers on an enterprise plan have the additional option to set custom limits.",
4657
4738
  "default": "dev"
4658
4739
  },
4659
- "wrangler_ssh": {
4740
+ "ssh": {
4660
4741
  "type": "object",
4661
4742
  "properties": {
4662
4743
  "enabled": {
@@ -4713,6 +4794,39 @@
4713
4794
  },
4714
4795
  "description": "Trusted user CA keys to put in the container's trusted_user_ca_keys file."
4715
4796
  },
4797
+ "constraints": {
4798
+ "type": "object",
4799
+ "properties": {
4800
+ "regions": {
4801
+ "type": "array",
4802
+ "items": {
4803
+ "type": "string",
4804
+ "enum": [
4805
+ "ENAM",
4806
+ "WNAM",
4807
+ "EEUR",
4808
+ "WEUR",
4809
+ "APAC",
4810
+ "SAM",
4811
+ "ME",
4812
+ "OC",
4813
+ "AFR"
4814
+ ]
4815
+ },
4816
+ "description": "Limit container placement to specific geographic regions."
4817
+ },
4818
+ "jurisdiction": {
4819
+ "type": "string",
4820
+ "enum": [
4821
+ "eu",
4822
+ "fedramp"
4823
+ ],
4824
+ "description": "Restrict containers to compliance boundaries."
4825
+ }
4826
+ },
4827
+ "additionalProperties": false,
4828
+ "description": "Scheduling constraints for container placement."
4829
+ },
4716
4830
  "rollout_step_percentage": {
4717
4831
  "anyOf": [
4718
4832
  {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wrangler",
3
- "version": "4.83.0",
3
+ "version": "4.84.1",
4
4
  "description": "Command-line interface for all things Cloudflare Workers",
5
5
  "keywords": [
6
6
  "assembly",
@@ -54,16 +54,16 @@
54
54
  "esbuild": "0.27.3",
55
55
  "path-to-regexp": "6.3.0",
56
56
  "unenv": "2.0.0-rc.24",
57
- "workerd": "1.20260415.1",
57
+ "workerd": "1.20260421.1",
58
58
  "@cloudflare/kv-asset-handler": "0.4.2",
59
- "miniflare": "4.20260415.0",
60
- "@cloudflare/unenv-preset": "2.16.0"
59
+ "@cloudflare/unenv-preset": "2.16.0",
60
+ "miniflare": "4.20260421.0"
61
61
  },
62
62
  "devDependencies": {
63
63
  "@aws-sdk/client-s3": "^3.721.0",
64
64
  "@bomb.sh/tab": "^0.0.12",
65
65
  "@cloudflare/types": "6.18.4",
66
- "@cloudflare/workers-types": "^4.20260415.1",
66
+ "@cloudflare/workers-types": "^4.20260421.1",
67
67
  "@cspotcode/source-map-support": "0.8.1",
68
68
  "@netlify/build-info": "^10.2.0",
69
69
  "@sentry/node": "^7.86.0",
@@ -87,7 +87,7 @@
87
87
  "@types/yargs": "^17.0.22",
88
88
  "@vitest/ui": "4.1.0",
89
89
  "@webcontainer/env": "^1.1.0",
90
- "am-i-vibing": "^0.1.0",
90
+ "am-i-vibing": "^0.1.1",
91
91
  "capnweb": "^0.5.0",
92
92
  "chalk": "^5.2.0",
93
93
  "chokidar": "^4.0.1",
@@ -146,15 +146,15 @@
146
146
  "yargs": "^17.7.2",
147
147
  "@cloudflare/cli": "1.4.0",
148
148
  "@cloudflare/codemod": "1.1.0",
149
- "@cloudflare/containers-shared": "0.13.1",
150
- "@cloudflare/pages-shared": "^0.13.125",
151
- "@cloudflare/workers-shared": "0.19.2",
149
+ "@cloudflare/pages-shared": "^0.13.127",
152
150
  "@cloudflare/workers-tsconfig": "0.0.0",
153
- "@cloudflare/workers-utils": "0.16.1",
154
- "@cloudflare/workflows-shared": "0.9.0"
151
+ "@cloudflare/workers-utils": "0.17.0",
152
+ "@cloudflare/workflows-shared": "0.9.0",
153
+ "@cloudflare/containers-shared": "0.14.0",
154
+ "@cloudflare/workers-shared": "0.19.2"
155
155
  },
156
156
  "peerDependencies": {
157
- "@cloudflare/workers-types": "^4.20260415.1"
157
+ "@cloudflare/workers-types": "^4.20260421.1"
158
158
  },
159
159
  "peerDependenciesMeta": {
160
160
  "@cloudflare/workers-types": {
@@ -155,8 +155,9 @@ export class ProxyWorker implements DurableObject {
155
155
  res = new Response(res.body, res);
156
156
  rewriteUrlRelatedHeaders(res.headers, innerUrl, outerUrl);
157
157
 
158
+ await checkForPreviewTokenError(res, this.env, proxyData);
159
+
158
160
  if (isHtmlResponse(res)) {
159
- await checkForPreviewTokenError(res, this.env, proxyData);
160
161
  res = insertLiveReloadScript(request, res, this.env, proxyData);
161
162
  }
162
163
 
@@ -256,8 +257,15 @@ async function checkForPreviewTokenError(
256
257
  // so we clone and read the text instead.
257
258
  const clone = response.clone();
258
259
  const text = await clone.text();
259
- // Naive string match should be good enough when combined with status code check
260
- if (text.includes("Invalid Workers Preview configuration")) {
260
+ // Naive string match should be good enough when combined with status code check.
261
+ // "Invalid Workers Preview configuration" is the HTML error returned when the
262
+ // preview token has expired. "error code: 1031" is a text/plain error returned
263
+ // by remote bindings (e.g. Workers AI) when their underlying session has timed out.
264
+ // Both indicate the preview session needs to be refreshed.
265
+ if (
266
+ text.includes("Invalid Workers Preview configuration") ||
267
+ text.includes("error code: 1031")
268
+ ) {
261
269
  void sendMessageToProxyController(env, {
262
270
  type: "previewTokenExpired",
263
271
  proxyData,
@@ -17,6 +17,7 @@ function serialiseError(e) {
17
17
 
18
18
  // src/api/startDevWorker/utils.ts
19
19
  import assert from "node:assert";
20
+ var PREVIEW_TOKEN_REFRESH_INTERVAL = 50 * 60 * 1e3;
20
21
  function createDeferred(previousDeferred) {
21
22
  let resolve, reject;
22
23
  const newPromise = new Promise((_resolve, _reject) => {
@@ -1,5 +1,6 @@
1
1
  // src/api/startDevWorker/utils.ts
2
2
  import assert from "node:assert";
3
+ var PREVIEW_TOKEN_REFRESH_INTERVAL = 50 * 60 * 1e3;
3
4
  function createDeferred(previousDeferred) {
4
5
  let resolve, reject;
5
6
  const newPromise = new Promise((_resolve, _reject) => {
@@ -113,8 +114,8 @@ var ProxyWorker = class {
113
114
  void fetch(userWorkerUrl, new Request(request, { headers })).then(async (res) => {
114
115
  res = new Response(res.body, res);
115
116
  rewriteUrlRelatedHeaders(res.headers, innerUrl, outerUrl);
117
+ await checkForPreviewTokenError(res, this.env, proxyData);
116
118
  if (isHtmlResponse(res)) {
117
- await checkForPreviewTokenError(res, this.env, proxyData);
118
119
  res = insertLiveReloadScript(request, res, this.env, proxyData);
119
120
  }
120
121
  deferredResponse.resolve(res);
@@ -171,7 +172,7 @@ async function checkForPreviewTokenError(response, env, proxyData) {
171
172
  }
172
173
  const clone = response.clone();
173
174
  const text = await clone.text();
174
- if (text.includes("Invalid Workers Preview configuration")) {
175
+ if (text.includes("Invalid Workers Preview configuration") || text.includes("error code: 1031")) {
175
176
  void sendMessageToProxyController(env, {
176
177
  type: "previewTokenExpired",
177
178
  proxyData
@@ -193,13 +193,13 @@ declare function deploy({ directory, accountId, projectName, branch, skipCaching
193
193
  };
194
194
  };
195
195
  latest_stage: {
196
- status: "skipped" | "canceled" | "active" | "success" | "idle" | "failure";
196
+ status: "skipped" | "active" | "canceled" | "success" | "idle" | "failure";
197
197
  name: "build" | "queued" | "deploy" | "initialize" | "clone_repo";
198
198
  started_on: string | null;
199
199
  ended_on: string | null;
200
200
  };
201
201
  stages: {
202
- status: "skipped" | "canceled" | "active" | "success" | "idle" | "failure";
202
+ status: "skipped" | "active" | "canceled" | "success" | "idle" | "failure";
203
203
  name: "build" | "queued" | "deploy" | "initialize" | "clone_repo";
204
204
  started_on: string | null;
205
205
  ended_on: string | null;
@@ -939,7 +939,7 @@ type ContainerApp = {
939
939
  /** @defaults to 2 GB */
940
940
  disk_mb?: number;
941
941
  };
942
- wrangler_ssh?: {
942
+ ssh?: {
943
943
  /**
944
944
  * If enabled, those with write access to a container will be able to SSH into it through Wrangler.
945
945
  * @default false
@@ -951,6 +951,14 @@ type ContainerApp = {
951
951
  */
952
952
  port?: number;
953
953
  };
954
+ /**
955
+ * @deprecated Use `ssh` instead.
956
+ * @hidden
957
+ */
958
+ wrangler_ssh?: {
959
+ enabled: boolean;
960
+ port?: number;
961
+ };
954
962
  /**
955
963
  * SSH public keys to put in the container's authorized_keys file.
956
964
  */
@@ -989,16 +997,29 @@ type ContainerApp = {
989
997
  memory_mib?: number;
990
998
  };
991
999
  /**
992
- * Scheduling constraints
993
- * @hidden
1000
+ * Scheduling constraints for container placement.
994
1001
  */
995
1002
  constraints?: {
996
- regions?: string[];
1003
+ /**
1004
+ * Limit container placement to specific geographic regions.
1005
+ */
1006
+ regions?: ("ENAM" | "WNAM" | "EEUR" | "WEUR" | "APAC" | "SAM" | "ME" | "OC" | "AFR")[];
1007
+ /**
1008
+ * Restrict containers to compliance boundaries.
1009
+ */
1010
+ jurisdiction?: "eu" | "fedramp";
1011
+ /**
1012
+ * @hidden
1013
+ */
997
1014
  cities?: string[];
998
1015
  /**
999
1016
  * @deprecated Use `tiers` instead
1017
+ * @hidden
1000
1018
  */
1001
1019
  tier?: number;
1020
+ /**
1021
+ * @hidden
1022
+ */
1002
1023
  tiers?: number[];
1003
1024
  };
1004
1025
  /**
@@ -2009,6 +2030,24 @@ interface EnvironmentNonInheritable {
2009
2030
  /** Name of the secret */
2010
2031
  secret_name: string;
2011
2032
  }[];
2033
+ /**
2034
+ * Specifies Artifacts bindings that are bound to this Worker environment.
2035
+ * Artifacts provides git-compatible file storage on Cloudflare Workers.
2036
+ *
2037
+ * NOTE: This field is not automatically inherited from the top level environment,
2038
+ * and so must be specified in every named environment.
2039
+ *
2040
+ * @default []
2041
+ * @nonInheritable
2042
+ */
2043
+ artifacts: {
2044
+ /** The binding name used to refer to the Artifacts instance. */
2045
+ binding: string;
2046
+ /** The namespace to use. */
2047
+ namespace: string;
2048
+ /** Whether to use the remote Artifacts service in local dev. */
2049
+ remote?: boolean;
2050
+ }[];
2012
2051
  /**
2013
2052
  * **DO NOT USE**. Hello World Binding Config to serve as an explanatory example.
2014
2053
  *
@@ -2846,8 +2885,8 @@ type WorkerConfigObject = {
2846
2885
  declare function maybeStartOrUpdateRemoteProxySession(wranglerOrWorkerConfigObject: WranglerConfigObject | WorkerConfigObject, preExistingRemoteProxySessionData?: {
2847
2886
  session: RemoteProxySession;
2848
2887
  remoteBindings: Record<string, Binding>;
2849
- auth?: CfAccount | undefined;
2850
- } | null, auth?: CfAccount | undefined): Promise<{
2888
+ auth?: AsyncHook<CfAccount> | undefined;
2889
+ } | null, auth?: AsyncHook<CfAccount> | undefined): Promise<{
2851
2890
  session: RemoteProxySession;
2852
2891
  remoteBindings: Record<string, Binding>;
2853
2892
  } | null>;
@@ -2976,7 +3015,7 @@ type Teams =
2976
3015
  | "Product: WVPC"
2977
3016
  | "Product: Tunnels"
2978
3017
  | "Product: Email Service"
2979
- | "Product: Browser Rendering";
3018
+ | "Product: Browser Run";
2980
3019
 
2981
3020
  /** Convert literal string types like 'foo-bar' to 'FooBar' */
2982
3021
  type PascalCase<S extends string> = string extends S ? string : S extends `${infer T}-${infer U}` ? `${Capitalize<T>}${PascalCase<U>}` : Capitalize<S>;