@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.
@@ -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, ChatCompletionsInput>;
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, ChatCompletionsInput>;
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: ChatCompletionsBase;
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: ChatCompletionsBase;
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 = XOR<
10871
- ChatCompletionsPromptInput,
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 (gateway fallback)
10945
- run(
10946
- model: string & {},
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: {
@@ -6177,9 +6177,6 @@ type ChatCompletionChoice = {
6177
6177
  | "function_call";
6178
6178
  logprobs: ChatCompletionLogprobs | null;
6179
6179
  };
6180
- type ChatCompletionsPromptInput = {
6181
- prompt: string;
6182
- } & ChatCompletionsCommonOptions;
6183
6180
  type ChatCompletionsMessagesInput = {
6184
6181
  messages: Array<ChatCompletionMessageParam>;
6185
6182
  } & ChatCompletionsCommonOptions;
@@ -10304,11 +10301,11 @@ declare abstract class Base_Ai_Cf_Pipecat_Ai_Smart_Turn_V2 {
10304
10301
  postProcessedOutputs: Ai_Cf_Pipecat_Ai_Smart_Turn_V2_Output;
10305
10302
  }
10306
10303
  declare abstract class Base_Ai_Cf_Openai_Gpt_Oss_120B {
10307
- inputs: XOR<ResponsesInput, ChatCompletionsInput>;
10304
+ inputs: XOR<ResponsesInput, ChatCompletionsMessagesInput>;
10308
10305
  postProcessedOutputs: XOR<ResponsesOutput, ChatCompletionsOutput>;
10309
10306
  }
10310
10307
  declare abstract class Base_Ai_Cf_Openai_Gpt_Oss_20B {
10311
- inputs: XOR<ResponsesInput, ChatCompletionsInput>;
10308
+ inputs: XOR<ResponsesInput, ChatCompletionsMessagesInput>;
10312
10309
  postProcessedOutputs: XOR<ResponsesOutput, ChatCompletionsOutput>;
10313
10310
  }
10314
10311
  interface Ai_Cf_Leonardo_Phoenix_1_0_Input {
@@ -11403,7 +11400,7 @@ declare abstract class Base_Ai_Cf_Moonshotai_Kimi_K2_5 {
11403
11400
  postProcessedOutputs: ChatCompletionsOutput;
11404
11401
  }
11405
11402
  declare abstract class Base_Ai_Cf_Moonshotai_Kimi_K2_6 {
11406
- inputs: ChatCompletionsBase;
11403
+ inputs: ChatCompletionsInput;
11407
11404
  postProcessedOutputs: ChatCompletionsOutput;
11408
11405
  }
11409
11406
  declare abstract class Base_Ai_Cf_Nvidia_Nemotron_3_120B_A12B {
@@ -11411,7 +11408,7 @@ declare abstract class Base_Ai_Cf_Nvidia_Nemotron_3_120B_A12B {
11411
11408
  postProcessedOutputs: ChatCompletionsOutput;
11412
11409
  }
11413
11410
  declare abstract class Base_Ai_Cf_Google_Gemma_4_26B_A4B_IT {
11414
- inputs: ChatCompletionsBase;
11411
+ inputs: ChatCompletionsInput;
11415
11412
  postProcessedOutputs: ChatCompletionsOutput;
11416
11413
  }
11417
11414
  interface AiModels {
@@ -11558,16 +11555,8 @@ type AiModelsSearchObject = {
11558
11555
  value: string;
11559
11556
  }[];
11560
11557
  };
11561
- type ChatCompletionsBase = XOR<
11562
- ChatCompletionsPromptInput,
11563
- ChatCompletionsMessagesInput
11564
- >;
11565
- type ChatCompletionsInput = XOR<
11566
- ChatCompletionsBase,
11567
- {
11568
- requests: ChatCompletionsBase[];
11569
- }
11570
- >;
11558
+ type ChatCompletionsBase = ChatCompletionsMessagesInput;
11559
+ type ChatCompletionsInput = ChatCompletionsMessagesInput;
11571
11560
  interface InferenceUpstreamError extends Error {}
11572
11561
  interface AiInternalError extends Error {}
11573
11562
  type AiModelListType = Record<string, any>;
@@ -11630,9 +11619,16 @@ declare abstract class Ai<AiModelList extends AiModelListType = AiModels> {
11630
11619
  inputs: AiModelList[Name]["inputs"],
11631
11620
  options?: AiOptions,
11632
11621
  ): Promise<AiModelList[Name]["postProcessedOutputs"]>;
11633
- // Unknown model (gateway fallback)
11634
- run(
11635
- model: string & {},
11622
+ // Unknown model (fallback).
11623
+ //
11624
+ // The `Exclude<..., keyof AiModelList>` constraint forces TypeScript to
11625
+ // route any model name that is a literal key of `AiModelList` to one of
11626
+ // the known-model overloads above (so input/output mismatches surface as
11627
+ // type errors rather than silently falling back to `Record<string, unknown>`).
11628
+ // Names that aren't in `AiModelList` — e.g. third-party gateway models
11629
+ // like `"google/nano-banana"` — still hit this overload.
11630
+ run<Model extends string>(
11631
+ model: Model extends keyof AiModelList ? never : Model,
11636
11632
  inputs: Record<string, unknown>,
11637
11633
  options?: AiOptions,
11638
11634
  ): Promise<Record<string, unknown>>;
@@ -14400,6 +14396,7 @@ declare namespace CloudflareWorkersModule {
14400
14396
  export type WorkflowTimeoutDuration = WorkflowSleepDuration;
14401
14397
  export type WorkflowRetentionDuration = WorkflowSleepDuration;
14402
14398
  export type WorkflowBackoff = "constant" | "linear" | "exponential";
14399
+ export type WorkflowStepSensitivity = "output";
14403
14400
  export type WorkflowStepConfig = {
14404
14401
  retries?: {
14405
14402
  limit: number;
@@ -14407,16 +14404,26 @@ declare namespace CloudflareWorkersModule {
14407
14404
  backoff?: WorkflowBackoff;
14408
14405
  };
14409
14406
  timeout?: WorkflowTimeoutDuration | number;
14407
+ sensitive?: WorkflowStepSensitivity;
14408
+ };
14409
+ export type WorkflowCronSchedule = {
14410
+ /** Cron expression that triggered this event. */
14411
+ cron: string;
14412
+ /** Timestamp of the scheduled trigger, in milliseconds since the Unix epoch. */
14413
+ scheduledTime: number;
14410
14414
  };
14411
14415
  export type WorkflowEvent<T> = {
14412
14416
  payload: Readonly<T>;
14413
14417
  timestamp: Date;
14414
14418
  instanceId: string;
14419
+ workflowName: string;
14420
+ schedule?: WorkflowCronSchedule;
14415
14421
  };
14416
14422
  export type WorkflowStepEvent<T> = {
14417
14423
  payload: Readonly<T>;
14418
14424
  timestamp: Date;
14419
14425
  type: string;
14426
+ sensitive?: WorkflowStepSensitivity;
14420
14427
  };
14421
14428
  export type WorkflowStepContext = {
14422
14429
  step: {
@@ -6186,9 +6186,6 @@ export type ChatCompletionChoice = {
6186
6186
  | "function_call";
6187
6187
  logprobs: ChatCompletionLogprobs | null;
6188
6188
  };
6189
- export type ChatCompletionsPromptInput = {
6190
- prompt: string;
6191
- } & ChatCompletionsCommonOptions;
6192
6189
  export type ChatCompletionsMessagesInput = {
6193
6190
  messages: Array<ChatCompletionMessageParam>;
6194
6191
  } & ChatCompletionsCommonOptions;
@@ -10314,11 +10311,11 @@ export declare abstract class Base_Ai_Cf_Pipecat_Ai_Smart_Turn_V2 {
10314
10311
  postProcessedOutputs: Ai_Cf_Pipecat_Ai_Smart_Turn_V2_Output;
10315
10312
  }
10316
10313
  export declare abstract class Base_Ai_Cf_Openai_Gpt_Oss_120B {
10317
- inputs: XOR<ResponsesInput, ChatCompletionsInput>;
10314
+ inputs: XOR<ResponsesInput, ChatCompletionsMessagesInput>;
10318
10315
  postProcessedOutputs: XOR<ResponsesOutput, ChatCompletionsOutput>;
10319
10316
  }
10320
10317
  export declare abstract class Base_Ai_Cf_Openai_Gpt_Oss_20B {
10321
- inputs: XOR<ResponsesInput, ChatCompletionsInput>;
10318
+ inputs: XOR<ResponsesInput, ChatCompletionsMessagesInput>;
10322
10319
  postProcessedOutputs: XOR<ResponsesOutput, ChatCompletionsOutput>;
10323
10320
  }
10324
10321
  export interface Ai_Cf_Leonardo_Phoenix_1_0_Input {
@@ -11413,7 +11410,7 @@ export declare abstract class Base_Ai_Cf_Moonshotai_Kimi_K2_5 {
11413
11410
  postProcessedOutputs: ChatCompletionsOutput;
11414
11411
  }
11415
11412
  export declare abstract class Base_Ai_Cf_Moonshotai_Kimi_K2_6 {
11416
- inputs: ChatCompletionsBase;
11413
+ inputs: ChatCompletionsInput;
11417
11414
  postProcessedOutputs: ChatCompletionsOutput;
11418
11415
  }
11419
11416
  export declare abstract class Base_Ai_Cf_Nvidia_Nemotron_3_120B_A12B {
@@ -11421,7 +11418,7 @@ export declare abstract class Base_Ai_Cf_Nvidia_Nemotron_3_120B_A12B {
11421
11418
  postProcessedOutputs: ChatCompletionsOutput;
11422
11419
  }
11423
11420
  export declare abstract class Base_Ai_Cf_Google_Gemma_4_26B_A4B_IT {
11424
- inputs: ChatCompletionsBase;
11421
+ inputs: ChatCompletionsInput;
11425
11422
  postProcessedOutputs: ChatCompletionsOutput;
11426
11423
  }
11427
11424
  export interface AiModels {
@@ -11568,16 +11565,8 @@ export type AiModelsSearchObject = {
11568
11565
  value: string;
11569
11566
  }[];
11570
11567
  };
11571
- export type ChatCompletionsBase = XOR<
11572
- ChatCompletionsPromptInput,
11573
- ChatCompletionsMessagesInput
11574
- >;
11575
- export type ChatCompletionsInput = XOR<
11576
- ChatCompletionsBase,
11577
- {
11578
- requests: ChatCompletionsBase[];
11579
- }
11580
- >;
11568
+ export type ChatCompletionsBase = ChatCompletionsMessagesInput;
11569
+ export type ChatCompletionsInput = ChatCompletionsMessagesInput;
11581
11570
  export interface InferenceUpstreamError extends Error {}
11582
11571
  export interface AiInternalError extends Error {}
11583
11572
  export type AiModelListType = Record<string, any>;
@@ -11642,9 +11631,16 @@ export declare abstract class Ai<
11642
11631
  inputs: AiModelList[Name]["inputs"],
11643
11632
  options?: AiOptions,
11644
11633
  ): Promise<AiModelList[Name]["postProcessedOutputs"]>;
11645
- // Unknown model (gateway fallback)
11646
- run(
11647
- model: string & {},
11634
+ // Unknown model (fallback).
11635
+ //
11636
+ // The `Exclude<..., keyof AiModelList>` constraint forces TypeScript to
11637
+ // route any model name that is a literal key of `AiModelList` to one of
11638
+ // the known-model overloads above (so input/output mismatches surface as
11639
+ // type errors rather than silently falling back to `Record<string, unknown>`).
11640
+ // Names that aren't in `AiModelList` — e.g. third-party gateway models
11641
+ // like `"google/nano-banana"` — still hit this overload.
11642
+ run<Model extends string>(
11643
+ model: Model extends keyof AiModelList ? never : Model,
11648
11644
  inputs: Record<string, unknown>,
11649
11645
  options?: AiOptions,
11650
11646
  ): Promise<Record<string, unknown>>;
@@ -14371,6 +14367,7 @@ export declare namespace CloudflareWorkersModule {
14371
14367
  export type WorkflowTimeoutDuration = WorkflowSleepDuration;
14372
14368
  export type WorkflowRetentionDuration = WorkflowSleepDuration;
14373
14369
  export type WorkflowBackoff = "constant" | "linear" | "exponential";
14370
+ export type WorkflowStepSensitivity = "output";
14374
14371
  export type WorkflowStepConfig = {
14375
14372
  retries?: {
14376
14373
  limit: number;
@@ -14378,16 +14375,26 @@ export declare namespace CloudflareWorkersModule {
14378
14375
  backoff?: WorkflowBackoff;
14379
14376
  };
14380
14377
  timeout?: WorkflowTimeoutDuration | number;
14378
+ sensitive?: WorkflowStepSensitivity;
14379
+ };
14380
+ export type WorkflowCronSchedule = {
14381
+ /** Cron expression that triggered this event. */
14382
+ cron: string;
14383
+ /** Timestamp of the scheduled trigger, in milliseconds since the Unix epoch. */
14384
+ scheduledTime: number;
14381
14385
  };
14382
14386
  export type WorkflowEvent<T> = {
14383
14387
  payload: Readonly<T>;
14384
14388
  timestamp: Date;
14385
14389
  instanceId: string;
14390
+ workflowName: string;
14391
+ schedule?: WorkflowCronSchedule;
14386
14392
  };
14387
14393
  export type WorkflowStepEvent<T> = {
14388
14394
  payload: Readonly<T>;
14389
14395
  timestamp: Date;
14390
14396
  type: string;
14397
+ sensitive?: WorkflowStepSensitivity;
14391
14398
  };
14392
14399
  export type WorkflowStepContext = {
14393
14400
  step: {
package/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, ChatCompletionsInput>;
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, ChatCompletionsInput>;
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: ChatCompletionsBase;
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: ChatCompletionsBase;
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 = XOR<
10753
- ChatCompletionsPromptInput,
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 (gateway fallback)
10825
- run(
10826
- model: string & {},
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/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, ChatCompletionsInput>;
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, ChatCompletionsInput>;
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: ChatCompletionsBase;
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: ChatCompletionsBase;
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 = XOR<
10763
- ChatCompletionsPromptInput,
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 (gateway fallback)
10837
- run(
10838
- model: string & {},
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: {