@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.ts CHANGED
@@ -480,6 +480,11 @@ export type ExportedHandlerFetchHandler<
480
480
  env: Env,
481
481
  ctx: ExecutionContext<Props>,
482
482
  ) => Response | Promise<Response>;
483
+ export type ExportedHandlerConnectHandler<Env = unknown, Props = unknown> = (
484
+ socket: Socket,
485
+ env: Env,
486
+ ctx: ExecutionContext<Props>,
487
+ ) => void | Promise<void>;
483
488
  export type ExportedHandlerTailHandler<Env = unknown, Props = unknown> = (
484
489
  events: TraceItem[],
485
490
  env: Env,
@@ -521,6 +526,7 @@ export interface ExportedHandler<
521
526
  Props = unknown,
522
527
  > {
523
528
  fetch?: ExportedHandlerFetchHandler<Env, CfHostMetadata, Props>;
529
+ connect?: ExportedHandlerConnectHandler<Env, Props>;
524
530
  tail?: ExportedHandlerTailHandler<Env, Props>;
525
531
  trace?: ExportedHandlerTraceHandler<Env, Props>;
526
532
  tailStream?: ExportedHandlerTailStreamHandler<Env, Props>;
@@ -535,12 +541,14 @@ export interface StructuredSerializeOptions {
535
541
  export interface AlarmInvocationInfo {
536
542
  readonly isRetry: boolean;
537
543
  readonly retryCount: number;
544
+ readonly scheduledTime: number;
538
545
  }
539
546
  export interface Cloudflare {
540
547
  readonly compatibilityFlags: Record<string, boolean>;
541
548
  }
542
549
  export interface DurableObject {
543
550
  fetch(request: Request): Response | Promise<Response>;
551
+ connect?(socket: Socket): void | Promise<void>;
544
552
  alarm?(alarmInfo?: AlarmInvocationInfo): void | Promise<void>;
545
553
  webSocketMessage?(
546
554
  ws: WebSocket,
@@ -558,7 +566,7 @@ export type DurableObjectStub<
558
566
  T extends Rpc.DurableObjectBranded | undefined = undefined,
559
567
  > = Fetcher<
560
568
  T,
561
- "alarm" | "webSocketMessage" | "webSocketClose" | "webSocketError"
569
+ "alarm" | "connect" | "webSocketMessage" | "webSocketClose" | "webSocketError"
562
570
  > & {
563
571
  readonly id: DurableObjectId;
564
572
  readonly name?: string;
@@ -567,6 +575,7 @@ export interface DurableObjectId {
567
575
  toString(): string;
568
576
  equals(other: DurableObjectId): boolean;
569
577
  readonly name?: string;
578
+ readonly jurisdiction?: string;
570
579
  }
571
580
  export declare abstract class DurableObjectNamespace<
572
581
  T extends Rpc.DurableObjectBranded | undefined = undefined,
@@ -3073,6 +3082,11 @@ export interface QueuingStrategyInit {
3073
3082
  */
3074
3083
  highWaterMark: number;
3075
3084
  }
3085
+ export interface TracePreviewInfo {
3086
+ id: string;
3087
+ slug: string;
3088
+ name: string;
3089
+ }
3076
3090
  export interface ScriptVersion {
3077
3091
  id?: string;
3078
3092
  tag?: string;
@@ -3087,6 +3101,7 @@ export interface TraceItem {
3087
3101
  | (
3088
3102
  | TraceItemFetchEventInfo
3089
3103
  | TraceItemJsRpcEventInfo
3104
+ | TraceItemConnectEventInfo
3090
3105
  | TraceItemScheduledEventInfo
3091
3106
  | TraceItemAlarmEventInfo
3092
3107
  | TraceItemQueueEventInfo
@@ -3105,6 +3120,8 @@ export interface TraceItem {
3105
3120
  readonly scriptVersion?: ScriptVersion;
3106
3121
  readonly dispatchNamespace?: string;
3107
3122
  readonly scriptTags?: string[];
3123
+ readonly tailAttributes?: Record<string, boolean | number | string>;
3124
+ readonly preview?: TracePreviewInfo;
3108
3125
  readonly durableObjectId?: string;
3109
3126
  readonly outcome: string;
3110
3127
  readonly executionModel: string;
@@ -3115,6 +3132,7 @@ export interface TraceItem {
3115
3132
  export interface TraceItemAlarmEventInfo {
3116
3133
  readonly scheduledTime: Date;
3117
3134
  }
3135
+ export interface TraceItemConnectEventInfo {}
3118
3136
  export interface TraceItemCustomEventInfo {}
3119
3137
  export interface TraceItemScheduledEventInfo {
3120
3138
  readonly scheduledTime: number;
@@ -3655,7 +3673,7 @@ export interface ContainerStartupOptions {
3655
3673
  entrypoint?: string[];
3656
3674
  enableInternet: boolean;
3657
3675
  env?: Record<string, string>;
3658
- hardTimeout?: number | bigint;
3676
+ labels?: Record<string, string>;
3659
3677
  }
3660
3678
  /**
3661
3679
  * 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.
@@ -3782,11 +3800,10 @@ export declare abstract class Performance {
3782
3800
  */
3783
3801
  toJSON(): object;
3784
3802
  }
3785
- // AI Search V2 API Error Interfaces
3803
+ // ============ AI Search Error Interfaces ============
3786
3804
  export interface AiSearchInternalError extends Error {}
3787
3805
  export interface AiSearchNotFoundError extends Error {}
3788
- export interface AiSearchNameNotSetError extends Error {}
3789
- // AI Search V2 Request Types
3806
+ // ============ AI Search Request Types ============
3790
3807
  export type AiSearchSearchRequest = {
3791
3808
  messages: Array<{
3792
3809
  role: "system" | "developer" | "user" | "assistant" | "tool";
@@ -3811,9 +3828,8 @@ export type AiSearchSearchRequest = {
3811
3828
  [key: string]: unknown;
3812
3829
  };
3813
3830
  reranking?: {
3814
- /** Enable reranking (default false) */
3815
3831
  enabled?: boolean;
3816
- model?: "@cf/baai/bge-reranker-base" | "";
3832
+ model?: "@cf/baai/bge-reranker-base" | string;
3817
3833
  /** Match threshold (0-1, default 0.4) */
3818
3834
  match_threshold?: number;
3819
3835
  [key: string]: unknown;
@@ -3825,6 +3841,7 @@ export type AiSearchChatCompletionsRequest = {
3825
3841
  messages: Array<{
3826
3842
  role: "system" | "developer" | "user" | "assistant" | "tool";
3827
3843
  content: string | null;
3844
+ [key: string]: unknown;
3828
3845
  }>;
3829
3846
  model?: string;
3830
3847
  stream?: boolean;
@@ -3845,7 +3862,7 @@ export type AiSearchChatCompletionsRequest = {
3845
3862
  };
3846
3863
  reranking?: {
3847
3864
  enabled?: boolean;
3848
- model?: "@cf/baai/bge-reranker-base" | "";
3865
+ model?: "@cf/baai/bge-reranker-base" | string;
3849
3866
  match_threshold?: number;
3850
3867
  [key: string]: unknown;
3851
3868
  };
@@ -3853,7 +3870,7 @@ export type AiSearchChatCompletionsRequest = {
3853
3870
  };
3854
3871
  [key: string]: unknown;
3855
3872
  };
3856
- // AI Search V2 Response Types
3873
+ // ============ AI Search Response Types ============
3857
3874
  export type AiSearchSearchResponse = {
3858
3875
  search_query: string;
3859
3876
  chunks: Array<{
@@ -3872,26 +3889,65 @@ export type AiSearchSearchResponse = {
3872
3889
  keyword_score?: number;
3873
3890
  /** Vector similarity score (0-1) */
3874
3891
  vector_score?: number;
3892
+ [key: string]: unknown;
3893
+ };
3894
+ }>;
3895
+ };
3896
+ export type AiSearchChatCompletionsResponse = {
3897
+ id?: string;
3898
+ object?: string;
3899
+ model?: string;
3900
+ choices: Array<{
3901
+ index?: number;
3902
+ message: {
3903
+ role: "system" | "developer" | "user" | "assistant" | "tool";
3904
+ content: string | null;
3905
+ [key: string]: unknown;
3875
3906
  };
3907
+ [key: string]: unknown;
3876
3908
  }>;
3909
+ chunks: AiSearchSearchResponse["chunks"];
3910
+ [key: string]: unknown;
3877
3911
  };
3878
- export type AiSearchListResponse = Array<{
3912
+ export type AiSearchStatsResponse = {
3913
+ queued?: number;
3914
+ running?: number;
3915
+ completed?: number;
3916
+ error?: number;
3917
+ skipped?: number;
3918
+ outdated?: number;
3919
+ last_activity?: string;
3920
+ };
3921
+ // ============ AI Search Instance Info Types ============
3922
+ export type AiSearchInstanceInfo = {
3879
3923
  id: string;
3880
- internal_id?: string;
3881
- account_id?: string;
3882
- account_tag?: string;
3883
- /** Whether the instance is enabled (default true) */
3884
- enable?: boolean;
3885
- type?: "r2" | "web-crawler";
3924
+ type?: "r2" | "web-crawler" | string;
3886
3925
  source?: string;
3926
+ paused?: boolean;
3927
+ status?: string;
3928
+ namespace?: string;
3929
+ created_at?: string;
3930
+ modified_at?: string;
3887
3931
  [key: string]: unknown;
3888
- }>;
3932
+ };
3933
+ export type AiSearchListResponse = {
3934
+ result: AiSearchInstanceInfo[];
3935
+ result_info?: {
3936
+ count: number;
3937
+ page: number;
3938
+ per_page: number;
3939
+ total_count: number;
3940
+ };
3941
+ };
3942
+ // ============ AI Search Config Types ============
3889
3943
  export type AiSearchConfig = {
3890
3944
  /** Instance ID (1-32 chars, pattern: ^[a-z0-9_]+(?:-[a-z0-9_]+)*$) */
3891
3945
  id: string;
3892
- type: "r2" | "web-crawler";
3893
- source: string;
3894
- source_params?: object;
3946
+ /** Instance type. Omit to create with built-in storage. */
3947
+ type?: "r2" | "web-crawler" | string;
3948
+ /** Source URL (required for web-crawler type). */
3949
+ source?: string;
3950
+ source_params?: unknown;
3895
3951
  /** Token ID (UUID format) */
3896
3952
  token_id?: string;
3897
3953
  ai_gateway_id?: string;
@@ -3901,54 +3957,307 @@ export type AiSearchConfig = {
3901
3957
  reranking?: boolean;
3902
3958
  embedding_model?: string;
3903
3959
  ai_search_model?: string;
3960
+ [key: string]: unknown;
3904
3961
  };
3905
- export type AiSearchInstance = {
3962
+ // ============ AI Search Item Types ============
3963
+ export type AiSearchItemInfo = {
3906
3964
  id: string;
3907
- enable?: boolean;
3908
- type?: "r2" | "web-crawler";
3909
- source?: string;
3965
+ key: string;
3966
+ status:
3967
+ | "completed"
3968
+ | "error"
3969
+ | "skipped"
3970
+ | "queued"
3971
+ | "processing"
3972
+ | "outdated";
3973
+ metadata?: Record<string, unknown>;
3910
3974
  [key: string]: unknown;
3911
3975
  };
3912
- // AI Search Instance Service - Instance-level operations
3913
- export declare abstract class AiSearchInstanceService {
3976
+ export type AiSearchItemContentResult = {
3977
+ body: ReadableStream;
3978
+ contentType: string;
3979
+ filename: string;
3980
+ size: number;
3981
+ };
3982
+ export type AiSearchUploadItemOptions = {
3983
+ metadata?: Record<string, unknown>;
3984
+ };
3985
+ export type AiSearchListItemsParams = {
3986
+ page?: number;
3987
+ per_page?: number;
3988
+ };
3989
+ export type AiSearchListItemsResponse = {
3990
+ result: AiSearchItemInfo[];
3991
+ result_info?: {
3992
+ count: number;
3993
+ page: number;
3994
+ per_page: number;
3995
+ total_count: number;
3996
+ };
3997
+ };
3998
+ // ============ AI Search Job Types ============
3999
+ export type AiSearchJobInfo = {
4000
+ id: string;
4001
+ source: "user" | "schedule";
4002
+ description?: string;
4003
+ last_seen_at?: string;
4004
+ started_at?: string;
4005
+ ended_at?: string;
4006
+ end_reason?: string;
4007
+ };
4008
+ export type AiSearchJobLog = {
4009
+ id: number;
4010
+ message: string;
4011
+ message_type: number;
4012
+ created_at: number;
4013
+ };
4014
+ export type AiSearchCreateJobParams = {
4015
+ description?: string;
4016
+ };
4017
+ export type AiSearchListJobsParams = {
4018
+ page?: number;
4019
+ per_page?: number;
4020
+ };
4021
+ export type AiSearchListJobsResponse = {
4022
+ result: AiSearchJobInfo[];
4023
+ result_info?: {
4024
+ count: number;
4025
+ page: number;
4026
+ per_page: number;
4027
+ total_count: number;
4028
+ };
4029
+ };
4030
+ export type AiSearchJobLogsParams = {
4031
+ page?: number;
4032
+ per_page?: number;
4033
+ };
4034
+ export type AiSearchJobLogsResponse = {
4035
+ result: AiSearchJobLog[];
4036
+ result_info?: {
4037
+ count: number;
4038
+ page: number;
4039
+ per_page: number;
4040
+ total_count: number;
4041
+ };
4042
+ };
4043
+ // ============ AI Search Sub-Service Classes ============
4044
+ /**
4045
+ * Single item service for an AI Search instance.
4046
+ * Provides info, delete, and download operations on a specific item.
4047
+ */
4048
+ export declare abstract class AiSearchItem {
4049
+ /** Get metadata about this item. */
4050
+ info(): Promise<AiSearchItemInfo>;
4051
+ /**
4052
+ * Download the item's content.
4053
+ * @returns Object with body stream, content type, filename, and size.
4054
+ */
4055
+ download(): Promise<AiSearchItemContentResult>;
4056
+ }
4057
+ /**
4058
+ * Items collection service for an AI Search instance.
4059
+ * Provides list, upload, and access to individual items.
4060
+ */
4061
+ export declare abstract class AiSearchItems {
4062
+ /** List items in this instance. */
4063
+ list(params?: AiSearchListItemsParams): Promise<AiSearchListItemsResponse>;
4064
+ /**
4065
+ * Upload a file as an item.
4066
+ * @param name Filename for the uploaded item.
4067
+ * @param content File content as a ReadableStream, ArrayBuffer, or string.
4068
+ * @param options Optional metadata to attach to the item.
4069
+ * @returns The created item info.
4070
+ */
4071
+ upload(
4072
+ name: string,
4073
+ content: ReadableStream | ArrayBuffer | string,
4074
+ options?: AiSearchUploadItemOptions,
4075
+ ): Promise<AiSearchItemInfo>;
4076
+ /**
4077
+ * Upload a file and poll until processing completes.
4078
+ * @param name Filename for the uploaded item.
4079
+ * @param content File content as a ReadableStream, ArrayBuffer, or string.
4080
+ * @param options Optional metadata to attach to the item.
4081
+ * @returns The item info after processing completes (or timeout).
4082
+ */
4083
+ uploadAndPoll(
4084
+ name: string,
4085
+ content: ReadableStream | ArrayBuffer | string,
4086
+ options?: AiSearchUploadItemOptions,
4087
+ ): Promise<AiSearchItemInfo>;
4088
+ /**
4089
+ * Get an item by ID.
4090
+ * @param itemId The item identifier.
4091
+ * @returns Item service for info, delete, and download operations.
4092
+ */
4093
+ get(itemId: string): AiSearchItem;
4094
+ /** Delete this item from the instance.
4095
+ * @param itemId The item identifier.
4096
+ */
4097
+ delete(itemId: string): Promise<void>;
4098
+ }
4099
+ /**
4100
+ * Single job service for an AI Search instance.
4101
+ * Provides info and logs for a specific job.
4102
+ */
4103
+ export declare abstract class AiSearchJob {
4104
+ /** Get metadata about this job. */
4105
+ info(): Promise<AiSearchJobInfo>;
4106
+ /** Get logs for this job. */
4107
+ logs(params?: AiSearchJobLogsParams): Promise<AiSearchJobLogsResponse>;
4108
+ }
4109
+ /**
4110
+ * Jobs collection service for an AI Search instance.
4111
+ * Provides list, create, and access to individual jobs.
4112
+ */
4113
+ export declare abstract class AiSearchJobs {
4114
+ /** List jobs for this instance. */
4115
+ list(params?: AiSearchListJobsParams): Promise<AiSearchListJobsResponse>;
4116
+ /**
4117
+ * Create a new indexing job.
4118
+ * @param params Optional job parameters.
4119
+ * @returns The created job info.
4120
+ */
4121
+ create(params?: AiSearchCreateJobParams): Promise<AiSearchJobInfo>;
4122
+ /**
4123
+ * Get a job by ID.
4124
+ * @param jobId The job identifier.
4125
+ * @returns Job service for info and logs operations.
4126
+ */
4127
+ get(jobId: string): AiSearchJob;
4128
+ }
4129
+ // ============ AI Search Binding Classes ============
4130
+ /**
4131
+ * Instance-level AI Search service.
4132
+ *
4133
+ * Used as:
4134
+ * - The return type of `AiSearchNamespace.get(name)` (namespace binding)
4135
+ * - The type of `env.BLOG_SEARCH` (single instance binding via `ai_search`)
4136
+ *
4137
+ * Provides search, chat, update, stats, items, and jobs operations.
4138
+ *
4139
+ * @example
4140
+ * ```ts
4141
+ * // Via namespace binding
4142
+ * const instance = env.AI_SEARCH.get("blog");
4143
+ * const results = await instance.search({
4144
+ * messages: [{ role: "user", content: "How does caching work?" }],
4145
+ * });
4146
+ *
4147
+ * // Via single instance binding
4148
+ * const results = await env.BLOG_SEARCH.search({
4149
+ * messages: [{ role: "user", content: "How does caching work?" }],
4150
+ * });
4151
+ * ```
4152
+ */
4153
+ export declare abstract class AiSearchInstance {
3914
4154
  /**
3915
4155
  * Search the AI Search instance for relevant chunks.
3916
- * @param params Search request with messages and AI search options
3917
- * @returns Search response with matching chunks
4156
+ * @param params Search request with messages and optional AI search options.
4157
+ * @returns Search response with matching chunks and search query.
3918
4158
  */
3919
4159
  search(params: AiSearchSearchRequest): Promise<AiSearchSearchResponse>;
4160
+ /**
4161
+ * Generate chat completions with AI Search context (streaming).
4162
+ * @param params Chat completions request with stream: true.
4163
+ * @returns ReadableStream of server-sent events.
4164
+ */
4165
+ chatCompletions(
4166
+ params: AiSearchChatCompletionsRequest & {
4167
+ stream: true;
4168
+ },
4169
+ ): Promise<ReadableStream>;
3920
4170
  /**
3921
4171
  * Generate chat completions with AI Search context.
3922
- * @param params Chat completions request with optional streaming
3923
- * @returns Response object (if streaming) or chat completion result
4172
+ * @param params Chat completions request.
4173
+ * @returns Chat completion response with choices and RAG chunks.
3924
4174
  */
3925
4175
  chatCompletions(
3926
4176
  params: AiSearchChatCompletionsRequest,
3927
- ): Promise<Response | object>;
4177
+ ): Promise<AiSearchChatCompletionsResponse>;
3928
4178
  /**
3929
- * Delete this AI Search instance.
4179
+ * Update the instance configuration.
4180
+ * @param config Partial configuration to update.
4181
+ * @returns Updated instance info.
3930
4182
  */
3931
- delete(): Promise<void>;
4183
+ update(config: Partial<AiSearchConfig>): Promise<AiSearchInstanceInfo>;
4184
+ /** Get metadata about this instance. */
4185
+ info(): Promise<AiSearchInstanceInfo>;
4186
+ /**
4187
+ * Get instance statistics (item count, indexing status, etc.).
4188
+ * @returns Statistics with counts per status and last activity time.
4189
+ */
4190
+ stats(): Promise<AiSearchStatsResponse>;
4191
+ /** Items collection — list, upload, and manage items in this instance. */
4192
+ get items(): AiSearchItems;
4193
+ /** Jobs collection — list, create, and inspect indexing jobs. */
4194
+ get jobs(): AiSearchJobs;
3932
4195
  }
3933
- // AI Search Account Service - Account-level operations
3934
- export declare abstract class AiSearchAccountService {
4196
+ /**
4197
+ * Namespace-level AI Search service.
4198
+ *
4199
+ * Used as the type of `env.AI_SEARCH` (namespace binding via `ai_search_namespaces`).
4200
+ * Scoped to a single namespace. Provides dynamic instance access, creation, and deletion.
4201
+ *
4202
+ * @example
4203
+ * ```ts
4204
+ * // Access an instance within the namespace
4205
+ * const blog = env.AI_SEARCH.get("blog");
4206
+ * const results = await blog.search({
4207
+ * messages: [{ role: "user", content: "How does caching work?" }],
4208
+ * });
4209
+ *
4210
+ * // List all instances in the namespace
4211
+ * const instances = await env.AI_SEARCH.list();
4212
+ *
4213
+ * // Create a new instance with built-in storage
4214
+ * const tenant = await env.AI_SEARCH.create({
4215
+ * id: "tenant-123",
4216
+ * });
4217
+ *
4218
+ * // Upload items into the instance
4219
+ * await tenant.items.upload("doc.pdf", fileContent);
4220
+ *
4221
+ * // Delete an instance
4222
+ * await env.AI_SEARCH.delete("tenant-123");
4223
+ * ```
4224
+ */
4225
+ export declare abstract class AiSearchNamespace {
3935
4226
  /**
3936
- * List all AI Search instances in the account.
3937
- * @returns Array of AI Search instances
4227
+ * Get an instance by name within the bound namespace.
4228
+ * @param name Instance name.
4229
+ * @returns Instance service for search, chat, update, stats, items, and jobs.
4230
+ */
4231
+ get(name: string): AiSearchInstance;
4232
+ /**
4233
+ * List all instances in the bound namespace.
4234
+ * @returns Array of instance metadata.
3938
4235
  */
3939
4236
  list(): Promise<AiSearchListResponse>;
3940
4237
  /**
3941
- * Get an AI Search instance by ID.
3942
- * @param name Instance ID
3943
- * @returns Instance service for performing operations
4238
+ * Create a new instance within the bound namespace.
4239
+ * @param config Instance configuration. Only `id` is required — omit `type` and `source` to create with built-in storage.
4240
+ * @returns Instance service for the newly created instance.
4241
+ *
4242
+ * @example
4243
+ * ```ts
4244
+ * // Create with built-in storage (upload items manually)
4245
+ * const instance = await env.AI_SEARCH.create({ id: "my-search" });
4246
+ *
4247
+ * // Create with web crawler source
4248
+ * const instance = await env.AI_SEARCH.create({
4249
+ * id: "docs-search",
4250
+ * type: "web-crawler",
4251
+ * source: "https://developers.cloudflare.com",
4252
+ * });
4253
+ * ```
3944
4254
  */
3945
- get(name: string): AiSearchInstanceService;
4255
+ create(config: AiSearchConfig): Promise<AiSearchInstance>;
3946
4256
  /**
3947
- * Create a new AI Search instance.
3948
- * @param config Instance configuration
3949
- * @returns Instance service for performing operations
4257
+ * Delete an instance from the bound namespace.
4258
+ * @param name Instance name to delete.
3950
4259
  */
3951
- create(config: AiSearchConfig): Promise<AiSearchInstanceService>;
4260
+ delete(name: string): Promise<void>;
3952
4261
  }
3953
4262
  export type AiImageClassificationInput = {
3954
4263
  image: number[];
@@ -4224,6 +4533,402 @@ export declare abstract class BaseAiTranslation {
4224
4533
  inputs: AiTranslationInput;
4225
4534
  postProcessedOutputs: AiTranslationOutput;
4226
4535
  }
4536
+ /**
4537
+ * Workers AI support for OpenAI's Chat Completions API
4538
+ */
4539
+ export type ChatCompletionContentPartText = {
4540
+ type: "text";
4541
+ text: string;
4542
+ };
4543
+ export type ChatCompletionContentPartImage = {
4544
+ type: "image_url";
4545
+ image_url: {
4546
+ url: string;
4547
+ detail?: "auto" | "low" | "high";
4548
+ };
4549
+ };
4550
+ export type ChatCompletionContentPartInputAudio = {
4551
+ type: "input_audio";
4552
+ input_audio: {
4553
+ /** Base64 encoded audio data. */
4554
+ data: string;
4555
+ format: "wav" | "mp3";
4556
+ };
4557
+ };
4558
+ export type ChatCompletionContentPartFile = {
4559
+ type: "file";
4560
+ file: {
4561
+ /** Base64 encoded file data. */
4562
+ file_data?: string;
4563
+ /** The ID of an uploaded file. */
4564
+ file_id?: string;
4565
+ filename?: string;
4566
+ };
4567
+ };
4568
+ export type ChatCompletionContentPartRefusal = {
4569
+ type: "refusal";
4570
+ refusal: string;
4571
+ };
4572
+ export type ChatCompletionContentPart =
4573
+ | ChatCompletionContentPartText
4574
+ | ChatCompletionContentPartImage
4575
+ | ChatCompletionContentPartInputAudio
4576
+ | ChatCompletionContentPartFile;
4577
+ export type FunctionDefinition = {
4578
+ name: string;
4579
+ description?: string;
4580
+ parameters?: Record<string, unknown>;
4581
+ strict?: boolean | null;
4582
+ };
4583
+ export type ChatCompletionFunctionTool = {
4584
+ type: "function";
4585
+ function: FunctionDefinition;
4586
+ };
4587
+ export type ChatCompletionCustomToolGrammarFormat = {
4588
+ type: "grammar";
4589
+ grammar: {
4590
+ definition: string;
4591
+ syntax: "lark" | "regex";
4592
+ };
4593
+ };
4594
+ export type ChatCompletionCustomToolTextFormat = {
4595
+ type: "text";
4596
+ };
4597
+ export type ChatCompletionCustomToolFormat =
4598
+ | ChatCompletionCustomToolTextFormat
4599
+ | ChatCompletionCustomToolGrammarFormat;
4600
+ export type ChatCompletionCustomTool = {
4601
+ type: "custom";
4602
+ custom: {
4603
+ name: string;
4604
+ description?: string;
4605
+ format?: ChatCompletionCustomToolFormat;
4606
+ };
4607
+ };
4608
+ export type ChatCompletionTool =
4609
+ | ChatCompletionFunctionTool
4610
+ | ChatCompletionCustomTool;
4611
+ export type ChatCompletionMessageFunctionToolCall = {
4612
+ id: string;
4613
+ type: "function";
4614
+ function: {
4615
+ name: string;
4616
+ /** JSON-encoded arguments string. */
4617
+ arguments: string;
4618
+ };
4619
+ };
4620
+ export type ChatCompletionMessageCustomToolCall = {
4621
+ id: string;
4622
+ type: "custom";
4623
+ custom: {
4624
+ name: string;
4625
+ input: string;
4626
+ };
4627
+ };
4628
+ export type ChatCompletionMessageToolCall =
4629
+ | ChatCompletionMessageFunctionToolCall
4630
+ | ChatCompletionMessageCustomToolCall;
4631
+ export type ChatCompletionToolChoiceFunction = {
4632
+ type: "function";
4633
+ function: {
4634
+ name: string;
4635
+ };
4636
+ };
4637
+ export type ChatCompletionToolChoiceCustom = {
4638
+ type: "custom";
4639
+ custom: {
4640
+ name: string;
4641
+ };
4642
+ };
4643
+ export type ChatCompletionToolChoiceAllowedTools = {
4644
+ type: "allowed_tools";
4645
+ allowed_tools: {
4646
+ mode: "auto" | "required";
4647
+ tools: Array<Record<string, unknown>>;
4648
+ };
4649
+ };
4650
+ export type ChatCompletionToolChoiceOption =
4651
+ | "none"
4652
+ | "auto"
4653
+ | "required"
4654
+ | ChatCompletionToolChoiceFunction
4655
+ | ChatCompletionToolChoiceCustom
4656
+ | ChatCompletionToolChoiceAllowedTools;
4657
+ export type DeveloperMessage = {
4658
+ role: "developer";
4659
+ content:
4660
+ | string
4661
+ | Array<{
4662
+ type: "text";
4663
+ text: string;
4664
+ }>;
4665
+ name?: string;
4666
+ };
4667
+ export type SystemMessage = {
4668
+ role: "system";
4669
+ content:
4670
+ | string
4671
+ | Array<{
4672
+ type: "text";
4673
+ text: string;
4674
+ }>;
4675
+ name?: string;
4676
+ };
4677
+ /**
4678
+ * Permissive merged content part used inside UserMessage arrays.
4679
+ *
4680
+ * Cabidela has a limitation where anyOf/oneOf with enum-based discrimination
4681
+ * inside nested array items does not correctly match different branches for
4682
+ * different array elements, so the schema uses a single merged object.
4683
+ */
4684
+ export type UserMessageContentPart = {
4685
+ type: "text" | "image_url" | "input_audio" | "file";
4686
+ text?: string;
4687
+ image_url?: {
4688
+ url?: string;
4689
+ detail?: "auto" | "low" | "high";
4690
+ };
4691
+ input_audio?: {
4692
+ data?: string;
4693
+ format?: "wav" | "mp3";
4694
+ };
4695
+ file?: {
4696
+ file_data?: string;
4697
+ file_id?: string;
4698
+ filename?: string;
4699
+ };
4700
+ };
4701
+ export type UserMessage = {
4702
+ role: "user";
4703
+ content: string | Array<UserMessageContentPart>;
4704
+ name?: string;
4705
+ };
4706
+ export type AssistantMessageContentPart = {
4707
+ type: "text" | "refusal";
4708
+ text?: string;
4709
+ refusal?: string;
4710
+ };
4711
+ export type AssistantMessage = {
4712
+ role: "assistant";
4713
+ content?: string | null | Array<AssistantMessageContentPart>;
4714
+ refusal?: string | null;
4715
+ name?: string;
4716
+ audio?: {
4717
+ id: string;
4718
+ };
4719
+ tool_calls?: Array<ChatCompletionMessageToolCall>;
4720
+ function_call?: {
4721
+ name: string;
4722
+ arguments: string;
4723
+ };
4724
+ };
4725
+ export type ToolMessage = {
4726
+ role: "tool";
4727
+ content:
4728
+ | string
4729
+ | Array<{
4730
+ type: "text";
4731
+ text: string;
4732
+ }>;
4733
+ tool_call_id: string;
4734
+ };
4735
+ export type FunctionMessage = {
4736
+ role: "function";
4737
+ content: string;
4738
+ name: string;
4739
+ };
4740
+ export type ChatCompletionMessageParam =
4741
+ | DeveloperMessage
4742
+ | SystemMessage
4743
+ | UserMessage
4744
+ | AssistantMessage
4745
+ | ToolMessage
4746
+ | FunctionMessage;
4747
+ export type ChatCompletionsResponseFormatText = {
4748
+ type: "text";
4749
+ };
4750
+ export type ChatCompletionsResponseFormatJSONObject = {
4751
+ type: "json_object";
4752
+ };
4753
+ export type ResponseFormatJSONSchema = {
4754
+ type: "json_schema";
4755
+ json_schema: {
4756
+ name: string;
4757
+ description?: string;
4758
+ schema?: Record<string, unknown>;
4759
+ strict?: boolean | null;
4760
+ };
4761
+ };
4762
+ export type ResponseFormat =
4763
+ | ChatCompletionsResponseFormatText
4764
+ | ChatCompletionsResponseFormatJSONObject
4765
+ | ResponseFormatJSONSchema;
4766
+ export type ChatCompletionsStreamOptions = {
4767
+ include_usage?: boolean;
4768
+ include_obfuscation?: boolean;
4769
+ };
4770
+ export type PredictionContent = {
4771
+ type: "content";
4772
+ content:
4773
+ | string
4774
+ | Array<{
4775
+ type: "text";
4776
+ text: string;
4777
+ }>;
4778
+ };
4779
+ export type AudioParams = {
4780
+ voice:
4781
+ | string
4782
+ | {
4783
+ id: string;
4784
+ };
4785
+ format: "wav" | "aac" | "mp3" | "flac" | "opus" | "pcm16";
4786
+ };
4787
+ export type WebSearchUserLocation = {
4788
+ type: "approximate";
4789
+ approximate: {
4790
+ city?: string;
4791
+ country?: string;
4792
+ region?: string;
4793
+ timezone?: string;
4794
+ };
4795
+ };
4796
+ export type WebSearchOptions = {
4797
+ search_context_size?: "low" | "medium" | "high";
4798
+ user_location?: WebSearchUserLocation;
4799
+ };
4800
+ export type ChatTemplateKwargs = {
4801
+ /** Whether to enable reasoning, enabled by default. */
4802
+ enable_thinking?: boolean;
4803
+ /** If false, preserves reasoning context between turns. */
4804
+ clear_thinking?: boolean;
4805
+ };
4806
+ /** Shared optional properties used by both Prompt and Messages input branches. */
4807
+ export type ChatCompletionsCommonOptions = {
4808
+ model?: string;
4809
+ audio?: AudioParams;
4810
+ frequency_penalty?: number | null;
4811
+ logit_bias?: Record<string, unknown> | null;
4812
+ logprobs?: boolean | null;
4813
+ top_logprobs?: number | null;
4814
+ max_tokens?: number | null;
4815
+ max_completion_tokens?: number | null;
4816
+ metadata?: Record<string, unknown> | null;
4817
+ modalities?: Array<"text" | "audio"> | null;
4818
+ n?: number | null;
4819
+ parallel_tool_calls?: boolean;
4820
+ prediction?: PredictionContent;
4821
+ presence_penalty?: number | null;
4822
+ reasoning_effort?: "low" | "medium" | "high" | null;
4823
+ chat_template_kwargs?: ChatTemplateKwargs;
4824
+ response_format?: ResponseFormat;
4825
+ seed?: number | null;
4826
+ service_tier?: "auto" | "default" | "flex" | "scale" | "priority" | null;
4827
+ stop?: string | Array<string> | null;
4828
+ store?: boolean | null;
4829
+ stream?: boolean | null;
4830
+ stream_options?: ChatCompletionsStreamOptions;
4831
+ temperature?: number | null;
4832
+ tool_choice?: ChatCompletionToolChoiceOption;
4833
+ tools?: Array<ChatCompletionTool>;
4834
+ top_p?: number | null;
4835
+ user?: string;
4836
+ web_search_options?: WebSearchOptions;
4837
+ function_call?:
4838
+ | "none"
4839
+ | "auto"
4840
+ | {
4841
+ name: string;
4842
+ };
4843
+ functions?: Array<FunctionDefinition>;
4844
+ };
4845
+ export type PromptTokensDetails = {
4846
+ cached_tokens?: number;
4847
+ audio_tokens?: number;
4848
+ };
4849
+ export type CompletionTokensDetails = {
4850
+ reasoning_tokens?: number;
4851
+ audio_tokens?: number;
4852
+ accepted_prediction_tokens?: number;
4853
+ rejected_prediction_tokens?: number;
4854
+ };
4855
+ export type CompletionUsage = {
4856
+ prompt_tokens: number;
4857
+ completion_tokens: number;
4858
+ total_tokens: number;
4859
+ prompt_tokens_details?: PromptTokensDetails;
4860
+ completion_tokens_details?: CompletionTokensDetails;
4861
+ };
4862
+ export type ChatCompletionTopLogprob = {
4863
+ token: string;
4864
+ logprob: number;
4865
+ bytes: Array<number> | null;
4866
+ };
4867
+ export type ChatCompletionTokenLogprob = {
4868
+ token: string;
4869
+ logprob: number;
4870
+ bytes: Array<number> | null;
4871
+ top_logprobs: Array<ChatCompletionTopLogprob>;
4872
+ };
4873
+ export type ChatCompletionAudio = {
4874
+ id: string;
4875
+ /** Base64 encoded audio bytes. */
4876
+ data: string;
4877
+ expires_at: number;
4878
+ transcript: string;
4879
+ };
4880
+ export type ChatCompletionUrlCitation = {
4881
+ type: "url_citation";
4882
+ url_citation: {
4883
+ url: string;
4884
+ title: string;
4885
+ start_index: number;
4886
+ end_index: number;
4887
+ };
4888
+ };
4889
+ export type ChatCompletionResponseMessage = {
4890
+ role: "assistant";
4891
+ content: string | null;
4892
+ refusal: string | null;
4893
+ annotations?: Array<ChatCompletionUrlCitation>;
4894
+ audio?: ChatCompletionAudio;
4895
+ tool_calls?: Array<ChatCompletionMessageToolCall>;
4896
+ function_call?: {
4897
+ name: string;
4898
+ arguments: string;
4899
+ } | null;
4900
+ };
4901
+ export type ChatCompletionLogprobs = {
4902
+ content: Array<ChatCompletionTokenLogprob> | null;
4903
+ refusal?: Array<ChatCompletionTokenLogprob> | null;
4904
+ };
4905
+ export type ChatCompletionChoice = {
4906
+ index: number;
4907
+ message: ChatCompletionResponseMessage;
4908
+ finish_reason:
4909
+ | "stop"
4910
+ | "length"
4911
+ | "tool_calls"
4912
+ | "content_filter"
4913
+ | "function_call";
4914
+ logprobs: ChatCompletionLogprobs | null;
4915
+ };
4916
+ export type ChatCompletionsPromptInput = {
4917
+ prompt: string;
4918
+ } & ChatCompletionsCommonOptions;
4919
+ export type ChatCompletionsMessagesInput = {
4920
+ messages: Array<ChatCompletionMessageParam>;
4921
+ } & ChatCompletionsCommonOptions;
4922
+ export type ChatCompletionsOutput = {
4923
+ id: string;
4924
+ object: string;
4925
+ created: number;
4926
+ model: string;
4927
+ choices: Array<ChatCompletionChoice>;
4928
+ usage?: CompletionUsage;
4929
+ system_fingerprint?: string | null;
4930
+ service_tier?: "auto" | "default" | "flex" | "scale" | "priority" | null;
4931
+ };
4227
4932
  /**
4228
4933
  * Workers AI support for OpenAI's Responses API
4229
4934
  * Reference: https://github.com/openai/openai-node/blob/master/src/resources/responses/responses.ts
@@ -4646,6 +5351,12 @@ export type ReasoningEffort = "minimal" | "low" | "medium" | "high" | null;
4646
5351
  export type StreamOptions = {
4647
5352
  include_obfuscation?: boolean;
4648
5353
  };
5354
+ /** Marks keys from T that aren't in U as optional never */
5355
+ export type Without<T, U> = {
5356
+ [P in Exclude<keyof T, keyof U>]?: never;
5357
+ };
5358
+ /** Either T or U, but not both (mutually exclusive) */
5359
+ export type XOR<T, U> = (T & Without<U, T>) | (U & Without<T, U>);
4649
5360
  export type Ai_Cf_Baai_Bge_Base_En_V1_5_Input =
4650
5361
  | {
4651
5362
  text: string | string[];
@@ -4938,10 +5649,12 @@ export declare abstract class Base_Ai_Cf_Openai_Whisper_Tiny_En {
4938
5649
  postProcessedOutputs: Ai_Cf_Openai_Whisper_Tiny_En_Output;
4939
5650
  }
4940
5651
  export interface Ai_Cf_Openai_Whisper_Large_V3_Turbo_Input {
4941
- /**
4942
- * Base64 encoded value of the audio data.
4943
- */
4944
- audio: string;
5652
+ audio:
5653
+ | string
5654
+ | {
5655
+ body?: object;
5656
+ contentType?: string;
5657
+ };
4945
5658
  /**
4946
5659
  * Supported tasks are 'translate' or 'transcribe'.
4947
5660
  */
@@ -4959,9 +5672,33 @@ export interface Ai_Cf_Openai_Whisper_Large_V3_Turbo_Input {
4959
5672
  */
4960
5673
  initial_prompt?: string;
4961
5674
  /**
4962
- * The prefix it appended the the beginning of the output of the transcription and can guide the transcription result.
5675
+ * The prefix appended to the beginning of the output of the transcription and can guide the transcription result.
4963
5676
  */
4964
5677
  prefix?: string;
5678
+ /**
5679
+ * The number of beams to use in beam search decoding. Higher values may improve accuracy at the cost of speed.
5680
+ */
5681
+ beam_size?: number;
5682
+ /**
5683
+ * Whether to condition on previous text during transcription. Setting to false may help prevent hallucination loops.
5684
+ */
5685
+ condition_on_previous_text?: boolean;
5686
+ /**
5687
+ * Threshold for detecting no-speech segments. Segments with no-speech probability above this value are skipped.
5688
+ */
5689
+ no_speech_threshold?: number;
5690
+ /**
5691
+ * Threshold for filtering out segments with high compression ratio, which often indicate repetitive or hallucinated text.
5692
+ */
5693
+ compression_ratio_threshold?: number;
5694
+ /**
5695
+ * Threshold for filtering out segments with low average log probability, indicating low confidence.
5696
+ */
5697
+ log_prob_threshold?: number;
5698
+ /**
5699
+ * Optional threshold (in seconds) to skip silent periods that may cause hallucinations.
5700
+ */
5701
+ hallucination_silence_threshold?: number;
4965
5702
  }
4966
5703
  export interface Ai_Cf_Openai_Whisper_Large_V3_Turbo_Output {
4967
5704
  transcription_info?: {
@@ -5108,11 +5845,11 @@ export interface Ai_Cf_Baai_Bge_M3_Input_Embedding_1 {
5108
5845
  truncate_inputs?: boolean;
5109
5846
  }
5110
5847
  export type Ai_Cf_Baai_Bge_M3_Output =
5111
- | Ai_Cf_Baai_Bge_M3_Ouput_Query
5848
+ | Ai_Cf_Baai_Bge_M3_Output_Query
5112
5849
  | Ai_Cf_Baai_Bge_M3_Output_EmbeddingFor_Contexts
5113
- | Ai_Cf_Baai_Bge_M3_Ouput_Embedding
5850
+ | Ai_Cf_Baai_Bge_M3_Output_Embedding
5114
5851
  | Ai_Cf_Baai_Bge_M3_AsyncResponse;
5115
- export interface Ai_Cf_Baai_Bge_M3_Ouput_Query {
5852
+ export interface Ai_Cf_Baai_Bge_M3_Output_Query {
5116
5853
  response?: {
5117
5854
  /**
5118
5855
  * Index of the context in the request
@@ -5132,7 +5869,7 @@ export interface Ai_Cf_Baai_Bge_M3_Output_EmbeddingFor_Contexts {
5132
5869
  */
5133
5870
  pooling?: "mean" | "cls";
5134
5871
  }
5135
- export interface Ai_Cf_Baai_Bge_M3_Ouput_Embedding {
5872
+ export interface Ai_Cf_Baai_Bge_M3_Output_Embedding {
5136
5873
  shape?: number[];
5137
5874
  /**
5138
5875
  * Embeddings of the requested text values
@@ -5237,7 +5974,7 @@ export interface Ai_Cf_Meta_Llama_3_2_11B_Vision_Instruct_Messages {
5237
5974
  */
5238
5975
  role?: string;
5239
5976
  /**
5240
- * 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
5977
+ * The tool call id. If you don't know what to put here you can fall back to 000000001
5241
5978
  */
5242
5979
  tool_call_id?: string;
5243
5980
  content?:
@@ -5492,10 +6229,18 @@ export interface Ai_Cf_Meta_Llama_3_3_70B_Instruct_Fp8_Fast_Messages {
5492
6229
  * The role of the message sender (e.g., 'user', 'assistant', 'system', 'tool').
5493
6230
  */
5494
6231
  role: string;
5495
- /**
5496
- * The content of the message as a string.
5497
- */
5498
- content: string;
6232
+ content:
6233
+ | string
6234
+ | {
6235
+ /**
6236
+ * Type of the content (text)
6237
+ */
6238
+ type?: string;
6239
+ /**
6240
+ * Text content
6241
+ */
6242
+ text?: string;
6243
+ }[];
5499
6244
  }[];
5500
6245
  functions?: {
5501
6246
  name: string;
@@ -6151,7 +6896,7 @@ export interface Ai_Cf_Qwen_Qwq_32B_Messages {
6151
6896
  */
6152
6897
  role?: string;
6153
6898
  /**
6154
- * 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
6899
+ * The tool call id. If you don't know what to put here you can fall back to 000000001
6155
6900
  */
6156
6901
  tool_call_id?: string;
6157
6902
  content?:
@@ -6278,7 +7023,7 @@ export interface Ai_Cf_Qwen_Qwq_32B_Messages {
6278
7023
  }
6279
7024
  )[];
6280
7025
  /**
6281
- * JSON schema that should be fulfilled for the response.
7026
+ * JSON schema that should be fufilled for the response.
6282
7027
  */
6283
7028
  guided_json?: object;
6284
7029
  /**
@@ -6552,7 +7297,7 @@ export interface Ai_Cf_Mistralai_Mistral_Small_3_1_24B_Instruct_Messages {
6552
7297
  }
6553
7298
  )[];
6554
7299
  /**
6555
- * JSON schema that should be fulfilled for the response.
7300
+ * JSON schema that should be fufilled for the response.
6556
7301
  */
6557
7302
  guided_json?: object;
6558
7303
  /**
@@ -6645,7 +7390,7 @@ export interface Ai_Cf_Google_Gemma_3_12B_It_Prompt {
6645
7390
  */
6646
7391
  prompt: string;
6647
7392
  /**
6648
- * JSON schema that should be fulfilled for the response.
7393
+ * JSON schema that should be fufilled for the response.
6649
7394
  */
6650
7395
  guided_json?: object;
6651
7396
  /**
@@ -6809,7 +7554,7 @@ export interface Ai_Cf_Google_Gemma_3_12B_It_Messages {
6809
7554
  }
6810
7555
  )[];
6811
7556
  /**
6812
- * JSON schema that should be fulfilled for the response.
7557
+ * JSON schema that should be fufilled for the response.
6813
7558
  */
6814
7559
  guided_json?: object;
6815
7560
  /**
@@ -7090,7 +7835,7 @@ export interface Ai_Cf_Meta_Llama_4_Scout_17B_16E_Instruct_Messages {
7090
7835
  )[];
7091
7836
  response_format?: Ai_Cf_Meta_Llama_4_Scout_17B_16E_Instruct_JSON_Mode;
7092
7837
  /**
7093
- * JSON schema that should be fulfilled for the response.
7838
+ * JSON schema that should be fufilled for the response.
7094
7839
  */
7095
7840
  guided_json?: object;
7096
7841
  /**
@@ -7329,7 +8074,7 @@ export interface Ai_Cf_Meta_Llama_4_Scout_17B_16E_Instruct_Messages_Inner {
7329
8074
  )[];
7330
8075
  response_format?: Ai_Cf_Meta_Llama_4_Scout_17B_16E_Instruct_JSON_Mode;
7331
8076
  /**
7332
- * JSON schema that should be fulfilled for the response.
8077
+ * JSON schema that should be fufilled for the response.
7333
8078
  */
7334
8079
  guided_json?: object;
7335
8080
  /**
@@ -7494,10 +8239,18 @@ export interface Ai_Cf_Qwen_Qwen3_30B_A3B_Fp8_Messages {
7494
8239
  * The role of the message sender (e.g., 'user', 'assistant', 'system', 'tool').
7495
8240
  */
7496
8241
  role: string;
7497
- /**
7498
- * The content of the message as a string.
7499
- */
7500
- content: string;
8242
+ content:
8243
+ | string
8244
+ | {
8245
+ /**
8246
+ * Type of the content (text)
8247
+ */
8248
+ type?: string;
8249
+ /**
8250
+ * Text content
8251
+ */
8252
+ text?: string;
8253
+ }[];
7501
8254
  }[];
7502
8255
  functions?: {
7503
8256
  name: string;
@@ -7709,10 +8462,18 @@ export interface Ai_Cf_Qwen_Qwen3_30B_A3B_Fp8_Messages_1 {
7709
8462
  * The role of the message sender (e.g., 'user', 'assistant', 'system', 'tool').
7710
8463
  */
7711
8464
  role: string;
7712
- /**
7713
- * The content of the message as a string.
7714
- */
7715
- content: string;
8465
+ content:
8466
+ | string
8467
+ | {
8468
+ /**
8469
+ * Type of the content (text)
8470
+ */
8471
+ type?: string;
8472
+ /**
8473
+ * Text content
8474
+ */
8475
+ text?: string;
8476
+ }[];
7716
8477
  }[];
7717
8478
  functions?: {
7718
8479
  name: string;
@@ -8280,12 +9041,12 @@ export declare abstract class Base_Ai_Cf_Pipecat_Ai_Smart_Turn_V2 {
8280
9041
  postProcessedOutputs: Ai_Cf_Pipecat_Ai_Smart_Turn_V2_Output;
8281
9042
  }
8282
9043
  export declare abstract class Base_Ai_Cf_Openai_Gpt_Oss_120B {
8283
- inputs: ResponsesInput;
8284
- postProcessedOutputs: ResponsesOutput;
9044
+ inputs: XOR<ResponsesInput, ChatCompletionsInput>;
9045
+ postProcessedOutputs: XOR<ResponsesOutput, ChatCompletionsOutput>;
8285
9046
  }
8286
9047
  export declare abstract class Base_Ai_Cf_Openai_Gpt_Oss_20B {
8287
- inputs: ResponsesInput;
8288
- postProcessedOutputs: ResponsesOutput;
9048
+ inputs: XOR<ResponsesInput, ChatCompletionsInput>;
9049
+ postProcessedOutputs: XOR<ResponsesOutput, ChatCompletionsOutput>;
8289
9050
  }
8290
9051
  export interface Ai_Cf_Leonardo_Phoenix_1_0_Input {
8291
9052
  /**
@@ -8417,7 +9178,7 @@ export interface Ai_Cf_Ai4Bharat_Indictrans2_En_Indic_1B_Input {
8417
9178
  */
8418
9179
  text: string | string[];
8419
9180
  /**
8420
- * Target language to translate to
9181
+ * Target langauge to translate to
8421
9182
  */
8422
9183
  target_language:
8423
9184
  | "asm_Beng"
@@ -8533,10 +9294,18 @@ export interface Ai_Cf_Aisingapore_Gemma_Sea_Lion_V4_27B_It_Messages {
8533
9294
  * The role of the message sender (e.g., 'user', 'assistant', 'system', 'tool').
8534
9295
  */
8535
9296
  role: string;
8536
- /**
8537
- * The content of the message as a string.
8538
- */
8539
- content: string;
9297
+ content:
9298
+ | string
9299
+ | {
9300
+ /**
9301
+ * Type of the content (text)
9302
+ */
9303
+ type?: string;
9304
+ /**
9305
+ * Text content
9306
+ */
9307
+ text?: string;
9308
+ }[];
8540
9309
  }[];
8541
9310
  functions?: {
8542
9311
  name: string;
@@ -8748,10 +9517,18 @@ export interface Ai_Cf_Aisingapore_Gemma_Sea_Lion_V4_27B_It_Messages_1 {
8748
9517
  * The role of the message sender (e.g., 'user', 'assistant', 'system', 'tool').
8749
9518
  */
8750
9519
  role: string;
8751
- /**
8752
- * The content of the message as a string.
8753
- */
8754
- content: string;
9520
+ content:
9521
+ | string
9522
+ | {
9523
+ /**
9524
+ * Type of the content (text)
9525
+ */
9526
+ type?: string;
9527
+ /**
9528
+ * Text content
9529
+ */
9530
+ text?: string;
9531
+ }[];
8755
9532
  }[];
8756
9533
  functions?: {
8757
9534
  name: string;
@@ -9306,6 +10083,66 @@ export declare abstract class Base_Ai_Cf_Deepgram_Aura_2_Es {
9306
10083
  inputs: Ai_Cf_Deepgram_Aura_2_Es_Input;
9307
10084
  postProcessedOutputs: Ai_Cf_Deepgram_Aura_2_Es_Output;
9308
10085
  }
10086
+ export interface Ai_Cf_Black_Forest_Labs_Flux_2_Dev_Input {
10087
+ multipart: {
10088
+ body?: object;
10089
+ contentType?: string;
10090
+ };
10091
+ }
10092
+ export interface Ai_Cf_Black_Forest_Labs_Flux_2_Dev_Output {
10093
+ /**
10094
+ * Generated image as Base64 string.
10095
+ */
10096
+ image?: string;
10097
+ }
10098
+ export declare abstract class Base_Ai_Cf_Black_Forest_Labs_Flux_2_Dev {
10099
+ inputs: Ai_Cf_Black_Forest_Labs_Flux_2_Dev_Input;
10100
+ postProcessedOutputs: Ai_Cf_Black_Forest_Labs_Flux_2_Dev_Output;
10101
+ }
10102
+ export interface Ai_Cf_Black_Forest_Labs_Flux_2_Klein_4B_Input {
10103
+ multipart: {
10104
+ body?: object;
10105
+ contentType?: string;
10106
+ };
10107
+ }
10108
+ export interface Ai_Cf_Black_Forest_Labs_Flux_2_Klein_4B_Output {
10109
+ /**
10110
+ * Generated image as Base64 string.
10111
+ */
10112
+ image?: string;
10113
+ }
10114
+ export declare abstract class Base_Ai_Cf_Black_Forest_Labs_Flux_2_Klein_4B {
10115
+ inputs: Ai_Cf_Black_Forest_Labs_Flux_2_Klein_4B_Input;
10116
+ postProcessedOutputs: Ai_Cf_Black_Forest_Labs_Flux_2_Klein_4B_Output;
10117
+ }
10118
+ export interface Ai_Cf_Black_Forest_Labs_Flux_2_Klein_9B_Input {
10119
+ multipart: {
10120
+ body?: object;
10121
+ contentType?: string;
10122
+ };
10123
+ }
10124
+ export interface Ai_Cf_Black_Forest_Labs_Flux_2_Klein_9B_Output {
10125
+ /**
10126
+ * Generated image as Base64 string.
10127
+ */
10128
+ image?: string;
10129
+ }
10130
+ export declare abstract class Base_Ai_Cf_Black_Forest_Labs_Flux_2_Klein_9B {
10131
+ inputs: Ai_Cf_Black_Forest_Labs_Flux_2_Klein_9B_Input;
10132
+ postProcessedOutputs: Ai_Cf_Black_Forest_Labs_Flux_2_Klein_9B_Output;
10133
+ }
10134
+ export declare abstract class Base_Ai_Cf_Zai_Org_Glm_4_7_Flash {
10135
+ inputs: ChatCompletionsInput;
10136
+ postProcessedOutputs: ChatCompletionsOutput;
10137
+ }
10138
+ export declare abstract class Base_Ai_Cf_Moonshotai_Kimi_K2_5 {
10139
+ inputs: ChatCompletionsInput;
10140
+ postProcessedOutputs: ChatCompletionsOutput;
10141
+ }
10142
+ export declare abstract class Base_Ai_Cf_Nvidia_Nemotron_3_120B_A12B {
10143
+ inputs: ChatCompletionsInput;
10144
+ postProcessedOutputs: ChatCompletionsOutput;
10145
+ }
9309
10146
  export interface AiModels {
9310
10147
  "@cf/huggingface/distilbert-sst-2-int8": BaseAiTextClassification;
9311
10148
  "@cf/stabilityai/stable-diffusion-xl-base-1.0": BaseAiTextToImage;
@@ -9324,7 +10161,6 @@ export interface AiModels {
9324
10161
  "@hf/thebloke/zephyr-7b-beta-awq": BaseAiTextGeneration;
9325
10162
  "@hf/thebloke/openhermes-2.5-mistral-7b-awq": BaseAiTextGeneration;
9326
10163
  "@hf/thebloke/neural-chat-7b-v3-1-awq": BaseAiTextGeneration;
9327
- "@hf/thebloke/llamaguard-7b-awq": BaseAiTextGeneration;
9328
10164
  "@hf/thebloke/deepseek-coder-6.7b-base-awq": BaseAiTextGeneration;
9329
10165
  "@hf/thebloke/deepseek-coder-6.7b-instruct-awq": BaseAiTextGeneration;
9330
10166
  "@cf/deepseek-ai/deepseek-math-7b-instruct": BaseAiTextGeneration;
@@ -9391,6 +10227,12 @@ export interface AiModels {
9391
10227
  "@cf/deepgram/flux": Base_Ai_Cf_Deepgram_Flux;
9392
10228
  "@cf/deepgram/aura-2-en": Base_Ai_Cf_Deepgram_Aura_2_En;
9393
10229
  "@cf/deepgram/aura-2-es": Base_Ai_Cf_Deepgram_Aura_2_Es;
10230
+ "@cf/black-forest-labs/flux-2-dev": Base_Ai_Cf_Black_Forest_Labs_Flux_2_Dev;
10231
+ "@cf/black-forest-labs/flux-2-klein-4b": Base_Ai_Cf_Black_Forest_Labs_Flux_2_Klein_4B;
10232
+ "@cf/black-forest-labs/flux-2-klein-9b": Base_Ai_Cf_Black_Forest_Labs_Flux_2_Klein_9B;
10233
+ "@cf/zai-org/glm-4.7-flash": Base_Ai_Cf_Zai_Org_Glm_4_7_Flash;
10234
+ "@cf/moonshotai/kimi-k2.5": Base_Ai_Cf_Moonshotai_Kimi_K2_5;
10235
+ "@cf/nvidia/nemotron-3-120b-a12b": Base_Ai_Cf_Nvidia_Nemotron_3_120B_A12B;
9394
10236
  }
9395
10237
  export type AiOptions = {
9396
10238
  /**
@@ -9416,6 +10258,7 @@ export type AiOptions = {
9416
10258
  returnRawResponse?: boolean;
9417
10259
  prefix?: string;
9418
10260
  extraHeaders?: object;
10261
+ signal?: AbortSignal;
9419
10262
  };
9420
10263
  export type AiModelsSearchParams = {
9421
10264
  author?: string;
@@ -9442,6 +10285,16 @@ export type AiModelsSearchObject = {
9442
10285
  value: string;
9443
10286
  }[];
9444
10287
  };
10288
+ export type ChatCompletionsBase = XOR<
10289
+ ChatCompletionsPromptInput,
10290
+ ChatCompletionsMessagesInput
10291
+ >;
10292
+ export type ChatCompletionsInput = XOR<
10293
+ ChatCompletionsBase,
10294
+ {
10295
+ requests: ChatCompletionsBase[];
10296
+ }
10297
+ >;
9445
10298
  export interface InferenceUpstreamError extends Error {}
9446
10299
  export interface AiInternalError extends Error {}
9447
10300
  export type AiModelListType = Record<string, any>;
@@ -9451,46 +10304,16 @@ export declare abstract class Ai<
9451
10304
  aiGatewayLogId: string | null;
9452
10305
  gateway(gatewayId: string): AiGateway;
9453
10306
  /**
9454
- * Access the AI Search API for managing AI-powered search instances.
9455
- *
9456
- * This is the new API that replaces AutoRAG with better namespace separation:
9457
- * - Account-level operations: `list()`, `create()`
9458
- * - Instance-level operations: `get(id).search()`, `get(id).chatCompletions()`, `get(id).delete()`
9459
- *
9460
- * @example
9461
- * ```typescript
9462
- * // List all AI Search instances
9463
- * const instances = await env.AI.aiSearch.list();
9464
- *
9465
- * // Search an instance
9466
- * const results = await env.AI.aiSearch.get('my-search').search({
9467
- * messages: [{ role: 'user', content: 'What is the policy?' }],
9468
- * ai_search_options: {
9469
- * retrieval: { max_num_results: 10 }
9470
- * }
9471
- * });
9472
- *
9473
- * // Generate chat completions with AI Search context
9474
- * const response = await env.AI.aiSearch.get('my-search').chatCompletions({
9475
- * messages: [{ role: 'user', content: 'What is the policy?' }],
9476
- * model: '@cf/meta/llama-3.3-70b-instruct-fp8-fast'
9477
- * });
9478
- * ```
10307
+ * @deprecated Use the standalone `ai_search_namespaces` or `ai_search` Workers bindings instead.
10308
+ * See https://developers.cloudflare.com/ai-search/usage/workers-binding/
9479
10309
  */
9480
- aiSearch(): AiSearchAccountService;
10310
+ aiSearch(): AiSearchNamespace;
9481
10311
  /**
9482
10312
  * @deprecated AutoRAG has been replaced by AI Search.
9483
- * Use `env.AI.aiSearch` instead for better API design and new features.
9484
- *
9485
- * Migration guide:
9486
- * - `env.AI.autorag().list()` → `env.AI.aiSearch.list()`
9487
- * - `env.AI.autorag('id').search({ query: '...' })` → `env.AI.aiSearch.get('id').search({ messages: [{ role: 'user', content: '...' }] })`
9488
- * - `env.AI.autorag('id').aiSearch(...)` → `env.AI.aiSearch.get('id').chatCompletions(...)`
10313
+ * Use the standalone `ai_search_namespaces` or `ai_search` Workers bindings instead.
10314
+ * See https://developers.cloudflare.com/ai-search/usage/workers-binding/
9489
10315
  *
9490
- * Note: The old API continues to work for backwards compatibility, but new projects should use AI Search.
9491
- *
9492
- * @see AiSearchAccountService
9493
- * @param autoragId Optional instance ID (omit for account-level operations)
10316
+ * @param autoragId Instance ID
9494
10317
  */
9495
10318
  autorag(autoragId: string): AutoRAG;
9496
10319
  run<
@@ -9649,22 +10472,23 @@ export declare abstract class AiGateway {
9649
10472
  getUrl(provider?: AIGatewayProviders | string): Promise<string>; // eslint-disable-line
9650
10473
  }
9651
10474
  /**
9652
- * @deprecated AutoRAG has been replaced by AI Search. Use AiSearchInternalError instead.
9653
- * @see AiSearchInternalError
10475
+ * @deprecated Use the standalone AI Search Workers binding instead.
10476
+ * See https://developers.cloudflare.com/ai-search/usage/workers-binding/
9654
10477
  */
9655
10478
  export interface AutoRAGInternalError extends Error {}
9656
10479
  /**
9657
- * @deprecated AutoRAG has been replaced by AI Search. Use AiSearchNotFoundError instead.
9658
- * @see AiSearchNotFoundError
10480
+ * @deprecated Use the standalone AI Search Workers binding instead.
10481
+ * See https://developers.cloudflare.com/ai-search/usage/workers-binding/
9659
10482
  */
9660
10483
  export interface AutoRAGNotFoundError extends Error {}
9661
10484
  /**
9662
- * @deprecated This error type is no longer used in the AI Search API.
10485
+ * @deprecated Use the standalone AI Search Workers binding instead.
10486
+ * See https://developers.cloudflare.com/ai-search/usage/workers-binding/
9663
10487
  */
9664
10488
  export interface AutoRAGUnauthorizedError extends Error {}
9665
10489
  /**
9666
- * @deprecated AutoRAG has been replaced by AI Search. Use AiSearchNameNotSetError instead.
9667
- * @see AiSearchNameNotSetError
10490
+ * @deprecated Use the standalone AI Search Workers binding instead.
10491
+ * See https://developers.cloudflare.com/ai-search/usage/workers-binding/
9668
10492
  */
9669
10493
  export interface AutoRAGNameNotSetError extends Error {}
9670
10494
  export type ComparisonFilter = {
@@ -9677,9 +10501,8 @@ export type CompoundFilter = {
9677
10501
  filters: ComparisonFilter[];
9678
10502
  };
9679
10503
  /**
9680
- * @deprecated AutoRAG has been replaced by AI Search.
9681
- * Use AiSearchSearchRequest with the new API instead.
9682
- * @see AiSearchSearchRequest
10504
+ * @deprecated Use the standalone AI Search Workers binding instead.
10505
+ * See https://developers.cloudflare.com/ai-search/usage/workers-binding/
9683
10506
  */
9684
10507
  export type AutoRagSearchRequest = {
9685
10508
  query: string;
@@ -9696,18 +10519,16 @@ export type AutoRagSearchRequest = {
9696
10519
  rewrite_query?: boolean;
9697
10520
  };
9698
10521
  /**
9699
- * @deprecated AutoRAG has been replaced by AI Search.
9700
- * Use AiSearchChatCompletionsRequest with the new API instead.
9701
- * @see AiSearchChatCompletionsRequest
10522
+ * @deprecated Use the standalone AI Search Workers binding instead.
10523
+ * See https://developers.cloudflare.com/ai-search/usage/workers-binding/
9702
10524
  */
9703
10525
  export type AutoRagAiSearchRequest = AutoRagSearchRequest & {
9704
10526
  stream?: boolean;
9705
10527
  system_prompt?: string;
9706
10528
  };
9707
10529
  /**
9708
- * @deprecated AutoRAG has been replaced by AI Search.
9709
- * Use AiSearchChatCompletionsRequest with stream: true instead.
9710
- * @see AiSearchChatCompletionsRequest
10530
+ * @deprecated Use the standalone AI Search Workers binding instead.
10531
+ * See https://developers.cloudflare.com/ai-search/usage/workers-binding/
9711
10532
  */
9712
10533
  export type AutoRagAiSearchRequestStreaming = Omit<
9713
10534
  AutoRagAiSearchRequest,
@@ -9716,9 +10537,8 @@ export type AutoRagAiSearchRequestStreaming = Omit<
9716
10537
  stream: true;
9717
10538
  };
9718
10539
  /**
9719
- * @deprecated AutoRAG has been replaced by AI Search.
9720
- * Use AiSearchSearchResponse with the new API instead.
9721
- * @see AiSearchSearchResponse
10540
+ * @deprecated Use the standalone AI Search Workers binding instead.
10541
+ * See https://developers.cloudflare.com/ai-search/usage/workers-binding/
9722
10542
  */
9723
10543
  export type AutoRagSearchResponse = {
9724
10544
  object: "vector_store.search_results.page";
@@ -9737,9 +10557,8 @@ export type AutoRagSearchResponse = {
9737
10557
  next_page: string | null;
9738
10558
  };
9739
10559
  /**
9740
- * @deprecated AutoRAG has been replaced by AI Search.
9741
- * Use AiSearchListResponse with the new API instead.
9742
- * @see AiSearchListResponse
10560
+ * @deprecated Use the standalone AI Search Workers binding instead.
10561
+ * See https://developers.cloudflare.com/ai-search/usage/workers-binding/
9743
10562
  */
9744
10563
  export type AutoRagListResponse = {
9745
10564
  id: string;
@@ -9751,49 +10570,40 @@ export type AutoRagListResponse = {
9751
10570
  status: string;
9752
10571
  }[];
9753
10572
  /**
9754
- * @deprecated AutoRAG has been replaced by AI Search.
9755
- * The new API returns different response formats for chat completions.
10573
+ * @deprecated Use the standalone AI Search Workers binding instead.
10574
+ * See https://developers.cloudflare.com/ai-search/usage/workers-binding/
9756
10575
  */
9757
10576
  export type AutoRagAiSearchResponse = AutoRagSearchResponse & {
9758
10577
  response: string;
9759
10578
  };
9760
10579
  /**
9761
- * @deprecated AutoRAG has been replaced by AI Search.
9762
- * Use the new AI Search API instead: `env.AI.aiSearch`
9763
- *
9764
- * Migration guide:
9765
- * - `env.AI.autorag().list()` → `env.AI.aiSearch.list()`
9766
- * - `env.AI.autorag('id').search(...)` → `env.AI.aiSearch.get('id').search(...)`
9767
- * - `env.AI.autorag('id').aiSearch(...)` → `env.AI.aiSearch.get('id').chatCompletions(...)`
9768
- *
9769
- * @see AiSearchAccountService
9770
- * @see AiSearchInstanceService
10580
+ * @deprecated Use the standalone AI Search Workers binding instead.
10581
+ * See https://developers.cloudflare.com/ai-search/usage/workers-binding/
9771
10582
  */
9772
10583
  export declare abstract class AutoRAG {
9773
10584
  /**
9774
- * @deprecated Use `env.AI.aiSearch.list()` instead.
9775
- * @see AiSearchAccountService.list
10585
+ * @deprecated Use the standalone AI Search Workers binding instead.
10586
+ * See https://developers.cloudflare.com/ai-search/usage/workers-binding/
9776
10587
  */
9777
10588
  list(): Promise<AutoRagListResponse>;
9778
10589
  /**
9779
- * @deprecated Use `env.AI.aiSearch.get(id).search(...)` instead.
9780
- * Note: The new API uses a messages array instead of a query string.
9781
- * @see AiSearchInstanceService.search
10590
+ * @deprecated Use the standalone AI Search Workers binding instead.
10591
+ * See https://developers.cloudflare.com/ai-search/usage/workers-binding/
9782
10592
  */
9783
10593
  search(params: AutoRagSearchRequest): Promise<AutoRagSearchResponse>;
9784
10594
  /**
9785
- * @deprecated Use `env.AI.aiSearch.get(id).chatCompletions(...)` instead.
9786
- * @see AiSearchInstanceService.chatCompletions
10595
+ * @deprecated Use the standalone AI Search Workers binding instead.
10596
+ * See https://developers.cloudflare.com/ai-search/usage/workers-binding/
9787
10597
  */
9788
10598
  aiSearch(params: AutoRagAiSearchRequestStreaming): Promise<Response>;
9789
10599
  /**
9790
- * @deprecated Use `env.AI.aiSearch.get(id).chatCompletions(...)` instead.
9791
- * @see AiSearchInstanceService.chatCompletions
10600
+ * @deprecated Use the standalone AI Search Workers binding instead.
10601
+ * See https://developers.cloudflare.com/ai-search/usage/workers-binding/
9792
10602
  */
9793
10603
  aiSearch(params: AutoRagAiSearchRequest): Promise<AutoRagAiSearchResponse>;
9794
10604
  /**
9795
- * @deprecated Use `env.AI.aiSearch.get(id).chatCompletions(...)` instead.
9796
- * @see AiSearchInstanceService.chatCompletions
10605
+ * @deprecated Use the standalone AI Search Workers binding instead.
10606
+ * See https://developers.cloudflare.com/ai-search/usage/workers-binding/
9797
10607
  */
9798
10608
  aiSearch(
9799
10609
  params: AutoRagAiSearchRequest,
@@ -9918,6 +10728,41 @@ export interface RequestInitCfProperties extends Record<string, unknown> {
9918
10728
  * (e.g. { '200-299': 86400, '404': 1, '500-599': 0 })
9919
10729
  */
9920
10730
  cacheTtlByStatus?: Record<string, number>;
10731
+ /**
10732
+ * Explicit Cache-Control header value to set on the response stored in cache.
10733
+ * This gives full control over cache directives (e.g. 'public, max-age=3600, s-maxage=86400').
10734
+ *
10735
+ * Cannot be used together with `cacheTtl` or the `cache` request option (`no-store`/`no-cache`),
10736
+ * as these are mutually exclusive cache control mechanisms. Setting both will throw a TypeError.
10737
+ *
10738
+ * Can be used together with `cacheTtlByStatus`.
10739
+ */
10740
+ cacheControl?: string;
10741
+ /**
10742
+ * Whether the response should be eligible for Cache Reserve storage.
10743
+ */
10744
+ cacheReserveEligible?: boolean;
10745
+ /**
10746
+ * Whether to respect strong ETags (as opposed to weak ETags) from the origin.
10747
+ */
10748
+ respectStrongEtag?: boolean;
10749
+ /**
10750
+ * Whether to strip ETag headers from the origin response before caching.
10751
+ */
10752
+ stripEtags?: boolean;
10753
+ /**
10754
+ * Whether to strip Last-Modified headers from the origin response before caching.
10755
+ */
10756
+ stripLastModified?: boolean;
10757
+ /**
10758
+ * Whether to enable Cache Deception Armor, which protects against web cache
10759
+ * deception attacks by verifying the Content-Type matches the URL extension.
10760
+ */
10761
+ cacheDeceptionArmor?: boolean;
10762
+ /**
10763
+ * Minimum file size in bytes for a response to be eligible for Cache Reserve storage.
10764
+ */
10765
+ cacheReserveMinimumFileSize?: number;
9921
10766
  scrapeShield?: boolean;
9922
10767
  apps?: boolean;
9923
10768
  image?: RequestInitCfPropertiesImage;
@@ -11786,6 +12631,7 @@ export declare namespace CloudflareWorkersModule {
11786
12631
  constructor(ctx: ExecutionContext, env: Env);
11787
12632
  email?(message: ForwardableEmailMessage): void | Promise<void>;
11788
12633
  fetch?(request: Request): Response | Promise<Response>;
12634
+ connect?(socket: Socket): void | Promise<void>;
11789
12635
  queue?(batch: MessageBatch<unknown>): void | Promise<void>;
11790
12636
  scheduled?(controller: ScheduledController): void | Promise<void>;
11791
12637
  tail?(events: TraceItem[]): void | Promise<void>;
@@ -11806,6 +12652,7 @@ export declare namespace CloudflareWorkersModule {
11806
12652
  constructor(ctx: DurableObjectState, env: Env);
11807
12653
  alarm?(alarmInfo?: AlarmInvocationInfo): void | Promise<void>;
11808
12654
  fetch?(request: Request): Response | Promise<Response>;
12655
+ connect?(socket: Socket): void | Promise<void>;
11809
12656
  webSocketMessage?(
11810
12657
  ws: WebSocket,
11811
12658
  message: string | ArrayBuffer,
@@ -11946,17 +12793,6 @@ export interface StreamBinding {
11946
12793
  * @returns A handle for per-video operations.
11947
12794
  */
11948
12795
  video(id: string): StreamVideoHandle;
11949
- /**
11950
- * Uploads a new video from a File.
11951
- * @param file The video file to upload.
11952
- * @returns The uploaded video details.
11953
- * @throws {BadRequestError} if the upload parameter is invalid
11954
- * @throws {QuotaReachedError} if the account storage capacity is exceeded
11955
- * @throws {MaxFileSizeError} if the file size is too large
11956
- * @throws {RateLimitedError} if the server received too many requests
11957
- * @throws {InternalError} if an unexpected error occurs
11958
- */
11959
- upload(file: File): Promise<StreamVideo>;
11960
12796
  /**
11961
12797
  * Uploads a new video from a provided URL.
11962
12798
  * @param url The URL to upload from.
@@ -12806,6 +13642,9 @@ export declare namespace TailStream {
12806
13642
  readonly type: "fetch";
12807
13643
  readonly statusCode: number;
12808
13644
  }
13645
+ interface ConnectEventInfo {
13646
+ readonly type: "connect";
13647
+ }
12809
13648
  type EventOutcome =
12810
13649
  | "ok"
12811
13650
  | "canceled"
@@ -12836,6 +13675,7 @@ export declare namespace TailStream {
12836
13675
  readonly scriptVersion?: ScriptVersion;
12837
13676
  readonly info:
12838
13677
  | FetchEventInfo
13678
+ | ConnectEventInfo
12839
13679
  | JsRpcEventInfo
12840
13680
  | ScheduledEventInfo
12841
13681
  | AlarmEventInfo