@cloudflare/workers-types 4.20260520.1 → 4.20260522.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.
package/latest/index.d.ts CHANGED
@@ -10734,12 +10734,16 @@ declare abstract class Base_Ai_Cf_Moonshotai_Kimi_K2_5 {
10734
10734
  inputs: ChatCompletionsInput;
10735
10735
  postProcessedOutputs: ChatCompletionsOutput;
10736
10736
  }
10737
+ declare abstract class Base_Ai_Cf_Moonshotai_Kimi_K2_6 {
10738
+ inputs: ChatCompletionsBase;
10739
+ postProcessedOutputs: ChatCompletionsOutput;
10740
+ }
10737
10741
  declare abstract class Base_Ai_Cf_Nvidia_Nemotron_3_120B_A12B {
10738
10742
  inputs: ChatCompletionsInput;
10739
10743
  postProcessedOutputs: ChatCompletionsOutput;
10740
10744
  }
10741
10745
  declare abstract class Base_Ai_Cf_Google_Gemma_4_26B_A4B_IT {
10742
- inputs: ChatCompletionsInput;
10746
+ inputs: ChatCompletionsBase;
10743
10747
  postProcessedOutputs: ChatCompletionsOutput;
10744
10748
  }
10745
10749
  interface AiModels {
@@ -10831,7 +10835,9 @@ interface AiModels {
10831
10835
  "@cf/black-forest-labs/flux-2-klein-9b": Base_Ai_Cf_Black_Forest_Labs_Flux_2_Klein_9B;
10832
10836
  "@cf/zai-org/glm-4.7-flash": Base_Ai_Cf_Zai_Org_Glm_4_7_Flash;
10833
10837
  "@cf/moonshotai/kimi-k2.5": Base_Ai_Cf_Moonshotai_Kimi_K2_5;
10838
+ "@cf/moonshotai/kimi-k2.6": Base_Ai_Cf_Moonshotai_Kimi_K2_6;
10834
10839
  "@cf/nvidia/nemotron-3-120b-a12b": Base_Ai_Cf_Nvidia_Nemotron_3_120B_A12B;
10840
+ "@cf/google/gemma-4-26b-a4b-it": Base_Ai_Cf_Google_Gemma_4_26B_A4B_IT;
10835
10841
  }
10836
10842
  type AiOptions = {
10837
10843
  /**
@@ -13752,15 +13758,29 @@ declare namespace CloudflareWorkersModule {
13752
13758
  attempt: number;
13753
13759
  config: WorkflowStepConfig;
13754
13760
  };
13761
+ export type WorkflowRollbackContext<T = unknown> = {
13762
+ error: Error;
13763
+ output: T | undefined;
13764
+ stepName: string;
13765
+ };
13766
+ export type WorkflowRollbackHandler<T = unknown> = (
13767
+ ctx: WorkflowRollbackContext<T>,
13768
+ ) => Promise<void>;
13769
+ export type WorkflowStepRollbackOptions<T = unknown> = {
13770
+ rollback?: WorkflowRollbackHandler<T>;
13771
+ rollbackConfig?: WorkflowStepConfig;
13772
+ };
13755
13773
  export abstract class WorkflowStep {
13756
13774
  do<T extends Rpc.Serializable<T>>(
13757
13775
  name: string,
13758
13776
  callback: (ctx: WorkflowStepContext) => Promise<T>,
13777
+ rollbackOptions?: WorkflowStepRollbackOptions<T>,
13759
13778
  ): Promise<T>;
13760
13779
  do<T extends Rpc.Serializable<T>>(
13761
13780
  name: string,
13762
13781
  config: WorkflowStepConfig,
13763
13782
  callback: (ctx: WorkflowStepContext) => Promise<T>,
13783
+ rollbackOptions?: WorkflowStepRollbackOptions<T>,
13764
13784
  ): Promise<T>;
13765
13785
  sleep: (name: string, duration: WorkflowSleepDuration) => Promise<void>;
13766
13786
  sleepUntil: (name: string, timestamp: Date | number) => Promise<void>;
@@ -15152,6 +15172,103 @@ type WorkerVersionMetadata = {
15152
15172
  /** The timestamp of when the Worker Version was uploaded */
15153
15173
  timestamp: string;
15154
15174
  };
15175
+ // ============ Web Search Request Types ============
15176
+ /**
15177
+ * Options for a Web Search query.
15178
+ */
15179
+ type WebSearchSearchOptions = {
15180
+ /** The search query. */
15181
+ query: string;
15182
+ /**
15183
+ * Maximum number of results to return. Defaults to 10, capped at 20.
15184
+ * The actual count may be lower if fewer matches exist.
15185
+ */
15186
+ limit?: number;
15187
+ };
15188
+ // ============ Web Search Response Types ============
15189
+ /**
15190
+ * A single Web Search result.
15191
+ *
15192
+ * Web Search is discovery-only -- results carry catalog metadata about a page
15193
+ * but never the page body. To read a result's content the caller invokes the
15194
+ * global `fetch()` API against the result's `url`, at which point the
15195
+ * destination's own access controls apply (including Cloudflare Pay-per-Crawl).
15196
+ */
15197
+ type WebSearchResult = {
15198
+ /** Canonical URL. */
15199
+ url: string;
15200
+ /** Page title. */
15201
+ title: string;
15202
+ /** Page-level description. May be absent. */
15203
+ description?: string;
15204
+ /**
15205
+ * Last-modified date for the page, when known. Naive (no timezone)
15206
+ * ISO-8601 datetime, e.g. `"2025-11-30T04:39:48"`.
15207
+ */
15208
+ lastModifiedDate?: string;
15209
+ /**
15210
+ * Page meta image URL (typically the `og:image`). May be absent.
15211
+ */
15212
+ imageUrl?: string;
15213
+ /** Optional favicon URL for UI hints. */
15214
+ faviconUrl?: string;
15215
+ };
15216
+ /**
15217
+ * Per-response metadata for a Web Search query. Carries operational
15218
+ * fields useful for support and debugging.
15219
+ */
15220
+ type WebSearchResponseMetadata = {
15221
+ /** The query that was executed. */
15222
+ query: string;
15223
+ /** Opaque request identifier used for support and debugging. */
15224
+ requestId: string;
15225
+ /** End-to-end latency for this search request, in milliseconds. */
15226
+ latencyMs: number;
15227
+ };
15228
+ /**
15229
+ * Response from a Web Search query.
15230
+ */
15231
+ type WebSearchSearchResponse = {
15232
+ items: WebSearchResult[];
15233
+ metadata: WebSearchResponseMetadata;
15234
+ };
15235
+ // ============ Web Search Binding Class ============
15236
+ /**
15237
+ * Cloudflare Web Search binding.
15238
+ *
15239
+ * Discovery-only primitive for agents and Workers. Returns URLs and catalog
15240
+ * metadata for a query; never returns page content or excerpts. To read a
15241
+ * result's body, fetch the URL with the global `fetch()` API.
15242
+ *
15243
+ * Declared in wrangler with a single object (there is exactly one corpus, the
15244
+ * public web, so there is no name, namespace, or instance to specify):
15245
+ *
15246
+ * ```jsonc
15247
+ * { "web_search": { "binding": "WEBSEARCH" } }
15248
+ * ```
15249
+ *
15250
+ * @example
15251
+ * ```ts
15252
+ * const { items, metadata } = await env.WEBSEARCH.search({
15253
+ * query: "Cloudflare Workers",
15254
+ * });
15255
+ *
15256
+ * const top = items[0];
15257
+ * console.log(top.url, top.title, metadata.latencyMs);
15258
+ *
15259
+ * // Read content yourself; pay-per-crawl and other publisher
15260
+ * // controls apply at the fetch site, not at search time.
15261
+ * const page = await fetch(top.url);
15262
+ * ```
15263
+ */
15264
+ declare abstract class WebSearch {
15265
+ /**
15266
+ * Run a Web Search query.
15267
+ * @param options Search options. Only `query` is required.
15268
+ * @returns The matching results plus per-response metadata.
15269
+ */
15270
+ search(options: WebSearchSearchOptions): Promise<WebSearchSearchResponse>;
15271
+ }
15155
15272
  interface DynamicDispatchLimits {
15156
15273
  /**
15157
15274
  * Limit CPU time in milliseconds.
package/latest/index.ts CHANGED
@@ -10744,12 +10744,16 @@ export declare abstract class Base_Ai_Cf_Moonshotai_Kimi_K2_5 {
10744
10744
  inputs: ChatCompletionsInput;
10745
10745
  postProcessedOutputs: ChatCompletionsOutput;
10746
10746
  }
10747
+ export declare abstract class Base_Ai_Cf_Moonshotai_Kimi_K2_6 {
10748
+ inputs: ChatCompletionsBase;
10749
+ postProcessedOutputs: ChatCompletionsOutput;
10750
+ }
10747
10751
  export declare abstract class Base_Ai_Cf_Nvidia_Nemotron_3_120B_A12B {
10748
10752
  inputs: ChatCompletionsInput;
10749
10753
  postProcessedOutputs: ChatCompletionsOutput;
10750
10754
  }
10751
10755
  export declare abstract class Base_Ai_Cf_Google_Gemma_4_26B_A4B_IT {
10752
- inputs: ChatCompletionsInput;
10756
+ inputs: ChatCompletionsBase;
10753
10757
  postProcessedOutputs: ChatCompletionsOutput;
10754
10758
  }
10755
10759
  export interface AiModels {
@@ -10841,7 +10845,9 @@ export interface AiModels {
10841
10845
  "@cf/black-forest-labs/flux-2-klein-9b": Base_Ai_Cf_Black_Forest_Labs_Flux_2_Klein_9B;
10842
10846
  "@cf/zai-org/glm-4.7-flash": Base_Ai_Cf_Zai_Org_Glm_4_7_Flash;
10843
10847
  "@cf/moonshotai/kimi-k2.5": Base_Ai_Cf_Moonshotai_Kimi_K2_5;
10848
+ "@cf/moonshotai/kimi-k2.6": Base_Ai_Cf_Moonshotai_Kimi_K2_6;
10844
10849
  "@cf/nvidia/nemotron-3-120b-a12b": Base_Ai_Cf_Nvidia_Nemotron_3_120B_A12B;
10850
+ "@cf/google/gemma-4-26b-a4b-it": Base_Ai_Cf_Google_Gemma_4_26B_A4B_IT;
10845
10851
  }
10846
10852
  export type AiOptions = {
10847
10853
  /**
@@ -13723,15 +13729,29 @@ export declare namespace CloudflareWorkersModule {
13723
13729
  attempt: number;
13724
13730
  config: WorkflowStepConfig;
13725
13731
  };
13732
+ export type WorkflowRollbackContext<T = unknown> = {
13733
+ error: Error;
13734
+ output: T | undefined;
13735
+ stepName: string;
13736
+ };
13737
+ export type WorkflowRollbackHandler<T = unknown> = (
13738
+ ctx: WorkflowRollbackContext<T>,
13739
+ ) => Promise<void>;
13740
+ export type WorkflowStepRollbackOptions<T = unknown> = {
13741
+ rollback?: WorkflowRollbackHandler<T>;
13742
+ rollbackConfig?: WorkflowStepConfig;
13743
+ };
13726
13744
  export abstract class WorkflowStep {
13727
13745
  do<T extends Rpc.Serializable<T>>(
13728
13746
  name: string,
13729
13747
  callback: (ctx: WorkflowStepContext) => Promise<T>,
13748
+ rollbackOptions?: WorkflowStepRollbackOptions<T>,
13730
13749
  ): Promise<T>;
13731
13750
  do<T extends Rpc.Serializable<T>>(
13732
13751
  name: string,
13733
13752
  config: WorkflowStepConfig,
13734
13753
  callback: (ctx: WorkflowStepContext) => Promise<T>,
13754
+ rollbackOptions?: WorkflowStepRollbackOptions<T>,
13735
13755
  ): Promise<T>;
13736
13756
  sleep: (name: string, duration: WorkflowSleepDuration) => Promise<void>;
13737
13757
  sleepUntil: (name: string, timestamp: Date | number) => Promise<void>;
@@ -15113,6 +15133,103 @@ export type WorkerVersionMetadata = {
15113
15133
  /** The timestamp of when the Worker Version was uploaded */
15114
15134
  timestamp: string;
15115
15135
  };
15136
+ // ============ Web Search Request Types ============
15137
+ /**
15138
+ * Options for a Web Search query.
15139
+ */
15140
+ export type WebSearchSearchOptions = {
15141
+ /** The search query. */
15142
+ query: string;
15143
+ /**
15144
+ * Maximum number of results to return. Defaults to 10, capped at 20.
15145
+ * The actual count may be lower if fewer matches exist.
15146
+ */
15147
+ limit?: number;
15148
+ };
15149
+ // ============ Web Search Response Types ============
15150
+ /**
15151
+ * A single Web Search result.
15152
+ *
15153
+ * Web Search is discovery-only -- results carry catalog metadata about a page
15154
+ * but never the page body. To read a result's content the caller invokes the
15155
+ * global `fetch()` API against the result's `url`, at which point the
15156
+ * destination's own access controls apply (including Cloudflare Pay-per-Crawl).
15157
+ */
15158
+ export type WebSearchResult = {
15159
+ /** Canonical URL. */
15160
+ url: string;
15161
+ /** Page title. */
15162
+ title: string;
15163
+ /** Page-level description. May be absent. */
15164
+ description?: string;
15165
+ /**
15166
+ * Last-modified date for the page, when known. Naive (no timezone)
15167
+ * ISO-8601 datetime, e.g. `"2025-11-30T04:39:48"`.
15168
+ */
15169
+ lastModifiedDate?: string;
15170
+ /**
15171
+ * Page meta image URL (typically the `og:image`). May be absent.
15172
+ */
15173
+ imageUrl?: string;
15174
+ /** Optional favicon URL for UI hints. */
15175
+ faviconUrl?: string;
15176
+ };
15177
+ /**
15178
+ * Per-response metadata for a Web Search query. Carries operational
15179
+ * fields useful for support and debugging.
15180
+ */
15181
+ export type WebSearchResponseMetadata = {
15182
+ /** The query that was executed. */
15183
+ query: string;
15184
+ /** Opaque request identifier used for support and debugging. */
15185
+ requestId: string;
15186
+ /** End-to-end latency for this search request, in milliseconds. */
15187
+ latencyMs: number;
15188
+ };
15189
+ /**
15190
+ * Response from a Web Search query.
15191
+ */
15192
+ export type WebSearchSearchResponse = {
15193
+ items: WebSearchResult[];
15194
+ metadata: WebSearchResponseMetadata;
15195
+ };
15196
+ // ============ Web Search Binding Class ============
15197
+ /**
15198
+ * Cloudflare Web Search binding.
15199
+ *
15200
+ * Discovery-only primitive for agents and Workers. Returns URLs and catalog
15201
+ * metadata for a query; never returns page content or excerpts. To read a
15202
+ * result's body, fetch the URL with the global `fetch()` API.
15203
+ *
15204
+ * Declared in wrangler with a single object (there is exactly one corpus, the
15205
+ * public web, so there is no name, namespace, or instance to specify):
15206
+ *
15207
+ * ```jsonc
15208
+ * { "web_search": { "binding": "WEBSEARCH" } }
15209
+ * ```
15210
+ *
15211
+ * @example
15212
+ * ```ts
15213
+ * const { items, metadata } = await env.WEBSEARCH.search({
15214
+ * query: "Cloudflare Workers",
15215
+ * });
15216
+ *
15217
+ * const top = items[0];
15218
+ * console.log(top.url, top.title, metadata.latencyMs);
15219
+ *
15220
+ * // Read content yourself; pay-per-crawl and other publisher
15221
+ * // controls apply at the fetch site, not at search time.
15222
+ * const page = await fetch(top.url);
15223
+ * ```
15224
+ */
15225
+ export declare abstract class WebSearch {
15226
+ /**
15227
+ * Run a Web Search query.
15228
+ * @param options Search options. Only `query` is required.
15229
+ * @returns The matching results plus per-response metadata.
15230
+ */
15231
+ search(options: WebSearchSearchOptions): Promise<WebSearchSearchResponse>;
15232
+ }
15116
15233
  export interface DynamicDispatchLimits {
15117
15234
  /**
15118
15235
  * Limit CPU time in milliseconds.
package/oldest/index.d.ts CHANGED
@@ -10593,12 +10593,16 @@ declare abstract class Base_Ai_Cf_Moonshotai_Kimi_K2_5 {
10593
10593
  inputs: ChatCompletionsInput;
10594
10594
  postProcessedOutputs: ChatCompletionsOutput;
10595
10595
  }
10596
+ declare abstract class Base_Ai_Cf_Moonshotai_Kimi_K2_6 {
10597
+ inputs: ChatCompletionsBase;
10598
+ postProcessedOutputs: ChatCompletionsOutput;
10599
+ }
10596
10600
  declare abstract class Base_Ai_Cf_Nvidia_Nemotron_3_120B_A12B {
10597
10601
  inputs: ChatCompletionsInput;
10598
10602
  postProcessedOutputs: ChatCompletionsOutput;
10599
10603
  }
10600
10604
  declare abstract class Base_Ai_Cf_Google_Gemma_4_26B_A4B_IT {
10601
- inputs: ChatCompletionsInput;
10605
+ inputs: ChatCompletionsBase;
10602
10606
  postProcessedOutputs: ChatCompletionsOutput;
10603
10607
  }
10604
10608
  interface AiModels {
@@ -10690,7 +10694,9 @@ interface AiModels {
10690
10694
  "@cf/black-forest-labs/flux-2-klein-9b": Base_Ai_Cf_Black_Forest_Labs_Flux_2_Klein_9B;
10691
10695
  "@cf/zai-org/glm-4.7-flash": Base_Ai_Cf_Zai_Org_Glm_4_7_Flash;
10692
10696
  "@cf/moonshotai/kimi-k2.5": Base_Ai_Cf_Moonshotai_Kimi_K2_5;
10697
+ "@cf/moonshotai/kimi-k2.6": Base_Ai_Cf_Moonshotai_Kimi_K2_6;
10693
10698
  "@cf/nvidia/nemotron-3-120b-a12b": Base_Ai_Cf_Nvidia_Nemotron_3_120B_A12B;
10699
+ "@cf/google/gemma-4-26b-a4b-it": Base_Ai_Cf_Google_Gemma_4_26B_A4B_IT;
10694
10700
  }
10695
10701
  type AiOptions = {
10696
10702
  /**
@@ -13611,15 +13617,29 @@ declare namespace CloudflareWorkersModule {
13611
13617
  attempt: number;
13612
13618
  config: WorkflowStepConfig;
13613
13619
  };
13620
+ export type WorkflowRollbackContext<T = unknown> = {
13621
+ error: Error;
13622
+ output: T | undefined;
13623
+ stepName: string;
13624
+ };
13625
+ export type WorkflowRollbackHandler<T = unknown> = (
13626
+ ctx: WorkflowRollbackContext<T>,
13627
+ ) => Promise<void>;
13628
+ export type WorkflowStepRollbackOptions<T = unknown> = {
13629
+ rollback?: WorkflowRollbackHandler<T>;
13630
+ rollbackConfig?: WorkflowStepConfig;
13631
+ };
13614
13632
  export abstract class WorkflowStep {
13615
13633
  do<T extends Rpc.Serializable<T>>(
13616
13634
  name: string,
13617
13635
  callback: (ctx: WorkflowStepContext) => Promise<T>,
13636
+ rollbackOptions?: WorkflowStepRollbackOptions<T>,
13618
13637
  ): Promise<T>;
13619
13638
  do<T extends Rpc.Serializable<T>>(
13620
13639
  name: string,
13621
13640
  config: WorkflowStepConfig,
13622
13641
  callback: (ctx: WorkflowStepContext) => Promise<T>,
13642
+ rollbackOptions?: WorkflowStepRollbackOptions<T>,
13623
13643
  ): Promise<T>;
13624
13644
  sleep: (name: string, duration: WorkflowSleepDuration) => Promise<void>;
13625
13645
  sleepUntil: (name: string, timestamp: Date | number) => Promise<void>;
@@ -15011,6 +15031,103 @@ type WorkerVersionMetadata = {
15011
15031
  /** The timestamp of when the Worker Version was uploaded */
15012
15032
  timestamp: string;
15013
15033
  };
15034
+ // ============ Web Search Request Types ============
15035
+ /**
15036
+ * Options for a Web Search query.
15037
+ */
15038
+ type WebSearchSearchOptions = {
15039
+ /** The search query. */
15040
+ query: string;
15041
+ /**
15042
+ * Maximum number of results to return. Defaults to 10, capped at 20.
15043
+ * The actual count may be lower if fewer matches exist.
15044
+ */
15045
+ limit?: number;
15046
+ };
15047
+ // ============ Web Search Response Types ============
15048
+ /**
15049
+ * A single Web Search result.
15050
+ *
15051
+ * Web Search is discovery-only -- results carry catalog metadata about a page
15052
+ * but never the page body. To read a result's content the caller invokes the
15053
+ * global `fetch()` API against the result's `url`, at which point the
15054
+ * destination's own access controls apply (including Cloudflare Pay-per-Crawl).
15055
+ */
15056
+ type WebSearchResult = {
15057
+ /** Canonical URL. */
15058
+ url: string;
15059
+ /** Page title. */
15060
+ title: string;
15061
+ /** Page-level description. May be absent. */
15062
+ description?: string;
15063
+ /**
15064
+ * Last-modified date for the page, when known. Naive (no timezone)
15065
+ * ISO-8601 datetime, e.g. `"2025-11-30T04:39:48"`.
15066
+ */
15067
+ lastModifiedDate?: string;
15068
+ /**
15069
+ * Page meta image URL (typically the `og:image`). May be absent.
15070
+ */
15071
+ imageUrl?: string;
15072
+ /** Optional favicon URL for UI hints. */
15073
+ faviconUrl?: string;
15074
+ };
15075
+ /**
15076
+ * Per-response metadata for a Web Search query. Carries operational
15077
+ * fields useful for support and debugging.
15078
+ */
15079
+ type WebSearchResponseMetadata = {
15080
+ /** The query that was executed. */
15081
+ query: string;
15082
+ /** Opaque request identifier used for support and debugging. */
15083
+ requestId: string;
15084
+ /** End-to-end latency for this search request, in milliseconds. */
15085
+ latencyMs: number;
15086
+ };
15087
+ /**
15088
+ * Response from a Web Search query.
15089
+ */
15090
+ type WebSearchSearchResponse = {
15091
+ items: WebSearchResult[];
15092
+ metadata: WebSearchResponseMetadata;
15093
+ };
15094
+ // ============ Web Search Binding Class ============
15095
+ /**
15096
+ * Cloudflare Web Search binding.
15097
+ *
15098
+ * Discovery-only primitive for agents and Workers. Returns URLs and catalog
15099
+ * metadata for a query; never returns page content or excerpts. To read a
15100
+ * result's body, fetch the URL with the global `fetch()` API.
15101
+ *
15102
+ * Declared in wrangler with a single object (there is exactly one corpus, the
15103
+ * public web, so there is no name, namespace, or instance to specify):
15104
+ *
15105
+ * ```jsonc
15106
+ * { "web_search": { "binding": "WEBSEARCH" } }
15107
+ * ```
15108
+ *
15109
+ * @example
15110
+ * ```ts
15111
+ * const { items, metadata } = await env.WEBSEARCH.search({
15112
+ * query: "Cloudflare Workers",
15113
+ * });
15114
+ *
15115
+ * const top = items[0];
15116
+ * console.log(top.url, top.title, metadata.latencyMs);
15117
+ *
15118
+ * // Read content yourself; pay-per-crawl and other publisher
15119
+ * // controls apply at the fetch site, not at search time.
15120
+ * const page = await fetch(top.url);
15121
+ * ```
15122
+ */
15123
+ declare abstract class WebSearch {
15124
+ /**
15125
+ * Run a Web Search query.
15126
+ * @param options Search options. Only `query` is required.
15127
+ * @returns The matching results plus per-response metadata.
15128
+ */
15129
+ search(options: WebSearchSearchOptions): Promise<WebSearchSearchResponse>;
15130
+ }
15014
15131
  interface DynamicDispatchLimits {
15015
15132
  /**
15016
15133
  * Limit CPU time in milliseconds.
package/oldest/index.ts CHANGED
@@ -10603,12 +10603,16 @@ export declare abstract class Base_Ai_Cf_Moonshotai_Kimi_K2_5 {
10603
10603
  inputs: ChatCompletionsInput;
10604
10604
  postProcessedOutputs: ChatCompletionsOutput;
10605
10605
  }
10606
+ export declare abstract class Base_Ai_Cf_Moonshotai_Kimi_K2_6 {
10607
+ inputs: ChatCompletionsBase;
10608
+ postProcessedOutputs: ChatCompletionsOutput;
10609
+ }
10606
10610
  export declare abstract class Base_Ai_Cf_Nvidia_Nemotron_3_120B_A12B {
10607
10611
  inputs: ChatCompletionsInput;
10608
10612
  postProcessedOutputs: ChatCompletionsOutput;
10609
10613
  }
10610
10614
  export declare abstract class Base_Ai_Cf_Google_Gemma_4_26B_A4B_IT {
10611
- inputs: ChatCompletionsInput;
10615
+ inputs: ChatCompletionsBase;
10612
10616
  postProcessedOutputs: ChatCompletionsOutput;
10613
10617
  }
10614
10618
  export interface AiModels {
@@ -10700,7 +10704,9 @@ export interface AiModels {
10700
10704
  "@cf/black-forest-labs/flux-2-klein-9b": Base_Ai_Cf_Black_Forest_Labs_Flux_2_Klein_9B;
10701
10705
  "@cf/zai-org/glm-4.7-flash": Base_Ai_Cf_Zai_Org_Glm_4_7_Flash;
10702
10706
  "@cf/moonshotai/kimi-k2.5": Base_Ai_Cf_Moonshotai_Kimi_K2_5;
10707
+ "@cf/moonshotai/kimi-k2.6": Base_Ai_Cf_Moonshotai_Kimi_K2_6;
10703
10708
  "@cf/nvidia/nemotron-3-120b-a12b": Base_Ai_Cf_Nvidia_Nemotron_3_120B_A12B;
10709
+ "@cf/google/gemma-4-26b-a4b-it": Base_Ai_Cf_Google_Gemma_4_26B_A4B_IT;
10704
10710
  }
10705
10711
  export type AiOptions = {
10706
10712
  /**
@@ -13582,15 +13588,29 @@ export declare namespace CloudflareWorkersModule {
13582
13588
  attempt: number;
13583
13589
  config: WorkflowStepConfig;
13584
13590
  };
13591
+ export type WorkflowRollbackContext<T = unknown> = {
13592
+ error: Error;
13593
+ output: T | undefined;
13594
+ stepName: string;
13595
+ };
13596
+ export type WorkflowRollbackHandler<T = unknown> = (
13597
+ ctx: WorkflowRollbackContext<T>,
13598
+ ) => Promise<void>;
13599
+ export type WorkflowStepRollbackOptions<T = unknown> = {
13600
+ rollback?: WorkflowRollbackHandler<T>;
13601
+ rollbackConfig?: WorkflowStepConfig;
13602
+ };
13585
13603
  export abstract class WorkflowStep {
13586
13604
  do<T extends Rpc.Serializable<T>>(
13587
13605
  name: string,
13588
13606
  callback: (ctx: WorkflowStepContext) => Promise<T>,
13607
+ rollbackOptions?: WorkflowStepRollbackOptions<T>,
13589
13608
  ): Promise<T>;
13590
13609
  do<T extends Rpc.Serializable<T>>(
13591
13610
  name: string,
13592
13611
  config: WorkflowStepConfig,
13593
13612
  callback: (ctx: WorkflowStepContext) => Promise<T>,
13613
+ rollbackOptions?: WorkflowStepRollbackOptions<T>,
13594
13614
  ): Promise<T>;
13595
13615
  sleep: (name: string, duration: WorkflowSleepDuration) => Promise<void>;
13596
13616
  sleepUntil: (name: string, timestamp: Date | number) => Promise<void>;
@@ -14972,6 +14992,103 @@ export type WorkerVersionMetadata = {
14972
14992
  /** The timestamp of when the Worker Version was uploaded */
14973
14993
  timestamp: string;
14974
14994
  };
14995
+ // ============ Web Search Request Types ============
14996
+ /**
14997
+ * Options for a Web Search query.
14998
+ */
14999
+ export type WebSearchSearchOptions = {
15000
+ /** The search query. */
15001
+ query: string;
15002
+ /**
15003
+ * Maximum number of results to return. Defaults to 10, capped at 20.
15004
+ * The actual count may be lower if fewer matches exist.
15005
+ */
15006
+ limit?: number;
15007
+ };
15008
+ // ============ Web Search Response Types ============
15009
+ /**
15010
+ * A single Web Search result.
15011
+ *
15012
+ * Web Search is discovery-only -- results carry catalog metadata about a page
15013
+ * but never the page body. To read a result's content the caller invokes the
15014
+ * global `fetch()` API against the result's `url`, at which point the
15015
+ * destination's own access controls apply (including Cloudflare Pay-per-Crawl).
15016
+ */
15017
+ export type WebSearchResult = {
15018
+ /** Canonical URL. */
15019
+ url: string;
15020
+ /** Page title. */
15021
+ title: string;
15022
+ /** Page-level description. May be absent. */
15023
+ description?: string;
15024
+ /**
15025
+ * Last-modified date for the page, when known. Naive (no timezone)
15026
+ * ISO-8601 datetime, e.g. `"2025-11-30T04:39:48"`.
15027
+ */
15028
+ lastModifiedDate?: string;
15029
+ /**
15030
+ * Page meta image URL (typically the `og:image`). May be absent.
15031
+ */
15032
+ imageUrl?: string;
15033
+ /** Optional favicon URL for UI hints. */
15034
+ faviconUrl?: string;
15035
+ };
15036
+ /**
15037
+ * Per-response metadata for a Web Search query. Carries operational
15038
+ * fields useful for support and debugging.
15039
+ */
15040
+ export type WebSearchResponseMetadata = {
15041
+ /** The query that was executed. */
15042
+ query: string;
15043
+ /** Opaque request identifier used for support and debugging. */
15044
+ requestId: string;
15045
+ /** End-to-end latency for this search request, in milliseconds. */
15046
+ latencyMs: number;
15047
+ };
15048
+ /**
15049
+ * Response from a Web Search query.
15050
+ */
15051
+ export type WebSearchSearchResponse = {
15052
+ items: WebSearchResult[];
15053
+ metadata: WebSearchResponseMetadata;
15054
+ };
15055
+ // ============ Web Search Binding Class ============
15056
+ /**
15057
+ * Cloudflare Web Search binding.
15058
+ *
15059
+ * Discovery-only primitive for agents and Workers. Returns URLs and catalog
15060
+ * metadata for a query; never returns page content or excerpts. To read a
15061
+ * result's body, fetch the URL with the global `fetch()` API.
15062
+ *
15063
+ * Declared in wrangler with a single object (there is exactly one corpus, the
15064
+ * public web, so there is no name, namespace, or instance to specify):
15065
+ *
15066
+ * ```jsonc
15067
+ * { "web_search": { "binding": "WEBSEARCH" } }
15068
+ * ```
15069
+ *
15070
+ * @example
15071
+ * ```ts
15072
+ * const { items, metadata } = await env.WEBSEARCH.search({
15073
+ * query: "Cloudflare Workers",
15074
+ * });
15075
+ *
15076
+ * const top = items[0];
15077
+ * console.log(top.url, top.title, metadata.latencyMs);
15078
+ *
15079
+ * // Read content yourself; pay-per-crawl and other publisher
15080
+ * // controls apply at the fetch site, not at search time.
15081
+ * const page = await fetch(top.url);
15082
+ * ```
15083
+ */
15084
+ export declare abstract class WebSearch {
15085
+ /**
15086
+ * Run a Web Search query.
15087
+ * @param options Search options. Only `query` is required.
15088
+ * @returns The matching results plus per-response metadata.
15089
+ */
15090
+ search(options: WebSearchSearchOptions): Promise<WebSearchSearchResponse>;
15091
+ }
14975
15092
  export interface DynamicDispatchLimits {
14976
15093
  /**
14977
15094
  * Limit CPU time in milliseconds.
package/package.json CHANGED
@@ -7,5 +7,5 @@
7
7
  },
8
8
  "author": "Cloudflare Workers DevProd Team <workers-devprod@cloudflare.com> (https://workers.cloudflare.com)",
9
9
  "license": "MIT OR Apache-2.0",
10
- "version": "4.20260520.1"
10
+ "version": "4.20260522.1"
11
11
  }