@cloudflare/workers-types 4.20260317.1 → 4.20260331.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/oldest/index.d.ts CHANGED
@@ -478,6 +478,11 @@ type ExportedHandlerFetchHandler<
478
478
  env: Env,
479
479
  ctx: ExecutionContext<Props>,
480
480
  ) => Response | Promise<Response>;
481
+ type ExportedHandlerConnectHandler<Env = unknown, Props = unknown> = (
482
+ socket: Socket,
483
+ env: Env,
484
+ ctx: ExecutionContext<Props>,
485
+ ) => void | Promise<void>;
481
486
  type ExportedHandlerTailHandler<Env = unknown, Props = unknown> = (
482
487
  events: TraceItem[],
483
488
  env: Env,
@@ -519,6 +524,7 @@ interface ExportedHandler<
519
524
  Props = unknown,
520
525
  > {
521
526
  fetch?: ExportedHandlerFetchHandler<Env, CfHostMetadata, Props>;
527
+ connect?: ExportedHandlerConnectHandler<Env, Props>;
522
528
  tail?: ExportedHandlerTailHandler<Env, Props>;
523
529
  trace?: ExportedHandlerTraceHandler<Env, Props>;
524
530
  tailStream?: ExportedHandlerTailStreamHandler<Env, Props>;
@@ -533,12 +539,14 @@ interface StructuredSerializeOptions {
533
539
  interface AlarmInvocationInfo {
534
540
  readonly isRetry: boolean;
535
541
  readonly retryCount: number;
542
+ readonly scheduledTime: number;
536
543
  }
537
544
  interface Cloudflare {
538
545
  readonly compatibilityFlags: Record<string, boolean>;
539
546
  }
540
547
  interface DurableObject {
541
548
  fetch(request: Request): Response | Promise<Response>;
549
+ connect?(socket: Socket): void | Promise<void>;
542
550
  alarm?(alarmInfo?: AlarmInvocationInfo): void | Promise<void>;
543
551
  webSocketMessage?(
544
552
  ws: WebSocket,
@@ -556,7 +564,7 @@ type DurableObjectStub<
556
564
  T extends Rpc.DurableObjectBranded | undefined = undefined,
557
565
  > = Fetcher<
558
566
  T,
559
- "alarm" | "webSocketMessage" | "webSocketClose" | "webSocketError"
567
+ "alarm" | "connect" | "webSocketMessage" | "webSocketClose" | "webSocketError"
560
568
  > & {
561
569
  readonly id: DurableObjectId;
562
570
  readonly name?: string;
@@ -565,6 +573,7 @@ interface DurableObjectId {
565
573
  toString(): string;
566
574
  equals(other: DurableObjectId): boolean;
567
575
  readonly name?: string;
576
+ readonly jurisdiction?: string;
568
577
  }
569
578
  declare abstract class DurableObjectNamespace<
570
579
  T extends Rpc.DurableObjectBranded | undefined = undefined,
@@ -3067,6 +3076,11 @@ interface QueuingStrategyInit {
3067
3076
  */
3068
3077
  highWaterMark: number;
3069
3078
  }
3079
+ interface TracePreviewInfo {
3080
+ id: string;
3081
+ slug: string;
3082
+ name: string;
3083
+ }
3070
3084
  interface ScriptVersion {
3071
3085
  id?: string;
3072
3086
  tag?: string;
@@ -3081,6 +3095,7 @@ interface TraceItem {
3081
3095
  | (
3082
3096
  | TraceItemFetchEventInfo
3083
3097
  | TraceItemJsRpcEventInfo
3098
+ | TraceItemConnectEventInfo
3084
3099
  | TraceItemScheduledEventInfo
3085
3100
  | TraceItemAlarmEventInfo
3086
3101
  | TraceItemQueueEventInfo
@@ -3099,6 +3114,8 @@ interface TraceItem {
3099
3114
  readonly scriptVersion?: ScriptVersion;
3100
3115
  readonly dispatchNamespace?: string;
3101
3116
  readonly scriptTags?: string[];
3117
+ readonly tailAttributes?: Record<string, boolean | number | string>;
3118
+ readonly preview?: TracePreviewInfo;
3102
3119
  readonly durableObjectId?: string;
3103
3120
  readonly outcome: string;
3104
3121
  readonly executionModel: string;
@@ -3109,6 +3126,7 @@ interface TraceItem {
3109
3126
  interface TraceItemAlarmEventInfo {
3110
3127
  readonly scheduledTime: Date;
3111
3128
  }
3129
+ interface TraceItemConnectEventInfo {}
3112
3130
  interface TraceItemCustomEventInfo {}
3113
3131
  interface TraceItemScheduledEventInfo {
3114
3132
  readonly scheduledTime: number;
@@ -3649,7 +3667,7 @@ interface ContainerStartupOptions {
3649
3667
  entrypoint?: string[];
3650
3668
  enableInternet: boolean;
3651
3669
  env?: Record<string, string>;
3652
- hardTimeout?: number | bigint;
3670
+ labels?: Record<string, string>;
3653
3671
  }
3654
3672
  /**
3655
3673
  * The **`MessagePort`** interface of the Channel Messaging API represents one of the two ports of a MessageChannel, allowing messages to be sent from one port and listening out for them arriving at the other.
@@ -3776,11 +3794,10 @@ declare abstract class Performance {
3776
3794
  */
3777
3795
  toJSON(): object;
3778
3796
  }
3779
- // AI Search V2 API Error Interfaces
3797
+ // ============ AI Search Error Interfaces ============
3780
3798
  interface AiSearchInternalError extends Error {}
3781
3799
  interface AiSearchNotFoundError extends Error {}
3782
- interface AiSearchNameNotSetError extends Error {}
3783
- // AI Search V2 Request Types
3800
+ // ============ AI Search Request Types ============
3784
3801
  type AiSearchSearchRequest = {
3785
3802
  messages: Array<{
3786
3803
  role: "system" | "developer" | "user" | "assistant" | "tool";
@@ -3805,9 +3822,8 @@ type AiSearchSearchRequest = {
3805
3822
  [key: string]: unknown;
3806
3823
  };
3807
3824
  reranking?: {
3808
- /** Enable reranking (default false) */
3809
3825
  enabled?: boolean;
3810
- model?: "@cf/baai/bge-reranker-base" | "";
3826
+ model?: "@cf/baai/bge-reranker-base" | string;
3811
3827
  /** Match threshold (0-1, default 0.4) */
3812
3828
  match_threshold?: number;
3813
3829
  [key: string]: unknown;
@@ -3819,6 +3835,7 @@ type AiSearchChatCompletionsRequest = {
3819
3835
  messages: Array<{
3820
3836
  role: "system" | "developer" | "user" | "assistant" | "tool";
3821
3837
  content: string | null;
3838
+ [key: string]: unknown;
3822
3839
  }>;
3823
3840
  model?: string;
3824
3841
  stream?: boolean;
@@ -3839,7 +3856,7 @@ type AiSearchChatCompletionsRequest = {
3839
3856
  };
3840
3857
  reranking?: {
3841
3858
  enabled?: boolean;
3842
- model?: "@cf/baai/bge-reranker-base" | "";
3859
+ model?: "@cf/baai/bge-reranker-base" | string;
3843
3860
  match_threshold?: number;
3844
3861
  [key: string]: unknown;
3845
3862
  };
@@ -3847,7 +3864,7 @@ type AiSearchChatCompletionsRequest = {
3847
3864
  };
3848
3865
  [key: string]: unknown;
3849
3866
  };
3850
- // AI Search V2 Response Types
3867
+ // ============ AI Search Response Types ============
3851
3868
  type AiSearchSearchResponse = {
3852
3869
  search_query: string;
3853
3870
  chunks: Array<{
@@ -3866,26 +3883,65 @@ type AiSearchSearchResponse = {
3866
3883
  keyword_score?: number;
3867
3884
  /** Vector similarity score (0-1) */
3868
3885
  vector_score?: number;
3886
+ [key: string]: unknown;
3887
+ };
3888
+ }>;
3889
+ };
3890
+ type AiSearchChatCompletionsResponse = {
3891
+ id?: string;
3892
+ object?: string;
3893
+ model?: string;
3894
+ choices: Array<{
3895
+ index?: number;
3896
+ message: {
3897
+ role: "system" | "developer" | "user" | "assistant" | "tool";
3898
+ content: string | null;
3899
+ [key: string]: unknown;
3869
3900
  };
3901
+ [key: string]: unknown;
3870
3902
  }>;
3903
+ chunks: AiSearchSearchResponse["chunks"];
3904
+ [key: string]: unknown;
3871
3905
  };
3872
- type AiSearchListResponse = Array<{
3906
+ type AiSearchStatsResponse = {
3907
+ queued?: number;
3908
+ running?: number;
3909
+ completed?: number;
3910
+ error?: number;
3911
+ skipped?: number;
3912
+ outdated?: number;
3913
+ last_activity?: string;
3914
+ };
3915
+ // ============ AI Search Instance Info Types ============
3916
+ type AiSearchInstanceInfo = {
3873
3917
  id: string;
3874
- internal_id?: string;
3875
- account_id?: string;
3876
- account_tag?: string;
3877
- /** Whether the instance is enabled (default true) */
3878
- enable?: boolean;
3879
- type?: "r2" | "web-crawler";
3918
+ type?: "r2" | "web-crawler" | string;
3880
3919
  source?: string;
3920
+ paused?: boolean;
3921
+ status?: string;
3922
+ namespace?: string;
3923
+ created_at?: string;
3924
+ modified_at?: string;
3881
3925
  [key: string]: unknown;
3882
- }>;
3926
+ };
3927
+ type AiSearchListResponse = {
3928
+ result: AiSearchInstanceInfo[];
3929
+ result_info?: {
3930
+ count: number;
3931
+ page: number;
3932
+ per_page: number;
3933
+ total_count: number;
3934
+ };
3935
+ };
3936
+ // ============ AI Search Config Types ============
3883
3937
  type AiSearchConfig = {
3884
3938
  /** Instance ID (1-32 chars, pattern: ^[a-z0-9_]+(?:-[a-z0-9_]+)*$) */
3885
3939
  id: string;
3886
- type: "r2" | "web-crawler";
3887
- source: string;
3888
- source_params?: object;
3940
+ /** Instance type. Omit to create with built-in storage. */
3941
+ type?: "r2" | "web-crawler" | string;
3942
+ /** Source URL (required for web-crawler type). */
3943
+ source?: string;
3944
+ source_params?: unknown;
3889
3945
  /** Token ID (UUID format) */
3890
3946
  token_id?: string;
3891
3947
  ai_gateway_id?: string;
@@ -3895,54 +3951,307 @@ type AiSearchConfig = {
3895
3951
  reranking?: boolean;
3896
3952
  embedding_model?: string;
3897
3953
  ai_search_model?: string;
3954
+ [key: string]: unknown;
3898
3955
  };
3899
- type AiSearchInstance = {
3956
+ // ============ AI Search Item Types ============
3957
+ type AiSearchItemInfo = {
3900
3958
  id: string;
3901
- enable?: boolean;
3902
- type?: "r2" | "web-crawler";
3903
- source?: string;
3959
+ key: string;
3960
+ status:
3961
+ | "completed"
3962
+ | "error"
3963
+ | "skipped"
3964
+ | "queued"
3965
+ | "processing"
3966
+ | "outdated";
3967
+ metadata?: Record<string, unknown>;
3904
3968
  [key: string]: unknown;
3905
3969
  };
3906
- // AI Search Instance Service - Instance-level operations
3907
- declare abstract class AiSearchInstanceService {
3970
+ type AiSearchItemContentResult = {
3971
+ body: ReadableStream;
3972
+ contentType: string;
3973
+ filename: string;
3974
+ size: number;
3975
+ };
3976
+ type AiSearchUploadItemOptions = {
3977
+ metadata?: Record<string, unknown>;
3978
+ };
3979
+ type AiSearchListItemsParams = {
3980
+ page?: number;
3981
+ per_page?: number;
3982
+ };
3983
+ type AiSearchListItemsResponse = {
3984
+ result: AiSearchItemInfo[];
3985
+ result_info?: {
3986
+ count: number;
3987
+ page: number;
3988
+ per_page: number;
3989
+ total_count: number;
3990
+ };
3991
+ };
3992
+ // ============ AI Search Job Types ============
3993
+ type AiSearchJobInfo = {
3994
+ id: string;
3995
+ source: "user" | "schedule";
3996
+ description?: string;
3997
+ last_seen_at?: string;
3998
+ started_at?: string;
3999
+ ended_at?: string;
4000
+ end_reason?: string;
4001
+ };
4002
+ type AiSearchJobLog = {
4003
+ id: number;
4004
+ message: string;
4005
+ message_type: number;
4006
+ created_at: number;
4007
+ };
4008
+ type AiSearchCreateJobParams = {
4009
+ description?: string;
4010
+ };
4011
+ type AiSearchListJobsParams = {
4012
+ page?: number;
4013
+ per_page?: number;
4014
+ };
4015
+ type AiSearchListJobsResponse = {
4016
+ result: AiSearchJobInfo[];
4017
+ result_info?: {
4018
+ count: number;
4019
+ page: number;
4020
+ per_page: number;
4021
+ total_count: number;
4022
+ };
4023
+ };
4024
+ type AiSearchJobLogsParams = {
4025
+ page?: number;
4026
+ per_page?: number;
4027
+ };
4028
+ type AiSearchJobLogsResponse = {
4029
+ result: AiSearchJobLog[];
4030
+ result_info?: {
4031
+ count: number;
4032
+ page: number;
4033
+ per_page: number;
4034
+ total_count: number;
4035
+ };
4036
+ };
4037
+ // ============ AI Search Sub-Service Classes ============
4038
+ /**
4039
+ * Single item service for an AI Search instance.
4040
+ * Provides info, delete, and download operations on a specific item.
4041
+ */
4042
+ declare abstract class AiSearchItem {
4043
+ /** Get metadata about this item. */
4044
+ info(): Promise<AiSearchItemInfo>;
4045
+ /**
4046
+ * Download the item's content.
4047
+ * @returns Object with body stream, content type, filename, and size.
4048
+ */
4049
+ download(): Promise<AiSearchItemContentResult>;
4050
+ }
4051
+ /**
4052
+ * Items collection service for an AI Search instance.
4053
+ * Provides list, upload, and access to individual items.
4054
+ */
4055
+ declare abstract class AiSearchItems {
4056
+ /** List items in this instance. */
4057
+ list(params?: AiSearchListItemsParams): Promise<AiSearchListItemsResponse>;
4058
+ /**
4059
+ * Upload a file as an item.
4060
+ * @param name Filename for the uploaded item.
4061
+ * @param content File content as a ReadableStream, ArrayBuffer, or string.
4062
+ * @param options Optional metadata to attach to the item.
4063
+ * @returns The created item info.
4064
+ */
4065
+ upload(
4066
+ name: string,
4067
+ content: ReadableStream | ArrayBuffer | string,
4068
+ options?: AiSearchUploadItemOptions,
4069
+ ): Promise<AiSearchItemInfo>;
4070
+ /**
4071
+ * Upload a file and poll until processing completes.
4072
+ * @param name Filename for the uploaded item.
4073
+ * @param content File content as a ReadableStream, ArrayBuffer, or string.
4074
+ * @param options Optional metadata to attach to the item.
4075
+ * @returns The item info after processing completes (or timeout).
4076
+ */
4077
+ uploadAndPoll(
4078
+ name: string,
4079
+ content: ReadableStream | ArrayBuffer | string,
4080
+ options?: AiSearchUploadItemOptions,
4081
+ ): Promise<AiSearchItemInfo>;
4082
+ /**
4083
+ * Get an item by ID.
4084
+ * @param itemId The item identifier.
4085
+ * @returns Item service for info, delete, and download operations.
4086
+ */
4087
+ get(itemId: string): AiSearchItem;
4088
+ /** Delete this item from the instance.
4089
+ * @param itemId The item identifier.
4090
+ */
4091
+ delete(itemId: string): Promise<void>;
4092
+ }
4093
+ /**
4094
+ * Single job service for an AI Search instance.
4095
+ * Provides info and logs for a specific job.
4096
+ */
4097
+ declare abstract class AiSearchJob {
4098
+ /** Get metadata about this job. */
4099
+ info(): Promise<AiSearchJobInfo>;
4100
+ /** Get logs for this job. */
4101
+ logs(params?: AiSearchJobLogsParams): Promise<AiSearchJobLogsResponse>;
4102
+ }
4103
+ /**
4104
+ * Jobs collection service for an AI Search instance.
4105
+ * Provides list, create, and access to individual jobs.
4106
+ */
4107
+ declare abstract class AiSearchJobs {
4108
+ /** List jobs for this instance. */
4109
+ list(params?: AiSearchListJobsParams): Promise<AiSearchListJobsResponse>;
4110
+ /**
4111
+ * Create a new indexing job.
4112
+ * @param params Optional job parameters.
4113
+ * @returns The created job info.
4114
+ */
4115
+ create(params?: AiSearchCreateJobParams): Promise<AiSearchJobInfo>;
4116
+ /**
4117
+ * Get a job by ID.
4118
+ * @param jobId The job identifier.
4119
+ * @returns Job service for info and logs operations.
4120
+ */
4121
+ get(jobId: string): AiSearchJob;
4122
+ }
4123
+ // ============ AI Search Binding Classes ============
4124
+ /**
4125
+ * Instance-level AI Search service.
4126
+ *
4127
+ * Used as:
4128
+ * - The return type of `AiSearchNamespace.get(name)` (namespace binding)
4129
+ * - The type of `env.BLOG_SEARCH` (single instance binding via `ai_search`)
4130
+ *
4131
+ * Provides search, chat, update, stats, items, and jobs operations.
4132
+ *
4133
+ * @example
4134
+ * ```ts
4135
+ * // Via namespace binding
4136
+ * const instance = env.AI_SEARCH.get("blog");
4137
+ * const results = await instance.search({
4138
+ * messages: [{ role: "user", content: "How does caching work?" }],
4139
+ * });
4140
+ *
4141
+ * // Via single instance binding
4142
+ * const results = await env.BLOG_SEARCH.search({
4143
+ * messages: [{ role: "user", content: "How does caching work?" }],
4144
+ * });
4145
+ * ```
4146
+ */
4147
+ declare abstract class AiSearchInstance {
3908
4148
  /**
3909
4149
  * Search the AI Search instance for relevant chunks.
3910
- * @param params Search request with messages and AI search options
3911
- * @returns Search response with matching chunks
4150
+ * @param params Search request with messages and optional AI search options.
4151
+ * @returns Search response with matching chunks and search query.
3912
4152
  */
3913
4153
  search(params: AiSearchSearchRequest): Promise<AiSearchSearchResponse>;
4154
+ /**
4155
+ * Generate chat completions with AI Search context (streaming).
4156
+ * @param params Chat completions request with stream: true.
4157
+ * @returns ReadableStream of server-sent events.
4158
+ */
4159
+ chatCompletions(
4160
+ params: AiSearchChatCompletionsRequest & {
4161
+ stream: true;
4162
+ },
4163
+ ): Promise<ReadableStream>;
3914
4164
  /**
3915
4165
  * Generate chat completions with AI Search context.
3916
- * @param params Chat completions request with optional streaming
3917
- * @returns Response object (if streaming) or chat completion result
4166
+ * @param params Chat completions request.
4167
+ * @returns Chat completion response with choices and RAG chunks.
3918
4168
  */
3919
4169
  chatCompletions(
3920
4170
  params: AiSearchChatCompletionsRequest,
3921
- ): Promise<Response | object>;
4171
+ ): Promise<AiSearchChatCompletionsResponse>;
3922
4172
  /**
3923
- * Delete this AI Search instance.
4173
+ * Update the instance configuration.
4174
+ * @param config Partial configuration to update.
4175
+ * @returns Updated instance info.
3924
4176
  */
3925
- delete(): Promise<void>;
4177
+ update(config: Partial<AiSearchConfig>): Promise<AiSearchInstanceInfo>;
4178
+ /** Get metadata about this instance. */
4179
+ info(): Promise<AiSearchInstanceInfo>;
4180
+ /**
4181
+ * Get instance statistics (item count, indexing status, etc.).
4182
+ * @returns Statistics with counts per status and last activity time.
4183
+ */
4184
+ stats(): Promise<AiSearchStatsResponse>;
4185
+ /** Items collection — list, upload, and manage items in this instance. */
4186
+ get items(): AiSearchItems;
4187
+ /** Jobs collection — list, create, and inspect indexing jobs. */
4188
+ get jobs(): AiSearchJobs;
3926
4189
  }
3927
- // AI Search Account Service - Account-level operations
3928
- declare abstract class AiSearchAccountService {
4190
+ /**
4191
+ * Namespace-level AI Search service.
4192
+ *
4193
+ * Used as the type of `env.AI_SEARCH` (namespace binding via `ai_search_namespaces`).
4194
+ * Scoped to a single namespace. Provides dynamic instance access, creation, and deletion.
4195
+ *
4196
+ * @example
4197
+ * ```ts
4198
+ * // Access an instance within the namespace
4199
+ * const blog = env.AI_SEARCH.get("blog");
4200
+ * const results = await blog.search({
4201
+ * messages: [{ role: "user", content: "How does caching work?" }],
4202
+ * });
4203
+ *
4204
+ * // List all instances in the namespace
4205
+ * const instances = await env.AI_SEARCH.list();
4206
+ *
4207
+ * // Create a new instance with built-in storage
4208
+ * const tenant = await env.AI_SEARCH.create({
4209
+ * id: "tenant-123",
4210
+ * });
4211
+ *
4212
+ * // Upload items into the instance
4213
+ * await tenant.items.upload("doc.pdf", fileContent);
4214
+ *
4215
+ * // Delete an instance
4216
+ * await env.AI_SEARCH.delete("tenant-123");
4217
+ * ```
4218
+ */
4219
+ declare abstract class AiSearchNamespace {
3929
4220
  /**
3930
- * List all AI Search instances in the account.
3931
- * @returns Array of AI Search instances
4221
+ * Get an instance by name within the bound namespace.
4222
+ * @param name Instance name.
4223
+ * @returns Instance service for search, chat, update, stats, items, and jobs.
4224
+ */
4225
+ get(name: string): AiSearchInstance;
4226
+ /**
4227
+ * List all instances in the bound namespace.
4228
+ * @returns Array of instance metadata.
3932
4229
  */
3933
4230
  list(): Promise<AiSearchListResponse>;
3934
4231
  /**
3935
- * Get an AI Search instance by ID.
3936
- * @param name Instance ID
3937
- * @returns Instance service for performing operations
4232
+ * Create a new instance within the bound namespace.
4233
+ * @param config Instance configuration. Only `id` is required — omit `type` and `source` to create with built-in storage.
4234
+ * @returns Instance service for the newly created instance.
4235
+ *
4236
+ * @example
4237
+ * ```ts
4238
+ * // Create with built-in storage (upload items manually)
4239
+ * const instance = await env.AI_SEARCH.create({ id: "my-search" });
4240
+ *
4241
+ * // Create with web crawler source
4242
+ * const instance = await env.AI_SEARCH.create({
4243
+ * id: "docs-search",
4244
+ * type: "web-crawler",
4245
+ * source: "https://developers.cloudflare.com",
4246
+ * });
4247
+ * ```
3938
4248
  */
3939
- get(name: string): AiSearchInstanceService;
4249
+ create(config: AiSearchConfig): Promise<AiSearchInstance>;
3940
4250
  /**
3941
- * Create a new AI Search instance.
3942
- * @param config Instance configuration
3943
- * @returns Instance service for performing operations
4251
+ * Delete an instance from the bound namespace.
4252
+ * @param name Instance name to delete.
3944
4253
  */
3945
- create(config: AiSearchConfig): Promise<AiSearchInstanceService>;
4254
+ delete(name: string): Promise<void>;
3946
4255
  }
3947
4256
  type AiImageClassificationInput = {
3948
4257
  image: number[];
@@ -4218,6 +4527,400 @@ declare abstract class BaseAiTranslation {
4218
4527
  inputs: AiTranslationInput;
4219
4528
  postProcessedOutputs: AiTranslationOutput;
4220
4529
  }
4530
+ /**
4531
+ * Workers AI support for OpenAI's Chat Completions API
4532
+ */
4533
+ type ChatCompletionContentPartText = {
4534
+ type: "text";
4535
+ text: string;
4536
+ };
4537
+ type ChatCompletionContentPartImage = {
4538
+ type: "image_url";
4539
+ image_url: {
4540
+ url: string;
4541
+ detail?: "auto" | "low" | "high";
4542
+ };
4543
+ };
4544
+ type ChatCompletionContentPartInputAudio = {
4545
+ type: "input_audio";
4546
+ input_audio: {
4547
+ /** Base64 encoded audio data. */
4548
+ data: string;
4549
+ format: "wav" | "mp3";
4550
+ };
4551
+ };
4552
+ type ChatCompletionContentPartFile = {
4553
+ type: "file";
4554
+ file: {
4555
+ /** Base64 encoded file data. */
4556
+ file_data?: string;
4557
+ /** The ID of an uploaded file. */
4558
+ file_id?: string;
4559
+ filename?: string;
4560
+ };
4561
+ };
4562
+ type ChatCompletionContentPartRefusal = {
4563
+ type: "refusal";
4564
+ refusal: string;
4565
+ };
4566
+ type ChatCompletionContentPart =
4567
+ | ChatCompletionContentPartText
4568
+ | ChatCompletionContentPartImage
4569
+ | ChatCompletionContentPartInputAudio
4570
+ | ChatCompletionContentPartFile;
4571
+ type FunctionDefinition = {
4572
+ name: string;
4573
+ description?: string;
4574
+ parameters?: Record<string, unknown>;
4575
+ strict?: boolean | null;
4576
+ };
4577
+ type ChatCompletionFunctionTool = {
4578
+ type: "function";
4579
+ function: FunctionDefinition;
4580
+ };
4581
+ type ChatCompletionCustomToolGrammarFormat = {
4582
+ type: "grammar";
4583
+ grammar: {
4584
+ definition: string;
4585
+ syntax: "lark" | "regex";
4586
+ };
4587
+ };
4588
+ type ChatCompletionCustomToolTextFormat = {
4589
+ type: "text";
4590
+ };
4591
+ type ChatCompletionCustomToolFormat =
4592
+ | ChatCompletionCustomToolTextFormat
4593
+ | ChatCompletionCustomToolGrammarFormat;
4594
+ type ChatCompletionCustomTool = {
4595
+ type: "custom";
4596
+ custom: {
4597
+ name: string;
4598
+ description?: string;
4599
+ format?: ChatCompletionCustomToolFormat;
4600
+ };
4601
+ };
4602
+ type ChatCompletionTool = ChatCompletionFunctionTool | ChatCompletionCustomTool;
4603
+ type ChatCompletionMessageFunctionToolCall = {
4604
+ id: string;
4605
+ type: "function";
4606
+ function: {
4607
+ name: string;
4608
+ /** JSON-encoded arguments string. */
4609
+ arguments: string;
4610
+ };
4611
+ };
4612
+ type ChatCompletionMessageCustomToolCall = {
4613
+ id: string;
4614
+ type: "custom";
4615
+ custom: {
4616
+ name: string;
4617
+ input: string;
4618
+ };
4619
+ };
4620
+ type ChatCompletionMessageToolCall =
4621
+ | ChatCompletionMessageFunctionToolCall
4622
+ | ChatCompletionMessageCustomToolCall;
4623
+ type ChatCompletionToolChoiceFunction = {
4624
+ type: "function";
4625
+ function: {
4626
+ name: string;
4627
+ };
4628
+ };
4629
+ type ChatCompletionToolChoiceCustom = {
4630
+ type: "custom";
4631
+ custom: {
4632
+ name: string;
4633
+ };
4634
+ };
4635
+ type ChatCompletionToolChoiceAllowedTools = {
4636
+ type: "allowed_tools";
4637
+ allowed_tools: {
4638
+ mode: "auto" | "required";
4639
+ tools: Array<Record<string, unknown>>;
4640
+ };
4641
+ };
4642
+ type ChatCompletionToolChoiceOption =
4643
+ | "none"
4644
+ | "auto"
4645
+ | "required"
4646
+ | ChatCompletionToolChoiceFunction
4647
+ | ChatCompletionToolChoiceCustom
4648
+ | ChatCompletionToolChoiceAllowedTools;
4649
+ type DeveloperMessage = {
4650
+ role: "developer";
4651
+ content:
4652
+ | string
4653
+ | Array<{
4654
+ type: "text";
4655
+ text: string;
4656
+ }>;
4657
+ name?: string;
4658
+ };
4659
+ type SystemMessage = {
4660
+ role: "system";
4661
+ content:
4662
+ | string
4663
+ | Array<{
4664
+ type: "text";
4665
+ text: string;
4666
+ }>;
4667
+ name?: string;
4668
+ };
4669
+ /**
4670
+ * Permissive merged content part used inside UserMessage arrays.
4671
+ *
4672
+ * Cabidela has a limitation where anyOf/oneOf with enum-based discrimination
4673
+ * inside nested array items does not correctly match different branches for
4674
+ * different array elements, so the schema uses a single merged object.
4675
+ */
4676
+ type UserMessageContentPart = {
4677
+ type: "text" | "image_url" | "input_audio" | "file";
4678
+ text?: string;
4679
+ image_url?: {
4680
+ url?: string;
4681
+ detail?: "auto" | "low" | "high";
4682
+ };
4683
+ input_audio?: {
4684
+ data?: string;
4685
+ format?: "wav" | "mp3";
4686
+ };
4687
+ file?: {
4688
+ file_data?: string;
4689
+ file_id?: string;
4690
+ filename?: string;
4691
+ };
4692
+ };
4693
+ type UserMessage = {
4694
+ role: "user";
4695
+ content: string | Array<UserMessageContentPart>;
4696
+ name?: string;
4697
+ };
4698
+ type AssistantMessageContentPart = {
4699
+ type: "text" | "refusal";
4700
+ text?: string;
4701
+ refusal?: string;
4702
+ };
4703
+ type AssistantMessage = {
4704
+ role: "assistant";
4705
+ content?: string | null | Array<AssistantMessageContentPart>;
4706
+ refusal?: string | null;
4707
+ name?: string;
4708
+ audio?: {
4709
+ id: string;
4710
+ };
4711
+ tool_calls?: Array<ChatCompletionMessageToolCall>;
4712
+ function_call?: {
4713
+ name: string;
4714
+ arguments: string;
4715
+ };
4716
+ };
4717
+ type ToolMessage = {
4718
+ role: "tool";
4719
+ content:
4720
+ | string
4721
+ | Array<{
4722
+ type: "text";
4723
+ text: string;
4724
+ }>;
4725
+ tool_call_id: string;
4726
+ };
4727
+ type FunctionMessage = {
4728
+ role: "function";
4729
+ content: string;
4730
+ name: string;
4731
+ };
4732
+ type ChatCompletionMessageParam =
4733
+ | DeveloperMessage
4734
+ | SystemMessage
4735
+ | UserMessage
4736
+ | AssistantMessage
4737
+ | ToolMessage
4738
+ | FunctionMessage;
4739
+ type ChatCompletionsResponseFormatText = {
4740
+ type: "text";
4741
+ };
4742
+ type ChatCompletionsResponseFormatJSONObject = {
4743
+ type: "json_object";
4744
+ };
4745
+ type ResponseFormatJSONSchema = {
4746
+ type: "json_schema";
4747
+ json_schema: {
4748
+ name: string;
4749
+ description?: string;
4750
+ schema?: Record<string, unknown>;
4751
+ strict?: boolean | null;
4752
+ };
4753
+ };
4754
+ type ResponseFormat =
4755
+ | ChatCompletionsResponseFormatText
4756
+ | ChatCompletionsResponseFormatJSONObject
4757
+ | ResponseFormatJSONSchema;
4758
+ type ChatCompletionsStreamOptions = {
4759
+ include_usage?: boolean;
4760
+ include_obfuscation?: boolean;
4761
+ };
4762
+ type PredictionContent = {
4763
+ type: "content";
4764
+ content:
4765
+ | string
4766
+ | Array<{
4767
+ type: "text";
4768
+ text: string;
4769
+ }>;
4770
+ };
4771
+ type AudioParams = {
4772
+ voice:
4773
+ | string
4774
+ | {
4775
+ id: string;
4776
+ };
4777
+ format: "wav" | "aac" | "mp3" | "flac" | "opus" | "pcm16";
4778
+ };
4779
+ type WebSearchUserLocation = {
4780
+ type: "approximate";
4781
+ approximate: {
4782
+ city?: string;
4783
+ country?: string;
4784
+ region?: string;
4785
+ timezone?: string;
4786
+ };
4787
+ };
4788
+ type WebSearchOptions = {
4789
+ search_context_size?: "low" | "medium" | "high";
4790
+ user_location?: WebSearchUserLocation;
4791
+ };
4792
+ type ChatTemplateKwargs = {
4793
+ /** Whether to enable reasoning, enabled by default. */
4794
+ enable_thinking?: boolean;
4795
+ /** If false, preserves reasoning context between turns. */
4796
+ clear_thinking?: boolean;
4797
+ };
4798
+ /** Shared optional properties used by both Prompt and Messages input branches. */
4799
+ type ChatCompletionsCommonOptions = {
4800
+ model?: string;
4801
+ audio?: AudioParams;
4802
+ frequency_penalty?: number | null;
4803
+ logit_bias?: Record<string, unknown> | null;
4804
+ logprobs?: boolean | null;
4805
+ top_logprobs?: number | null;
4806
+ max_tokens?: number | null;
4807
+ max_completion_tokens?: number | null;
4808
+ metadata?: Record<string, unknown> | null;
4809
+ modalities?: Array<"text" | "audio"> | null;
4810
+ n?: number | null;
4811
+ parallel_tool_calls?: boolean;
4812
+ prediction?: PredictionContent;
4813
+ presence_penalty?: number | null;
4814
+ reasoning_effort?: "low" | "medium" | "high" | null;
4815
+ chat_template_kwargs?: ChatTemplateKwargs;
4816
+ response_format?: ResponseFormat;
4817
+ seed?: number | null;
4818
+ service_tier?: "auto" | "default" | "flex" | "scale" | "priority" | null;
4819
+ stop?: string | Array<string> | null;
4820
+ store?: boolean | null;
4821
+ stream?: boolean | null;
4822
+ stream_options?: ChatCompletionsStreamOptions;
4823
+ temperature?: number | null;
4824
+ tool_choice?: ChatCompletionToolChoiceOption;
4825
+ tools?: Array<ChatCompletionTool>;
4826
+ top_p?: number | null;
4827
+ user?: string;
4828
+ web_search_options?: WebSearchOptions;
4829
+ function_call?:
4830
+ | "none"
4831
+ | "auto"
4832
+ | {
4833
+ name: string;
4834
+ };
4835
+ functions?: Array<FunctionDefinition>;
4836
+ };
4837
+ type PromptTokensDetails = {
4838
+ cached_tokens?: number;
4839
+ audio_tokens?: number;
4840
+ };
4841
+ type CompletionTokensDetails = {
4842
+ reasoning_tokens?: number;
4843
+ audio_tokens?: number;
4844
+ accepted_prediction_tokens?: number;
4845
+ rejected_prediction_tokens?: number;
4846
+ };
4847
+ type CompletionUsage = {
4848
+ prompt_tokens: number;
4849
+ completion_tokens: number;
4850
+ total_tokens: number;
4851
+ prompt_tokens_details?: PromptTokensDetails;
4852
+ completion_tokens_details?: CompletionTokensDetails;
4853
+ };
4854
+ type ChatCompletionTopLogprob = {
4855
+ token: string;
4856
+ logprob: number;
4857
+ bytes: Array<number> | null;
4858
+ };
4859
+ type ChatCompletionTokenLogprob = {
4860
+ token: string;
4861
+ logprob: number;
4862
+ bytes: Array<number> | null;
4863
+ top_logprobs: Array<ChatCompletionTopLogprob>;
4864
+ };
4865
+ type ChatCompletionAudio = {
4866
+ id: string;
4867
+ /** Base64 encoded audio bytes. */
4868
+ data: string;
4869
+ expires_at: number;
4870
+ transcript: string;
4871
+ };
4872
+ type ChatCompletionUrlCitation = {
4873
+ type: "url_citation";
4874
+ url_citation: {
4875
+ url: string;
4876
+ title: string;
4877
+ start_index: number;
4878
+ end_index: number;
4879
+ };
4880
+ };
4881
+ type ChatCompletionResponseMessage = {
4882
+ role: "assistant";
4883
+ content: string | null;
4884
+ refusal: string | null;
4885
+ annotations?: Array<ChatCompletionUrlCitation>;
4886
+ audio?: ChatCompletionAudio;
4887
+ tool_calls?: Array<ChatCompletionMessageToolCall>;
4888
+ function_call?: {
4889
+ name: string;
4890
+ arguments: string;
4891
+ } | null;
4892
+ };
4893
+ type ChatCompletionLogprobs = {
4894
+ content: Array<ChatCompletionTokenLogprob> | null;
4895
+ refusal?: Array<ChatCompletionTokenLogprob> | null;
4896
+ };
4897
+ type ChatCompletionChoice = {
4898
+ index: number;
4899
+ message: ChatCompletionResponseMessage;
4900
+ finish_reason:
4901
+ | "stop"
4902
+ | "length"
4903
+ | "tool_calls"
4904
+ | "content_filter"
4905
+ | "function_call";
4906
+ logprobs: ChatCompletionLogprobs | null;
4907
+ };
4908
+ type ChatCompletionsPromptInput = {
4909
+ prompt: string;
4910
+ } & ChatCompletionsCommonOptions;
4911
+ type ChatCompletionsMessagesInput = {
4912
+ messages: Array<ChatCompletionMessageParam>;
4913
+ } & ChatCompletionsCommonOptions;
4914
+ type ChatCompletionsOutput = {
4915
+ id: string;
4916
+ object: string;
4917
+ created: number;
4918
+ model: string;
4919
+ choices: Array<ChatCompletionChoice>;
4920
+ usage?: CompletionUsage;
4921
+ system_fingerprint?: string | null;
4922
+ service_tier?: "auto" | "default" | "flex" | "scale" | "priority" | null;
4923
+ };
4221
4924
  /**
4222
4925
  * Workers AI support for OpenAI's Responses API
4223
4926
  * Reference: https://github.com/openai/openai-node/blob/master/src/resources/responses/responses.ts
@@ -4639,6 +5342,12 @@ type ReasoningEffort = "minimal" | "low" | "medium" | "high" | null;
4639
5342
  type StreamOptions = {
4640
5343
  include_obfuscation?: boolean;
4641
5344
  };
5345
+ /** Marks keys from T that aren't in U as optional never */
5346
+ type Without<T, U> = {
5347
+ [P in Exclude<keyof T, keyof U>]?: never;
5348
+ };
5349
+ /** Either T or U, but not both (mutually exclusive) */
5350
+ type XOR<T, U> = (T & Without<U, T>) | (U & Without<T, U>);
4642
5351
  type Ai_Cf_Baai_Bge_Base_En_V1_5_Input =
4643
5352
  | {
4644
5353
  text: string | string[];
@@ -4931,10 +5640,12 @@ declare abstract class Base_Ai_Cf_Openai_Whisper_Tiny_En {
4931
5640
  postProcessedOutputs: Ai_Cf_Openai_Whisper_Tiny_En_Output;
4932
5641
  }
4933
5642
  interface Ai_Cf_Openai_Whisper_Large_V3_Turbo_Input {
4934
- /**
4935
- * Base64 encoded value of the audio data.
4936
- */
4937
- audio: string;
5643
+ audio:
5644
+ | string
5645
+ | {
5646
+ body?: object;
5647
+ contentType?: string;
5648
+ };
4938
5649
  /**
4939
5650
  * Supported tasks are 'translate' or 'transcribe'.
4940
5651
  */
@@ -4952,9 +5663,33 @@ interface Ai_Cf_Openai_Whisper_Large_V3_Turbo_Input {
4952
5663
  */
4953
5664
  initial_prompt?: string;
4954
5665
  /**
4955
- * The prefix it appended the the beginning of the output of the transcription and can guide the transcription result.
5666
+ * The prefix appended to the beginning of the output of the transcription and can guide the transcription result.
4956
5667
  */
4957
5668
  prefix?: string;
5669
+ /**
5670
+ * The number of beams to use in beam search decoding. Higher values may improve accuracy at the cost of speed.
5671
+ */
5672
+ beam_size?: number;
5673
+ /**
5674
+ * Whether to condition on previous text during transcription. Setting to false may help prevent hallucination loops.
5675
+ */
5676
+ condition_on_previous_text?: boolean;
5677
+ /**
5678
+ * Threshold for detecting no-speech segments. Segments with no-speech probability above this value are skipped.
5679
+ */
5680
+ no_speech_threshold?: number;
5681
+ /**
5682
+ * Threshold for filtering out segments with high compression ratio, which often indicate repetitive or hallucinated text.
5683
+ */
5684
+ compression_ratio_threshold?: number;
5685
+ /**
5686
+ * Threshold for filtering out segments with low average log probability, indicating low confidence.
5687
+ */
5688
+ log_prob_threshold?: number;
5689
+ /**
5690
+ * Optional threshold (in seconds) to skip silent periods that may cause hallucinations.
5691
+ */
5692
+ hallucination_silence_threshold?: number;
4958
5693
  }
4959
5694
  interface Ai_Cf_Openai_Whisper_Large_V3_Turbo_Output {
4960
5695
  transcription_info?: {
@@ -5101,11 +5836,11 @@ interface Ai_Cf_Baai_Bge_M3_Input_Embedding_1 {
5101
5836
  truncate_inputs?: boolean;
5102
5837
  }
5103
5838
  type Ai_Cf_Baai_Bge_M3_Output =
5104
- | Ai_Cf_Baai_Bge_M3_Ouput_Query
5839
+ | Ai_Cf_Baai_Bge_M3_Output_Query
5105
5840
  | Ai_Cf_Baai_Bge_M3_Output_EmbeddingFor_Contexts
5106
- | Ai_Cf_Baai_Bge_M3_Ouput_Embedding
5841
+ | Ai_Cf_Baai_Bge_M3_Output_Embedding
5107
5842
  | Ai_Cf_Baai_Bge_M3_AsyncResponse;
5108
- interface Ai_Cf_Baai_Bge_M3_Ouput_Query {
5843
+ interface Ai_Cf_Baai_Bge_M3_Output_Query {
5109
5844
  response?: {
5110
5845
  /**
5111
5846
  * Index of the context in the request
@@ -5125,7 +5860,7 @@ interface Ai_Cf_Baai_Bge_M3_Output_EmbeddingFor_Contexts {
5125
5860
  */
5126
5861
  pooling?: "mean" | "cls";
5127
5862
  }
5128
- interface Ai_Cf_Baai_Bge_M3_Ouput_Embedding {
5863
+ interface Ai_Cf_Baai_Bge_M3_Output_Embedding {
5129
5864
  shape?: number[];
5130
5865
  /**
5131
5866
  * Embeddings of the requested text values
@@ -5230,7 +5965,7 @@ interface Ai_Cf_Meta_Llama_3_2_11B_Vision_Instruct_Messages {
5230
5965
  */
5231
5966
  role?: string;
5232
5967
  /**
5233
- * The tool call id. Must be supplied for tool calls for Mistral-3. If you don't know what to put here you can fall back to 000000001
5968
+ * The tool call id. If you don't know what to put here you can fall back to 000000001
5234
5969
  */
5235
5970
  tool_call_id?: string;
5236
5971
  content?:
@@ -5485,10 +6220,18 @@ interface Ai_Cf_Meta_Llama_3_3_70B_Instruct_Fp8_Fast_Messages {
5485
6220
  * The role of the message sender (e.g., 'user', 'assistant', 'system', 'tool').
5486
6221
  */
5487
6222
  role: string;
5488
- /**
5489
- * The content of the message as a string.
5490
- */
5491
- content: string;
6223
+ content:
6224
+ | string
6225
+ | {
6226
+ /**
6227
+ * Type of the content (text)
6228
+ */
6229
+ type?: string;
6230
+ /**
6231
+ * Text content
6232
+ */
6233
+ text?: string;
6234
+ }[];
5492
6235
  }[];
5493
6236
  functions?: {
5494
6237
  name: string;
@@ -6144,7 +6887,7 @@ interface Ai_Cf_Qwen_Qwq_32B_Messages {
6144
6887
  */
6145
6888
  role?: string;
6146
6889
  /**
6147
- * The tool call id. Must be supplied for tool calls for Mistral-3. If you don't know what to put here you can fall back to 000000001
6890
+ * The tool call id. If you don't know what to put here you can fall back to 000000001
6148
6891
  */
6149
6892
  tool_call_id?: string;
6150
6893
  content?:
@@ -6271,7 +7014,7 @@ interface Ai_Cf_Qwen_Qwq_32B_Messages {
6271
7014
  }
6272
7015
  )[];
6273
7016
  /**
6274
- * JSON schema that should be fulfilled for the response.
7017
+ * JSON schema that should be fufilled for the response.
6275
7018
  */
6276
7019
  guided_json?: object;
6277
7020
  /**
@@ -6545,7 +7288,7 @@ interface Ai_Cf_Mistralai_Mistral_Small_3_1_24B_Instruct_Messages {
6545
7288
  }
6546
7289
  )[];
6547
7290
  /**
6548
- * JSON schema that should be fulfilled for the response.
7291
+ * JSON schema that should be fufilled for the response.
6549
7292
  */
6550
7293
  guided_json?: object;
6551
7294
  /**
@@ -6638,7 +7381,7 @@ interface Ai_Cf_Google_Gemma_3_12B_It_Prompt {
6638
7381
  */
6639
7382
  prompt: string;
6640
7383
  /**
6641
- * JSON schema that should be fulfilled for the response.
7384
+ * JSON schema that should be fufilled for the response.
6642
7385
  */
6643
7386
  guided_json?: object;
6644
7387
  /**
@@ -6802,7 +7545,7 @@ interface Ai_Cf_Google_Gemma_3_12B_It_Messages {
6802
7545
  }
6803
7546
  )[];
6804
7547
  /**
6805
- * JSON schema that should be fulfilled for the response.
7548
+ * JSON schema that should be fufilled for the response.
6806
7549
  */
6807
7550
  guided_json?: object;
6808
7551
  /**
@@ -7083,7 +7826,7 @@ interface Ai_Cf_Meta_Llama_4_Scout_17B_16E_Instruct_Messages {
7083
7826
  )[];
7084
7827
  response_format?: Ai_Cf_Meta_Llama_4_Scout_17B_16E_Instruct_JSON_Mode;
7085
7828
  /**
7086
- * JSON schema that should be fulfilled for the response.
7829
+ * JSON schema that should be fufilled for the response.
7087
7830
  */
7088
7831
  guided_json?: object;
7089
7832
  /**
@@ -7322,7 +8065,7 @@ interface Ai_Cf_Meta_Llama_4_Scout_17B_16E_Instruct_Messages_Inner {
7322
8065
  )[];
7323
8066
  response_format?: Ai_Cf_Meta_Llama_4_Scout_17B_16E_Instruct_JSON_Mode;
7324
8067
  /**
7325
- * JSON schema that should be fulfilled for the response.
8068
+ * JSON schema that should be fufilled for the response.
7326
8069
  */
7327
8070
  guided_json?: object;
7328
8071
  /**
@@ -7487,10 +8230,18 @@ interface Ai_Cf_Qwen_Qwen3_30B_A3B_Fp8_Messages {
7487
8230
  * The role of the message sender (e.g., 'user', 'assistant', 'system', 'tool').
7488
8231
  */
7489
8232
  role: string;
7490
- /**
7491
- * The content of the message as a string.
7492
- */
7493
- content: string;
8233
+ content:
8234
+ | string
8235
+ | {
8236
+ /**
8237
+ * Type of the content (text)
8238
+ */
8239
+ type?: string;
8240
+ /**
8241
+ * Text content
8242
+ */
8243
+ text?: string;
8244
+ }[];
7494
8245
  }[];
7495
8246
  functions?: {
7496
8247
  name: string;
@@ -7702,10 +8453,18 @@ interface Ai_Cf_Qwen_Qwen3_30B_A3B_Fp8_Messages_1 {
7702
8453
  * The role of the message sender (e.g., 'user', 'assistant', 'system', 'tool').
7703
8454
  */
7704
8455
  role: string;
7705
- /**
7706
- * The content of the message as a string.
7707
- */
7708
- content: string;
8456
+ content:
8457
+ | string
8458
+ | {
8459
+ /**
8460
+ * Type of the content (text)
8461
+ */
8462
+ type?: string;
8463
+ /**
8464
+ * Text content
8465
+ */
8466
+ text?: string;
8467
+ }[];
7709
8468
  }[];
7710
8469
  functions?: {
7711
8470
  name: string;
@@ -8273,12 +9032,12 @@ declare abstract class Base_Ai_Cf_Pipecat_Ai_Smart_Turn_V2 {
8273
9032
  postProcessedOutputs: Ai_Cf_Pipecat_Ai_Smart_Turn_V2_Output;
8274
9033
  }
8275
9034
  declare abstract class Base_Ai_Cf_Openai_Gpt_Oss_120B {
8276
- inputs: ResponsesInput;
8277
- postProcessedOutputs: ResponsesOutput;
9035
+ inputs: XOR<ResponsesInput, ChatCompletionsInput>;
9036
+ postProcessedOutputs: XOR<ResponsesOutput, ChatCompletionsOutput>;
8278
9037
  }
8279
9038
  declare abstract class Base_Ai_Cf_Openai_Gpt_Oss_20B {
8280
- inputs: ResponsesInput;
8281
- postProcessedOutputs: ResponsesOutput;
9039
+ inputs: XOR<ResponsesInput, ChatCompletionsInput>;
9040
+ postProcessedOutputs: XOR<ResponsesOutput, ChatCompletionsOutput>;
8282
9041
  }
8283
9042
  interface Ai_Cf_Leonardo_Phoenix_1_0_Input {
8284
9043
  /**
@@ -8410,7 +9169,7 @@ interface Ai_Cf_Ai4Bharat_Indictrans2_En_Indic_1B_Input {
8410
9169
  */
8411
9170
  text: string | string[];
8412
9171
  /**
8413
- * Target language to translate to
9172
+ * Target langauge to translate to
8414
9173
  */
8415
9174
  target_language:
8416
9175
  | "asm_Beng"
@@ -8526,10 +9285,18 @@ interface Ai_Cf_Aisingapore_Gemma_Sea_Lion_V4_27B_It_Messages {
8526
9285
  * The role of the message sender (e.g., 'user', 'assistant', 'system', 'tool').
8527
9286
  */
8528
9287
  role: string;
8529
- /**
8530
- * The content of the message as a string.
8531
- */
8532
- content: string;
9288
+ content:
9289
+ | string
9290
+ | {
9291
+ /**
9292
+ * Type of the content (text)
9293
+ */
9294
+ type?: string;
9295
+ /**
9296
+ * Text content
9297
+ */
9298
+ text?: string;
9299
+ }[];
8533
9300
  }[];
8534
9301
  functions?: {
8535
9302
  name: string;
@@ -8741,10 +9508,18 @@ interface Ai_Cf_Aisingapore_Gemma_Sea_Lion_V4_27B_It_Messages_1 {
8741
9508
  * The role of the message sender (e.g., 'user', 'assistant', 'system', 'tool').
8742
9509
  */
8743
9510
  role: string;
8744
- /**
8745
- * The content of the message as a string.
8746
- */
8747
- content: string;
9511
+ content:
9512
+ | string
9513
+ | {
9514
+ /**
9515
+ * Type of the content (text)
9516
+ */
9517
+ type?: string;
9518
+ /**
9519
+ * Text content
9520
+ */
9521
+ text?: string;
9522
+ }[];
8748
9523
  }[];
8749
9524
  functions?: {
8750
9525
  name: string;
@@ -9299,6 +10074,66 @@ declare abstract class Base_Ai_Cf_Deepgram_Aura_2_Es {
9299
10074
  inputs: Ai_Cf_Deepgram_Aura_2_Es_Input;
9300
10075
  postProcessedOutputs: Ai_Cf_Deepgram_Aura_2_Es_Output;
9301
10076
  }
10077
+ interface Ai_Cf_Black_Forest_Labs_Flux_2_Dev_Input {
10078
+ multipart: {
10079
+ body?: object;
10080
+ contentType?: string;
10081
+ };
10082
+ }
10083
+ interface Ai_Cf_Black_Forest_Labs_Flux_2_Dev_Output {
10084
+ /**
10085
+ * Generated image as Base64 string.
10086
+ */
10087
+ image?: string;
10088
+ }
10089
+ declare abstract class Base_Ai_Cf_Black_Forest_Labs_Flux_2_Dev {
10090
+ inputs: Ai_Cf_Black_Forest_Labs_Flux_2_Dev_Input;
10091
+ postProcessedOutputs: Ai_Cf_Black_Forest_Labs_Flux_2_Dev_Output;
10092
+ }
10093
+ interface Ai_Cf_Black_Forest_Labs_Flux_2_Klein_4B_Input {
10094
+ multipart: {
10095
+ body?: object;
10096
+ contentType?: string;
10097
+ };
10098
+ }
10099
+ interface Ai_Cf_Black_Forest_Labs_Flux_2_Klein_4B_Output {
10100
+ /**
10101
+ * Generated image as Base64 string.
10102
+ */
10103
+ image?: string;
10104
+ }
10105
+ declare abstract class Base_Ai_Cf_Black_Forest_Labs_Flux_2_Klein_4B {
10106
+ inputs: Ai_Cf_Black_Forest_Labs_Flux_2_Klein_4B_Input;
10107
+ postProcessedOutputs: Ai_Cf_Black_Forest_Labs_Flux_2_Klein_4B_Output;
10108
+ }
10109
+ interface Ai_Cf_Black_Forest_Labs_Flux_2_Klein_9B_Input {
10110
+ multipart: {
10111
+ body?: object;
10112
+ contentType?: string;
10113
+ };
10114
+ }
10115
+ interface Ai_Cf_Black_Forest_Labs_Flux_2_Klein_9B_Output {
10116
+ /**
10117
+ * Generated image as Base64 string.
10118
+ */
10119
+ image?: string;
10120
+ }
10121
+ declare abstract class Base_Ai_Cf_Black_Forest_Labs_Flux_2_Klein_9B {
10122
+ inputs: Ai_Cf_Black_Forest_Labs_Flux_2_Klein_9B_Input;
10123
+ postProcessedOutputs: Ai_Cf_Black_Forest_Labs_Flux_2_Klein_9B_Output;
10124
+ }
10125
+ declare abstract class Base_Ai_Cf_Zai_Org_Glm_4_7_Flash {
10126
+ inputs: ChatCompletionsInput;
10127
+ postProcessedOutputs: ChatCompletionsOutput;
10128
+ }
10129
+ declare abstract class Base_Ai_Cf_Moonshotai_Kimi_K2_5 {
10130
+ inputs: ChatCompletionsInput;
10131
+ postProcessedOutputs: ChatCompletionsOutput;
10132
+ }
10133
+ declare abstract class Base_Ai_Cf_Nvidia_Nemotron_3_120B_A12B {
10134
+ inputs: ChatCompletionsInput;
10135
+ postProcessedOutputs: ChatCompletionsOutput;
10136
+ }
9302
10137
  interface AiModels {
9303
10138
  "@cf/huggingface/distilbert-sst-2-int8": BaseAiTextClassification;
9304
10139
  "@cf/stabilityai/stable-diffusion-xl-base-1.0": BaseAiTextToImage;
@@ -9317,7 +10152,6 @@ interface AiModels {
9317
10152
  "@hf/thebloke/zephyr-7b-beta-awq": BaseAiTextGeneration;
9318
10153
  "@hf/thebloke/openhermes-2.5-mistral-7b-awq": BaseAiTextGeneration;
9319
10154
  "@hf/thebloke/neural-chat-7b-v3-1-awq": BaseAiTextGeneration;
9320
- "@hf/thebloke/llamaguard-7b-awq": BaseAiTextGeneration;
9321
10155
  "@hf/thebloke/deepseek-coder-6.7b-base-awq": BaseAiTextGeneration;
9322
10156
  "@hf/thebloke/deepseek-coder-6.7b-instruct-awq": BaseAiTextGeneration;
9323
10157
  "@cf/deepseek-ai/deepseek-math-7b-instruct": BaseAiTextGeneration;
@@ -9384,6 +10218,12 @@ interface AiModels {
9384
10218
  "@cf/deepgram/flux": Base_Ai_Cf_Deepgram_Flux;
9385
10219
  "@cf/deepgram/aura-2-en": Base_Ai_Cf_Deepgram_Aura_2_En;
9386
10220
  "@cf/deepgram/aura-2-es": Base_Ai_Cf_Deepgram_Aura_2_Es;
10221
+ "@cf/black-forest-labs/flux-2-dev": Base_Ai_Cf_Black_Forest_Labs_Flux_2_Dev;
10222
+ "@cf/black-forest-labs/flux-2-klein-4b": Base_Ai_Cf_Black_Forest_Labs_Flux_2_Klein_4B;
10223
+ "@cf/black-forest-labs/flux-2-klein-9b": Base_Ai_Cf_Black_Forest_Labs_Flux_2_Klein_9B;
10224
+ "@cf/zai-org/glm-4.7-flash": Base_Ai_Cf_Zai_Org_Glm_4_7_Flash;
10225
+ "@cf/moonshotai/kimi-k2.5": Base_Ai_Cf_Moonshotai_Kimi_K2_5;
10226
+ "@cf/nvidia/nemotron-3-120b-a12b": Base_Ai_Cf_Nvidia_Nemotron_3_120B_A12B;
9387
10227
  }
9388
10228
  type AiOptions = {
9389
10229
  /**
@@ -9409,6 +10249,7 @@ type AiOptions = {
9409
10249
  returnRawResponse?: boolean;
9410
10250
  prefix?: string;
9411
10251
  extraHeaders?: object;
10252
+ signal?: AbortSignal;
9412
10253
  };
9413
10254
  type AiModelsSearchParams = {
9414
10255
  author?: string;
@@ -9435,6 +10276,16 @@ type AiModelsSearchObject = {
9435
10276
  value: string;
9436
10277
  }[];
9437
10278
  };
10279
+ type ChatCompletionsBase = XOR<
10280
+ ChatCompletionsPromptInput,
10281
+ ChatCompletionsMessagesInput
10282
+ >;
10283
+ type ChatCompletionsInput = XOR<
10284
+ ChatCompletionsBase,
10285
+ {
10286
+ requests: ChatCompletionsBase[];
10287
+ }
10288
+ >;
9438
10289
  interface InferenceUpstreamError extends Error {}
9439
10290
  interface AiInternalError extends Error {}
9440
10291
  type AiModelListType = Record<string, any>;
@@ -9442,46 +10293,16 @@ declare abstract class Ai<AiModelList extends AiModelListType = AiModels> {
9442
10293
  aiGatewayLogId: string | null;
9443
10294
  gateway(gatewayId: string): AiGateway;
9444
10295
  /**
9445
- * Access the AI Search API for managing AI-powered search instances.
9446
- *
9447
- * This is the new API that replaces AutoRAG with better namespace separation:
9448
- * - Account-level operations: `list()`, `create()`
9449
- * - Instance-level operations: `get(id).search()`, `get(id).chatCompletions()`, `get(id).delete()`
9450
- *
9451
- * @example
9452
- * ```typescript
9453
- * // List all AI Search instances
9454
- * const instances = await env.AI.aiSearch.list();
9455
- *
9456
- * // Search an instance
9457
- * const results = await env.AI.aiSearch.get('my-search').search({
9458
- * messages: [{ role: 'user', content: 'What is the policy?' }],
9459
- * ai_search_options: {
9460
- * retrieval: { max_num_results: 10 }
9461
- * }
9462
- * });
9463
- *
9464
- * // Generate chat completions with AI Search context
9465
- * const response = await env.AI.aiSearch.get('my-search').chatCompletions({
9466
- * messages: [{ role: 'user', content: 'What is the policy?' }],
9467
- * model: '@cf/meta/llama-3.3-70b-instruct-fp8-fast'
9468
- * });
9469
- * ```
10296
+ * @deprecated Use the standalone `ai_search_namespaces` or `ai_search` Workers bindings instead.
10297
+ * See https://developers.cloudflare.com/ai-search/usage/workers-binding/
9470
10298
  */
9471
- aiSearch(): AiSearchAccountService;
10299
+ aiSearch(): AiSearchNamespace;
9472
10300
  /**
9473
10301
  * @deprecated AutoRAG has been replaced by AI Search.
9474
- * Use `env.AI.aiSearch` instead for better API design and new features.
9475
- *
9476
- * Migration guide:
9477
- * - `env.AI.autorag().list()` → `env.AI.aiSearch.list()`
9478
- * - `env.AI.autorag('id').search({ query: '...' })` → `env.AI.aiSearch.get('id').search({ messages: [{ role: 'user', content: '...' }] })`
9479
- * - `env.AI.autorag('id').aiSearch(...)` → `env.AI.aiSearch.get('id').chatCompletions(...)`
10302
+ * Use the standalone `ai_search_namespaces` or `ai_search` Workers bindings instead.
10303
+ * See https://developers.cloudflare.com/ai-search/usage/workers-binding/
9480
10304
  *
9481
- * Note: The old API continues to work for backwards compatibility, but new projects should use AI Search.
9482
- *
9483
- * @see AiSearchAccountService
9484
- * @param autoragId Optional instance ID (omit for account-level operations)
10305
+ * @param autoragId Instance ID
9485
10306
  */
9486
10307
  autorag(autoragId: string): AutoRAG;
9487
10308
  run<
@@ -9640,22 +10461,23 @@ declare abstract class AiGateway {
9640
10461
  getUrl(provider?: AIGatewayProviders | string): Promise<string>; // eslint-disable-line
9641
10462
  }
9642
10463
  /**
9643
- * @deprecated AutoRAG has been replaced by AI Search. Use AiSearchInternalError instead.
9644
- * @see AiSearchInternalError
10464
+ * @deprecated Use the standalone AI Search Workers binding instead.
10465
+ * See https://developers.cloudflare.com/ai-search/usage/workers-binding/
9645
10466
  */
9646
10467
  interface AutoRAGInternalError extends Error {}
9647
10468
  /**
9648
- * @deprecated AutoRAG has been replaced by AI Search. Use AiSearchNotFoundError instead.
9649
- * @see AiSearchNotFoundError
10469
+ * @deprecated Use the standalone AI Search Workers binding instead.
10470
+ * See https://developers.cloudflare.com/ai-search/usage/workers-binding/
9650
10471
  */
9651
10472
  interface AutoRAGNotFoundError extends Error {}
9652
10473
  /**
9653
- * @deprecated This error type is no longer used in the AI Search API.
10474
+ * @deprecated Use the standalone AI Search Workers binding instead.
10475
+ * See https://developers.cloudflare.com/ai-search/usage/workers-binding/
9654
10476
  */
9655
10477
  interface AutoRAGUnauthorizedError extends Error {}
9656
10478
  /**
9657
- * @deprecated AutoRAG has been replaced by AI Search. Use AiSearchNameNotSetError instead.
9658
- * @see AiSearchNameNotSetError
10479
+ * @deprecated Use the standalone AI Search Workers binding instead.
10480
+ * See https://developers.cloudflare.com/ai-search/usage/workers-binding/
9659
10481
  */
9660
10482
  interface AutoRAGNameNotSetError extends Error {}
9661
10483
  type ComparisonFilter = {
@@ -9668,9 +10490,8 @@ type CompoundFilter = {
9668
10490
  filters: ComparisonFilter[];
9669
10491
  };
9670
10492
  /**
9671
- * @deprecated AutoRAG has been replaced by AI Search.
9672
- * Use AiSearchSearchRequest with the new API instead.
9673
- * @see AiSearchSearchRequest
10493
+ * @deprecated Use the standalone AI Search Workers binding instead.
10494
+ * See https://developers.cloudflare.com/ai-search/usage/workers-binding/
9674
10495
  */
9675
10496
  type AutoRagSearchRequest = {
9676
10497
  query: string;
@@ -9687,18 +10508,16 @@ type AutoRagSearchRequest = {
9687
10508
  rewrite_query?: boolean;
9688
10509
  };
9689
10510
  /**
9690
- * @deprecated AutoRAG has been replaced by AI Search.
9691
- * Use AiSearchChatCompletionsRequest with the new API instead.
9692
- * @see AiSearchChatCompletionsRequest
10511
+ * @deprecated Use the standalone AI Search Workers binding instead.
10512
+ * See https://developers.cloudflare.com/ai-search/usage/workers-binding/
9693
10513
  */
9694
10514
  type AutoRagAiSearchRequest = AutoRagSearchRequest & {
9695
10515
  stream?: boolean;
9696
10516
  system_prompt?: string;
9697
10517
  };
9698
10518
  /**
9699
- * @deprecated AutoRAG has been replaced by AI Search.
9700
- * Use AiSearchChatCompletionsRequest with stream: true instead.
9701
- * @see AiSearchChatCompletionsRequest
10519
+ * @deprecated Use the standalone AI Search Workers binding instead.
10520
+ * See https://developers.cloudflare.com/ai-search/usage/workers-binding/
9702
10521
  */
9703
10522
  type AutoRagAiSearchRequestStreaming = Omit<
9704
10523
  AutoRagAiSearchRequest,
@@ -9707,9 +10526,8 @@ type AutoRagAiSearchRequestStreaming = Omit<
9707
10526
  stream: true;
9708
10527
  };
9709
10528
  /**
9710
- * @deprecated AutoRAG has been replaced by AI Search.
9711
- * Use AiSearchSearchResponse with the new API instead.
9712
- * @see AiSearchSearchResponse
10529
+ * @deprecated Use the standalone AI Search Workers binding instead.
10530
+ * See https://developers.cloudflare.com/ai-search/usage/workers-binding/
9713
10531
  */
9714
10532
  type AutoRagSearchResponse = {
9715
10533
  object: "vector_store.search_results.page";
@@ -9728,9 +10546,8 @@ type AutoRagSearchResponse = {
9728
10546
  next_page: string | null;
9729
10547
  };
9730
10548
  /**
9731
- * @deprecated AutoRAG has been replaced by AI Search.
9732
- * Use AiSearchListResponse with the new API instead.
9733
- * @see AiSearchListResponse
10549
+ * @deprecated Use the standalone AI Search Workers binding instead.
10550
+ * See https://developers.cloudflare.com/ai-search/usage/workers-binding/
9734
10551
  */
9735
10552
  type AutoRagListResponse = {
9736
10553
  id: string;
@@ -9742,49 +10559,40 @@ type AutoRagListResponse = {
9742
10559
  status: string;
9743
10560
  }[];
9744
10561
  /**
9745
- * @deprecated AutoRAG has been replaced by AI Search.
9746
- * The new API returns different response formats for chat completions.
10562
+ * @deprecated Use the standalone AI Search Workers binding instead.
10563
+ * See https://developers.cloudflare.com/ai-search/usage/workers-binding/
9747
10564
  */
9748
10565
  type AutoRagAiSearchResponse = AutoRagSearchResponse & {
9749
10566
  response: string;
9750
10567
  };
9751
10568
  /**
9752
- * @deprecated AutoRAG has been replaced by AI Search.
9753
- * Use the new AI Search API instead: `env.AI.aiSearch`
9754
- *
9755
- * Migration guide:
9756
- * - `env.AI.autorag().list()` → `env.AI.aiSearch.list()`
9757
- * - `env.AI.autorag('id').search(...)` → `env.AI.aiSearch.get('id').search(...)`
9758
- * - `env.AI.autorag('id').aiSearch(...)` → `env.AI.aiSearch.get('id').chatCompletions(...)`
9759
- *
9760
- * @see AiSearchAccountService
9761
- * @see AiSearchInstanceService
10569
+ * @deprecated Use the standalone AI Search Workers binding instead.
10570
+ * See https://developers.cloudflare.com/ai-search/usage/workers-binding/
9762
10571
  */
9763
10572
  declare abstract class AutoRAG {
9764
10573
  /**
9765
- * @deprecated Use `env.AI.aiSearch.list()` instead.
9766
- * @see AiSearchAccountService.list
10574
+ * @deprecated Use the standalone AI Search Workers binding instead.
10575
+ * See https://developers.cloudflare.com/ai-search/usage/workers-binding/
9767
10576
  */
9768
10577
  list(): Promise<AutoRagListResponse>;
9769
10578
  /**
9770
- * @deprecated Use `env.AI.aiSearch.get(id).search(...)` instead.
9771
- * Note: The new API uses a messages array instead of a query string.
9772
- * @see AiSearchInstanceService.search
10579
+ * @deprecated Use the standalone AI Search Workers binding instead.
10580
+ * See https://developers.cloudflare.com/ai-search/usage/workers-binding/
9773
10581
  */
9774
10582
  search(params: AutoRagSearchRequest): Promise<AutoRagSearchResponse>;
9775
10583
  /**
9776
- * @deprecated Use `env.AI.aiSearch.get(id).chatCompletions(...)` instead.
9777
- * @see AiSearchInstanceService.chatCompletions
10584
+ * @deprecated Use the standalone AI Search Workers binding instead.
10585
+ * See https://developers.cloudflare.com/ai-search/usage/workers-binding/
9778
10586
  */
9779
10587
  aiSearch(params: AutoRagAiSearchRequestStreaming): Promise<Response>;
9780
10588
  /**
9781
- * @deprecated Use `env.AI.aiSearch.get(id).chatCompletions(...)` instead.
9782
- * @see AiSearchInstanceService.chatCompletions
10589
+ * @deprecated Use the standalone AI Search Workers binding instead.
10590
+ * See https://developers.cloudflare.com/ai-search/usage/workers-binding/
9783
10591
  */
9784
10592
  aiSearch(params: AutoRagAiSearchRequest): Promise<AutoRagAiSearchResponse>;
9785
10593
  /**
9786
- * @deprecated Use `env.AI.aiSearch.get(id).chatCompletions(...)` instead.
9787
- * @see AiSearchInstanceService.chatCompletions
10594
+ * @deprecated Use the standalone AI Search Workers binding instead.
10595
+ * See https://developers.cloudflare.com/ai-search/usage/workers-binding/
9788
10596
  */
9789
10597
  aiSearch(
9790
10598
  params: AutoRagAiSearchRequest,
@@ -9909,6 +10717,41 @@ interface RequestInitCfProperties extends Record<string, unknown> {
9909
10717
  * (e.g. { '200-299': 86400, '404': 1, '500-599': 0 })
9910
10718
  */
9911
10719
  cacheTtlByStatus?: Record<string, number>;
10720
+ /**
10721
+ * Explicit Cache-Control header value to set on the response stored in cache.
10722
+ * This gives full control over cache directives (e.g. 'public, max-age=3600, s-maxage=86400').
10723
+ *
10724
+ * Cannot be used together with `cacheTtl` or the `cache` request option (`no-store`/`no-cache`),
10725
+ * as these are mutually exclusive cache control mechanisms. Setting both will throw a TypeError.
10726
+ *
10727
+ * Can be used together with `cacheTtlByStatus`.
10728
+ */
10729
+ cacheControl?: string;
10730
+ /**
10731
+ * Whether the response should be eligible for Cache Reserve storage.
10732
+ */
10733
+ cacheReserveEligible?: boolean;
10734
+ /**
10735
+ * Whether to respect strong ETags (as opposed to weak ETags) from the origin.
10736
+ */
10737
+ respectStrongEtag?: boolean;
10738
+ /**
10739
+ * Whether to strip ETag headers from the origin response before caching.
10740
+ */
10741
+ stripEtags?: boolean;
10742
+ /**
10743
+ * Whether to strip Last-Modified headers from the origin response before caching.
10744
+ */
10745
+ stripLastModified?: boolean;
10746
+ /**
10747
+ * Whether to enable Cache Deception Armor, which protects against web cache
10748
+ * deception attacks by verifying the Content-Type matches the URL extension.
10749
+ */
10750
+ cacheDeceptionArmor?: boolean;
10751
+ /**
10752
+ * Minimum file size in bytes for a response to be eligible for Cache Reserve storage.
10753
+ */
10754
+ cacheReserveMinimumFileSize?: number;
9912
10755
  scrapeShield?: boolean;
9913
10756
  apps?: boolean;
9914
10757
  image?: RequestInitCfPropertiesImage;
@@ -11821,6 +12664,7 @@ declare namespace CloudflareWorkersModule {
11821
12664
  constructor(ctx: ExecutionContext, env: Env);
11822
12665
  email?(message: ForwardableEmailMessage): void | Promise<void>;
11823
12666
  fetch?(request: Request): Response | Promise<Response>;
12667
+ connect?(socket: Socket): void | Promise<void>;
11824
12668
  queue?(batch: MessageBatch<unknown>): void | Promise<void>;
11825
12669
  scheduled?(controller: ScheduledController): void | Promise<void>;
11826
12670
  tail?(events: TraceItem[]): void | Promise<void>;
@@ -11841,6 +12685,7 @@ declare namespace CloudflareWorkersModule {
11841
12685
  constructor(ctx: DurableObjectState, env: Env);
11842
12686
  alarm?(alarmInfo?: AlarmInvocationInfo): void | Promise<void>;
11843
12687
  fetch?(request: Request): Response | Promise<Response>;
12688
+ connect?(socket: Socket): void | Promise<void>;
11844
12689
  webSocketMessage?(
11845
12690
  ws: WebSocket,
11846
12691
  message: string | ArrayBuffer,
@@ -11991,17 +12836,6 @@ interface StreamBinding {
11991
12836
  * @returns A handle for per-video operations.
11992
12837
  */
11993
12838
  video(id: string): StreamVideoHandle;
11994
- /**
11995
- * Uploads a new video from a File.
11996
- * @param file The video file to upload.
11997
- * @returns The uploaded video details.
11998
- * @throws {BadRequestError} if the upload parameter is invalid
11999
- * @throws {QuotaReachedError} if the account storage capacity is exceeded
12000
- * @throws {MaxFileSizeError} if the file size is too large
12001
- * @throws {RateLimitedError} if the server received too many requests
12002
- * @throws {InternalError} if an unexpected error occurs
12003
- */
12004
- upload(file: File): Promise<StreamVideo>;
12005
12839
  /**
12006
12840
  * Uploads a new video from a provided URL.
12007
12841
  * @param url The URL to upload from.
@@ -12851,6 +13685,9 @@ declare namespace TailStream {
12851
13685
  readonly type: "fetch";
12852
13686
  readonly statusCode: number;
12853
13687
  }
13688
+ interface ConnectEventInfo {
13689
+ readonly type: "connect";
13690
+ }
12854
13691
  type EventOutcome =
12855
13692
  | "ok"
12856
13693
  | "canceled"
@@ -12881,6 +13718,7 @@ declare namespace TailStream {
12881
13718
  readonly scriptVersion?: ScriptVersion;
12882
13719
  readonly info:
12883
13720
  | FetchEventInfo
13721
+ | ConnectEventInfo
12884
13722
  | JsRpcEventInfo
12885
13723
  | ScheduledEventInfo
12886
13724
  | AlarmEventInfo