@cloudflare/workers-types 4.20260525.1 → 4.20260527.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 +27 -20
- package/2021-11-03/index.ts +27 -20
- package/2022-01-31/index.d.ts +27 -20
- package/2022-01-31/index.ts +27 -20
- package/2022-03-21/index.d.ts +27 -20
- package/2022-03-21/index.ts +27 -20
- package/2022-08-04/index.d.ts +27 -20
- package/2022-08-04/index.ts +27 -20
- package/2022-10-31/index.d.ts +27 -20
- package/2022-10-31/index.ts +27 -20
- package/2022-11-30/index.d.ts +27 -20
- package/2022-11-30/index.ts +27 -20
- package/2023-03-01/index.d.ts +27 -20
- package/2023-03-01/index.ts +27 -20
- package/2023-07-01/index.d.ts +27 -20
- package/2023-07-01/index.ts +27 -20
- package/experimental/index.d.ts +27 -20
- package/experimental/index.ts +27 -20
- package/index.d.ts +27 -20
- package/index.ts +27 -20
- package/latest/index.d.ts +27 -20
- package/latest/index.ts +27 -20
- package/oldest/index.d.ts +27 -20
- package/oldest/index.ts +27 -20
- package/package.json +1 -1
package/2022-11-30/index.d.ts
CHANGED
|
@@ -5470,9 +5470,6 @@ type ChatCompletionChoice = {
|
|
|
5470
5470
|
| "function_call";
|
|
5471
5471
|
logprobs: ChatCompletionLogprobs | null;
|
|
5472
5472
|
};
|
|
5473
|
-
type ChatCompletionsPromptInput = {
|
|
5474
|
-
prompt: string;
|
|
5475
|
-
} & ChatCompletionsCommonOptions;
|
|
5476
5473
|
type ChatCompletionsMessagesInput = {
|
|
5477
5474
|
messages: Array<ChatCompletionMessageParam>;
|
|
5478
5475
|
} & ChatCompletionsCommonOptions;
|
|
@@ -9597,11 +9594,11 @@ declare abstract class Base_Ai_Cf_Pipecat_Ai_Smart_Turn_V2 {
|
|
|
9597
9594
|
postProcessedOutputs: Ai_Cf_Pipecat_Ai_Smart_Turn_V2_Output;
|
|
9598
9595
|
}
|
|
9599
9596
|
declare abstract class Base_Ai_Cf_Openai_Gpt_Oss_120B {
|
|
9600
|
-
inputs: XOR<ResponsesInput,
|
|
9597
|
+
inputs: XOR<ResponsesInput, ChatCompletionsMessagesInput>;
|
|
9601
9598
|
postProcessedOutputs: XOR<ResponsesOutput, ChatCompletionsOutput>;
|
|
9602
9599
|
}
|
|
9603
9600
|
declare abstract class Base_Ai_Cf_Openai_Gpt_Oss_20B {
|
|
9604
|
-
inputs: XOR<ResponsesInput,
|
|
9601
|
+
inputs: XOR<ResponsesInput, ChatCompletionsMessagesInput>;
|
|
9605
9602
|
postProcessedOutputs: XOR<ResponsesOutput, ChatCompletionsOutput>;
|
|
9606
9603
|
}
|
|
9607
9604
|
interface Ai_Cf_Leonardo_Phoenix_1_0_Input {
|
|
@@ -10696,7 +10693,7 @@ declare abstract class Base_Ai_Cf_Moonshotai_Kimi_K2_5 {
|
|
|
10696
10693
|
postProcessedOutputs: ChatCompletionsOutput;
|
|
10697
10694
|
}
|
|
10698
10695
|
declare abstract class Base_Ai_Cf_Moonshotai_Kimi_K2_6 {
|
|
10699
|
-
inputs:
|
|
10696
|
+
inputs: ChatCompletionsInput;
|
|
10700
10697
|
postProcessedOutputs: ChatCompletionsOutput;
|
|
10701
10698
|
}
|
|
10702
10699
|
declare abstract class Base_Ai_Cf_Nvidia_Nemotron_3_120B_A12B {
|
|
@@ -10704,7 +10701,7 @@ declare abstract class Base_Ai_Cf_Nvidia_Nemotron_3_120B_A12B {
|
|
|
10704
10701
|
postProcessedOutputs: ChatCompletionsOutput;
|
|
10705
10702
|
}
|
|
10706
10703
|
declare abstract class Base_Ai_Cf_Google_Gemma_4_26B_A4B_IT {
|
|
10707
|
-
inputs:
|
|
10704
|
+
inputs: ChatCompletionsInput;
|
|
10708
10705
|
postProcessedOutputs: ChatCompletionsOutput;
|
|
10709
10706
|
}
|
|
10710
10707
|
interface AiModels {
|
|
@@ -10851,16 +10848,8 @@ type AiModelsSearchObject = {
|
|
|
10851
10848
|
value: string;
|
|
10852
10849
|
}[];
|
|
10853
10850
|
};
|
|
10854
|
-
type ChatCompletionsBase =
|
|
10855
|
-
|
|
10856
|
-
ChatCompletionsMessagesInput
|
|
10857
|
-
>;
|
|
10858
|
-
type ChatCompletionsInput = XOR<
|
|
10859
|
-
ChatCompletionsBase,
|
|
10860
|
-
{
|
|
10861
|
-
requests: ChatCompletionsBase[];
|
|
10862
|
-
}
|
|
10863
|
-
>;
|
|
10851
|
+
type ChatCompletionsBase = ChatCompletionsMessagesInput;
|
|
10852
|
+
type ChatCompletionsInput = ChatCompletionsMessagesInput;
|
|
10864
10853
|
interface InferenceUpstreamError extends Error {}
|
|
10865
10854
|
interface AiInternalError extends Error {}
|
|
10866
10855
|
type AiModelListType = Record<string, any>;
|
|
@@ -10923,9 +10912,16 @@ declare abstract class Ai<AiModelList extends AiModelListType = AiModels> {
|
|
|
10923
10912
|
inputs: AiModelList[Name]["inputs"],
|
|
10924
10913
|
options?: AiOptions,
|
|
10925
10914
|
): Promise<AiModelList[Name]["postProcessedOutputs"]>;
|
|
10926
|
-
// Unknown model (
|
|
10927
|
-
|
|
10928
|
-
|
|
10915
|
+
// Unknown model (fallback).
|
|
10916
|
+
//
|
|
10917
|
+
// The `Exclude<..., keyof AiModelList>` constraint forces TypeScript to
|
|
10918
|
+
// route any model name that is a literal key of `AiModelList` to one of
|
|
10919
|
+
// the known-model overloads above (so input/output mismatches surface as
|
|
10920
|
+
// type errors rather than silently falling back to `Record<string, unknown>`).
|
|
10921
|
+
// Names that aren't in `AiModelList` — e.g. third-party gateway models
|
|
10922
|
+
// like `"google/nano-banana"` — still hit this overload.
|
|
10923
|
+
run<Model extends string>(
|
|
10924
|
+
model: Model extends keyof AiModelList ? never : Model,
|
|
10929
10925
|
inputs: Record<string, unknown>,
|
|
10930
10926
|
options?: AiOptions,
|
|
10931
10927
|
): Promise<Record<string, unknown>>;
|
|
@@ -13693,6 +13689,7 @@ declare namespace CloudflareWorkersModule {
|
|
|
13693
13689
|
export type WorkflowTimeoutDuration = WorkflowSleepDuration;
|
|
13694
13690
|
export type WorkflowRetentionDuration = WorkflowSleepDuration;
|
|
13695
13691
|
export type WorkflowBackoff = "constant" | "linear" | "exponential";
|
|
13692
|
+
export type WorkflowStepSensitivity = "output";
|
|
13696
13693
|
export type WorkflowStepConfig = {
|
|
13697
13694
|
retries?: {
|
|
13698
13695
|
limit: number;
|
|
@@ -13700,16 +13697,26 @@ declare namespace CloudflareWorkersModule {
|
|
|
13700
13697
|
backoff?: WorkflowBackoff;
|
|
13701
13698
|
};
|
|
13702
13699
|
timeout?: WorkflowTimeoutDuration | number;
|
|
13700
|
+
sensitive?: WorkflowStepSensitivity;
|
|
13701
|
+
};
|
|
13702
|
+
export type WorkflowCronSchedule = {
|
|
13703
|
+
/** Cron expression that triggered this event. */
|
|
13704
|
+
cron: string;
|
|
13705
|
+
/** Timestamp of the scheduled trigger, in milliseconds since the Unix epoch. */
|
|
13706
|
+
scheduledTime: number;
|
|
13703
13707
|
};
|
|
13704
13708
|
export type WorkflowEvent<T> = {
|
|
13705
13709
|
payload: Readonly<T>;
|
|
13706
13710
|
timestamp: Date;
|
|
13707
13711
|
instanceId: string;
|
|
13712
|
+
workflowName: string;
|
|
13713
|
+
schedule?: WorkflowCronSchedule;
|
|
13708
13714
|
};
|
|
13709
13715
|
export type WorkflowStepEvent<T> = {
|
|
13710
13716
|
payload: Readonly<T>;
|
|
13711
13717
|
timestamp: Date;
|
|
13712
13718
|
type: string;
|
|
13719
|
+
sensitive?: WorkflowStepSensitivity;
|
|
13713
13720
|
};
|
|
13714
13721
|
export type WorkflowStepContext = {
|
|
13715
13722
|
step: {
|
package/2022-11-30/index.ts
CHANGED
|
@@ -5479,9 +5479,6 @@ export type ChatCompletionChoice = {
|
|
|
5479
5479
|
| "function_call";
|
|
5480
5480
|
logprobs: ChatCompletionLogprobs | null;
|
|
5481
5481
|
};
|
|
5482
|
-
export type ChatCompletionsPromptInput = {
|
|
5483
|
-
prompt: string;
|
|
5484
|
-
} & ChatCompletionsCommonOptions;
|
|
5485
5482
|
export type ChatCompletionsMessagesInput = {
|
|
5486
5483
|
messages: Array<ChatCompletionMessageParam>;
|
|
5487
5484
|
} & ChatCompletionsCommonOptions;
|
|
@@ -9607,11 +9604,11 @@ export declare abstract class Base_Ai_Cf_Pipecat_Ai_Smart_Turn_V2 {
|
|
|
9607
9604
|
postProcessedOutputs: Ai_Cf_Pipecat_Ai_Smart_Turn_V2_Output;
|
|
9608
9605
|
}
|
|
9609
9606
|
export declare abstract class Base_Ai_Cf_Openai_Gpt_Oss_120B {
|
|
9610
|
-
inputs: XOR<ResponsesInput,
|
|
9607
|
+
inputs: XOR<ResponsesInput, ChatCompletionsMessagesInput>;
|
|
9611
9608
|
postProcessedOutputs: XOR<ResponsesOutput, ChatCompletionsOutput>;
|
|
9612
9609
|
}
|
|
9613
9610
|
export declare abstract class Base_Ai_Cf_Openai_Gpt_Oss_20B {
|
|
9614
|
-
inputs: XOR<ResponsesInput,
|
|
9611
|
+
inputs: XOR<ResponsesInput, ChatCompletionsMessagesInput>;
|
|
9615
9612
|
postProcessedOutputs: XOR<ResponsesOutput, ChatCompletionsOutput>;
|
|
9616
9613
|
}
|
|
9617
9614
|
export interface Ai_Cf_Leonardo_Phoenix_1_0_Input {
|
|
@@ -10706,7 +10703,7 @@ export declare abstract class Base_Ai_Cf_Moonshotai_Kimi_K2_5 {
|
|
|
10706
10703
|
postProcessedOutputs: ChatCompletionsOutput;
|
|
10707
10704
|
}
|
|
10708
10705
|
export declare abstract class Base_Ai_Cf_Moonshotai_Kimi_K2_6 {
|
|
10709
|
-
inputs:
|
|
10706
|
+
inputs: ChatCompletionsInput;
|
|
10710
10707
|
postProcessedOutputs: ChatCompletionsOutput;
|
|
10711
10708
|
}
|
|
10712
10709
|
export declare abstract class Base_Ai_Cf_Nvidia_Nemotron_3_120B_A12B {
|
|
@@ -10714,7 +10711,7 @@ export declare abstract class Base_Ai_Cf_Nvidia_Nemotron_3_120B_A12B {
|
|
|
10714
10711
|
postProcessedOutputs: ChatCompletionsOutput;
|
|
10715
10712
|
}
|
|
10716
10713
|
export declare abstract class Base_Ai_Cf_Google_Gemma_4_26B_A4B_IT {
|
|
10717
|
-
inputs:
|
|
10714
|
+
inputs: ChatCompletionsInput;
|
|
10718
10715
|
postProcessedOutputs: ChatCompletionsOutput;
|
|
10719
10716
|
}
|
|
10720
10717
|
export interface AiModels {
|
|
@@ -10861,16 +10858,8 @@ export type AiModelsSearchObject = {
|
|
|
10861
10858
|
value: string;
|
|
10862
10859
|
}[];
|
|
10863
10860
|
};
|
|
10864
|
-
export type ChatCompletionsBase =
|
|
10865
|
-
|
|
10866
|
-
ChatCompletionsMessagesInput
|
|
10867
|
-
>;
|
|
10868
|
-
export type ChatCompletionsInput = XOR<
|
|
10869
|
-
ChatCompletionsBase,
|
|
10870
|
-
{
|
|
10871
|
-
requests: ChatCompletionsBase[];
|
|
10872
|
-
}
|
|
10873
|
-
>;
|
|
10861
|
+
export type ChatCompletionsBase = ChatCompletionsMessagesInput;
|
|
10862
|
+
export type ChatCompletionsInput = ChatCompletionsMessagesInput;
|
|
10874
10863
|
export interface InferenceUpstreamError extends Error {}
|
|
10875
10864
|
export interface AiInternalError extends Error {}
|
|
10876
10865
|
export type AiModelListType = Record<string, any>;
|
|
@@ -10935,9 +10924,16 @@ export declare abstract class Ai<
|
|
|
10935
10924
|
inputs: AiModelList[Name]["inputs"],
|
|
10936
10925
|
options?: AiOptions,
|
|
10937
10926
|
): Promise<AiModelList[Name]["postProcessedOutputs"]>;
|
|
10938
|
-
// Unknown model (
|
|
10939
|
-
|
|
10940
|
-
|
|
10927
|
+
// Unknown model (fallback).
|
|
10928
|
+
//
|
|
10929
|
+
// The `Exclude<..., keyof AiModelList>` constraint forces TypeScript to
|
|
10930
|
+
// route any model name that is a literal key of `AiModelList` to one of
|
|
10931
|
+
// the known-model overloads above (so input/output mismatches surface as
|
|
10932
|
+
// type errors rather than silently falling back to `Record<string, unknown>`).
|
|
10933
|
+
// Names that aren't in `AiModelList` — e.g. third-party gateway models
|
|
10934
|
+
// like `"google/nano-banana"` — still hit this overload.
|
|
10935
|
+
run<Model extends string>(
|
|
10936
|
+
model: Model extends keyof AiModelList ? never : Model,
|
|
10941
10937
|
inputs: Record<string, unknown>,
|
|
10942
10938
|
options?: AiOptions,
|
|
10943
10939
|
): Promise<Record<string, unknown>>;
|
|
@@ -13664,6 +13660,7 @@ export declare namespace CloudflareWorkersModule {
|
|
|
13664
13660
|
export type WorkflowTimeoutDuration = WorkflowSleepDuration;
|
|
13665
13661
|
export type WorkflowRetentionDuration = WorkflowSleepDuration;
|
|
13666
13662
|
export type WorkflowBackoff = "constant" | "linear" | "exponential";
|
|
13663
|
+
export type WorkflowStepSensitivity = "output";
|
|
13667
13664
|
export type WorkflowStepConfig = {
|
|
13668
13665
|
retries?: {
|
|
13669
13666
|
limit: number;
|
|
@@ -13671,16 +13668,26 @@ export declare namespace CloudflareWorkersModule {
|
|
|
13671
13668
|
backoff?: WorkflowBackoff;
|
|
13672
13669
|
};
|
|
13673
13670
|
timeout?: WorkflowTimeoutDuration | number;
|
|
13671
|
+
sensitive?: WorkflowStepSensitivity;
|
|
13672
|
+
};
|
|
13673
|
+
export type WorkflowCronSchedule = {
|
|
13674
|
+
/** Cron expression that triggered this event. */
|
|
13675
|
+
cron: string;
|
|
13676
|
+
/** Timestamp of the scheduled trigger, in milliseconds since the Unix epoch. */
|
|
13677
|
+
scheduledTime: number;
|
|
13674
13678
|
};
|
|
13675
13679
|
export type WorkflowEvent<T> = {
|
|
13676
13680
|
payload: Readonly<T>;
|
|
13677
13681
|
timestamp: Date;
|
|
13678
13682
|
instanceId: string;
|
|
13683
|
+
workflowName: string;
|
|
13684
|
+
schedule?: WorkflowCronSchedule;
|
|
13679
13685
|
};
|
|
13680
13686
|
export type WorkflowStepEvent<T> = {
|
|
13681
13687
|
payload: Readonly<T>;
|
|
13682
13688
|
timestamp: Date;
|
|
13683
13689
|
type: string;
|
|
13690
|
+
sensitive?: WorkflowStepSensitivity;
|
|
13684
13691
|
};
|
|
13685
13692
|
export type WorkflowStepContext = {
|
|
13686
13693
|
step: {
|
package/2023-03-01/index.d.ts
CHANGED
|
@@ -5476,9 +5476,6 @@ type ChatCompletionChoice = {
|
|
|
5476
5476
|
| "function_call";
|
|
5477
5477
|
logprobs: ChatCompletionLogprobs | null;
|
|
5478
5478
|
};
|
|
5479
|
-
type ChatCompletionsPromptInput = {
|
|
5480
|
-
prompt: string;
|
|
5481
|
-
} & ChatCompletionsCommonOptions;
|
|
5482
5479
|
type ChatCompletionsMessagesInput = {
|
|
5483
5480
|
messages: Array<ChatCompletionMessageParam>;
|
|
5484
5481
|
} & ChatCompletionsCommonOptions;
|
|
@@ -9603,11 +9600,11 @@ declare abstract class Base_Ai_Cf_Pipecat_Ai_Smart_Turn_V2 {
|
|
|
9603
9600
|
postProcessedOutputs: Ai_Cf_Pipecat_Ai_Smart_Turn_V2_Output;
|
|
9604
9601
|
}
|
|
9605
9602
|
declare abstract class Base_Ai_Cf_Openai_Gpt_Oss_120B {
|
|
9606
|
-
inputs: XOR<ResponsesInput,
|
|
9603
|
+
inputs: XOR<ResponsesInput, ChatCompletionsMessagesInput>;
|
|
9607
9604
|
postProcessedOutputs: XOR<ResponsesOutput, ChatCompletionsOutput>;
|
|
9608
9605
|
}
|
|
9609
9606
|
declare abstract class Base_Ai_Cf_Openai_Gpt_Oss_20B {
|
|
9610
|
-
inputs: XOR<ResponsesInput,
|
|
9607
|
+
inputs: XOR<ResponsesInput, ChatCompletionsMessagesInput>;
|
|
9611
9608
|
postProcessedOutputs: XOR<ResponsesOutput, ChatCompletionsOutput>;
|
|
9612
9609
|
}
|
|
9613
9610
|
interface Ai_Cf_Leonardo_Phoenix_1_0_Input {
|
|
@@ -10702,7 +10699,7 @@ declare abstract class Base_Ai_Cf_Moonshotai_Kimi_K2_5 {
|
|
|
10702
10699
|
postProcessedOutputs: ChatCompletionsOutput;
|
|
10703
10700
|
}
|
|
10704
10701
|
declare abstract class Base_Ai_Cf_Moonshotai_Kimi_K2_6 {
|
|
10705
|
-
inputs:
|
|
10702
|
+
inputs: ChatCompletionsInput;
|
|
10706
10703
|
postProcessedOutputs: ChatCompletionsOutput;
|
|
10707
10704
|
}
|
|
10708
10705
|
declare abstract class Base_Ai_Cf_Nvidia_Nemotron_3_120B_A12B {
|
|
@@ -10710,7 +10707,7 @@ declare abstract class Base_Ai_Cf_Nvidia_Nemotron_3_120B_A12B {
|
|
|
10710
10707
|
postProcessedOutputs: ChatCompletionsOutput;
|
|
10711
10708
|
}
|
|
10712
10709
|
declare abstract class Base_Ai_Cf_Google_Gemma_4_26B_A4B_IT {
|
|
10713
|
-
inputs:
|
|
10710
|
+
inputs: ChatCompletionsInput;
|
|
10714
10711
|
postProcessedOutputs: ChatCompletionsOutput;
|
|
10715
10712
|
}
|
|
10716
10713
|
interface AiModels {
|
|
@@ -10857,16 +10854,8 @@ type AiModelsSearchObject = {
|
|
|
10857
10854
|
value: string;
|
|
10858
10855
|
}[];
|
|
10859
10856
|
};
|
|
10860
|
-
type ChatCompletionsBase =
|
|
10861
|
-
|
|
10862
|
-
ChatCompletionsMessagesInput
|
|
10863
|
-
>;
|
|
10864
|
-
type ChatCompletionsInput = XOR<
|
|
10865
|
-
ChatCompletionsBase,
|
|
10866
|
-
{
|
|
10867
|
-
requests: ChatCompletionsBase[];
|
|
10868
|
-
}
|
|
10869
|
-
>;
|
|
10857
|
+
type ChatCompletionsBase = ChatCompletionsMessagesInput;
|
|
10858
|
+
type ChatCompletionsInput = ChatCompletionsMessagesInput;
|
|
10870
10859
|
interface InferenceUpstreamError extends Error {}
|
|
10871
10860
|
interface AiInternalError extends Error {}
|
|
10872
10861
|
type AiModelListType = Record<string, any>;
|
|
@@ -10929,9 +10918,16 @@ declare abstract class Ai<AiModelList extends AiModelListType = AiModels> {
|
|
|
10929
10918
|
inputs: AiModelList[Name]["inputs"],
|
|
10930
10919
|
options?: AiOptions,
|
|
10931
10920
|
): Promise<AiModelList[Name]["postProcessedOutputs"]>;
|
|
10932
|
-
// Unknown model (
|
|
10933
|
-
|
|
10934
|
-
|
|
10921
|
+
// Unknown model (fallback).
|
|
10922
|
+
//
|
|
10923
|
+
// The `Exclude<..., keyof AiModelList>` constraint forces TypeScript to
|
|
10924
|
+
// route any model name that is a literal key of `AiModelList` to one of
|
|
10925
|
+
// the known-model overloads above (so input/output mismatches surface as
|
|
10926
|
+
// type errors rather than silently falling back to `Record<string, unknown>`).
|
|
10927
|
+
// Names that aren't in `AiModelList` — e.g. third-party gateway models
|
|
10928
|
+
// like `"google/nano-banana"` — still hit this overload.
|
|
10929
|
+
run<Model extends string>(
|
|
10930
|
+
model: Model extends keyof AiModelList ? never : Model,
|
|
10935
10931
|
inputs: Record<string, unknown>,
|
|
10936
10932
|
options?: AiOptions,
|
|
10937
10933
|
): Promise<Record<string, unknown>>;
|
|
@@ -13699,6 +13695,7 @@ declare namespace CloudflareWorkersModule {
|
|
|
13699
13695
|
export type WorkflowTimeoutDuration = WorkflowSleepDuration;
|
|
13700
13696
|
export type WorkflowRetentionDuration = WorkflowSleepDuration;
|
|
13701
13697
|
export type WorkflowBackoff = "constant" | "linear" | "exponential";
|
|
13698
|
+
export type WorkflowStepSensitivity = "output";
|
|
13702
13699
|
export type WorkflowStepConfig = {
|
|
13703
13700
|
retries?: {
|
|
13704
13701
|
limit: number;
|
|
@@ -13706,16 +13703,26 @@ declare namespace CloudflareWorkersModule {
|
|
|
13706
13703
|
backoff?: WorkflowBackoff;
|
|
13707
13704
|
};
|
|
13708
13705
|
timeout?: WorkflowTimeoutDuration | number;
|
|
13706
|
+
sensitive?: WorkflowStepSensitivity;
|
|
13707
|
+
};
|
|
13708
|
+
export type WorkflowCronSchedule = {
|
|
13709
|
+
/** Cron expression that triggered this event. */
|
|
13710
|
+
cron: string;
|
|
13711
|
+
/** Timestamp of the scheduled trigger, in milliseconds since the Unix epoch. */
|
|
13712
|
+
scheduledTime: number;
|
|
13709
13713
|
};
|
|
13710
13714
|
export type WorkflowEvent<T> = {
|
|
13711
13715
|
payload: Readonly<T>;
|
|
13712
13716
|
timestamp: Date;
|
|
13713
13717
|
instanceId: string;
|
|
13718
|
+
workflowName: string;
|
|
13719
|
+
schedule?: WorkflowCronSchedule;
|
|
13714
13720
|
};
|
|
13715
13721
|
export type WorkflowStepEvent<T> = {
|
|
13716
13722
|
payload: Readonly<T>;
|
|
13717
13723
|
timestamp: Date;
|
|
13718
13724
|
type: string;
|
|
13725
|
+
sensitive?: WorkflowStepSensitivity;
|
|
13719
13726
|
};
|
|
13720
13727
|
export type WorkflowStepContext = {
|
|
13721
13728
|
step: {
|
package/2023-03-01/index.ts
CHANGED
|
@@ -5485,9 +5485,6 @@ export type ChatCompletionChoice = {
|
|
|
5485
5485
|
| "function_call";
|
|
5486
5486
|
logprobs: ChatCompletionLogprobs | null;
|
|
5487
5487
|
};
|
|
5488
|
-
export type ChatCompletionsPromptInput = {
|
|
5489
|
-
prompt: string;
|
|
5490
|
-
} & ChatCompletionsCommonOptions;
|
|
5491
5488
|
export type ChatCompletionsMessagesInput = {
|
|
5492
5489
|
messages: Array<ChatCompletionMessageParam>;
|
|
5493
5490
|
} & ChatCompletionsCommonOptions;
|
|
@@ -9613,11 +9610,11 @@ export declare abstract class Base_Ai_Cf_Pipecat_Ai_Smart_Turn_V2 {
|
|
|
9613
9610
|
postProcessedOutputs: Ai_Cf_Pipecat_Ai_Smart_Turn_V2_Output;
|
|
9614
9611
|
}
|
|
9615
9612
|
export declare abstract class Base_Ai_Cf_Openai_Gpt_Oss_120B {
|
|
9616
|
-
inputs: XOR<ResponsesInput,
|
|
9613
|
+
inputs: XOR<ResponsesInput, ChatCompletionsMessagesInput>;
|
|
9617
9614
|
postProcessedOutputs: XOR<ResponsesOutput, ChatCompletionsOutput>;
|
|
9618
9615
|
}
|
|
9619
9616
|
export declare abstract class Base_Ai_Cf_Openai_Gpt_Oss_20B {
|
|
9620
|
-
inputs: XOR<ResponsesInput,
|
|
9617
|
+
inputs: XOR<ResponsesInput, ChatCompletionsMessagesInput>;
|
|
9621
9618
|
postProcessedOutputs: XOR<ResponsesOutput, ChatCompletionsOutput>;
|
|
9622
9619
|
}
|
|
9623
9620
|
export interface Ai_Cf_Leonardo_Phoenix_1_0_Input {
|
|
@@ -10712,7 +10709,7 @@ export declare abstract class Base_Ai_Cf_Moonshotai_Kimi_K2_5 {
|
|
|
10712
10709
|
postProcessedOutputs: ChatCompletionsOutput;
|
|
10713
10710
|
}
|
|
10714
10711
|
export declare abstract class Base_Ai_Cf_Moonshotai_Kimi_K2_6 {
|
|
10715
|
-
inputs:
|
|
10712
|
+
inputs: ChatCompletionsInput;
|
|
10716
10713
|
postProcessedOutputs: ChatCompletionsOutput;
|
|
10717
10714
|
}
|
|
10718
10715
|
export declare abstract class Base_Ai_Cf_Nvidia_Nemotron_3_120B_A12B {
|
|
@@ -10720,7 +10717,7 @@ export declare abstract class Base_Ai_Cf_Nvidia_Nemotron_3_120B_A12B {
|
|
|
10720
10717
|
postProcessedOutputs: ChatCompletionsOutput;
|
|
10721
10718
|
}
|
|
10722
10719
|
export declare abstract class Base_Ai_Cf_Google_Gemma_4_26B_A4B_IT {
|
|
10723
|
-
inputs:
|
|
10720
|
+
inputs: ChatCompletionsInput;
|
|
10724
10721
|
postProcessedOutputs: ChatCompletionsOutput;
|
|
10725
10722
|
}
|
|
10726
10723
|
export interface AiModels {
|
|
@@ -10867,16 +10864,8 @@ export type AiModelsSearchObject = {
|
|
|
10867
10864
|
value: string;
|
|
10868
10865
|
}[];
|
|
10869
10866
|
};
|
|
10870
|
-
export type ChatCompletionsBase =
|
|
10871
|
-
|
|
10872
|
-
ChatCompletionsMessagesInput
|
|
10873
|
-
>;
|
|
10874
|
-
export type ChatCompletionsInput = XOR<
|
|
10875
|
-
ChatCompletionsBase,
|
|
10876
|
-
{
|
|
10877
|
-
requests: ChatCompletionsBase[];
|
|
10878
|
-
}
|
|
10879
|
-
>;
|
|
10867
|
+
export type ChatCompletionsBase = ChatCompletionsMessagesInput;
|
|
10868
|
+
export type ChatCompletionsInput = ChatCompletionsMessagesInput;
|
|
10880
10869
|
export interface InferenceUpstreamError extends Error {}
|
|
10881
10870
|
export interface AiInternalError extends Error {}
|
|
10882
10871
|
export type AiModelListType = Record<string, any>;
|
|
@@ -10941,9 +10930,16 @@ export declare abstract class Ai<
|
|
|
10941
10930
|
inputs: AiModelList[Name]["inputs"],
|
|
10942
10931
|
options?: AiOptions,
|
|
10943
10932
|
): Promise<AiModelList[Name]["postProcessedOutputs"]>;
|
|
10944
|
-
// Unknown model (
|
|
10945
|
-
|
|
10946
|
-
|
|
10933
|
+
// Unknown model (fallback).
|
|
10934
|
+
//
|
|
10935
|
+
// The `Exclude<..., keyof AiModelList>` constraint forces TypeScript to
|
|
10936
|
+
// route any model name that is a literal key of `AiModelList` to one of
|
|
10937
|
+
// the known-model overloads above (so input/output mismatches surface as
|
|
10938
|
+
// type errors rather than silently falling back to `Record<string, unknown>`).
|
|
10939
|
+
// Names that aren't in `AiModelList` — e.g. third-party gateway models
|
|
10940
|
+
// like `"google/nano-banana"` — still hit this overload.
|
|
10941
|
+
run<Model extends string>(
|
|
10942
|
+
model: Model extends keyof AiModelList ? never : Model,
|
|
10947
10943
|
inputs: Record<string, unknown>,
|
|
10948
10944
|
options?: AiOptions,
|
|
10949
10945
|
): Promise<Record<string, unknown>>;
|
|
@@ -13670,6 +13666,7 @@ export declare namespace CloudflareWorkersModule {
|
|
|
13670
13666
|
export type WorkflowTimeoutDuration = WorkflowSleepDuration;
|
|
13671
13667
|
export type WorkflowRetentionDuration = WorkflowSleepDuration;
|
|
13672
13668
|
export type WorkflowBackoff = "constant" | "linear" | "exponential";
|
|
13669
|
+
export type WorkflowStepSensitivity = "output";
|
|
13673
13670
|
export type WorkflowStepConfig = {
|
|
13674
13671
|
retries?: {
|
|
13675
13672
|
limit: number;
|
|
@@ -13677,16 +13674,26 @@ export declare namespace CloudflareWorkersModule {
|
|
|
13677
13674
|
backoff?: WorkflowBackoff;
|
|
13678
13675
|
};
|
|
13679
13676
|
timeout?: WorkflowTimeoutDuration | number;
|
|
13677
|
+
sensitive?: WorkflowStepSensitivity;
|
|
13678
|
+
};
|
|
13679
|
+
export type WorkflowCronSchedule = {
|
|
13680
|
+
/** Cron expression that triggered this event. */
|
|
13681
|
+
cron: string;
|
|
13682
|
+
/** Timestamp of the scheduled trigger, in milliseconds since the Unix epoch. */
|
|
13683
|
+
scheduledTime: number;
|
|
13680
13684
|
};
|
|
13681
13685
|
export type WorkflowEvent<T> = {
|
|
13682
13686
|
payload: Readonly<T>;
|
|
13683
13687
|
timestamp: Date;
|
|
13684
13688
|
instanceId: string;
|
|
13689
|
+
workflowName: string;
|
|
13690
|
+
schedule?: WorkflowCronSchedule;
|
|
13685
13691
|
};
|
|
13686
13692
|
export type WorkflowStepEvent<T> = {
|
|
13687
13693
|
payload: Readonly<T>;
|
|
13688
13694
|
timestamp: Date;
|
|
13689
13695
|
type: string;
|
|
13696
|
+
sensitive?: WorkflowStepSensitivity;
|
|
13690
13697
|
};
|
|
13691
13698
|
export type WorkflowStepContext = {
|
|
13692
13699
|
step: {
|
package/2023-07-01/index.d.ts
CHANGED
|
@@ -5476,9 +5476,6 @@ type ChatCompletionChoice = {
|
|
|
5476
5476
|
| "function_call";
|
|
5477
5477
|
logprobs: ChatCompletionLogprobs | null;
|
|
5478
5478
|
};
|
|
5479
|
-
type ChatCompletionsPromptInput = {
|
|
5480
|
-
prompt: string;
|
|
5481
|
-
} & ChatCompletionsCommonOptions;
|
|
5482
5479
|
type ChatCompletionsMessagesInput = {
|
|
5483
5480
|
messages: Array<ChatCompletionMessageParam>;
|
|
5484
5481
|
} & ChatCompletionsCommonOptions;
|
|
@@ -9603,11 +9600,11 @@ declare abstract class Base_Ai_Cf_Pipecat_Ai_Smart_Turn_V2 {
|
|
|
9603
9600
|
postProcessedOutputs: Ai_Cf_Pipecat_Ai_Smart_Turn_V2_Output;
|
|
9604
9601
|
}
|
|
9605
9602
|
declare abstract class Base_Ai_Cf_Openai_Gpt_Oss_120B {
|
|
9606
|
-
inputs: XOR<ResponsesInput,
|
|
9603
|
+
inputs: XOR<ResponsesInput, ChatCompletionsMessagesInput>;
|
|
9607
9604
|
postProcessedOutputs: XOR<ResponsesOutput, ChatCompletionsOutput>;
|
|
9608
9605
|
}
|
|
9609
9606
|
declare abstract class Base_Ai_Cf_Openai_Gpt_Oss_20B {
|
|
9610
|
-
inputs: XOR<ResponsesInput,
|
|
9607
|
+
inputs: XOR<ResponsesInput, ChatCompletionsMessagesInput>;
|
|
9611
9608
|
postProcessedOutputs: XOR<ResponsesOutput, ChatCompletionsOutput>;
|
|
9612
9609
|
}
|
|
9613
9610
|
interface Ai_Cf_Leonardo_Phoenix_1_0_Input {
|
|
@@ -10702,7 +10699,7 @@ declare abstract class Base_Ai_Cf_Moonshotai_Kimi_K2_5 {
|
|
|
10702
10699
|
postProcessedOutputs: ChatCompletionsOutput;
|
|
10703
10700
|
}
|
|
10704
10701
|
declare abstract class Base_Ai_Cf_Moonshotai_Kimi_K2_6 {
|
|
10705
|
-
inputs:
|
|
10702
|
+
inputs: ChatCompletionsInput;
|
|
10706
10703
|
postProcessedOutputs: ChatCompletionsOutput;
|
|
10707
10704
|
}
|
|
10708
10705
|
declare abstract class Base_Ai_Cf_Nvidia_Nemotron_3_120B_A12B {
|
|
@@ -10710,7 +10707,7 @@ declare abstract class Base_Ai_Cf_Nvidia_Nemotron_3_120B_A12B {
|
|
|
10710
10707
|
postProcessedOutputs: ChatCompletionsOutput;
|
|
10711
10708
|
}
|
|
10712
10709
|
declare abstract class Base_Ai_Cf_Google_Gemma_4_26B_A4B_IT {
|
|
10713
|
-
inputs:
|
|
10710
|
+
inputs: ChatCompletionsInput;
|
|
10714
10711
|
postProcessedOutputs: ChatCompletionsOutput;
|
|
10715
10712
|
}
|
|
10716
10713
|
interface AiModels {
|
|
@@ -10857,16 +10854,8 @@ type AiModelsSearchObject = {
|
|
|
10857
10854
|
value: string;
|
|
10858
10855
|
}[];
|
|
10859
10856
|
};
|
|
10860
|
-
type ChatCompletionsBase =
|
|
10861
|
-
|
|
10862
|
-
ChatCompletionsMessagesInput
|
|
10863
|
-
>;
|
|
10864
|
-
type ChatCompletionsInput = XOR<
|
|
10865
|
-
ChatCompletionsBase,
|
|
10866
|
-
{
|
|
10867
|
-
requests: ChatCompletionsBase[];
|
|
10868
|
-
}
|
|
10869
|
-
>;
|
|
10857
|
+
type ChatCompletionsBase = ChatCompletionsMessagesInput;
|
|
10858
|
+
type ChatCompletionsInput = ChatCompletionsMessagesInput;
|
|
10870
10859
|
interface InferenceUpstreamError extends Error {}
|
|
10871
10860
|
interface AiInternalError extends Error {}
|
|
10872
10861
|
type AiModelListType = Record<string, any>;
|
|
@@ -10929,9 +10918,16 @@ declare abstract class Ai<AiModelList extends AiModelListType = AiModels> {
|
|
|
10929
10918
|
inputs: AiModelList[Name]["inputs"],
|
|
10930
10919
|
options?: AiOptions,
|
|
10931
10920
|
): Promise<AiModelList[Name]["postProcessedOutputs"]>;
|
|
10932
|
-
// Unknown model (
|
|
10933
|
-
|
|
10934
|
-
|
|
10921
|
+
// Unknown model (fallback).
|
|
10922
|
+
//
|
|
10923
|
+
// The `Exclude<..., keyof AiModelList>` constraint forces TypeScript to
|
|
10924
|
+
// route any model name that is a literal key of `AiModelList` to one of
|
|
10925
|
+
// the known-model overloads above (so input/output mismatches surface as
|
|
10926
|
+
// type errors rather than silently falling back to `Record<string, unknown>`).
|
|
10927
|
+
// Names that aren't in `AiModelList` — e.g. third-party gateway models
|
|
10928
|
+
// like `"google/nano-banana"` — still hit this overload.
|
|
10929
|
+
run<Model extends string>(
|
|
10930
|
+
model: Model extends keyof AiModelList ? never : Model,
|
|
10935
10931
|
inputs: Record<string, unknown>,
|
|
10936
10932
|
options?: AiOptions,
|
|
10937
10933
|
): Promise<Record<string, unknown>>;
|
|
@@ -13699,6 +13695,7 @@ declare namespace CloudflareWorkersModule {
|
|
|
13699
13695
|
export type WorkflowTimeoutDuration = WorkflowSleepDuration;
|
|
13700
13696
|
export type WorkflowRetentionDuration = WorkflowSleepDuration;
|
|
13701
13697
|
export type WorkflowBackoff = "constant" | "linear" | "exponential";
|
|
13698
|
+
export type WorkflowStepSensitivity = "output";
|
|
13702
13699
|
export type WorkflowStepConfig = {
|
|
13703
13700
|
retries?: {
|
|
13704
13701
|
limit: number;
|
|
@@ -13706,16 +13703,26 @@ declare namespace CloudflareWorkersModule {
|
|
|
13706
13703
|
backoff?: WorkflowBackoff;
|
|
13707
13704
|
};
|
|
13708
13705
|
timeout?: WorkflowTimeoutDuration | number;
|
|
13706
|
+
sensitive?: WorkflowStepSensitivity;
|
|
13707
|
+
};
|
|
13708
|
+
export type WorkflowCronSchedule = {
|
|
13709
|
+
/** Cron expression that triggered this event. */
|
|
13710
|
+
cron: string;
|
|
13711
|
+
/** Timestamp of the scheduled trigger, in milliseconds since the Unix epoch. */
|
|
13712
|
+
scheduledTime: number;
|
|
13709
13713
|
};
|
|
13710
13714
|
export type WorkflowEvent<T> = {
|
|
13711
13715
|
payload: Readonly<T>;
|
|
13712
13716
|
timestamp: Date;
|
|
13713
13717
|
instanceId: string;
|
|
13718
|
+
workflowName: string;
|
|
13719
|
+
schedule?: WorkflowCronSchedule;
|
|
13714
13720
|
};
|
|
13715
13721
|
export type WorkflowStepEvent<T> = {
|
|
13716
13722
|
payload: Readonly<T>;
|
|
13717
13723
|
timestamp: Date;
|
|
13718
13724
|
type: string;
|
|
13725
|
+
sensitive?: WorkflowStepSensitivity;
|
|
13719
13726
|
};
|
|
13720
13727
|
export type WorkflowStepContext = {
|
|
13721
13728
|
step: {
|