@cloudflare/workers-types 4.20260521.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/2021-11-03/index.d.ts +118 -1
- package/2021-11-03/index.ts +118 -1
- package/2022-01-31/index.d.ts +118 -1
- package/2022-01-31/index.ts +118 -1
- package/2022-03-21/index.d.ts +118 -1
- package/2022-03-21/index.ts +118 -1
- package/2022-08-04/index.d.ts +118 -1
- package/2022-08-04/index.ts +118 -1
- package/2022-10-31/index.d.ts +118 -1
- package/2022-10-31/index.ts +118 -1
- package/2022-11-30/index.d.ts +118 -1
- package/2022-11-30/index.ts +118 -1
- package/2023-03-01/index.d.ts +118 -1
- package/2023-03-01/index.ts +118 -1
- package/2023-07-01/index.d.ts +118 -1
- package/2023-07-01/index.ts +118 -1
- package/experimental/index.d.ts +118 -1
- package/experimental/index.ts +118 -1
- package/index.d.ts +118 -1
- package/index.ts +118 -1
- package/latest/index.d.ts +118 -1
- package/latest/index.ts +118 -1
- package/oldest/index.d.ts +118 -1
- package/oldest/index.ts +118 -1
- package/package.json +1 -1
package/2021-11-03/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:
|
|
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/2021-11-03/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:
|
|
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/2022-01-31/index.d.ts
CHANGED
|
@@ -10660,12 +10660,16 @@ declare abstract class Base_Ai_Cf_Moonshotai_Kimi_K2_5 {
|
|
|
10660
10660
|
inputs: ChatCompletionsInput;
|
|
10661
10661
|
postProcessedOutputs: ChatCompletionsOutput;
|
|
10662
10662
|
}
|
|
10663
|
+
declare abstract class Base_Ai_Cf_Moonshotai_Kimi_K2_6 {
|
|
10664
|
+
inputs: ChatCompletionsBase;
|
|
10665
|
+
postProcessedOutputs: ChatCompletionsOutput;
|
|
10666
|
+
}
|
|
10663
10667
|
declare abstract class Base_Ai_Cf_Nvidia_Nemotron_3_120B_A12B {
|
|
10664
10668
|
inputs: ChatCompletionsInput;
|
|
10665
10669
|
postProcessedOutputs: ChatCompletionsOutput;
|
|
10666
10670
|
}
|
|
10667
10671
|
declare abstract class Base_Ai_Cf_Google_Gemma_4_26B_A4B_IT {
|
|
10668
|
-
inputs:
|
|
10672
|
+
inputs: ChatCompletionsBase;
|
|
10669
10673
|
postProcessedOutputs: ChatCompletionsOutput;
|
|
10670
10674
|
}
|
|
10671
10675
|
interface AiModels {
|
|
@@ -10757,7 +10761,9 @@ interface AiModels {
|
|
|
10757
10761
|
"@cf/black-forest-labs/flux-2-klein-9b": Base_Ai_Cf_Black_Forest_Labs_Flux_2_Klein_9B;
|
|
10758
10762
|
"@cf/zai-org/glm-4.7-flash": Base_Ai_Cf_Zai_Org_Glm_4_7_Flash;
|
|
10759
10763
|
"@cf/moonshotai/kimi-k2.5": Base_Ai_Cf_Moonshotai_Kimi_K2_5;
|
|
10764
|
+
"@cf/moonshotai/kimi-k2.6": Base_Ai_Cf_Moonshotai_Kimi_K2_6;
|
|
10760
10765
|
"@cf/nvidia/nemotron-3-120b-a12b": Base_Ai_Cf_Nvidia_Nemotron_3_120B_A12B;
|
|
10766
|
+
"@cf/google/gemma-4-26b-a4b-it": Base_Ai_Cf_Google_Gemma_4_26B_A4B_IT;
|
|
10761
10767
|
}
|
|
10762
10768
|
type AiOptions = {
|
|
10763
10769
|
/**
|
|
@@ -13678,15 +13684,29 @@ declare namespace CloudflareWorkersModule {
|
|
|
13678
13684
|
attempt: number;
|
|
13679
13685
|
config: WorkflowStepConfig;
|
|
13680
13686
|
};
|
|
13687
|
+
export type WorkflowRollbackContext<T = unknown> = {
|
|
13688
|
+
error: Error;
|
|
13689
|
+
output: T | undefined;
|
|
13690
|
+
stepName: string;
|
|
13691
|
+
};
|
|
13692
|
+
export type WorkflowRollbackHandler<T = unknown> = (
|
|
13693
|
+
ctx: WorkflowRollbackContext<T>,
|
|
13694
|
+
) => Promise<void>;
|
|
13695
|
+
export type WorkflowStepRollbackOptions<T = unknown> = {
|
|
13696
|
+
rollback?: WorkflowRollbackHandler<T>;
|
|
13697
|
+
rollbackConfig?: WorkflowStepConfig;
|
|
13698
|
+
};
|
|
13681
13699
|
export abstract class WorkflowStep {
|
|
13682
13700
|
do<T extends Rpc.Serializable<T>>(
|
|
13683
13701
|
name: string,
|
|
13684
13702
|
callback: (ctx: WorkflowStepContext) => Promise<T>,
|
|
13703
|
+
rollbackOptions?: WorkflowStepRollbackOptions<T>,
|
|
13685
13704
|
): Promise<T>;
|
|
13686
13705
|
do<T extends Rpc.Serializable<T>>(
|
|
13687
13706
|
name: string,
|
|
13688
13707
|
config: WorkflowStepConfig,
|
|
13689
13708
|
callback: (ctx: WorkflowStepContext) => Promise<T>,
|
|
13709
|
+
rollbackOptions?: WorkflowStepRollbackOptions<T>,
|
|
13690
13710
|
): Promise<T>;
|
|
13691
13711
|
sleep: (name: string, duration: WorkflowSleepDuration) => Promise<void>;
|
|
13692
13712
|
sleepUntil: (name: string, timestamp: Date | number) => Promise<void>;
|
|
@@ -15078,6 +15098,103 @@ type WorkerVersionMetadata = {
|
|
|
15078
15098
|
/** The timestamp of when the Worker Version was uploaded */
|
|
15079
15099
|
timestamp: string;
|
|
15080
15100
|
};
|
|
15101
|
+
// ============ Web Search Request Types ============
|
|
15102
|
+
/**
|
|
15103
|
+
* Options for a Web Search query.
|
|
15104
|
+
*/
|
|
15105
|
+
type WebSearchSearchOptions = {
|
|
15106
|
+
/** The search query. */
|
|
15107
|
+
query: string;
|
|
15108
|
+
/**
|
|
15109
|
+
* Maximum number of results to return. Defaults to 10, capped at 20.
|
|
15110
|
+
* The actual count may be lower if fewer matches exist.
|
|
15111
|
+
*/
|
|
15112
|
+
limit?: number;
|
|
15113
|
+
};
|
|
15114
|
+
// ============ Web Search Response Types ============
|
|
15115
|
+
/**
|
|
15116
|
+
* A single Web Search result.
|
|
15117
|
+
*
|
|
15118
|
+
* Web Search is discovery-only -- results carry catalog metadata about a page
|
|
15119
|
+
* but never the page body. To read a result's content the caller invokes the
|
|
15120
|
+
* global `fetch()` API against the result's `url`, at which point the
|
|
15121
|
+
* destination's own access controls apply (including Cloudflare Pay-per-Crawl).
|
|
15122
|
+
*/
|
|
15123
|
+
type WebSearchResult = {
|
|
15124
|
+
/** Canonical URL. */
|
|
15125
|
+
url: string;
|
|
15126
|
+
/** Page title. */
|
|
15127
|
+
title: string;
|
|
15128
|
+
/** Page-level description. May be absent. */
|
|
15129
|
+
description?: string;
|
|
15130
|
+
/**
|
|
15131
|
+
* Last-modified date for the page, when known. Naive (no timezone)
|
|
15132
|
+
* ISO-8601 datetime, e.g. `"2025-11-30T04:39:48"`.
|
|
15133
|
+
*/
|
|
15134
|
+
lastModifiedDate?: string;
|
|
15135
|
+
/**
|
|
15136
|
+
* Page meta image URL (typically the `og:image`). May be absent.
|
|
15137
|
+
*/
|
|
15138
|
+
imageUrl?: string;
|
|
15139
|
+
/** Optional favicon URL for UI hints. */
|
|
15140
|
+
faviconUrl?: string;
|
|
15141
|
+
};
|
|
15142
|
+
/**
|
|
15143
|
+
* Per-response metadata for a Web Search query. Carries operational
|
|
15144
|
+
* fields useful for support and debugging.
|
|
15145
|
+
*/
|
|
15146
|
+
type WebSearchResponseMetadata = {
|
|
15147
|
+
/** The query that was executed. */
|
|
15148
|
+
query: string;
|
|
15149
|
+
/** Opaque request identifier used for support and debugging. */
|
|
15150
|
+
requestId: string;
|
|
15151
|
+
/** End-to-end latency for this search request, in milliseconds. */
|
|
15152
|
+
latencyMs: number;
|
|
15153
|
+
};
|
|
15154
|
+
/**
|
|
15155
|
+
* Response from a Web Search query.
|
|
15156
|
+
*/
|
|
15157
|
+
type WebSearchSearchResponse = {
|
|
15158
|
+
items: WebSearchResult[];
|
|
15159
|
+
metadata: WebSearchResponseMetadata;
|
|
15160
|
+
};
|
|
15161
|
+
// ============ Web Search Binding Class ============
|
|
15162
|
+
/**
|
|
15163
|
+
* Cloudflare Web Search binding.
|
|
15164
|
+
*
|
|
15165
|
+
* Discovery-only primitive for agents and Workers. Returns URLs and catalog
|
|
15166
|
+
* metadata for a query; never returns page content or excerpts. To read a
|
|
15167
|
+
* result's body, fetch the URL with the global `fetch()` API.
|
|
15168
|
+
*
|
|
15169
|
+
* Declared in wrangler with a single object (there is exactly one corpus, the
|
|
15170
|
+
* public web, so there is no name, namespace, or instance to specify):
|
|
15171
|
+
*
|
|
15172
|
+
* ```jsonc
|
|
15173
|
+
* { "web_search": { "binding": "WEBSEARCH" } }
|
|
15174
|
+
* ```
|
|
15175
|
+
*
|
|
15176
|
+
* @example
|
|
15177
|
+
* ```ts
|
|
15178
|
+
* const { items, metadata } = await env.WEBSEARCH.search({
|
|
15179
|
+
* query: "Cloudflare Workers",
|
|
15180
|
+
* });
|
|
15181
|
+
*
|
|
15182
|
+
* const top = items[0];
|
|
15183
|
+
* console.log(top.url, top.title, metadata.latencyMs);
|
|
15184
|
+
*
|
|
15185
|
+
* // Read content yourself; pay-per-crawl and other publisher
|
|
15186
|
+
* // controls apply at the fetch site, not at search time.
|
|
15187
|
+
* const page = await fetch(top.url);
|
|
15188
|
+
* ```
|
|
15189
|
+
*/
|
|
15190
|
+
declare abstract class WebSearch {
|
|
15191
|
+
/**
|
|
15192
|
+
* Run a Web Search query.
|
|
15193
|
+
* @param options Search options. Only `query` is required.
|
|
15194
|
+
* @returns The matching results plus per-response metadata.
|
|
15195
|
+
*/
|
|
15196
|
+
search(options: WebSearchSearchOptions): Promise<WebSearchSearchResponse>;
|
|
15197
|
+
}
|
|
15081
15198
|
interface DynamicDispatchLimits {
|
|
15082
15199
|
/**
|
|
15083
15200
|
* Limit CPU time in milliseconds.
|
package/2022-01-31/index.ts
CHANGED
|
@@ -10670,12 +10670,16 @@ export declare abstract class Base_Ai_Cf_Moonshotai_Kimi_K2_5 {
|
|
|
10670
10670
|
inputs: ChatCompletionsInput;
|
|
10671
10671
|
postProcessedOutputs: ChatCompletionsOutput;
|
|
10672
10672
|
}
|
|
10673
|
+
export declare abstract class Base_Ai_Cf_Moonshotai_Kimi_K2_6 {
|
|
10674
|
+
inputs: ChatCompletionsBase;
|
|
10675
|
+
postProcessedOutputs: ChatCompletionsOutput;
|
|
10676
|
+
}
|
|
10673
10677
|
export declare abstract class Base_Ai_Cf_Nvidia_Nemotron_3_120B_A12B {
|
|
10674
10678
|
inputs: ChatCompletionsInput;
|
|
10675
10679
|
postProcessedOutputs: ChatCompletionsOutput;
|
|
10676
10680
|
}
|
|
10677
10681
|
export declare abstract class Base_Ai_Cf_Google_Gemma_4_26B_A4B_IT {
|
|
10678
|
-
inputs:
|
|
10682
|
+
inputs: ChatCompletionsBase;
|
|
10679
10683
|
postProcessedOutputs: ChatCompletionsOutput;
|
|
10680
10684
|
}
|
|
10681
10685
|
export interface AiModels {
|
|
@@ -10767,7 +10771,9 @@ export interface AiModels {
|
|
|
10767
10771
|
"@cf/black-forest-labs/flux-2-klein-9b": Base_Ai_Cf_Black_Forest_Labs_Flux_2_Klein_9B;
|
|
10768
10772
|
"@cf/zai-org/glm-4.7-flash": Base_Ai_Cf_Zai_Org_Glm_4_7_Flash;
|
|
10769
10773
|
"@cf/moonshotai/kimi-k2.5": Base_Ai_Cf_Moonshotai_Kimi_K2_5;
|
|
10774
|
+
"@cf/moonshotai/kimi-k2.6": Base_Ai_Cf_Moonshotai_Kimi_K2_6;
|
|
10770
10775
|
"@cf/nvidia/nemotron-3-120b-a12b": Base_Ai_Cf_Nvidia_Nemotron_3_120B_A12B;
|
|
10776
|
+
"@cf/google/gemma-4-26b-a4b-it": Base_Ai_Cf_Google_Gemma_4_26B_A4B_IT;
|
|
10771
10777
|
}
|
|
10772
10778
|
export type AiOptions = {
|
|
10773
10779
|
/**
|
|
@@ -13649,15 +13655,29 @@ export declare namespace CloudflareWorkersModule {
|
|
|
13649
13655
|
attempt: number;
|
|
13650
13656
|
config: WorkflowStepConfig;
|
|
13651
13657
|
};
|
|
13658
|
+
export type WorkflowRollbackContext<T = unknown> = {
|
|
13659
|
+
error: Error;
|
|
13660
|
+
output: T | undefined;
|
|
13661
|
+
stepName: string;
|
|
13662
|
+
};
|
|
13663
|
+
export type WorkflowRollbackHandler<T = unknown> = (
|
|
13664
|
+
ctx: WorkflowRollbackContext<T>,
|
|
13665
|
+
) => Promise<void>;
|
|
13666
|
+
export type WorkflowStepRollbackOptions<T = unknown> = {
|
|
13667
|
+
rollback?: WorkflowRollbackHandler<T>;
|
|
13668
|
+
rollbackConfig?: WorkflowStepConfig;
|
|
13669
|
+
};
|
|
13652
13670
|
export abstract class WorkflowStep {
|
|
13653
13671
|
do<T extends Rpc.Serializable<T>>(
|
|
13654
13672
|
name: string,
|
|
13655
13673
|
callback: (ctx: WorkflowStepContext) => Promise<T>,
|
|
13674
|
+
rollbackOptions?: WorkflowStepRollbackOptions<T>,
|
|
13656
13675
|
): Promise<T>;
|
|
13657
13676
|
do<T extends Rpc.Serializable<T>>(
|
|
13658
13677
|
name: string,
|
|
13659
13678
|
config: WorkflowStepConfig,
|
|
13660
13679
|
callback: (ctx: WorkflowStepContext) => Promise<T>,
|
|
13680
|
+
rollbackOptions?: WorkflowStepRollbackOptions<T>,
|
|
13661
13681
|
): Promise<T>;
|
|
13662
13682
|
sleep: (name: string, duration: WorkflowSleepDuration) => Promise<void>;
|
|
13663
13683
|
sleepUntil: (name: string, timestamp: Date | number) => Promise<void>;
|
|
@@ -15039,6 +15059,103 @@ export type WorkerVersionMetadata = {
|
|
|
15039
15059
|
/** The timestamp of when the Worker Version was uploaded */
|
|
15040
15060
|
timestamp: string;
|
|
15041
15061
|
};
|
|
15062
|
+
// ============ Web Search Request Types ============
|
|
15063
|
+
/**
|
|
15064
|
+
* Options for a Web Search query.
|
|
15065
|
+
*/
|
|
15066
|
+
export type WebSearchSearchOptions = {
|
|
15067
|
+
/** The search query. */
|
|
15068
|
+
query: string;
|
|
15069
|
+
/**
|
|
15070
|
+
* Maximum number of results to return. Defaults to 10, capped at 20.
|
|
15071
|
+
* The actual count may be lower if fewer matches exist.
|
|
15072
|
+
*/
|
|
15073
|
+
limit?: number;
|
|
15074
|
+
};
|
|
15075
|
+
// ============ Web Search Response Types ============
|
|
15076
|
+
/**
|
|
15077
|
+
* A single Web Search result.
|
|
15078
|
+
*
|
|
15079
|
+
* Web Search is discovery-only -- results carry catalog metadata about a page
|
|
15080
|
+
* but never the page body. To read a result's content the caller invokes the
|
|
15081
|
+
* global `fetch()` API against the result's `url`, at which point the
|
|
15082
|
+
* destination's own access controls apply (including Cloudflare Pay-per-Crawl).
|
|
15083
|
+
*/
|
|
15084
|
+
export type WebSearchResult = {
|
|
15085
|
+
/** Canonical URL. */
|
|
15086
|
+
url: string;
|
|
15087
|
+
/** Page title. */
|
|
15088
|
+
title: string;
|
|
15089
|
+
/** Page-level description. May be absent. */
|
|
15090
|
+
description?: string;
|
|
15091
|
+
/**
|
|
15092
|
+
* Last-modified date for the page, when known. Naive (no timezone)
|
|
15093
|
+
* ISO-8601 datetime, e.g. `"2025-11-30T04:39:48"`.
|
|
15094
|
+
*/
|
|
15095
|
+
lastModifiedDate?: string;
|
|
15096
|
+
/**
|
|
15097
|
+
* Page meta image URL (typically the `og:image`). May be absent.
|
|
15098
|
+
*/
|
|
15099
|
+
imageUrl?: string;
|
|
15100
|
+
/** Optional favicon URL for UI hints. */
|
|
15101
|
+
faviconUrl?: string;
|
|
15102
|
+
};
|
|
15103
|
+
/**
|
|
15104
|
+
* Per-response metadata for a Web Search query. Carries operational
|
|
15105
|
+
* fields useful for support and debugging.
|
|
15106
|
+
*/
|
|
15107
|
+
export type WebSearchResponseMetadata = {
|
|
15108
|
+
/** The query that was executed. */
|
|
15109
|
+
query: string;
|
|
15110
|
+
/** Opaque request identifier used for support and debugging. */
|
|
15111
|
+
requestId: string;
|
|
15112
|
+
/** End-to-end latency for this search request, in milliseconds. */
|
|
15113
|
+
latencyMs: number;
|
|
15114
|
+
};
|
|
15115
|
+
/**
|
|
15116
|
+
* Response from a Web Search query.
|
|
15117
|
+
*/
|
|
15118
|
+
export type WebSearchSearchResponse = {
|
|
15119
|
+
items: WebSearchResult[];
|
|
15120
|
+
metadata: WebSearchResponseMetadata;
|
|
15121
|
+
};
|
|
15122
|
+
// ============ Web Search Binding Class ============
|
|
15123
|
+
/**
|
|
15124
|
+
* Cloudflare Web Search binding.
|
|
15125
|
+
*
|
|
15126
|
+
* Discovery-only primitive for agents and Workers. Returns URLs and catalog
|
|
15127
|
+
* metadata for a query; never returns page content or excerpts. To read a
|
|
15128
|
+
* result's body, fetch the URL with the global `fetch()` API.
|
|
15129
|
+
*
|
|
15130
|
+
* Declared in wrangler with a single object (there is exactly one corpus, the
|
|
15131
|
+
* public web, so there is no name, namespace, or instance to specify):
|
|
15132
|
+
*
|
|
15133
|
+
* ```jsonc
|
|
15134
|
+
* { "web_search": { "binding": "WEBSEARCH" } }
|
|
15135
|
+
* ```
|
|
15136
|
+
*
|
|
15137
|
+
* @example
|
|
15138
|
+
* ```ts
|
|
15139
|
+
* const { items, metadata } = await env.WEBSEARCH.search({
|
|
15140
|
+
* query: "Cloudflare Workers",
|
|
15141
|
+
* });
|
|
15142
|
+
*
|
|
15143
|
+
* const top = items[0];
|
|
15144
|
+
* console.log(top.url, top.title, metadata.latencyMs);
|
|
15145
|
+
*
|
|
15146
|
+
* // Read content yourself; pay-per-crawl and other publisher
|
|
15147
|
+
* // controls apply at the fetch site, not at search time.
|
|
15148
|
+
* const page = await fetch(top.url);
|
|
15149
|
+
* ```
|
|
15150
|
+
*/
|
|
15151
|
+
export declare abstract class WebSearch {
|
|
15152
|
+
/**
|
|
15153
|
+
* Run a Web Search query.
|
|
15154
|
+
* @param options Search options. Only `query` is required.
|
|
15155
|
+
* @returns The matching results plus per-response metadata.
|
|
15156
|
+
*/
|
|
15157
|
+
search(options: WebSearchSearchOptions): Promise<WebSearchSearchResponse>;
|
|
15158
|
+
}
|
|
15042
15159
|
export interface DynamicDispatchLimits {
|
|
15043
15160
|
/**
|
|
15044
15161
|
* Limit CPU time in milliseconds.
|