@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/2021-11-03/index.d.ts
CHANGED
|
@@ -5368,9 +5368,6 @@ type ChatCompletionChoice = {
|
|
|
5368
5368
|
| "function_call";
|
|
5369
5369
|
logprobs: ChatCompletionLogprobs | null;
|
|
5370
5370
|
};
|
|
5371
|
-
type ChatCompletionsPromptInput = {
|
|
5372
|
-
prompt: string;
|
|
5373
|
-
} & ChatCompletionsCommonOptions;
|
|
5374
5371
|
type ChatCompletionsMessagesInput = {
|
|
5375
5372
|
messages: Array<ChatCompletionMessageParam>;
|
|
5376
5373
|
} & ChatCompletionsCommonOptions;
|
|
@@ -9495,11 +9492,11 @@ declare abstract class Base_Ai_Cf_Pipecat_Ai_Smart_Turn_V2 {
|
|
|
9495
9492
|
postProcessedOutputs: Ai_Cf_Pipecat_Ai_Smart_Turn_V2_Output;
|
|
9496
9493
|
}
|
|
9497
9494
|
declare abstract class Base_Ai_Cf_Openai_Gpt_Oss_120B {
|
|
9498
|
-
inputs: XOR<ResponsesInput,
|
|
9495
|
+
inputs: XOR<ResponsesInput, ChatCompletionsMessagesInput>;
|
|
9499
9496
|
postProcessedOutputs: XOR<ResponsesOutput, ChatCompletionsOutput>;
|
|
9500
9497
|
}
|
|
9501
9498
|
declare abstract class Base_Ai_Cf_Openai_Gpt_Oss_20B {
|
|
9502
|
-
inputs: XOR<ResponsesInput,
|
|
9499
|
+
inputs: XOR<ResponsesInput, ChatCompletionsMessagesInput>;
|
|
9503
9500
|
postProcessedOutputs: XOR<ResponsesOutput, ChatCompletionsOutput>;
|
|
9504
9501
|
}
|
|
9505
9502
|
interface Ai_Cf_Leonardo_Phoenix_1_0_Input {
|
|
@@ -10594,7 +10591,7 @@ declare abstract class Base_Ai_Cf_Moonshotai_Kimi_K2_5 {
|
|
|
10594
10591
|
postProcessedOutputs: ChatCompletionsOutput;
|
|
10595
10592
|
}
|
|
10596
10593
|
declare abstract class Base_Ai_Cf_Moonshotai_Kimi_K2_6 {
|
|
10597
|
-
inputs:
|
|
10594
|
+
inputs: ChatCompletionsInput;
|
|
10598
10595
|
postProcessedOutputs: ChatCompletionsOutput;
|
|
10599
10596
|
}
|
|
10600
10597
|
declare abstract class Base_Ai_Cf_Nvidia_Nemotron_3_120B_A12B {
|
|
@@ -10602,7 +10599,7 @@ declare abstract class Base_Ai_Cf_Nvidia_Nemotron_3_120B_A12B {
|
|
|
10602
10599
|
postProcessedOutputs: ChatCompletionsOutput;
|
|
10603
10600
|
}
|
|
10604
10601
|
declare abstract class Base_Ai_Cf_Google_Gemma_4_26B_A4B_IT {
|
|
10605
|
-
inputs:
|
|
10602
|
+
inputs: ChatCompletionsInput;
|
|
10606
10603
|
postProcessedOutputs: ChatCompletionsOutput;
|
|
10607
10604
|
}
|
|
10608
10605
|
interface AiModels {
|
|
@@ -10749,16 +10746,8 @@ type AiModelsSearchObject = {
|
|
|
10749
10746
|
value: string;
|
|
10750
10747
|
}[];
|
|
10751
10748
|
};
|
|
10752
|
-
type ChatCompletionsBase =
|
|
10753
|
-
|
|
10754
|
-
ChatCompletionsMessagesInput
|
|
10755
|
-
>;
|
|
10756
|
-
type ChatCompletionsInput = XOR<
|
|
10757
|
-
ChatCompletionsBase,
|
|
10758
|
-
{
|
|
10759
|
-
requests: ChatCompletionsBase[];
|
|
10760
|
-
}
|
|
10761
|
-
>;
|
|
10749
|
+
type ChatCompletionsBase = ChatCompletionsMessagesInput;
|
|
10750
|
+
type ChatCompletionsInput = ChatCompletionsMessagesInput;
|
|
10762
10751
|
interface InferenceUpstreamError extends Error {}
|
|
10763
10752
|
interface AiInternalError extends Error {}
|
|
10764
10753
|
type AiModelListType = Record<string, any>;
|
|
@@ -10821,9 +10810,16 @@ declare abstract class Ai<AiModelList extends AiModelListType = AiModels> {
|
|
|
10821
10810
|
inputs: AiModelList[Name]["inputs"],
|
|
10822
10811
|
options?: AiOptions,
|
|
10823
10812
|
): Promise<AiModelList[Name]["postProcessedOutputs"]>;
|
|
10824
|
-
// Unknown model (
|
|
10825
|
-
|
|
10826
|
-
|
|
10813
|
+
// Unknown model (fallback).
|
|
10814
|
+
//
|
|
10815
|
+
// The `Exclude<..., keyof AiModelList>` constraint forces TypeScript to
|
|
10816
|
+
// route any model name that is a literal key of `AiModelList` to one of
|
|
10817
|
+
// the known-model overloads above (so input/output mismatches surface as
|
|
10818
|
+
// type errors rather than silently falling back to `Record<string, unknown>`).
|
|
10819
|
+
// Names that aren't in `AiModelList` — e.g. third-party gateway models
|
|
10820
|
+
// like `"google/nano-banana"` — still hit this overload.
|
|
10821
|
+
run<Model extends string>(
|
|
10822
|
+
model: Model extends keyof AiModelList ? never : Model,
|
|
10827
10823
|
inputs: Record<string, unknown>,
|
|
10828
10824
|
options?: AiOptions,
|
|
10829
10825
|
): Promise<Record<string, unknown>>;
|
|
@@ -13591,6 +13587,7 @@ declare namespace CloudflareWorkersModule {
|
|
|
13591
13587
|
export type WorkflowTimeoutDuration = WorkflowSleepDuration;
|
|
13592
13588
|
export type WorkflowRetentionDuration = WorkflowSleepDuration;
|
|
13593
13589
|
export type WorkflowBackoff = "constant" | "linear" | "exponential";
|
|
13590
|
+
export type WorkflowStepSensitivity = "output";
|
|
13594
13591
|
export type WorkflowStepConfig = {
|
|
13595
13592
|
retries?: {
|
|
13596
13593
|
limit: number;
|
|
@@ -13598,16 +13595,26 @@ declare namespace CloudflareWorkersModule {
|
|
|
13598
13595
|
backoff?: WorkflowBackoff;
|
|
13599
13596
|
};
|
|
13600
13597
|
timeout?: WorkflowTimeoutDuration | number;
|
|
13598
|
+
sensitive?: WorkflowStepSensitivity;
|
|
13599
|
+
};
|
|
13600
|
+
export type WorkflowCronSchedule = {
|
|
13601
|
+
/** Cron expression that triggered this event. */
|
|
13602
|
+
cron: string;
|
|
13603
|
+
/** Timestamp of the scheduled trigger, in milliseconds since the Unix epoch. */
|
|
13604
|
+
scheduledTime: number;
|
|
13601
13605
|
};
|
|
13602
13606
|
export type WorkflowEvent<T> = {
|
|
13603
13607
|
payload: Readonly<T>;
|
|
13604
13608
|
timestamp: Date;
|
|
13605
13609
|
instanceId: string;
|
|
13610
|
+
workflowName: string;
|
|
13611
|
+
schedule?: WorkflowCronSchedule;
|
|
13606
13612
|
};
|
|
13607
13613
|
export type WorkflowStepEvent<T> = {
|
|
13608
13614
|
payload: Readonly<T>;
|
|
13609
13615
|
timestamp: Date;
|
|
13610
13616
|
type: string;
|
|
13617
|
+
sensitive?: WorkflowStepSensitivity;
|
|
13611
13618
|
};
|
|
13612
13619
|
export type WorkflowStepContext = {
|
|
13613
13620
|
step: {
|
package/2021-11-03/index.ts
CHANGED
|
@@ -5377,9 +5377,6 @@ export type ChatCompletionChoice = {
|
|
|
5377
5377
|
| "function_call";
|
|
5378
5378
|
logprobs: ChatCompletionLogprobs | null;
|
|
5379
5379
|
};
|
|
5380
|
-
export type ChatCompletionsPromptInput = {
|
|
5381
|
-
prompt: string;
|
|
5382
|
-
} & ChatCompletionsCommonOptions;
|
|
5383
5380
|
export type ChatCompletionsMessagesInput = {
|
|
5384
5381
|
messages: Array<ChatCompletionMessageParam>;
|
|
5385
5382
|
} & ChatCompletionsCommonOptions;
|
|
@@ -9505,11 +9502,11 @@ export declare abstract class Base_Ai_Cf_Pipecat_Ai_Smart_Turn_V2 {
|
|
|
9505
9502
|
postProcessedOutputs: Ai_Cf_Pipecat_Ai_Smart_Turn_V2_Output;
|
|
9506
9503
|
}
|
|
9507
9504
|
export declare abstract class Base_Ai_Cf_Openai_Gpt_Oss_120B {
|
|
9508
|
-
inputs: XOR<ResponsesInput,
|
|
9505
|
+
inputs: XOR<ResponsesInput, ChatCompletionsMessagesInput>;
|
|
9509
9506
|
postProcessedOutputs: XOR<ResponsesOutput, ChatCompletionsOutput>;
|
|
9510
9507
|
}
|
|
9511
9508
|
export declare abstract class Base_Ai_Cf_Openai_Gpt_Oss_20B {
|
|
9512
|
-
inputs: XOR<ResponsesInput,
|
|
9509
|
+
inputs: XOR<ResponsesInput, ChatCompletionsMessagesInput>;
|
|
9513
9510
|
postProcessedOutputs: XOR<ResponsesOutput, ChatCompletionsOutput>;
|
|
9514
9511
|
}
|
|
9515
9512
|
export interface Ai_Cf_Leonardo_Phoenix_1_0_Input {
|
|
@@ -10604,7 +10601,7 @@ export declare abstract class Base_Ai_Cf_Moonshotai_Kimi_K2_5 {
|
|
|
10604
10601
|
postProcessedOutputs: ChatCompletionsOutput;
|
|
10605
10602
|
}
|
|
10606
10603
|
export declare abstract class Base_Ai_Cf_Moonshotai_Kimi_K2_6 {
|
|
10607
|
-
inputs:
|
|
10604
|
+
inputs: ChatCompletionsInput;
|
|
10608
10605
|
postProcessedOutputs: ChatCompletionsOutput;
|
|
10609
10606
|
}
|
|
10610
10607
|
export declare abstract class Base_Ai_Cf_Nvidia_Nemotron_3_120B_A12B {
|
|
@@ -10612,7 +10609,7 @@ export declare abstract class Base_Ai_Cf_Nvidia_Nemotron_3_120B_A12B {
|
|
|
10612
10609
|
postProcessedOutputs: ChatCompletionsOutput;
|
|
10613
10610
|
}
|
|
10614
10611
|
export declare abstract class Base_Ai_Cf_Google_Gemma_4_26B_A4B_IT {
|
|
10615
|
-
inputs:
|
|
10612
|
+
inputs: ChatCompletionsInput;
|
|
10616
10613
|
postProcessedOutputs: ChatCompletionsOutput;
|
|
10617
10614
|
}
|
|
10618
10615
|
export interface AiModels {
|
|
@@ -10759,16 +10756,8 @@ export type AiModelsSearchObject = {
|
|
|
10759
10756
|
value: string;
|
|
10760
10757
|
}[];
|
|
10761
10758
|
};
|
|
10762
|
-
export type ChatCompletionsBase =
|
|
10763
|
-
|
|
10764
|
-
ChatCompletionsMessagesInput
|
|
10765
|
-
>;
|
|
10766
|
-
export type ChatCompletionsInput = XOR<
|
|
10767
|
-
ChatCompletionsBase,
|
|
10768
|
-
{
|
|
10769
|
-
requests: ChatCompletionsBase[];
|
|
10770
|
-
}
|
|
10771
|
-
>;
|
|
10759
|
+
export type ChatCompletionsBase = ChatCompletionsMessagesInput;
|
|
10760
|
+
export type ChatCompletionsInput = ChatCompletionsMessagesInput;
|
|
10772
10761
|
export interface InferenceUpstreamError extends Error {}
|
|
10773
10762
|
export interface AiInternalError extends Error {}
|
|
10774
10763
|
export type AiModelListType = Record<string, any>;
|
|
@@ -10833,9 +10822,16 @@ export declare abstract class Ai<
|
|
|
10833
10822
|
inputs: AiModelList[Name]["inputs"],
|
|
10834
10823
|
options?: AiOptions,
|
|
10835
10824
|
): Promise<AiModelList[Name]["postProcessedOutputs"]>;
|
|
10836
|
-
// Unknown model (
|
|
10837
|
-
|
|
10838
|
-
|
|
10825
|
+
// Unknown model (fallback).
|
|
10826
|
+
//
|
|
10827
|
+
// The `Exclude<..., keyof AiModelList>` constraint forces TypeScript to
|
|
10828
|
+
// route any model name that is a literal key of `AiModelList` to one of
|
|
10829
|
+
// the known-model overloads above (so input/output mismatches surface as
|
|
10830
|
+
// type errors rather than silently falling back to `Record<string, unknown>`).
|
|
10831
|
+
// Names that aren't in `AiModelList` — e.g. third-party gateway models
|
|
10832
|
+
// like `"google/nano-banana"` — still hit this overload.
|
|
10833
|
+
run<Model extends string>(
|
|
10834
|
+
model: Model extends keyof AiModelList ? never : Model,
|
|
10839
10835
|
inputs: Record<string, unknown>,
|
|
10840
10836
|
options?: AiOptions,
|
|
10841
10837
|
): Promise<Record<string, unknown>>;
|
|
@@ -13562,6 +13558,7 @@ export declare namespace CloudflareWorkersModule {
|
|
|
13562
13558
|
export type WorkflowTimeoutDuration = WorkflowSleepDuration;
|
|
13563
13559
|
export type WorkflowRetentionDuration = WorkflowSleepDuration;
|
|
13564
13560
|
export type WorkflowBackoff = "constant" | "linear" | "exponential";
|
|
13561
|
+
export type WorkflowStepSensitivity = "output";
|
|
13565
13562
|
export type WorkflowStepConfig = {
|
|
13566
13563
|
retries?: {
|
|
13567
13564
|
limit: number;
|
|
@@ -13569,16 +13566,26 @@ export declare namespace CloudflareWorkersModule {
|
|
|
13569
13566
|
backoff?: WorkflowBackoff;
|
|
13570
13567
|
};
|
|
13571
13568
|
timeout?: WorkflowTimeoutDuration | number;
|
|
13569
|
+
sensitive?: WorkflowStepSensitivity;
|
|
13570
|
+
};
|
|
13571
|
+
export type WorkflowCronSchedule = {
|
|
13572
|
+
/** Cron expression that triggered this event. */
|
|
13573
|
+
cron: string;
|
|
13574
|
+
/** Timestamp of the scheduled trigger, in milliseconds since the Unix epoch. */
|
|
13575
|
+
scheduledTime: number;
|
|
13572
13576
|
};
|
|
13573
13577
|
export type WorkflowEvent<T> = {
|
|
13574
13578
|
payload: Readonly<T>;
|
|
13575
13579
|
timestamp: Date;
|
|
13576
13580
|
instanceId: string;
|
|
13581
|
+
workflowName: string;
|
|
13582
|
+
schedule?: WorkflowCronSchedule;
|
|
13577
13583
|
};
|
|
13578
13584
|
export type WorkflowStepEvent<T> = {
|
|
13579
13585
|
payload: Readonly<T>;
|
|
13580
13586
|
timestamp: Date;
|
|
13581
13587
|
type: string;
|
|
13588
|
+
sensitive?: WorkflowStepSensitivity;
|
|
13582
13589
|
};
|
|
13583
13590
|
export type WorkflowStepContext = {
|
|
13584
13591
|
step: {
|
package/2022-01-31/index.d.ts
CHANGED
|
@@ -5435,9 +5435,6 @@ type ChatCompletionChoice = {
|
|
|
5435
5435
|
| "function_call";
|
|
5436
5436
|
logprobs: ChatCompletionLogprobs | null;
|
|
5437
5437
|
};
|
|
5438
|
-
type ChatCompletionsPromptInput = {
|
|
5439
|
-
prompt: string;
|
|
5440
|
-
} & ChatCompletionsCommonOptions;
|
|
5441
5438
|
type ChatCompletionsMessagesInput = {
|
|
5442
5439
|
messages: Array<ChatCompletionMessageParam>;
|
|
5443
5440
|
} & ChatCompletionsCommonOptions;
|
|
@@ -9562,11 +9559,11 @@ declare abstract class Base_Ai_Cf_Pipecat_Ai_Smart_Turn_V2 {
|
|
|
9562
9559
|
postProcessedOutputs: Ai_Cf_Pipecat_Ai_Smart_Turn_V2_Output;
|
|
9563
9560
|
}
|
|
9564
9561
|
declare abstract class Base_Ai_Cf_Openai_Gpt_Oss_120B {
|
|
9565
|
-
inputs: XOR<ResponsesInput,
|
|
9562
|
+
inputs: XOR<ResponsesInput, ChatCompletionsMessagesInput>;
|
|
9566
9563
|
postProcessedOutputs: XOR<ResponsesOutput, ChatCompletionsOutput>;
|
|
9567
9564
|
}
|
|
9568
9565
|
declare abstract class Base_Ai_Cf_Openai_Gpt_Oss_20B {
|
|
9569
|
-
inputs: XOR<ResponsesInput,
|
|
9566
|
+
inputs: XOR<ResponsesInput, ChatCompletionsMessagesInput>;
|
|
9570
9567
|
postProcessedOutputs: XOR<ResponsesOutput, ChatCompletionsOutput>;
|
|
9571
9568
|
}
|
|
9572
9569
|
interface Ai_Cf_Leonardo_Phoenix_1_0_Input {
|
|
@@ -10661,7 +10658,7 @@ declare abstract class Base_Ai_Cf_Moonshotai_Kimi_K2_5 {
|
|
|
10661
10658
|
postProcessedOutputs: ChatCompletionsOutput;
|
|
10662
10659
|
}
|
|
10663
10660
|
declare abstract class Base_Ai_Cf_Moonshotai_Kimi_K2_6 {
|
|
10664
|
-
inputs:
|
|
10661
|
+
inputs: ChatCompletionsInput;
|
|
10665
10662
|
postProcessedOutputs: ChatCompletionsOutput;
|
|
10666
10663
|
}
|
|
10667
10664
|
declare abstract class Base_Ai_Cf_Nvidia_Nemotron_3_120B_A12B {
|
|
@@ -10669,7 +10666,7 @@ declare abstract class Base_Ai_Cf_Nvidia_Nemotron_3_120B_A12B {
|
|
|
10669
10666
|
postProcessedOutputs: ChatCompletionsOutput;
|
|
10670
10667
|
}
|
|
10671
10668
|
declare abstract class Base_Ai_Cf_Google_Gemma_4_26B_A4B_IT {
|
|
10672
|
-
inputs:
|
|
10669
|
+
inputs: ChatCompletionsInput;
|
|
10673
10670
|
postProcessedOutputs: ChatCompletionsOutput;
|
|
10674
10671
|
}
|
|
10675
10672
|
interface AiModels {
|
|
@@ -10816,16 +10813,8 @@ type AiModelsSearchObject = {
|
|
|
10816
10813
|
value: string;
|
|
10817
10814
|
}[];
|
|
10818
10815
|
};
|
|
10819
|
-
type ChatCompletionsBase =
|
|
10820
|
-
|
|
10821
|
-
ChatCompletionsMessagesInput
|
|
10822
|
-
>;
|
|
10823
|
-
type ChatCompletionsInput = XOR<
|
|
10824
|
-
ChatCompletionsBase,
|
|
10825
|
-
{
|
|
10826
|
-
requests: ChatCompletionsBase[];
|
|
10827
|
-
}
|
|
10828
|
-
>;
|
|
10816
|
+
type ChatCompletionsBase = ChatCompletionsMessagesInput;
|
|
10817
|
+
type ChatCompletionsInput = ChatCompletionsMessagesInput;
|
|
10829
10818
|
interface InferenceUpstreamError extends Error {}
|
|
10830
10819
|
interface AiInternalError extends Error {}
|
|
10831
10820
|
type AiModelListType = Record<string, any>;
|
|
@@ -10888,9 +10877,16 @@ declare abstract class Ai<AiModelList extends AiModelListType = AiModels> {
|
|
|
10888
10877
|
inputs: AiModelList[Name]["inputs"],
|
|
10889
10878
|
options?: AiOptions,
|
|
10890
10879
|
): Promise<AiModelList[Name]["postProcessedOutputs"]>;
|
|
10891
|
-
// Unknown model (
|
|
10892
|
-
|
|
10893
|
-
|
|
10880
|
+
// Unknown model (fallback).
|
|
10881
|
+
//
|
|
10882
|
+
// The `Exclude<..., keyof AiModelList>` constraint forces TypeScript to
|
|
10883
|
+
// route any model name that is a literal key of `AiModelList` to one of
|
|
10884
|
+
// the known-model overloads above (so input/output mismatches surface as
|
|
10885
|
+
// type errors rather than silently falling back to `Record<string, unknown>`).
|
|
10886
|
+
// Names that aren't in `AiModelList` — e.g. third-party gateway models
|
|
10887
|
+
// like `"google/nano-banana"` — still hit this overload.
|
|
10888
|
+
run<Model extends string>(
|
|
10889
|
+
model: Model extends keyof AiModelList ? never : Model,
|
|
10894
10890
|
inputs: Record<string, unknown>,
|
|
10895
10891
|
options?: AiOptions,
|
|
10896
10892
|
): Promise<Record<string, unknown>>;
|
|
@@ -13658,6 +13654,7 @@ declare namespace CloudflareWorkersModule {
|
|
|
13658
13654
|
export type WorkflowTimeoutDuration = WorkflowSleepDuration;
|
|
13659
13655
|
export type WorkflowRetentionDuration = WorkflowSleepDuration;
|
|
13660
13656
|
export type WorkflowBackoff = "constant" | "linear" | "exponential";
|
|
13657
|
+
export type WorkflowStepSensitivity = "output";
|
|
13661
13658
|
export type WorkflowStepConfig = {
|
|
13662
13659
|
retries?: {
|
|
13663
13660
|
limit: number;
|
|
@@ -13665,16 +13662,26 @@ declare namespace CloudflareWorkersModule {
|
|
|
13665
13662
|
backoff?: WorkflowBackoff;
|
|
13666
13663
|
};
|
|
13667
13664
|
timeout?: WorkflowTimeoutDuration | number;
|
|
13665
|
+
sensitive?: WorkflowStepSensitivity;
|
|
13666
|
+
};
|
|
13667
|
+
export type WorkflowCronSchedule = {
|
|
13668
|
+
/** Cron expression that triggered this event. */
|
|
13669
|
+
cron: string;
|
|
13670
|
+
/** Timestamp of the scheduled trigger, in milliseconds since the Unix epoch. */
|
|
13671
|
+
scheduledTime: number;
|
|
13668
13672
|
};
|
|
13669
13673
|
export type WorkflowEvent<T> = {
|
|
13670
13674
|
payload: Readonly<T>;
|
|
13671
13675
|
timestamp: Date;
|
|
13672
13676
|
instanceId: string;
|
|
13677
|
+
workflowName: string;
|
|
13678
|
+
schedule?: WorkflowCronSchedule;
|
|
13673
13679
|
};
|
|
13674
13680
|
export type WorkflowStepEvent<T> = {
|
|
13675
13681
|
payload: Readonly<T>;
|
|
13676
13682
|
timestamp: Date;
|
|
13677
13683
|
type: string;
|
|
13684
|
+
sensitive?: WorkflowStepSensitivity;
|
|
13678
13685
|
};
|
|
13679
13686
|
export type WorkflowStepContext = {
|
|
13680
13687
|
step: {
|
package/2022-01-31/index.ts
CHANGED
|
@@ -5444,9 +5444,6 @@ export type ChatCompletionChoice = {
|
|
|
5444
5444
|
| "function_call";
|
|
5445
5445
|
logprobs: ChatCompletionLogprobs | null;
|
|
5446
5446
|
};
|
|
5447
|
-
export type ChatCompletionsPromptInput = {
|
|
5448
|
-
prompt: string;
|
|
5449
|
-
} & ChatCompletionsCommonOptions;
|
|
5450
5447
|
export type ChatCompletionsMessagesInput = {
|
|
5451
5448
|
messages: Array<ChatCompletionMessageParam>;
|
|
5452
5449
|
} & ChatCompletionsCommonOptions;
|
|
@@ -9572,11 +9569,11 @@ export declare abstract class Base_Ai_Cf_Pipecat_Ai_Smart_Turn_V2 {
|
|
|
9572
9569
|
postProcessedOutputs: Ai_Cf_Pipecat_Ai_Smart_Turn_V2_Output;
|
|
9573
9570
|
}
|
|
9574
9571
|
export declare abstract class Base_Ai_Cf_Openai_Gpt_Oss_120B {
|
|
9575
|
-
inputs: XOR<ResponsesInput,
|
|
9572
|
+
inputs: XOR<ResponsesInput, ChatCompletionsMessagesInput>;
|
|
9576
9573
|
postProcessedOutputs: XOR<ResponsesOutput, ChatCompletionsOutput>;
|
|
9577
9574
|
}
|
|
9578
9575
|
export declare abstract class Base_Ai_Cf_Openai_Gpt_Oss_20B {
|
|
9579
|
-
inputs: XOR<ResponsesInput,
|
|
9576
|
+
inputs: XOR<ResponsesInput, ChatCompletionsMessagesInput>;
|
|
9580
9577
|
postProcessedOutputs: XOR<ResponsesOutput, ChatCompletionsOutput>;
|
|
9581
9578
|
}
|
|
9582
9579
|
export interface Ai_Cf_Leonardo_Phoenix_1_0_Input {
|
|
@@ -10671,7 +10668,7 @@ export declare abstract class Base_Ai_Cf_Moonshotai_Kimi_K2_5 {
|
|
|
10671
10668
|
postProcessedOutputs: ChatCompletionsOutput;
|
|
10672
10669
|
}
|
|
10673
10670
|
export declare abstract class Base_Ai_Cf_Moonshotai_Kimi_K2_6 {
|
|
10674
|
-
inputs:
|
|
10671
|
+
inputs: ChatCompletionsInput;
|
|
10675
10672
|
postProcessedOutputs: ChatCompletionsOutput;
|
|
10676
10673
|
}
|
|
10677
10674
|
export declare abstract class Base_Ai_Cf_Nvidia_Nemotron_3_120B_A12B {
|
|
@@ -10679,7 +10676,7 @@ export declare abstract class Base_Ai_Cf_Nvidia_Nemotron_3_120B_A12B {
|
|
|
10679
10676
|
postProcessedOutputs: ChatCompletionsOutput;
|
|
10680
10677
|
}
|
|
10681
10678
|
export declare abstract class Base_Ai_Cf_Google_Gemma_4_26B_A4B_IT {
|
|
10682
|
-
inputs:
|
|
10679
|
+
inputs: ChatCompletionsInput;
|
|
10683
10680
|
postProcessedOutputs: ChatCompletionsOutput;
|
|
10684
10681
|
}
|
|
10685
10682
|
export interface AiModels {
|
|
@@ -10826,16 +10823,8 @@ export type AiModelsSearchObject = {
|
|
|
10826
10823
|
value: string;
|
|
10827
10824
|
}[];
|
|
10828
10825
|
};
|
|
10829
|
-
export type ChatCompletionsBase =
|
|
10830
|
-
|
|
10831
|
-
ChatCompletionsMessagesInput
|
|
10832
|
-
>;
|
|
10833
|
-
export type ChatCompletionsInput = XOR<
|
|
10834
|
-
ChatCompletionsBase,
|
|
10835
|
-
{
|
|
10836
|
-
requests: ChatCompletionsBase[];
|
|
10837
|
-
}
|
|
10838
|
-
>;
|
|
10826
|
+
export type ChatCompletionsBase = ChatCompletionsMessagesInput;
|
|
10827
|
+
export type ChatCompletionsInput = ChatCompletionsMessagesInput;
|
|
10839
10828
|
export interface InferenceUpstreamError extends Error {}
|
|
10840
10829
|
export interface AiInternalError extends Error {}
|
|
10841
10830
|
export type AiModelListType = Record<string, any>;
|
|
@@ -10900,9 +10889,16 @@ export declare abstract class Ai<
|
|
|
10900
10889
|
inputs: AiModelList[Name]["inputs"],
|
|
10901
10890
|
options?: AiOptions,
|
|
10902
10891
|
): Promise<AiModelList[Name]["postProcessedOutputs"]>;
|
|
10903
|
-
// Unknown model (
|
|
10904
|
-
|
|
10905
|
-
|
|
10892
|
+
// Unknown model (fallback).
|
|
10893
|
+
//
|
|
10894
|
+
// The `Exclude<..., keyof AiModelList>` constraint forces TypeScript to
|
|
10895
|
+
// route any model name that is a literal key of `AiModelList` to one of
|
|
10896
|
+
// the known-model overloads above (so input/output mismatches surface as
|
|
10897
|
+
// type errors rather than silently falling back to `Record<string, unknown>`).
|
|
10898
|
+
// Names that aren't in `AiModelList` — e.g. third-party gateway models
|
|
10899
|
+
// like `"google/nano-banana"` — still hit this overload.
|
|
10900
|
+
run<Model extends string>(
|
|
10901
|
+
model: Model extends keyof AiModelList ? never : Model,
|
|
10906
10902
|
inputs: Record<string, unknown>,
|
|
10907
10903
|
options?: AiOptions,
|
|
10908
10904
|
): Promise<Record<string, unknown>>;
|
|
@@ -13629,6 +13625,7 @@ export declare namespace CloudflareWorkersModule {
|
|
|
13629
13625
|
export type WorkflowTimeoutDuration = WorkflowSleepDuration;
|
|
13630
13626
|
export type WorkflowRetentionDuration = WorkflowSleepDuration;
|
|
13631
13627
|
export type WorkflowBackoff = "constant" | "linear" | "exponential";
|
|
13628
|
+
export type WorkflowStepSensitivity = "output";
|
|
13632
13629
|
export type WorkflowStepConfig = {
|
|
13633
13630
|
retries?: {
|
|
13634
13631
|
limit: number;
|
|
@@ -13636,16 +13633,26 @@ export declare namespace CloudflareWorkersModule {
|
|
|
13636
13633
|
backoff?: WorkflowBackoff;
|
|
13637
13634
|
};
|
|
13638
13635
|
timeout?: WorkflowTimeoutDuration | number;
|
|
13636
|
+
sensitive?: WorkflowStepSensitivity;
|
|
13637
|
+
};
|
|
13638
|
+
export type WorkflowCronSchedule = {
|
|
13639
|
+
/** Cron expression that triggered this event. */
|
|
13640
|
+
cron: string;
|
|
13641
|
+
/** Timestamp of the scheduled trigger, in milliseconds since the Unix epoch. */
|
|
13642
|
+
scheduledTime: number;
|
|
13639
13643
|
};
|
|
13640
13644
|
export type WorkflowEvent<T> = {
|
|
13641
13645
|
payload: Readonly<T>;
|
|
13642
13646
|
timestamp: Date;
|
|
13643
13647
|
instanceId: string;
|
|
13648
|
+
workflowName: string;
|
|
13649
|
+
schedule?: WorkflowCronSchedule;
|
|
13644
13650
|
};
|
|
13645
13651
|
export type WorkflowStepEvent<T> = {
|
|
13646
13652
|
payload: Readonly<T>;
|
|
13647
13653
|
timestamp: Date;
|
|
13648
13654
|
type: string;
|
|
13655
|
+
sensitive?: WorkflowStepSensitivity;
|
|
13649
13656
|
};
|
|
13650
13657
|
export type WorkflowStepContext = {
|
|
13651
13658
|
step: {
|
package/2022-03-21/index.d.ts
CHANGED
|
@@ -5444,9 +5444,6 @@ type ChatCompletionChoice = {
|
|
|
5444
5444
|
| "function_call";
|
|
5445
5445
|
logprobs: ChatCompletionLogprobs | null;
|
|
5446
5446
|
};
|
|
5447
|
-
type ChatCompletionsPromptInput = {
|
|
5448
|
-
prompt: string;
|
|
5449
|
-
} & ChatCompletionsCommonOptions;
|
|
5450
5447
|
type ChatCompletionsMessagesInput = {
|
|
5451
5448
|
messages: Array<ChatCompletionMessageParam>;
|
|
5452
5449
|
} & ChatCompletionsCommonOptions;
|
|
@@ -9571,11 +9568,11 @@ declare abstract class Base_Ai_Cf_Pipecat_Ai_Smart_Turn_V2 {
|
|
|
9571
9568
|
postProcessedOutputs: Ai_Cf_Pipecat_Ai_Smart_Turn_V2_Output;
|
|
9572
9569
|
}
|
|
9573
9570
|
declare abstract class Base_Ai_Cf_Openai_Gpt_Oss_120B {
|
|
9574
|
-
inputs: XOR<ResponsesInput,
|
|
9571
|
+
inputs: XOR<ResponsesInput, ChatCompletionsMessagesInput>;
|
|
9575
9572
|
postProcessedOutputs: XOR<ResponsesOutput, ChatCompletionsOutput>;
|
|
9576
9573
|
}
|
|
9577
9574
|
declare abstract class Base_Ai_Cf_Openai_Gpt_Oss_20B {
|
|
9578
|
-
inputs: XOR<ResponsesInput,
|
|
9575
|
+
inputs: XOR<ResponsesInput, ChatCompletionsMessagesInput>;
|
|
9579
9576
|
postProcessedOutputs: XOR<ResponsesOutput, ChatCompletionsOutput>;
|
|
9580
9577
|
}
|
|
9581
9578
|
interface Ai_Cf_Leonardo_Phoenix_1_0_Input {
|
|
@@ -10670,7 +10667,7 @@ declare abstract class Base_Ai_Cf_Moonshotai_Kimi_K2_5 {
|
|
|
10670
10667
|
postProcessedOutputs: ChatCompletionsOutput;
|
|
10671
10668
|
}
|
|
10672
10669
|
declare abstract class Base_Ai_Cf_Moonshotai_Kimi_K2_6 {
|
|
10673
|
-
inputs:
|
|
10670
|
+
inputs: ChatCompletionsInput;
|
|
10674
10671
|
postProcessedOutputs: ChatCompletionsOutput;
|
|
10675
10672
|
}
|
|
10676
10673
|
declare abstract class Base_Ai_Cf_Nvidia_Nemotron_3_120B_A12B {
|
|
@@ -10678,7 +10675,7 @@ declare abstract class Base_Ai_Cf_Nvidia_Nemotron_3_120B_A12B {
|
|
|
10678
10675
|
postProcessedOutputs: ChatCompletionsOutput;
|
|
10679
10676
|
}
|
|
10680
10677
|
declare abstract class Base_Ai_Cf_Google_Gemma_4_26B_A4B_IT {
|
|
10681
|
-
inputs:
|
|
10678
|
+
inputs: ChatCompletionsInput;
|
|
10682
10679
|
postProcessedOutputs: ChatCompletionsOutput;
|
|
10683
10680
|
}
|
|
10684
10681
|
interface AiModels {
|
|
@@ -10825,16 +10822,8 @@ type AiModelsSearchObject = {
|
|
|
10825
10822
|
value: string;
|
|
10826
10823
|
}[];
|
|
10827
10824
|
};
|
|
10828
|
-
type ChatCompletionsBase =
|
|
10829
|
-
|
|
10830
|
-
ChatCompletionsMessagesInput
|
|
10831
|
-
>;
|
|
10832
|
-
type ChatCompletionsInput = XOR<
|
|
10833
|
-
ChatCompletionsBase,
|
|
10834
|
-
{
|
|
10835
|
-
requests: ChatCompletionsBase[];
|
|
10836
|
-
}
|
|
10837
|
-
>;
|
|
10825
|
+
type ChatCompletionsBase = ChatCompletionsMessagesInput;
|
|
10826
|
+
type ChatCompletionsInput = ChatCompletionsMessagesInput;
|
|
10838
10827
|
interface InferenceUpstreamError extends Error {}
|
|
10839
10828
|
interface AiInternalError extends Error {}
|
|
10840
10829
|
type AiModelListType = Record<string, any>;
|
|
@@ -10897,9 +10886,16 @@ declare abstract class Ai<AiModelList extends AiModelListType = AiModels> {
|
|
|
10897
10886
|
inputs: AiModelList[Name]["inputs"],
|
|
10898
10887
|
options?: AiOptions,
|
|
10899
10888
|
): Promise<AiModelList[Name]["postProcessedOutputs"]>;
|
|
10900
|
-
// Unknown model (
|
|
10901
|
-
|
|
10902
|
-
|
|
10889
|
+
// Unknown model (fallback).
|
|
10890
|
+
//
|
|
10891
|
+
// The `Exclude<..., keyof AiModelList>` constraint forces TypeScript to
|
|
10892
|
+
// route any model name that is a literal key of `AiModelList` to one of
|
|
10893
|
+
// the known-model overloads above (so input/output mismatches surface as
|
|
10894
|
+
// type errors rather than silently falling back to `Record<string, unknown>`).
|
|
10895
|
+
// Names that aren't in `AiModelList` — e.g. third-party gateway models
|
|
10896
|
+
// like `"google/nano-banana"` — still hit this overload.
|
|
10897
|
+
run<Model extends string>(
|
|
10898
|
+
model: Model extends keyof AiModelList ? never : Model,
|
|
10903
10899
|
inputs: Record<string, unknown>,
|
|
10904
10900
|
options?: AiOptions,
|
|
10905
10901
|
): Promise<Record<string, unknown>>;
|
|
@@ -13667,6 +13663,7 @@ declare namespace CloudflareWorkersModule {
|
|
|
13667
13663
|
export type WorkflowTimeoutDuration = WorkflowSleepDuration;
|
|
13668
13664
|
export type WorkflowRetentionDuration = WorkflowSleepDuration;
|
|
13669
13665
|
export type WorkflowBackoff = "constant" | "linear" | "exponential";
|
|
13666
|
+
export type WorkflowStepSensitivity = "output";
|
|
13670
13667
|
export type WorkflowStepConfig = {
|
|
13671
13668
|
retries?: {
|
|
13672
13669
|
limit: number;
|
|
@@ -13674,16 +13671,26 @@ declare namespace CloudflareWorkersModule {
|
|
|
13674
13671
|
backoff?: WorkflowBackoff;
|
|
13675
13672
|
};
|
|
13676
13673
|
timeout?: WorkflowTimeoutDuration | number;
|
|
13674
|
+
sensitive?: WorkflowStepSensitivity;
|
|
13675
|
+
};
|
|
13676
|
+
export type WorkflowCronSchedule = {
|
|
13677
|
+
/** Cron expression that triggered this event. */
|
|
13678
|
+
cron: string;
|
|
13679
|
+
/** Timestamp of the scheduled trigger, in milliseconds since the Unix epoch. */
|
|
13680
|
+
scheduledTime: number;
|
|
13677
13681
|
};
|
|
13678
13682
|
export type WorkflowEvent<T> = {
|
|
13679
13683
|
payload: Readonly<T>;
|
|
13680
13684
|
timestamp: Date;
|
|
13681
13685
|
instanceId: string;
|
|
13686
|
+
workflowName: string;
|
|
13687
|
+
schedule?: WorkflowCronSchedule;
|
|
13682
13688
|
};
|
|
13683
13689
|
export type WorkflowStepEvent<T> = {
|
|
13684
13690
|
payload: Readonly<T>;
|
|
13685
13691
|
timestamp: Date;
|
|
13686
13692
|
type: string;
|
|
13693
|
+
sensitive?: WorkflowStepSensitivity;
|
|
13687
13694
|
};
|
|
13688
13695
|
export type WorkflowStepContext = {
|
|
13689
13696
|
step: {
|