experimental-ash 0.20.1 → 0.22.0

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.
Files changed (66) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/dist/docs/public/channels/README.md +3 -1
  3. package/dist/docs/public/hooks.md +76 -6
  4. package/dist/docs/public/skills.md +6 -1
  5. package/dist/docs/public/tools.md +4 -0
  6. package/dist/src/chunks/{dev-authored-source-watcher-BR7XYOW0.js → dev-authored-source-watcher-DKDaaPea.js} +1 -1
  7. package/dist/src/chunks/{host-Dxf7CGaE.js → host-Btr4S69C.js} +7 -7
  8. package/dist/src/chunks/paths-DZTgjrW-.js +88 -0
  9. package/dist/src/chunks/{prewarm-vAT2QBqc.js → prewarm-BELT37PI.js} +1 -1
  10. package/dist/src/cli/commands/info.js +1 -1
  11. package/dist/src/cli/run.js +1 -1
  12. package/dist/src/compiled/.vendor-stamp.json +3 -3
  13. package/dist/src/compiled/@ai-sdk/anthropic/_provider-utils.d.ts +15 -0
  14. package/dist/src/compiled/@ai-sdk/anthropic/index.d.ts +1259 -6
  15. package/dist/src/compiled/@ai-sdk/google/_provider-utils.d.ts +11 -0
  16. package/dist/src/compiled/@ai-sdk/google/index.d.ts +561 -6
  17. package/dist/src/compiled/@ai-sdk/google/index.js +4 -4
  18. package/dist/src/compiled/@ai-sdk/google/package.json +1 -1
  19. package/dist/src/compiled/@ai-sdk/openai/_provider-utils.d.ts +15 -0
  20. package/dist/src/compiled/@ai-sdk/openai/index.d.ts +1255 -6
  21. package/dist/src/compiled/@ai-sdk/openai/index.js +1 -1
  22. package/dist/src/compiled/@ai-sdk/openai/package.json +1 -1
  23. package/dist/src/compiler/normalize-skill.js +5 -1
  24. package/dist/src/compiler/workspace-resources.js +12 -5
  25. package/dist/src/context/hook-lifecycle.d.ts +8 -8
  26. package/dist/src/context/hook-lifecycle.js +88 -36
  27. package/dist/src/evals/cli/eval.js +1 -1
  28. package/dist/src/execution/skills/instructions.d.ts +8 -4
  29. package/dist/src/execution/skills/instructions.js +3 -2
  30. package/dist/src/harness/attachment-staging.js +5 -1
  31. package/dist/src/harness/tool-loop.js +11 -3
  32. package/dist/src/internal/application/package.js +1 -1
  33. package/dist/src/internal/authored-definition/core.js +16 -1
  34. package/dist/src/internal/nitro/routes/workflow-route-helpers.d.ts +4 -4
  35. package/dist/src/internal/nitro/routes/workflow-route-helpers.js +6 -5
  36. package/dist/src/internal/nitro/routes/workflow-run-events.d.ts +1 -1
  37. package/dist/src/internal/nitro/routes/workflow-run-events.js +1 -1
  38. package/dist/src/internal/nitro/routes/workflow-run-steps.d.ts +1 -1
  39. package/dist/src/internal/nitro/routes/workflow-run-steps.js +1 -1
  40. package/dist/src/internal/nitro/routes/workflow-run.d.ts +1 -1
  41. package/dist/src/internal/nitro/routes/workflow-run.js +1 -1
  42. package/dist/src/internal/nitro/routes/workflow-runs.d.ts +1 -1
  43. package/dist/src/internal/nitro/routes/workflow-runs.js +1 -1
  44. package/dist/src/internal/workflow-bundle/vercel-workflow-output.js +2 -0
  45. package/dist/src/public/definitions/hook.d.ts +11 -3
  46. package/dist/src/public/definitions/skill.d.ts +4 -3
  47. package/dist/src/public/definitions/skill.js +1 -1
  48. package/dist/src/public/next/index.d.ts +74 -0
  49. package/dist/src/public/next/index.js +150 -0
  50. package/dist/src/public/next/server.d.ts +6 -0
  51. package/dist/src/public/next/server.js +348 -0
  52. package/dist/src/public/next/vercel-json.d.ts +8 -0
  53. package/dist/src/public/next/vercel-json.js +76 -0
  54. package/dist/src/public/skills/index.d.ts +1 -1
  55. package/dist/src/public/skills/index.js +1 -1
  56. package/dist/src/public/tool-result-narrowing.d.ts +68 -0
  57. package/dist/src/public/tool-result-narrowing.js +58 -0
  58. package/dist/src/public/tools/index.d.ts +1 -0
  59. package/dist/src/public/tools/index.js +1 -0
  60. package/dist/src/runtime/resolve-connection.js +2 -0
  61. package/dist/src/runtime/resolve-tool.js +2 -0
  62. package/dist/src/shared/skill-definition.d.ts +20 -2
  63. package/dist/src/shared/skill-package.d.ts +43 -0
  64. package/dist/src/shared/skill-package.js +100 -0
  65. package/package.json +13 -3
  66. package/dist/src/chunks/paths-BcM3el4Q.js +0 -88
@@ -0,0 +1,11 @@
1
+ // Auto-generated stub for `@ai-sdk/provider-utils` types referenced by a vendored .d.ts.
2
+ // Emitted by createDeclarationCopier > buildOpaqueTypesStub.
3
+ //
4
+ // Names are aliased to `unknown` so consumers don't have to install
5
+ // upstream @types just to typecheck against ash. If real types are
6
+ // needed in user code, install the upstream @types and use them directly.
7
+
8
+ export type FetchFunction = unknown;
9
+ export type InferSchema = unknown;
10
+ export type LazySchema = unknown;
11
+ export type ProviderExecutedToolFactory = unknown;
@@ -1,9 +1,564 @@
1
- import type { ToolSet } from "ai";
1
+ import * as _ai_sdk_provider_utils from './_provider-utils.js';
2
+ import { InferSchema, FetchFunction } from './_provider-utils.js';
3
+ import { ProviderV4, LanguageModelV4, ImageModelV4, EmbeddingModelV4, Experimental_VideoModelV4, FilesV4 } from '#compiled/@ai-sdk/provider/index.js';
2
4
 
3
- export interface GoogleProvider {
4
- tools: {
5
- googleSearch(args?: Record<string, unknown>): ToolSet[string];
6
- };
5
+ declare const googleErrorDataSchema: _ai_sdk_provider_utils.LazySchema<{
6
+ error: {
7
+ code: number | null;
8
+ message: string;
9
+ status: string;
10
+ };
11
+ }>;
12
+ type GoogleErrorData = InferSchema<typeof googleErrorDataSchema>;
13
+
14
+ type GoogleModelId = 'gemini-2.0-flash' | 'gemini-2.0-flash-001' | 'gemini-2.0-flash-lite' | 'gemini-2.0-flash-lite-001' | 'gemini-2.5-pro' | 'gemini-2.5-flash' | 'gemini-2.5-flash-image' | 'gemini-2.5-flash-lite' | 'gemini-2.5-flash-preview-tts' | 'gemini-2.5-pro-preview-tts' | 'gemini-2.5-flash-native-audio-latest' | 'gemini-2.5-flash-native-audio-preview-09-2025' | 'gemini-2.5-flash-native-audio-preview-12-2025' | 'gemini-2.5-computer-use-preview-10-2025' | 'gemini-3-pro-preview' | 'gemini-3-pro-image-preview' | 'gemini-3-flash-preview' | 'gemini-3.1-pro-preview' | 'gemini-3.1-pro-preview-customtools' | 'gemini-3.1-flash-image-preview' | 'gemini-3.1-flash-lite-preview' | 'gemini-3.1-flash-tts-preview' | 'gemini-3.5-flash' | 'gemini-pro-latest' | 'gemini-flash-latest' | 'gemini-flash-lite-latest' | 'deep-research-pro-preview-12-2025' | 'nano-banana-pro-preview' | 'aqa' | 'gemini-robotics-er-1.5-preview' | 'gemma-3-1b-it' | 'gemma-3-4b-it' | 'gemma-3n-e4b-it' | 'gemma-3n-e2b-it' | 'gemma-3-12b-it' | 'gemma-3-27b-it' | (string & {});
15
+ declare const googleLanguageModelOptions: _ai_sdk_provider_utils.LazySchema<{
16
+ responseModalities?: ("TEXT" | "IMAGE")[] | undefined;
17
+ thinkingConfig?: {
18
+ thinkingBudget?: number | undefined;
19
+ includeThoughts?: boolean | undefined;
20
+ thinkingLevel?: "minimal" | "low" | "medium" | "high" | undefined;
21
+ } | undefined;
22
+ cachedContent?: string | undefined;
23
+ structuredOutputs?: boolean | undefined;
24
+ safetySettings?: {
25
+ category: "HARM_CATEGORY_UNSPECIFIED" | "HARM_CATEGORY_HATE_SPEECH" | "HARM_CATEGORY_DANGEROUS_CONTENT" | "HARM_CATEGORY_HARASSMENT" | "HARM_CATEGORY_SEXUALLY_EXPLICIT" | "HARM_CATEGORY_CIVIC_INTEGRITY";
26
+ threshold: "HARM_BLOCK_THRESHOLD_UNSPECIFIED" | "BLOCK_LOW_AND_ABOVE" | "BLOCK_MEDIUM_AND_ABOVE" | "BLOCK_ONLY_HIGH" | "BLOCK_NONE" | "OFF";
27
+ }[] | undefined;
28
+ threshold?: "HARM_BLOCK_THRESHOLD_UNSPECIFIED" | "BLOCK_LOW_AND_ABOVE" | "BLOCK_MEDIUM_AND_ABOVE" | "BLOCK_ONLY_HIGH" | "BLOCK_NONE" | "OFF" | undefined;
29
+ audioTimestamp?: boolean | undefined;
30
+ labels?: Record<string, string> | undefined;
31
+ mediaResolution?: "MEDIA_RESOLUTION_UNSPECIFIED" | "MEDIA_RESOLUTION_LOW" | "MEDIA_RESOLUTION_MEDIUM" | "MEDIA_RESOLUTION_HIGH" | undefined;
32
+ imageConfig?: {
33
+ aspectRatio?: "1:1" | "2:3" | "3:2" | "3:4" | "4:3" | "4:5" | "5:4" | "9:16" | "16:9" | "21:9" | "1:8" | "8:1" | "1:4" | "4:1" | undefined;
34
+ imageSize?: "1K" | "2K" | "4K" | "512" | undefined;
35
+ } | undefined;
36
+ retrievalConfig?: {
37
+ latLng?: {
38
+ latitude: number;
39
+ longitude: number;
40
+ } | undefined;
41
+ } | undefined;
42
+ streamFunctionCallArguments?: boolean | undefined;
43
+ serviceTier?: "standard" | "flex" | "priority" | undefined;
44
+ }>;
45
+ type GoogleLanguageModelOptions = InferSchema<typeof googleLanguageModelOptions>;
46
+
47
+ declare const responseSchema: _ai_sdk_provider_utils.LazySchema<{
48
+ candidates: {
49
+ content?: Record<string, never> | {
50
+ parts?: ({
51
+ functionCall: {
52
+ id?: string | null | undefined;
53
+ name?: string | null | undefined;
54
+ args?: unknown;
55
+ partialArgs?: {
56
+ jsonPath: string;
57
+ stringValue?: string | null | undefined;
58
+ numberValue?: number | null | undefined;
59
+ boolValue?: boolean | null | undefined;
60
+ nullValue?: unknown;
61
+ willContinue?: boolean | null | undefined;
62
+ }[] | null | undefined;
63
+ willContinue?: boolean | null | undefined;
64
+ };
65
+ thoughtSignature?: string | null | undefined;
66
+ } | {
67
+ inlineData: {
68
+ mimeType: string;
69
+ data: string;
70
+ };
71
+ thought?: boolean | null | undefined;
72
+ thoughtSignature?: string | null | undefined;
73
+ } | {
74
+ toolCall: {
75
+ toolType: string;
76
+ id: string;
77
+ args?: unknown;
78
+ };
79
+ thoughtSignature?: string | null | undefined;
80
+ } | {
81
+ toolResponse: {
82
+ toolType: string;
83
+ id: string;
84
+ response?: unknown;
85
+ };
86
+ thoughtSignature?: string | null | undefined;
87
+ } | {
88
+ executableCode?: {
89
+ language: string;
90
+ code: string;
91
+ } | null | undefined;
92
+ codeExecutionResult?: {
93
+ outcome: string;
94
+ output?: string | null | undefined;
95
+ } | null | undefined;
96
+ text?: string | null | undefined;
97
+ thought?: boolean | null | undefined;
98
+ thoughtSignature?: string | null | undefined;
99
+ })[] | null | undefined;
100
+ } | null | undefined;
101
+ finishReason?: string | null | undefined;
102
+ finishMessage?: string | null | undefined;
103
+ safetyRatings?: {
104
+ category?: string | null | undefined;
105
+ probability?: string | null | undefined;
106
+ probabilityScore?: number | null | undefined;
107
+ severity?: string | null | undefined;
108
+ severityScore?: number | null | undefined;
109
+ blocked?: boolean | null | undefined;
110
+ }[] | null | undefined;
111
+ groundingMetadata?: {
112
+ webSearchQueries?: string[] | null | undefined;
113
+ imageSearchQueries?: string[] | null | undefined;
114
+ retrievalQueries?: string[] | null | undefined;
115
+ searchEntryPoint?: {
116
+ renderedContent: string;
117
+ } | null | undefined;
118
+ groundingChunks?: {
119
+ web?: {
120
+ uri: string;
121
+ title?: string | null | undefined;
122
+ } | null | undefined;
123
+ image?: {
124
+ sourceUri: string;
125
+ imageUri: string;
126
+ title?: string | null | undefined;
127
+ domain?: string | null | undefined;
128
+ } | null | undefined;
129
+ retrievedContext?: {
130
+ uri?: string | null | undefined;
131
+ title?: string | null | undefined;
132
+ text?: string | null | undefined;
133
+ fileSearchStore?: string | null | undefined;
134
+ } | null | undefined;
135
+ maps?: {
136
+ uri?: string | null | undefined;
137
+ title?: string | null | undefined;
138
+ text?: string | null | undefined;
139
+ placeId?: string | null | undefined;
140
+ } | null | undefined;
141
+ }[] | null | undefined;
142
+ groundingSupports?: {
143
+ segment?: {
144
+ startIndex?: number | null | undefined;
145
+ endIndex?: number | null | undefined;
146
+ text?: string | null | undefined;
147
+ } | null | undefined;
148
+ segment_text?: string | null | undefined;
149
+ groundingChunkIndices?: number[] | null | undefined;
150
+ supportChunkIndices?: number[] | null | undefined;
151
+ confidenceScores?: number[] | null | undefined;
152
+ confidenceScore?: number[] | null | undefined;
153
+ }[] | null | undefined;
154
+ retrievalMetadata?: Record<string, never> | {
155
+ webDynamicRetrievalScore: number;
156
+ } | null | undefined;
157
+ } | null | undefined;
158
+ urlContextMetadata?: {
159
+ urlMetadata?: {
160
+ retrievedUrl: string;
161
+ urlRetrievalStatus: string;
162
+ }[] | null | undefined;
163
+ } | null | undefined;
164
+ }[];
165
+ usageMetadata?: {
166
+ cachedContentTokenCount?: number | null | undefined;
167
+ thoughtsTokenCount?: number | null | undefined;
168
+ promptTokenCount?: number | null | undefined;
169
+ candidatesTokenCount?: number | null | undefined;
170
+ totalTokenCount?: number | null | undefined;
171
+ trafficType?: string | null | undefined;
172
+ promptTokensDetails?: {
173
+ modality: string;
174
+ tokenCount: number;
175
+ }[] | null | undefined;
176
+ candidatesTokensDetails?: {
177
+ modality: string;
178
+ tokenCount: number;
179
+ }[] | null | undefined;
180
+ } | null | undefined;
181
+ promptFeedback?: {
182
+ blockReason?: string | null | undefined;
183
+ safetyRatings?: {
184
+ category?: string | null | undefined;
185
+ probability?: string | null | undefined;
186
+ probabilityScore?: number | null | undefined;
187
+ severity?: string | null | undefined;
188
+ severityScore?: number | null | undefined;
189
+ blocked?: boolean | null | undefined;
190
+ }[] | null | undefined;
191
+ } | null | undefined;
192
+ serviceTier?: string | null | undefined;
193
+ }>;
194
+ type GroundingMetadataSchema = NonNullable<InferSchema<typeof responseSchema>['candidates'][number]['groundingMetadata']>;
195
+ type UrlContextMetadataSchema = NonNullable<InferSchema<typeof responseSchema>['candidates'][number]['urlContextMetadata']>;
196
+ type SafetyRatingSchema = NonNullable<InferSchema<typeof responseSchema>['candidates'][number]['safetyRatings']>[number];
197
+ type PromptFeedbackSchema = NonNullable<InferSchema<typeof responseSchema>['promptFeedback']>;
198
+ type UsageMetadataSchema = NonNullable<InferSchema<typeof responseSchema>['usageMetadata']>;
199
+
200
+ type GoogleGroundingMetadata = GroundingMetadataSchema;
201
+ type GoogleUrlContextMetadata = UrlContextMetadataSchema;
202
+ type GoogleSafetyRating = SafetyRatingSchema;
203
+ type GooglePromptFeedback = PromptFeedbackSchema;
204
+ type GoogleUsageMetadata = UsageMetadataSchema;
205
+ interface GoogleProviderMetadata {
206
+ promptFeedback: GooglePromptFeedback | null;
207
+ groundingMetadata: GoogleGroundingMetadata | null;
208
+ urlContextMetadata: GoogleUrlContextMetadata | null;
209
+ safetyRatings: GoogleSafetyRating[] | null;
210
+ usageMetadata: GoogleUsageMetadata | null;
211
+ finishMessage: string | null;
212
+ serviceTier: string | null;
213
+ }
214
+
215
+ declare const googleImageModelOptionsSchema: _ai_sdk_provider_utils.LazySchema<{
216
+ personGeneration?: "dont_allow" | "allow_adult" | "allow_all" | null | undefined;
217
+ aspectRatio?: "1:1" | "3:4" | "4:3" | "9:16" | "16:9" | null | undefined;
218
+ }>;
219
+ type GoogleImageModelOptions = InferSchema<typeof googleImageModelOptionsSchema>;
220
+
221
+ type GoogleEmbeddingModelId = 'gemini-embedding-001' | 'gemini-embedding-2-preview' | (string & {});
222
+ declare const googleEmbeddingModelOptions: _ai_sdk_provider_utils.LazySchema<{
223
+ outputDimensionality?: number | undefined;
224
+ taskType?: "SEMANTIC_SIMILARITY" | "CLASSIFICATION" | "CLUSTERING" | "RETRIEVAL_DOCUMENT" | "RETRIEVAL_QUERY" | "QUESTION_ANSWERING" | "FACT_VERIFICATION" | "CODE_RETRIEVAL_QUERY" | undefined;
225
+ content?: (({
226
+ text: string;
227
+ } | {
228
+ inlineData: {
229
+ mimeType: string;
230
+ data: string;
231
+ };
232
+ } | {
233
+ fileData: {
234
+ fileUri: string;
235
+ mimeType: string;
236
+ };
237
+ })[] | null)[] | undefined;
238
+ }>;
239
+ type GoogleEmbeddingModelOptions = InferSchema<typeof googleEmbeddingModelOptions>;
240
+
241
+ type GoogleVideoModelOptions = {
242
+ pollIntervalMs?: number | null;
243
+ pollTimeoutMs?: number | null;
244
+ personGeneration?: 'dont_allow' | 'allow_adult' | 'allow_all' | null;
245
+ negativePrompt?: string | null;
246
+ referenceImages?: Array<{
247
+ bytesBase64Encoded?: string;
248
+ gcsUri?: string;
249
+ }> | null;
250
+ [key: string]: unknown;
251
+ };
252
+
253
+ type GoogleVideoModelId = 'veo-3.1-fast-generate-preview' | 'veo-3.1-generate-preview' | 'veo-3.1-generate' | 'veo-3.1-lite-generate-preview' | 'veo-3.0-generate-001' | 'veo-3.0-fast-generate-001' | 'veo-2.0-generate-001' | (string & {});
254
+
255
+ type GoogleFilesUploadOptions = {
256
+ displayName?: string | null;
257
+ pollIntervalMs?: number | null;
258
+ pollTimeoutMs?: number | null;
259
+ [key: string]: unknown;
260
+ };
261
+
262
+ /**
263
+ * Type-only union of Gemini model IDs that the Interactions API accepts via
264
+ * `model:`. Mirrors `Model` from `googleapis/js-genai`
265
+ * `src/interactions/resources/interactions.ts`.
266
+ *
267
+ * Kept as a separate type from `GoogleModelId` even though most IDs overlap;
268
+ * the two surfaces (`:generateContent` vs `/interactions`) are independent and
269
+ * may diverge over time.
270
+ */
271
+ type GoogleInteractionsModelId = 'gemini-2.5-computer-use-preview-10-2025' | 'gemini-2.5-flash' | 'gemini-2.5-flash-image' | 'gemini-2.5-flash-lite' | 'gemini-2.5-flash-lite-preview-09-2025' | 'gemini-2.5-flash-native-audio-preview-12-2025' | 'gemini-2.5-flash-preview-09-2025' | 'gemini-2.5-flash-preview-tts' | 'gemini-2.5-pro' | 'gemini-2.5-pro-preview-tts' | 'gemini-3-flash-preview' | 'gemini-3-pro-image-preview' | 'gemini-3-pro-preview' | 'gemini-3.1-pro-preview' | 'gemini-3.1-flash-image-preview' | 'gemini-3.1-flash-lite-preview' | 'gemini-3.1-flash-tts-preview' | 'gemini-3.5-flash' | 'lyria-3-clip-preview' | 'lyria-3-pro-preview' | (string & {});
272
+ /**
273
+ * Provider-options schema for `google.interactions(...)` calls. Read from the
274
+ * shared `providerOptions.google.*` namespace (per PRD); per-call options that
275
+ * the AI SDK doesn't natively expose live here.
276
+ *
277
+ * All fields are `.nullish()` per the existing google provider convention.
278
+ */
279
+ declare const googleInteractionsLanguageModelOptions: _ai_sdk_provider_utils.LazySchema<{
280
+ previousInteractionId?: string | null | undefined;
281
+ store?: boolean | null | undefined;
282
+ agent?: string | null | undefined;
283
+ agentConfig?: {
284
+ [x: string]: unknown;
285
+ type: "dynamic";
286
+ } | {
287
+ type: "deep-research";
288
+ thinkingSummaries?: "auto" | "none" | null | undefined;
289
+ visualization?: "auto" | "off" | null | undefined;
290
+ collaborativePlanning?: boolean | null | undefined;
291
+ } | null | undefined;
292
+ thinkingLevel?: "minimal" | "low" | "medium" | "high" | null | undefined;
293
+ thinkingSummaries?: "auto" | "none" | null | undefined;
294
+ responseFormat?: ({
295
+ [x: string]: unknown;
296
+ type: "text";
297
+ mimeType?: string | null | undefined;
298
+ schema?: unknown;
299
+ } | {
300
+ [x: string]: unknown;
301
+ type: "image";
302
+ mimeType?: string | null | undefined;
303
+ aspectRatio?: "1:1" | "2:3" | "3:2" | "3:4" | "4:3" | "4:5" | "5:4" | "9:16" | "16:9" | "21:9" | "1:8" | "8:1" | "1:4" | "4:1" | null | undefined;
304
+ imageSize?: "1K" | "2K" | "4K" | "512" | null | undefined;
305
+ } | {
306
+ [x: string]: unknown;
307
+ type: "audio";
308
+ mimeType?: string | null | undefined;
309
+ })[] | null | undefined;
310
+ imageConfig?: {
311
+ aspectRatio?: "1:1" | "2:3" | "3:2" | "3:4" | "4:3" | "4:5" | "5:4" | "9:16" | "16:9" | "21:9" | "1:8" | "8:1" | "1:4" | "4:1" | null | undefined;
312
+ imageSize?: "1K" | "2K" | "4K" | "512" | null | undefined;
313
+ } | null | undefined;
314
+ mediaResolution?: "low" | "medium" | "high" | "ultra_high" | null | undefined;
315
+ responseModalities?: ("text" | "image" | "document" | "audio" | "video")[] | null | undefined;
316
+ serviceTier?: "standard" | "flex" | "priority" | null | undefined;
317
+ systemInstruction?: string | null | undefined;
318
+ signature?: string | null | undefined;
319
+ interactionId?: string | null | undefined;
320
+ pollingTimeoutMs?: number | null | undefined;
321
+ background?: boolean | null | undefined;
322
+ environment?: string | {
323
+ type: "remote";
324
+ sources?: ({
325
+ type: "gcs";
326
+ source: string;
327
+ target?: string | null | undefined;
328
+ } | {
329
+ type: "repository";
330
+ source: string;
331
+ target?: string | null | undefined;
332
+ } | {
333
+ type: "inline";
334
+ content: string;
335
+ target: string;
336
+ })[] | null | undefined;
337
+ network?: "disabled" | {
338
+ allowlist: {
339
+ domain: string;
340
+ transform?: Record<string, string>[] | null | undefined;
341
+ }[];
342
+ } | null | undefined;
343
+ } | null | undefined;
344
+ }>;
345
+ type GoogleLanguageModelInteractionsOptions = InferSchema<typeof googleInteractionsLanguageModelOptions>;
346
+
347
+ /**
348
+ * Provider-metadata shape that the Gemini Interactions language model writes
349
+ * onto `result.providerMetadata.google` (and reads back from input messages on
350
+ * the next turn for stateful chaining and signature round-trip).
351
+ */
352
+ type GoogleInteractionsProviderMetadata = {
353
+ /**
354
+ * Gemini-server-side interaction id (`Interaction.id`). Pass back in
355
+ * `providerOptions.google.previousInteractionId` to chain stateful turns.
356
+ */
357
+ interactionId?: string;
358
+ /**
359
+ * Service tier used for this interaction (passthrough for observability).
360
+ */
361
+ serviceTier?: string;
362
+ /**
363
+ * Per-block signature hash for backend validation. Set by the SDK on output
364
+ * reasoning / tool-call parts and round-tripped on input parts.
365
+ */
366
+ signature?: string;
367
+ };
368
+
369
+ /**
370
+ * Type-only module: declares the union of supported Gemini Interactions agent
371
+ * names. Used by the `google.interactions({ agent })` factory branch.
372
+ *
373
+ * Strict string-literal union: unknown agent names are a compile-time error.
374
+ * User-defined agents (created via the `/agents` endpoint) are addressed by
375
+ * a separate `{ managedAgent: string }` factory shape — see
376
+ * `GoogleInteractionsModelInput`.
377
+ */
378
+ type GoogleInteractionsAgentName = 'deep-research-pro-preview-12-2025' | 'deep-research-preview-04-2026' | 'deep-research-max-preview-04-2026' | 'antigravity-preview-05-2026';
379
+
380
+ declare const googleTools: {
381
+ /**
382
+ * Creates a Google search tool that gives Google direct access to real-time web content.
383
+ * Must have name "google_search".
384
+ */
385
+ googleSearch: _ai_sdk_provider_utils.ProviderExecutedToolFactory<{}, {}, {
386
+ [x: string]: unknown;
387
+ searchTypes?: {
388
+ webSearch?: Record<string, never> | undefined;
389
+ imageSearch?: Record<string, never> | undefined;
390
+ } | undefined;
391
+ timeRangeFilter?: {
392
+ startTime: string;
393
+ endTime: string;
394
+ } | undefined;
395
+ }, {}>;
396
+ /**
397
+ * Creates an Enterprise Web Search tool for grounding responses using a compliance-focused web index.
398
+ * Designed for highly-regulated industries (finance, healthcare, public sector).
399
+ * Does not log customer data and supports VPC service controls.
400
+ * Must have name "enterprise_web_search".
401
+ *
402
+ * @note Only available on Vertex AI. Requires Gemini 2.0 or newer.
403
+ *
404
+ * @see https://cloud.google.com/vertex-ai/generative-ai/docs/grounding/web-grounding-enterprise
405
+ */
406
+ enterpriseWebSearch: _ai_sdk_provider_utils.ProviderExecutedToolFactory<{}, {}, {}, {}>;
407
+ /**
408
+ * Creates a Google Maps grounding tool that gives the model access to Google Maps data.
409
+ * Must have name "google_maps".
410
+ *
411
+ * @see https://ai.google.dev/gemini-api/docs/maps-grounding
412
+ * @see https://cloud.google.com/vertex-ai/generative-ai/docs/grounding/grounding-with-google-maps
413
+ */
414
+ googleMaps: _ai_sdk_provider_utils.ProviderExecutedToolFactory<{}, {}, {}, {}>;
415
+ /**
416
+ * Creates a URL context tool that gives Google direct access to real-time web content.
417
+ * Must have name "url_context".
418
+ */
419
+ urlContext: _ai_sdk_provider_utils.ProviderExecutedToolFactory<{}, {}, {}, {}>;
420
+ /**
421
+ * Enables Retrieval Augmented Generation (RAG) via the Gemini File Search tool.
422
+ * Must have name "file_search".
423
+ *
424
+ * @param fileSearchStoreNames - Fully-qualified File Search store resource names.
425
+ * @param metadataFilter - Optional filter expression to restrict the files that can be retrieved.
426
+ * @param topK - Optional result limit for the number of chunks returned from File Search.
427
+ *
428
+ * @see https://ai.google.dev/gemini-api/docs/file-search
429
+ */
430
+ fileSearch: _ai_sdk_provider_utils.ProviderExecutedToolFactory<{}, {}, {
431
+ [x: string]: unknown;
432
+ fileSearchStoreNames: string[];
433
+ topK?: number | undefined;
434
+ metadataFilter?: string | undefined;
435
+ }, {}>;
436
+ /**
437
+ * A tool that enables the model to generate and run Python code.
438
+ * Must have name "code_execution".
439
+ *
440
+ * @note Ensure the selected model supports Code Execution.
441
+ * Multi-tool usage with the code execution tool is typically compatible with Gemini >=2 models.
442
+ *
443
+ * @see https://ai.google.dev/gemini-api/docs/code-execution (Google AI)
444
+ * @see https://cloud.google.com/vertex-ai/generative-ai/docs/model-reference/code-execution-api (Vertex AI)
445
+ */
446
+ codeExecution: _ai_sdk_provider_utils.ProviderExecutedToolFactory<{
447
+ language: string;
448
+ code: string;
449
+ }, {
450
+ outcome: string;
451
+ output: string;
452
+ }, {}, {}>;
453
+ /**
454
+ * Creates a Vertex RAG Store tool that enables the model to perform RAG searches against a Vertex RAG Store.
455
+ * Must have name "vertex_rag_store".
456
+ */
457
+ vertexRagStore: _ai_sdk_provider_utils.ProviderExecutedToolFactory<{}, {}, {
458
+ ragCorpus: string;
459
+ topK?: number;
460
+ }, {}>;
461
+ };
462
+
463
+ type GoogleImageModelId = 'imagen-4.0-generate-001' | 'imagen-4.0-ultra-generate-001' | 'imagen-4.0-fast-generate-001' | 'gemini-2.5-flash-image' | 'gemini-3-pro-image-preview' | 'gemini-3.1-flash-image-preview' | (string & {});
464
+ interface GoogleImageSettings {
465
+ /**
466
+ * Override the maximum number of images per call (default 4)
467
+ */
468
+ maxImagesPerCall?: number;
7
469
  }
8
470
 
9
- export declare const google: GoogleProvider;
471
+ interface GoogleProvider extends ProviderV4 {
472
+ (modelId: GoogleModelId): LanguageModelV4;
473
+ languageModel(modelId: GoogleModelId): LanguageModelV4;
474
+ chat(modelId: GoogleModelId): LanguageModelV4;
475
+ /**
476
+ * Creates a model for image generation.
477
+ */
478
+ image(modelId: GoogleImageModelId, settings?: GoogleImageSettings): ImageModelV4;
479
+ /**
480
+ * @deprecated Use `chat()` instead.
481
+ */
482
+ generativeAI(modelId: GoogleModelId): LanguageModelV4;
483
+ /**
484
+ * Creates a model for text embeddings.
485
+ */
486
+ embedding(modelId: GoogleEmbeddingModelId): EmbeddingModelV4;
487
+ /**
488
+ * Creates a model for text embeddings.
489
+ */
490
+ embeddingModel(modelId: GoogleEmbeddingModelId): EmbeddingModelV4;
491
+ /**
492
+ * @deprecated Use `embedding` instead.
493
+ */
494
+ textEmbedding(modelId: GoogleEmbeddingModelId): EmbeddingModelV4;
495
+ /**
496
+ * @deprecated Use `embeddingModel` instead.
497
+ */
498
+ textEmbeddingModel(modelId: GoogleEmbeddingModelId): EmbeddingModelV4;
499
+ /**
500
+ * Creates a model for video generation.
501
+ */
502
+ video(modelId: GoogleVideoModelId): Experimental_VideoModelV4;
503
+ /**
504
+ * Creates a model for video generation.
505
+ */
506
+ videoModel(modelId: GoogleVideoModelId): Experimental_VideoModelV4;
507
+ files(): FilesV4;
508
+ /**
509
+ * Creates a language model targeting the Gemini Interactions API
510
+ * (`POST /v1beta/interactions`). Pass:
511
+ * - a model ID (string),
512
+ * - `{ agent: <name> }` to use a known Gemini agent preset, or
513
+ * - `{ managedAgent: <name> }` to use a user-defined agent created via
514
+ * the `/v1beta/agents` endpoint.
515
+ */
516
+ interactions(modelIdOrAgent: GoogleInteractionsModelId | {
517
+ agent: GoogleInteractionsAgentName;
518
+ } | {
519
+ managedAgent: string;
520
+ }): LanguageModelV4;
521
+ tools: typeof googleTools;
522
+ }
523
+ interface GoogleProviderSettings {
524
+ /**
525
+ * Use a different URL prefix for API calls, e.g. to use proxy servers.
526
+ * The default prefix is `https://generativelanguage.googleapis.com/v1beta`.
527
+ */
528
+ baseURL?: string;
529
+ /**
530
+ * API key that is being send using the `x-goog-api-key` header.
531
+ * It defaults to the `GOOGLE_GENERATIVE_AI_API_KEY` environment variable.
532
+ */
533
+ apiKey?: string;
534
+ /**
535
+ * Custom headers to include in the requests.
536
+ */
537
+ headers?: Record<string, string | undefined>;
538
+ /**
539
+ * Custom fetch implementation. You can use it as a middleware to intercept requests,
540
+ * or to provide a custom fetch implementation for e.g. testing.
541
+ */
542
+ fetch?: FetchFunction;
543
+ /**
544
+ * Optional function to generate a unique ID for each request.
545
+ */
546
+ generateId?: () => string;
547
+ /**
548
+ * Custom provider name
549
+ * Defaults to 'google.generative-ai'.
550
+ */
551
+ name?: string;
552
+ }
553
+ /**
554
+ * Create a Google provider instance.
555
+ */
556
+ declare function createGoogle(options?: GoogleProviderSettings): GoogleProvider;
557
+ /**
558
+ * Default Google Generative AI provider instance.
559
+ */
560
+ declare const google: GoogleProvider;
561
+
562
+ declare const VERSION: string;
563
+
564
+ export { type GoogleEmbeddingModelOptions, type GoogleErrorData, type GoogleFilesUploadOptions, type GoogleEmbeddingModelOptions as GoogleGenerativeAIEmbeddingProviderOptions, type GoogleImageModelOptions as GoogleGenerativeAIImageProviderOptions, type GoogleProvider as GoogleGenerativeAIProvider, type GoogleProviderMetadata as GoogleGenerativeAIProviderMetadata, type GoogleLanguageModelOptions as GoogleGenerativeAIProviderOptions, type GoogleProviderSettings as GoogleGenerativeAIProviderSettings, type GoogleVideoModelId as GoogleGenerativeAIVideoModelId, type GoogleVideoModelOptions as GoogleGenerativeAIVideoProviderOptions, type GoogleImageModelOptions, type GoogleInteractionsAgentName, type GoogleInteractionsModelId, type GoogleInteractionsProviderMetadata, type GoogleLanguageModelInteractionsOptions, type GoogleLanguageModelOptions, type GoogleProvider, type GoogleProviderMetadata, type GoogleProviderSettings, type GoogleVideoModelId, type GoogleVideoModelOptions, VERSION, createGoogle, createGoogle as createGoogleGenerativeAI, google };