@ai-sdk/openai 3.0.0-beta.54 → 3.0.0-beta.56
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/CHANGELOG.md +13 -0
- package/dist/index.d.mts +51 -0
- package/dist/index.d.ts +51 -0
- package/dist/index.js +845 -474
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +803 -428
- package/dist/index.mjs.map +1 -1
- package/dist/internal/index.js +377 -23
- package/dist/internal/index.js.map +1 -1
- package/dist/internal/index.mjs +359 -1
- package/dist/internal/index.mjs.map +1 -1
- package/package.json +6 -5
package/dist/index.mjs
CHANGED
|
@@ -2024,6 +2024,98 @@ var webSearchPreview = createProviderDefinedToolFactoryWithOutputSchema6({
|
|
|
2024
2024
|
outputSchema: webSearchPreviewOutputSchema
|
|
2025
2025
|
});
|
|
2026
2026
|
|
|
2027
|
+
// src/tool/mcp.ts
|
|
2028
|
+
import {
|
|
2029
|
+
createProviderDefinedToolFactoryWithOutputSchema as createProviderDefinedToolFactoryWithOutputSchema7,
|
|
2030
|
+
lazySchema as lazySchema14,
|
|
2031
|
+
zodSchema as zodSchema14
|
|
2032
|
+
} from "@ai-sdk/provider-utils";
|
|
2033
|
+
import { z as z15 } from "zod/v4";
|
|
2034
|
+
var jsonValueSchema = z15.lazy(
|
|
2035
|
+
() => z15.union([
|
|
2036
|
+
z15.string(),
|
|
2037
|
+
z15.number(),
|
|
2038
|
+
z15.boolean(),
|
|
2039
|
+
z15.null(),
|
|
2040
|
+
z15.array(jsonValueSchema),
|
|
2041
|
+
z15.record(z15.string(), jsonValueSchema)
|
|
2042
|
+
])
|
|
2043
|
+
);
|
|
2044
|
+
var mcpArgsSchema = lazySchema14(
|
|
2045
|
+
() => zodSchema14(
|
|
2046
|
+
z15.object({
|
|
2047
|
+
serverLabel: z15.string(),
|
|
2048
|
+
allowedTools: z15.union([
|
|
2049
|
+
z15.array(z15.string()),
|
|
2050
|
+
z15.object({
|
|
2051
|
+
readOnly: z15.boolean().optional(),
|
|
2052
|
+
toolNames: z15.array(z15.string()).optional()
|
|
2053
|
+
})
|
|
2054
|
+
]).optional(),
|
|
2055
|
+
authorization: z15.string().optional(),
|
|
2056
|
+
connectorId: z15.string().optional(),
|
|
2057
|
+
headers: z15.record(z15.string(), z15.string()).optional(),
|
|
2058
|
+
// TODO: Integrate this MCP tool approval with our SDK's existing tool approval architecture
|
|
2059
|
+
// requireApproval: z
|
|
2060
|
+
// .union([
|
|
2061
|
+
// z.enum(['always', 'never']),
|
|
2062
|
+
// z.object({
|
|
2063
|
+
// readOnly: z.boolean().optional(),
|
|
2064
|
+
// toolNames: z.array(z.string()).optional(),
|
|
2065
|
+
// }),
|
|
2066
|
+
// ])
|
|
2067
|
+
// .optional(),
|
|
2068
|
+
serverDescription: z15.string().optional(),
|
|
2069
|
+
serverUrl: z15.string().optional()
|
|
2070
|
+
}).refine(
|
|
2071
|
+
(v) => v.serverUrl != null || v.connectorId != null,
|
|
2072
|
+
"One of serverUrl or connectorId must be provided."
|
|
2073
|
+
)
|
|
2074
|
+
)
|
|
2075
|
+
);
|
|
2076
|
+
var mcpInputSchema = lazySchema14(() => zodSchema14(z15.object({})));
|
|
2077
|
+
var mcpOutputSchema = lazySchema14(
|
|
2078
|
+
() => zodSchema14(
|
|
2079
|
+
z15.discriminatedUnion("type", [
|
|
2080
|
+
z15.object({
|
|
2081
|
+
type: z15.literal("call"),
|
|
2082
|
+
serverLabel: z15.string(),
|
|
2083
|
+
name: z15.string(),
|
|
2084
|
+
arguments: z15.string(),
|
|
2085
|
+
output: z15.string().nullable().optional(),
|
|
2086
|
+
error: z15.union([z15.string(), jsonValueSchema]).optional()
|
|
2087
|
+
}),
|
|
2088
|
+
z15.object({
|
|
2089
|
+
type: z15.literal("listTools"),
|
|
2090
|
+
serverLabel: z15.string(),
|
|
2091
|
+
tools: z15.array(
|
|
2092
|
+
z15.object({
|
|
2093
|
+
name: z15.string(),
|
|
2094
|
+
description: z15.string().optional(),
|
|
2095
|
+
inputSchema: jsonValueSchema,
|
|
2096
|
+
annotations: z15.record(z15.string(), jsonValueSchema).optional()
|
|
2097
|
+
})
|
|
2098
|
+
),
|
|
2099
|
+
error: z15.union([z15.string(), jsonValueSchema]).optional()
|
|
2100
|
+
}),
|
|
2101
|
+
z15.object({
|
|
2102
|
+
type: z15.literal("approvalRequest"),
|
|
2103
|
+
serverLabel: z15.string(),
|
|
2104
|
+
name: z15.string(),
|
|
2105
|
+
arguments: z15.string(),
|
|
2106
|
+
approvalRequestId: z15.string()
|
|
2107
|
+
})
|
|
2108
|
+
])
|
|
2109
|
+
)
|
|
2110
|
+
);
|
|
2111
|
+
var mcpToolFactory = createProviderDefinedToolFactoryWithOutputSchema7({
|
|
2112
|
+
id: "openai.mcp",
|
|
2113
|
+
name: "mcp",
|
|
2114
|
+
inputSchema: mcpInputSchema,
|
|
2115
|
+
outputSchema: mcpOutputSchema
|
|
2116
|
+
});
|
|
2117
|
+
var mcp = (args) => mcpToolFactory(args);
|
|
2118
|
+
|
|
2027
2119
|
// src/openai-tools.ts
|
|
2028
2120
|
var openaiTools = {
|
|
2029
2121
|
/**
|
|
@@ -2099,7 +2191,23 @@ var openaiTools = {
|
|
|
2099
2191
|
* @param searchContextSize - The search context size to use for the web search.
|
|
2100
2192
|
* @param userLocation - The user location to use for the web search.
|
|
2101
2193
|
*/
|
|
2102
|
-
webSearch
|
|
2194
|
+
webSearch,
|
|
2195
|
+
/**
|
|
2196
|
+
* MCP (Model Context Protocol) allows models to call tools exposed by
|
|
2197
|
+
* remote MCP servers or service connectors.
|
|
2198
|
+
*
|
|
2199
|
+
* Must have name `mcp`.
|
|
2200
|
+
*
|
|
2201
|
+
* @param serverLabel - Label to identify the MCP server.
|
|
2202
|
+
* @param allowedTools - Allowed tool names or filter object.
|
|
2203
|
+
* @param authorization - OAuth access token for the MCP server/connector.
|
|
2204
|
+
* @param connectorId - Identifier for a service connector.
|
|
2205
|
+
* @param headers - Optional headers to include in MCP requests.
|
|
2206
|
+
* // param requireApproval - Approval policy ('always'|'never'|filter object). (Removed - always 'never')
|
|
2207
|
+
* @param serverDescription - Optional description of the server.
|
|
2208
|
+
* @param serverUrl - URL for the MCP server.
|
|
2209
|
+
*/
|
|
2210
|
+
mcp
|
|
2103
2211
|
};
|
|
2104
2212
|
|
|
2105
2213
|
// src/responses/openai-responses-language-model.ts
|
|
@@ -2125,7 +2233,7 @@ import {
|
|
|
2125
2233
|
parseProviderOptions as parseProviderOptions4,
|
|
2126
2234
|
validateTypes
|
|
2127
2235
|
} from "@ai-sdk/provider-utils";
|
|
2128
|
-
import { z as
|
|
2236
|
+
import { z as z16 } from "zod/v4";
|
|
2129
2237
|
function isFileId(data, prefixes) {
|
|
2130
2238
|
if (!prefixes) return false;
|
|
2131
2239
|
return prefixes.some((prefix) => data.startsWith(prefix));
|
|
@@ -2414,9 +2522,9 @@ async function convertToOpenAIResponsesInput({
|
|
|
2414
2522
|
}
|
|
2415
2523
|
return { input, warnings };
|
|
2416
2524
|
}
|
|
2417
|
-
var openaiResponsesReasoningProviderOptionsSchema =
|
|
2418
|
-
itemId:
|
|
2419
|
-
reasoningEncryptedContent:
|
|
2525
|
+
var openaiResponsesReasoningProviderOptionsSchema = z16.object({
|
|
2526
|
+
itemId: z16.string().nullish(),
|
|
2527
|
+
reasoningEncryptedContent: z16.string().nullish()
|
|
2420
2528
|
});
|
|
2421
2529
|
|
|
2422
2530
|
// src/responses/map-openai-responses-finish-reason.ts
|
|
@@ -2438,285 +2546,344 @@ function mapOpenAIResponseFinishReason({
|
|
|
2438
2546
|
}
|
|
2439
2547
|
|
|
2440
2548
|
// src/responses/openai-responses-api.ts
|
|
2441
|
-
import { lazySchema as
|
|
2442
|
-
import { z as
|
|
2443
|
-
var openaiResponsesChunkSchema =
|
|
2444
|
-
() =>
|
|
2445
|
-
|
|
2446
|
-
|
|
2447
|
-
type:
|
|
2448
|
-
item_id:
|
|
2449
|
-
delta:
|
|
2450
|
-
logprobs:
|
|
2451
|
-
|
|
2452
|
-
token:
|
|
2453
|
-
logprob:
|
|
2454
|
-
top_logprobs:
|
|
2455
|
-
|
|
2456
|
-
token:
|
|
2457
|
-
logprob:
|
|
2549
|
+
import { lazySchema as lazySchema15, zodSchema as zodSchema15 } from "@ai-sdk/provider-utils";
|
|
2550
|
+
import { z as z17 } from "zod/v4";
|
|
2551
|
+
var openaiResponsesChunkSchema = lazySchema15(
|
|
2552
|
+
() => zodSchema15(
|
|
2553
|
+
z17.union([
|
|
2554
|
+
z17.object({
|
|
2555
|
+
type: z17.literal("response.output_text.delta"),
|
|
2556
|
+
item_id: z17.string(),
|
|
2557
|
+
delta: z17.string(),
|
|
2558
|
+
logprobs: z17.array(
|
|
2559
|
+
z17.object({
|
|
2560
|
+
token: z17.string(),
|
|
2561
|
+
logprob: z17.number(),
|
|
2562
|
+
top_logprobs: z17.array(
|
|
2563
|
+
z17.object({
|
|
2564
|
+
token: z17.string(),
|
|
2565
|
+
logprob: z17.number()
|
|
2458
2566
|
})
|
|
2459
2567
|
)
|
|
2460
2568
|
})
|
|
2461
2569
|
).nullish()
|
|
2462
2570
|
}),
|
|
2463
|
-
|
|
2464
|
-
type:
|
|
2465
|
-
response:
|
|
2466
|
-
incomplete_details:
|
|
2467
|
-
usage:
|
|
2468
|
-
input_tokens:
|
|
2469
|
-
input_tokens_details:
|
|
2470
|
-
output_tokens:
|
|
2471
|
-
output_tokens_details:
|
|
2571
|
+
z17.object({
|
|
2572
|
+
type: z17.enum(["response.completed", "response.incomplete"]),
|
|
2573
|
+
response: z17.object({
|
|
2574
|
+
incomplete_details: z17.object({ reason: z17.string() }).nullish(),
|
|
2575
|
+
usage: z17.object({
|
|
2576
|
+
input_tokens: z17.number(),
|
|
2577
|
+
input_tokens_details: z17.object({ cached_tokens: z17.number().nullish() }).nullish(),
|
|
2578
|
+
output_tokens: z17.number(),
|
|
2579
|
+
output_tokens_details: z17.object({ reasoning_tokens: z17.number().nullish() }).nullish()
|
|
2472
2580
|
}),
|
|
2473
|
-
service_tier:
|
|
2581
|
+
service_tier: z17.string().nullish()
|
|
2474
2582
|
})
|
|
2475
2583
|
}),
|
|
2476
|
-
|
|
2477
|
-
type:
|
|
2478
|
-
response:
|
|
2479
|
-
id:
|
|
2480
|
-
created_at:
|
|
2481
|
-
model:
|
|
2482
|
-
service_tier:
|
|
2584
|
+
z17.object({
|
|
2585
|
+
type: z17.literal("response.created"),
|
|
2586
|
+
response: z17.object({
|
|
2587
|
+
id: z17.string(),
|
|
2588
|
+
created_at: z17.number(),
|
|
2589
|
+
model: z17.string(),
|
|
2590
|
+
service_tier: z17.string().nullish()
|
|
2483
2591
|
})
|
|
2484
2592
|
}),
|
|
2485
|
-
|
|
2486
|
-
type:
|
|
2487
|
-
output_index:
|
|
2488
|
-
item:
|
|
2489
|
-
|
|
2490
|
-
type:
|
|
2491
|
-
id:
|
|
2593
|
+
z17.object({
|
|
2594
|
+
type: z17.literal("response.output_item.added"),
|
|
2595
|
+
output_index: z17.number(),
|
|
2596
|
+
item: z17.discriminatedUnion("type", [
|
|
2597
|
+
z17.object({
|
|
2598
|
+
type: z17.literal("message"),
|
|
2599
|
+
id: z17.string()
|
|
2492
2600
|
}),
|
|
2493
|
-
|
|
2494
|
-
type:
|
|
2495
|
-
id:
|
|
2496
|
-
encrypted_content:
|
|
2601
|
+
z17.object({
|
|
2602
|
+
type: z17.literal("reasoning"),
|
|
2603
|
+
id: z17.string(),
|
|
2604
|
+
encrypted_content: z17.string().nullish()
|
|
2497
2605
|
}),
|
|
2498
|
-
|
|
2499
|
-
type:
|
|
2500
|
-
id:
|
|
2501
|
-
call_id:
|
|
2502
|
-
name:
|
|
2503
|
-
arguments:
|
|
2606
|
+
z17.object({
|
|
2607
|
+
type: z17.literal("function_call"),
|
|
2608
|
+
id: z17.string(),
|
|
2609
|
+
call_id: z17.string(),
|
|
2610
|
+
name: z17.string(),
|
|
2611
|
+
arguments: z17.string()
|
|
2504
2612
|
}),
|
|
2505
|
-
|
|
2506
|
-
type:
|
|
2507
|
-
id:
|
|
2508
|
-
status:
|
|
2613
|
+
z17.object({
|
|
2614
|
+
type: z17.literal("web_search_call"),
|
|
2615
|
+
id: z17.string(),
|
|
2616
|
+
status: z17.string()
|
|
2509
2617
|
}),
|
|
2510
|
-
|
|
2511
|
-
type:
|
|
2512
|
-
id:
|
|
2513
|
-
status:
|
|
2618
|
+
z17.object({
|
|
2619
|
+
type: z17.literal("computer_call"),
|
|
2620
|
+
id: z17.string(),
|
|
2621
|
+
status: z17.string()
|
|
2514
2622
|
}),
|
|
2515
|
-
|
|
2516
|
-
type:
|
|
2517
|
-
id:
|
|
2623
|
+
z17.object({
|
|
2624
|
+
type: z17.literal("file_search_call"),
|
|
2625
|
+
id: z17.string()
|
|
2518
2626
|
}),
|
|
2519
|
-
|
|
2520
|
-
type:
|
|
2521
|
-
id:
|
|
2627
|
+
z17.object({
|
|
2628
|
+
type: z17.literal("image_generation_call"),
|
|
2629
|
+
id: z17.string()
|
|
2522
2630
|
}),
|
|
2523
|
-
|
|
2524
|
-
type:
|
|
2525
|
-
id:
|
|
2526
|
-
container_id:
|
|
2527
|
-
code:
|
|
2528
|
-
outputs:
|
|
2529
|
-
|
|
2530
|
-
|
|
2531
|
-
|
|
2631
|
+
z17.object({
|
|
2632
|
+
type: z17.literal("code_interpreter_call"),
|
|
2633
|
+
id: z17.string(),
|
|
2634
|
+
container_id: z17.string(),
|
|
2635
|
+
code: z17.string().nullable(),
|
|
2636
|
+
outputs: z17.array(
|
|
2637
|
+
z17.discriminatedUnion("type", [
|
|
2638
|
+
z17.object({ type: z17.literal("logs"), logs: z17.string() }),
|
|
2639
|
+
z17.object({ type: z17.literal("image"), url: z17.string() })
|
|
2532
2640
|
])
|
|
2533
2641
|
).nullable(),
|
|
2534
|
-
status:
|
|
2642
|
+
status: z17.string()
|
|
2643
|
+
}),
|
|
2644
|
+
z17.object({
|
|
2645
|
+
type: z17.literal("mcp_call"),
|
|
2646
|
+
id: z17.string(),
|
|
2647
|
+
status: z17.string()
|
|
2648
|
+
}),
|
|
2649
|
+
z17.object({
|
|
2650
|
+
type: z17.literal("mcp_list_tools"),
|
|
2651
|
+
id: z17.string()
|
|
2652
|
+
}),
|
|
2653
|
+
z17.object({
|
|
2654
|
+
type: z17.literal("mcp_approval_request"),
|
|
2655
|
+
id: z17.string()
|
|
2535
2656
|
})
|
|
2536
2657
|
])
|
|
2537
2658
|
}),
|
|
2538
|
-
|
|
2539
|
-
type:
|
|
2540
|
-
output_index:
|
|
2541
|
-
item:
|
|
2542
|
-
|
|
2543
|
-
type:
|
|
2544
|
-
id:
|
|
2659
|
+
z17.object({
|
|
2660
|
+
type: z17.literal("response.output_item.done"),
|
|
2661
|
+
output_index: z17.number(),
|
|
2662
|
+
item: z17.discriminatedUnion("type", [
|
|
2663
|
+
z17.object({
|
|
2664
|
+
type: z17.literal("message"),
|
|
2665
|
+
id: z17.string()
|
|
2545
2666
|
}),
|
|
2546
|
-
|
|
2547
|
-
type:
|
|
2548
|
-
id:
|
|
2549
|
-
encrypted_content:
|
|
2667
|
+
z17.object({
|
|
2668
|
+
type: z17.literal("reasoning"),
|
|
2669
|
+
id: z17.string(),
|
|
2670
|
+
encrypted_content: z17.string().nullish()
|
|
2550
2671
|
}),
|
|
2551
|
-
|
|
2552
|
-
type:
|
|
2553
|
-
id:
|
|
2554
|
-
call_id:
|
|
2555
|
-
name:
|
|
2556
|
-
arguments:
|
|
2557
|
-
status:
|
|
2672
|
+
z17.object({
|
|
2673
|
+
type: z17.literal("function_call"),
|
|
2674
|
+
id: z17.string(),
|
|
2675
|
+
call_id: z17.string(),
|
|
2676
|
+
name: z17.string(),
|
|
2677
|
+
arguments: z17.string(),
|
|
2678
|
+
status: z17.literal("completed")
|
|
2558
2679
|
}),
|
|
2559
|
-
|
|
2560
|
-
type:
|
|
2561
|
-
id:
|
|
2562
|
-
code:
|
|
2563
|
-
container_id:
|
|
2564
|
-
outputs:
|
|
2565
|
-
|
|
2566
|
-
|
|
2567
|
-
|
|
2680
|
+
z17.object({
|
|
2681
|
+
type: z17.literal("code_interpreter_call"),
|
|
2682
|
+
id: z17.string(),
|
|
2683
|
+
code: z17.string().nullable(),
|
|
2684
|
+
container_id: z17.string(),
|
|
2685
|
+
outputs: z17.array(
|
|
2686
|
+
z17.discriminatedUnion("type", [
|
|
2687
|
+
z17.object({ type: z17.literal("logs"), logs: z17.string() }),
|
|
2688
|
+
z17.object({ type: z17.literal("image"), url: z17.string() })
|
|
2568
2689
|
])
|
|
2569
2690
|
).nullable()
|
|
2570
2691
|
}),
|
|
2571
|
-
|
|
2572
|
-
type:
|
|
2573
|
-
id:
|
|
2574
|
-
result:
|
|
2692
|
+
z17.object({
|
|
2693
|
+
type: z17.literal("image_generation_call"),
|
|
2694
|
+
id: z17.string(),
|
|
2695
|
+
result: z17.string()
|
|
2575
2696
|
}),
|
|
2576
|
-
|
|
2577
|
-
type:
|
|
2578
|
-
id:
|
|
2579
|
-
status:
|
|
2580
|
-
action:
|
|
2581
|
-
|
|
2582
|
-
type:
|
|
2583
|
-
query:
|
|
2584
|
-
sources:
|
|
2585
|
-
|
|
2586
|
-
|
|
2587
|
-
|
|
2697
|
+
z17.object({
|
|
2698
|
+
type: z17.literal("web_search_call"),
|
|
2699
|
+
id: z17.string(),
|
|
2700
|
+
status: z17.string(),
|
|
2701
|
+
action: z17.discriminatedUnion("type", [
|
|
2702
|
+
z17.object({
|
|
2703
|
+
type: z17.literal("search"),
|
|
2704
|
+
query: z17.string().nullish(),
|
|
2705
|
+
sources: z17.array(
|
|
2706
|
+
z17.discriminatedUnion("type", [
|
|
2707
|
+
z17.object({ type: z17.literal("url"), url: z17.string() }),
|
|
2708
|
+
z17.object({ type: z17.literal("api"), name: z17.string() })
|
|
2588
2709
|
])
|
|
2589
2710
|
).nullish()
|
|
2590
2711
|
}),
|
|
2591
|
-
|
|
2592
|
-
type:
|
|
2593
|
-
url:
|
|
2712
|
+
z17.object({
|
|
2713
|
+
type: z17.literal("open_page"),
|
|
2714
|
+
url: z17.string()
|
|
2594
2715
|
}),
|
|
2595
|
-
|
|
2596
|
-
type:
|
|
2597
|
-
url:
|
|
2598
|
-
pattern:
|
|
2716
|
+
z17.object({
|
|
2717
|
+
type: z17.literal("find"),
|
|
2718
|
+
url: z17.string(),
|
|
2719
|
+
pattern: z17.string()
|
|
2599
2720
|
})
|
|
2600
2721
|
])
|
|
2601
2722
|
}),
|
|
2602
|
-
|
|
2603
|
-
type:
|
|
2604
|
-
id:
|
|
2605
|
-
queries:
|
|
2606
|
-
results:
|
|
2607
|
-
|
|
2608
|
-
attributes:
|
|
2609
|
-
|
|
2610
|
-
|
|
2723
|
+
z17.object({
|
|
2724
|
+
type: z17.literal("file_search_call"),
|
|
2725
|
+
id: z17.string(),
|
|
2726
|
+
queries: z17.array(z17.string()),
|
|
2727
|
+
results: z17.array(
|
|
2728
|
+
z17.object({
|
|
2729
|
+
attributes: z17.record(
|
|
2730
|
+
z17.string(),
|
|
2731
|
+
z17.union([z17.string(), z17.number(), z17.boolean()])
|
|
2611
2732
|
),
|
|
2612
|
-
file_id:
|
|
2613
|
-
filename:
|
|
2614
|
-
score:
|
|
2615
|
-
text:
|
|
2733
|
+
file_id: z17.string(),
|
|
2734
|
+
filename: z17.string(),
|
|
2735
|
+
score: z17.number(),
|
|
2736
|
+
text: z17.string()
|
|
2616
2737
|
})
|
|
2617
2738
|
).nullish()
|
|
2618
2739
|
}),
|
|
2619
|
-
|
|
2620
|
-
type:
|
|
2621
|
-
id:
|
|
2622
|
-
call_id:
|
|
2623
|
-
action:
|
|
2624
|
-
type:
|
|
2625
|
-
command:
|
|
2626
|
-
timeout_ms:
|
|
2627
|
-
user:
|
|
2628
|
-
working_directory:
|
|
2629
|
-
env:
|
|
2740
|
+
z17.object({
|
|
2741
|
+
type: z17.literal("local_shell_call"),
|
|
2742
|
+
id: z17.string(),
|
|
2743
|
+
call_id: z17.string(),
|
|
2744
|
+
action: z17.object({
|
|
2745
|
+
type: z17.literal("exec"),
|
|
2746
|
+
command: z17.array(z17.string()),
|
|
2747
|
+
timeout_ms: z17.number().optional(),
|
|
2748
|
+
user: z17.string().optional(),
|
|
2749
|
+
working_directory: z17.string().optional(),
|
|
2750
|
+
env: z17.record(z17.string(), z17.string()).optional()
|
|
2630
2751
|
})
|
|
2631
2752
|
}),
|
|
2632
|
-
|
|
2633
|
-
type:
|
|
2634
|
-
id:
|
|
2635
|
-
status:
|
|
2753
|
+
z17.object({
|
|
2754
|
+
type: z17.literal("computer_call"),
|
|
2755
|
+
id: z17.string(),
|
|
2756
|
+
status: z17.literal("completed")
|
|
2757
|
+
}),
|
|
2758
|
+
z17.object({
|
|
2759
|
+
type: z17.literal("mcp_call"),
|
|
2760
|
+
id: z17.string(),
|
|
2761
|
+
status: z17.string(),
|
|
2762
|
+
arguments: z17.string(),
|
|
2763
|
+
name: z17.string(),
|
|
2764
|
+
server_label: z17.string(),
|
|
2765
|
+
output: z17.string().nullish(),
|
|
2766
|
+
error: z17.union([
|
|
2767
|
+
z17.string(),
|
|
2768
|
+
z17.object({
|
|
2769
|
+
type: z17.string().optional(),
|
|
2770
|
+
code: z17.union([z17.number(), z17.string()]).optional(),
|
|
2771
|
+
message: z17.string().optional()
|
|
2772
|
+
}).loose()
|
|
2773
|
+
]).nullish()
|
|
2774
|
+
}),
|
|
2775
|
+
z17.object({
|
|
2776
|
+
type: z17.literal("mcp_list_tools"),
|
|
2777
|
+
id: z17.string(),
|
|
2778
|
+
server_label: z17.string(),
|
|
2779
|
+
tools: z17.array(
|
|
2780
|
+
z17.object({
|
|
2781
|
+
name: z17.string(),
|
|
2782
|
+
description: z17.string().optional(),
|
|
2783
|
+
input_schema: z17.any(),
|
|
2784
|
+
annotations: z17.record(z17.string(), z17.unknown()).optional()
|
|
2785
|
+
})
|
|
2786
|
+
),
|
|
2787
|
+
error: z17.union([
|
|
2788
|
+
z17.string(),
|
|
2789
|
+
z17.object({
|
|
2790
|
+
type: z17.string().optional(),
|
|
2791
|
+
code: z17.union([z17.number(), z17.string()]).optional(),
|
|
2792
|
+
message: z17.string().optional()
|
|
2793
|
+
}).loose()
|
|
2794
|
+
]).optional()
|
|
2795
|
+
}),
|
|
2796
|
+
z17.object({
|
|
2797
|
+
type: z17.literal("mcp_approval_request"),
|
|
2798
|
+
id: z17.string(),
|
|
2799
|
+
server_label: z17.string(),
|
|
2800
|
+
name: z17.string(),
|
|
2801
|
+
arguments: z17.string(),
|
|
2802
|
+
approval_request_id: z17.string()
|
|
2636
2803
|
})
|
|
2637
2804
|
])
|
|
2638
2805
|
}),
|
|
2639
|
-
|
|
2640
|
-
type:
|
|
2641
|
-
item_id:
|
|
2642
|
-
output_index:
|
|
2643
|
-
delta:
|
|
2806
|
+
z17.object({
|
|
2807
|
+
type: z17.literal("response.function_call_arguments.delta"),
|
|
2808
|
+
item_id: z17.string(),
|
|
2809
|
+
output_index: z17.number(),
|
|
2810
|
+
delta: z17.string()
|
|
2644
2811
|
}),
|
|
2645
|
-
|
|
2646
|
-
type:
|
|
2647
|
-
item_id:
|
|
2648
|
-
output_index:
|
|
2649
|
-
partial_image_b64:
|
|
2812
|
+
z17.object({
|
|
2813
|
+
type: z17.literal("response.image_generation_call.partial_image"),
|
|
2814
|
+
item_id: z17.string(),
|
|
2815
|
+
output_index: z17.number(),
|
|
2816
|
+
partial_image_b64: z17.string()
|
|
2650
2817
|
}),
|
|
2651
|
-
|
|
2652
|
-
type:
|
|
2653
|
-
item_id:
|
|
2654
|
-
output_index:
|
|
2655
|
-
delta:
|
|
2818
|
+
z17.object({
|
|
2819
|
+
type: z17.literal("response.code_interpreter_call_code.delta"),
|
|
2820
|
+
item_id: z17.string(),
|
|
2821
|
+
output_index: z17.number(),
|
|
2822
|
+
delta: z17.string()
|
|
2656
2823
|
}),
|
|
2657
|
-
|
|
2658
|
-
type:
|
|
2659
|
-
item_id:
|
|
2660
|
-
output_index:
|
|
2661
|
-
code:
|
|
2824
|
+
z17.object({
|
|
2825
|
+
type: z17.literal("response.code_interpreter_call_code.done"),
|
|
2826
|
+
item_id: z17.string(),
|
|
2827
|
+
output_index: z17.number(),
|
|
2828
|
+
code: z17.string()
|
|
2662
2829
|
}),
|
|
2663
|
-
|
|
2664
|
-
type:
|
|
2665
|
-
annotation:
|
|
2666
|
-
|
|
2667
|
-
type:
|
|
2668
|
-
url:
|
|
2669
|
-
title:
|
|
2830
|
+
z17.object({
|
|
2831
|
+
type: z17.literal("response.output_text.annotation.added"),
|
|
2832
|
+
annotation: z17.discriminatedUnion("type", [
|
|
2833
|
+
z17.object({
|
|
2834
|
+
type: z17.literal("url_citation"),
|
|
2835
|
+
url: z17.string(),
|
|
2836
|
+
title: z17.string()
|
|
2670
2837
|
}),
|
|
2671
|
-
|
|
2672
|
-
type:
|
|
2673
|
-
file_id:
|
|
2674
|
-
filename:
|
|
2675
|
-
index:
|
|
2676
|
-
start_index:
|
|
2677
|
-
end_index:
|
|
2678
|
-
quote:
|
|
2838
|
+
z17.object({
|
|
2839
|
+
type: z17.literal("file_citation"),
|
|
2840
|
+
file_id: z17.string(),
|
|
2841
|
+
filename: z17.string().nullish(),
|
|
2842
|
+
index: z17.number().nullish(),
|
|
2843
|
+
start_index: z17.number().nullish(),
|
|
2844
|
+
end_index: z17.number().nullish(),
|
|
2845
|
+
quote: z17.string().nullish()
|
|
2679
2846
|
}),
|
|
2680
|
-
|
|
2681
|
-
type:
|
|
2682
|
-
container_id:
|
|
2683
|
-
file_id:
|
|
2684
|
-
filename:
|
|
2685
|
-
start_index:
|
|
2686
|
-
end_index:
|
|
2687
|
-
index:
|
|
2847
|
+
z17.object({
|
|
2848
|
+
type: z17.literal("container_file_citation"),
|
|
2849
|
+
container_id: z17.string(),
|
|
2850
|
+
file_id: z17.string(),
|
|
2851
|
+
filename: z17.string().nullish(),
|
|
2852
|
+
start_index: z17.number().nullish(),
|
|
2853
|
+
end_index: z17.number().nullish(),
|
|
2854
|
+
index: z17.number().nullish()
|
|
2688
2855
|
}),
|
|
2689
|
-
|
|
2690
|
-
type:
|
|
2691
|
-
file_id:
|
|
2692
|
-
index:
|
|
2856
|
+
z17.object({
|
|
2857
|
+
type: z17.literal("file_path"),
|
|
2858
|
+
file_id: z17.string(),
|
|
2859
|
+
index: z17.number().nullish()
|
|
2693
2860
|
})
|
|
2694
2861
|
])
|
|
2695
2862
|
}),
|
|
2696
|
-
|
|
2697
|
-
type:
|
|
2698
|
-
item_id:
|
|
2699
|
-
summary_index:
|
|
2863
|
+
z17.object({
|
|
2864
|
+
type: z17.literal("response.reasoning_summary_part.added"),
|
|
2865
|
+
item_id: z17.string(),
|
|
2866
|
+
summary_index: z17.number()
|
|
2700
2867
|
}),
|
|
2701
|
-
|
|
2702
|
-
type:
|
|
2703
|
-
item_id:
|
|
2704
|
-
summary_index:
|
|
2705
|
-
delta:
|
|
2868
|
+
z17.object({
|
|
2869
|
+
type: z17.literal("response.reasoning_summary_text.delta"),
|
|
2870
|
+
item_id: z17.string(),
|
|
2871
|
+
summary_index: z17.number(),
|
|
2872
|
+
delta: z17.string()
|
|
2706
2873
|
}),
|
|
2707
|
-
|
|
2708
|
-
type:
|
|
2709
|
-
item_id:
|
|
2710
|
-
summary_index:
|
|
2874
|
+
z17.object({
|
|
2875
|
+
type: z17.literal("response.reasoning_summary_part.done"),
|
|
2876
|
+
item_id: z17.string(),
|
|
2877
|
+
summary_index: z17.number()
|
|
2711
2878
|
}),
|
|
2712
|
-
|
|
2713
|
-
type:
|
|
2714
|
-
code:
|
|
2715
|
-
message:
|
|
2716
|
-
param:
|
|
2717
|
-
sequence_number:
|
|
2879
|
+
z17.object({
|
|
2880
|
+
type: z17.literal("error"),
|
|
2881
|
+
code: z17.string(),
|
|
2882
|
+
message: z17.string(),
|
|
2883
|
+
param: z17.string().nullish(),
|
|
2884
|
+
sequence_number: z17.number()
|
|
2718
2885
|
}),
|
|
2719
|
-
|
|
2886
|
+
z17.object({ type: z17.string() }).loose().transform((value) => ({
|
|
2720
2887
|
type: "unknown_chunk",
|
|
2721
2888
|
message: value.type
|
|
2722
2889
|
}))
|
|
@@ -2724,188 +2891,234 @@ var openaiResponsesChunkSchema = lazySchema14(
|
|
|
2724
2891
|
])
|
|
2725
2892
|
)
|
|
2726
2893
|
);
|
|
2727
|
-
var openaiResponsesResponseSchema =
|
|
2728
|
-
() =>
|
|
2729
|
-
|
|
2730
|
-
id:
|
|
2731
|
-
created_at:
|
|
2732
|
-
error:
|
|
2733
|
-
code:
|
|
2734
|
-
message:
|
|
2894
|
+
var openaiResponsesResponseSchema = lazySchema15(
|
|
2895
|
+
() => zodSchema15(
|
|
2896
|
+
z17.object({
|
|
2897
|
+
id: z17.string(),
|
|
2898
|
+
created_at: z17.number(),
|
|
2899
|
+
error: z17.object({
|
|
2900
|
+
code: z17.string(),
|
|
2901
|
+
message: z17.string()
|
|
2735
2902
|
}).nullish(),
|
|
2736
|
-
model:
|
|
2737
|
-
output:
|
|
2738
|
-
|
|
2739
|
-
|
|
2740
|
-
type:
|
|
2741
|
-
role:
|
|
2742
|
-
id:
|
|
2743
|
-
content:
|
|
2744
|
-
|
|
2745
|
-
type:
|
|
2746
|
-
text:
|
|
2747
|
-
logprobs:
|
|
2748
|
-
|
|
2749
|
-
token:
|
|
2750
|
-
logprob:
|
|
2751
|
-
top_logprobs:
|
|
2752
|
-
|
|
2753
|
-
token:
|
|
2754
|
-
logprob:
|
|
2903
|
+
model: z17.string(),
|
|
2904
|
+
output: z17.array(
|
|
2905
|
+
z17.discriminatedUnion("type", [
|
|
2906
|
+
z17.object({
|
|
2907
|
+
type: z17.literal("message"),
|
|
2908
|
+
role: z17.literal("assistant"),
|
|
2909
|
+
id: z17.string(),
|
|
2910
|
+
content: z17.array(
|
|
2911
|
+
z17.object({
|
|
2912
|
+
type: z17.literal("output_text"),
|
|
2913
|
+
text: z17.string(),
|
|
2914
|
+
logprobs: z17.array(
|
|
2915
|
+
z17.object({
|
|
2916
|
+
token: z17.string(),
|
|
2917
|
+
logprob: z17.number(),
|
|
2918
|
+
top_logprobs: z17.array(
|
|
2919
|
+
z17.object({
|
|
2920
|
+
token: z17.string(),
|
|
2921
|
+
logprob: z17.number()
|
|
2755
2922
|
})
|
|
2756
2923
|
)
|
|
2757
2924
|
})
|
|
2758
2925
|
).nullish(),
|
|
2759
|
-
annotations:
|
|
2760
|
-
|
|
2761
|
-
|
|
2762
|
-
type:
|
|
2763
|
-
start_index:
|
|
2764
|
-
end_index:
|
|
2765
|
-
url:
|
|
2766
|
-
title:
|
|
2926
|
+
annotations: z17.array(
|
|
2927
|
+
z17.discriminatedUnion("type", [
|
|
2928
|
+
z17.object({
|
|
2929
|
+
type: z17.literal("url_citation"),
|
|
2930
|
+
start_index: z17.number(),
|
|
2931
|
+
end_index: z17.number(),
|
|
2932
|
+
url: z17.string(),
|
|
2933
|
+
title: z17.string()
|
|
2767
2934
|
}),
|
|
2768
|
-
|
|
2769
|
-
type:
|
|
2770
|
-
file_id:
|
|
2771
|
-
filename:
|
|
2772
|
-
index:
|
|
2773
|
-
start_index:
|
|
2774
|
-
end_index:
|
|
2775
|
-
quote:
|
|
2935
|
+
z17.object({
|
|
2936
|
+
type: z17.literal("file_citation"),
|
|
2937
|
+
file_id: z17.string(),
|
|
2938
|
+
filename: z17.string().nullish(),
|
|
2939
|
+
index: z17.number().nullish(),
|
|
2940
|
+
start_index: z17.number().nullish(),
|
|
2941
|
+
end_index: z17.number().nullish(),
|
|
2942
|
+
quote: z17.string().nullish()
|
|
2776
2943
|
}),
|
|
2777
|
-
|
|
2778
|
-
type:
|
|
2779
|
-
container_id:
|
|
2780
|
-
file_id:
|
|
2781
|
-
filename:
|
|
2782
|
-
start_index:
|
|
2783
|
-
end_index:
|
|
2784
|
-
index:
|
|
2944
|
+
z17.object({
|
|
2945
|
+
type: z17.literal("container_file_citation"),
|
|
2946
|
+
container_id: z17.string(),
|
|
2947
|
+
file_id: z17.string(),
|
|
2948
|
+
filename: z17.string().nullish(),
|
|
2949
|
+
start_index: z17.number().nullish(),
|
|
2950
|
+
end_index: z17.number().nullish(),
|
|
2951
|
+
index: z17.number().nullish()
|
|
2785
2952
|
}),
|
|
2786
|
-
|
|
2787
|
-
type:
|
|
2788
|
-
file_id:
|
|
2789
|
-
index:
|
|
2953
|
+
z17.object({
|
|
2954
|
+
type: z17.literal("file_path"),
|
|
2955
|
+
file_id: z17.string(),
|
|
2956
|
+
index: z17.number().nullish()
|
|
2790
2957
|
})
|
|
2791
2958
|
])
|
|
2792
2959
|
)
|
|
2793
2960
|
})
|
|
2794
2961
|
)
|
|
2795
2962
|
}),
|
|
2796
|
-
|
|
2797
|
-
type:
|
|
2798
|
-
id:
|
|
2799
|
-
status:
|
|
2800
|
-
action:
|
|
2801
|
-
|
|
2802
|
-
type:
|
|
2803
|
-
query:
|
|
2804
|
-
sources:
|
|
2805
|
-
|
|
2806
|
-
|
|
2807
|
-
|
|
2963
|
+
z17.object({
|
|
2964
|
+
type: z17.literal("web_search_call"),
|
|
2965
|
+
id: z17.string(),
|
|
2966
|
+
status: z17.string(),
|
|
2967
|
+
action: z17.discriminatedUnion("type", [
|
|
2968
|
+
z17.object({
|
|
2969
|
+
type: z17.literal("search"),
|
|
2970
|
+
query: z17.string().nullish(),
|
|
2971
|
+
sources: z17.array(
|
|
2972
|
+
z17.discriminatedUnion("type", [
|
|
2973
|
+
z17.object({ type: z17.literal("url"), url: z17.string() }),
|
|
2974
|
+
z17.object({ type: z17.literal("api"), name: z17.string() })
|
|
2808
2975
|
])
|
|
2809
2976
|
).nullish()
|
|
2810
2977
|
}),
|
|
2811
|
-
|
|
2812
|
-
type:
|
|
2813
|
-
url:
|
|
2978
|
+
z17.object({
|
|
2979
|
+
type: z17.literal("open_page"),
|
|
2980
|
+
url: z17.string()
|
|
2814
2981
|
}),
|
|
2815
|
-
|
|
2816
|
-
type:
|
|
2817
|
-
url:
|
|
2818
|
-
pattern:
|
|
2982
|
+
z17.object({
|
|
2983
|
+
type: z17.literal("find"),
|
|
2984
|
+
url: z17.string(),
|
|
2985
|
+
pattern: z17.string()
|
|
2819
2986
|
})
|
|
2820
2987
|
])
|
|
2821
2988
|
}),
|
|
2822
|
-
|
|
2823
|
-
type:
|
|
2824
|
-
id:
|
|
2825
|
-
queries:
|
|
2826
|
-
results:
|
|
2827
|
-
|
|
2828
|
-
attributes:
|
|
2829
|
-
|
|
2830
|
-
|
|
2989
|
+
z17.object({
|
|
2990
|
+
type: z17.literal("file_search_call"),
|
|
2991
|
+
id: z17.string(),
|
|
2992
|
+
queries: z17.array(z17.string()),
|
|
2993
|
+
results: z17.array(
|
|
2994
|
+
z17.object({
|
|
2995
|
+
attributes: z17.record(
|
|
2996
|
+
z17.string(),
|
|
2997
|
+
z17.union([z17.string(), z17.number(), z17.boolean()])
|
|
2831
2998
|
),
|
|
2832
|
-
file_id:
|
|
2833
|
-
filename:
|
|
2834
|
-
score:
|
|
2835
|
-
text:
|
|
2999
|
+
file_id: z17.string(),
|
|
3000
|
+
filename: z17.string(),
|
|
3001
|
+
score: z17.number(),
|
|
3002
|
+
text: z17.string()
|
|
2836
3003
|
})
|
|
2837
3004
|
).nullish()
|
|
2838
3005
|
}),
|
|
2839
|
-
|
|
2840
|
-
type:
|
|
2841
|
-
id:
|
|
2842
|
-
code:
|
|
2843
|
-
container_id:
|
|
2844
|
-
outputs:
|
|
2845
|
-
|
|
2846
|
-
|
|
2847
|
-
|
|
3006
|
+
z17.object({
|
|
3007
|
+
type: z17.literal("code_interpreter_call"),
|
|
3008
|
+
id: z17.string(),
|
|
3009
|
+
code: z17.string().nullable(),
|
|
3010
|
+
container_id: z17.string(),
|
|
3011
|
+
outputs: z17.array(
|
|
3012
|
+
z17.discriminatedUnion("type", [
|
|
3013
|
+
z17.object({ type: z17.literal("logs"), logs: z17.string() }),
|
|
3014
|
+
z17.object({ type: z17.literal("image"), url: z17.string() })
|
|
2848
3015
|
])
|
|
2849
3016
|
).nullable()
|
|
2850
3017
|
}),
|
|
2851
|
-
|
|
2852
|
-
type:
|
|
2853
|
-
id:
|
|
2854
|
-
result:
|
|
3018
|
+
z17.object({
|
|
3019
|
+
type: z17.literal("image_generation_call"),
|
|
3020
|
+
id: z17.string(),
|
|
3021
|
+
result: z17.string()
|
|
2855
3022
|
}),
|
|
2856
|
-
|
|
2857
|
-
type:
|
|
2858
|
-
id:
|
|
2859
|
-
call_id:
|
|
2860
|
-
action:
|
|
2861
|
-
type:
|
|
2862
|
-
command:
|
|
2863
|
-
timeout_ms:
|
|
2864
|
-
user:
|
|
2865
|
-
working_directory:
|
|
2866
|
-
env:
|
|
3023
|
+
z17.object({
|
|
3024
|
+
type: z17.literal("local_shell_call"),
|
|
3025
|
+
id: z17.string(),
|
|
3026
|
+
call_id: z17.string(),
|
|
3027
|
+
action: z17.object({
|
|
3028
|
+
type: z17.literal("exec"),
|
|
3029
|
+
command: z17.array(z17.string()),
|
|
3030
|
+
timeout_ms: z17.number().optional(),
|
|
3031
|
+
user: z17.string().optional(),
|
|
3032
|
+
working_directory: z17.string().optional(),
|
|
3033
|
+
env: z17.record(z17.string(), z17.string()).optional()
|
|
2867
3034
|
})
|
|
2868
3035
|
}),
|
|
2869
|
-
|
|
2870
|
-
type:
|
|
2871
|
-
call_id:
|
|
2872
|
-
name:
|
|
2873
|
-
arguments:
|
|
2874
|
-
id:
|
|
3036
|
+
z17.object({
|
|
3037
|
+
type: z17.literal("function_call"),
|
|
3038
|
+
call_id: z17.string(),
|
|
3039
|
+
name: z17.string(),
|
|
3040
|
+
arguments: z17.string(),
|
|
3041
|
+
id: z17.string()
|
|
2875
3042
|
}),
|
|
2876
|
-
|
|
2877
|
-
type:
|
|
2878
|
-
id:
|
|
2879
|
-
status:
|
|
3043
|
+
z17.object({
|
|
3044
|
+
type: z17.literal("computer_call"),
|
|
3045
|
+
id: z17.string(),
|
|
3046
|
+
status: z17.string().optional()
|
|
2880
3047
|
}),
|
|
2881
|
-
|
|
2882
|
-
type:
|
|
2883
|
-
id:
|
|
2884
|
-
encrypted_content:
|
|
2885
|
-
summary:
|
|
2886
|
-
|
|
2887
|
-
type:
|
|
2888
|
-
text:
|
|
3048
|
+
z17.object({
|
|
3049
|
+
type: z17.literal("reasoning"),
|
|
3050
|
+
id: z17.string(),
|
|
3051
|
+
encrypted_content: z17.string().nullish(),
|
|
3052
|
+
summary: z17.array(
|
|
3053
|
+
z17.object({
|
|
3054
|
+
type: z17.literal("summary_text"),
|
|
3055
|
+
text: z17.string()
|
|
2889
3056
|
})
|
|
2890
3057
|
)
|
|
3058
|
+
}),
|
|
3059
|
+
z17.object({
|
|
3060
|
+
type: z17.literal("mcp_call"),
|
|
3061
|
+
id: z17.string(),
|
|
3062
|
+
status: z17.string(),
|
|
3063
|
+
arguments: z17.string(),
|
|
3064
|
+
name: z17.string(),
|
|
3065
|
+
server_label: z17.string(),
|
|
3066
|
+
output: z17.string().nullish(),
|
|
3067
|
+
error: z17.union([
|
|
3068
|
+
z17.string(),
|
|
3069
|
+
z17.object({
|
|
3070
|
+
type: z17.string().optional(),
|
|
3071
|
+
code: z17.union([z17.number(), z17.string()]).optional(),
|
|
3072
|
+
message: z17.string().optional()
|
|
3073
|
+
}).loose()
|
|
3074
|
+
]).nullish()
|
|
3075
|
+
}),
|
|
3076
|
+
z17.object({
|
|
3077
|
+
type: z17.literal("mcp_list_tools"),
|
|
3078
|
+
id: z17.string(),
|
|
3079
|
+
server_label: z17.string(),
|
|
3080
|
+
tools: z17.array(
|
|
3081
|
+
z17.object({
|
|
3082
|
+
name: z17.string(),
|
|
3083
|
+
description: z17.string().optional(),
|
|
3084
|
+
input_schema: z17.any(),
|
|
3085
|
+
annotations: z17.record(z17.string(), z17.unknown()).optional()
|
|
3086
|
+
})
|
|
3087
|
+
),
|
|
3088
|
+
error: z17.union([
|
|
3089
|
+
z17.string(),
|
|
3090
|
+
z17.object({
|
|
3091
|
+
type: z17.string().optional(),
|
|
3092
|
+
code: z17.union([z17.number(), z17.string()]).optional(),
|
|
3093
|
+
message: z17.string().optional()
|
|
3094
|
+
}).loose()
|
|
3095
|
+
]).optional()
|
|
3096
|
+
}),
|
|
3097
|
+
z17.object({
|
|
3098
|
+
type: z17.literal("mcp_approval_request"),
|
|
3099
|
+
id: z17.string(),
|
|
3100
|
+
server_label: z17.string(),
|
|
3101
|
+
name: z17.string(),
|
|
3102
|
+
arguments: z17.string(),
|
|
3103
|
+
approval_request_id: z17.string()
|
|
2891
3104
|
})
|
|
2892
3105
|
])
|
|
2893
3106
|
),
|
|
2894
|
-
service_tier:
|
|
2895
|
-
incomplete_details:
|
|
2896
|
-
usage:
|
|
2897
|
-
input_tokens:
|
|
2898
|
-
input_tokens_details:
|
|
2899
|
-
output_tokens:
|
|
2900
|
-
output_tokens_details:
|
|
3107
|
+
service_tier: z17.string().nullish(),
|
|
3108
|
+
incomplete_details: z17.object({ reason: z17.string() }).nullish(),
|
|
3109
|
+
usage: z17.object({
|
|
3110
|
+
input_tokens: z17.number(),
|
|
3111
|
+
input_tokens_details: z17.object({ cached_tokens: z17.number().nullish() }).nullish(),
|
|
3112
|
+
output_tokens: z17.number(),
|
|
3113
|
+
output_tokens_details: z17.object({ reasoning_tokens: z17.number().nullish() }).nullish()
|
|
2901
3114
|
})
|
|
2902
3115
|
})
|
|
2903
3116
|
)
|
|
2904
3117
|
);
|
|
2905
3118
|
|
|
2906
3119
|
// src/responses/openai-responses-options.ts
|
|
2907
|
-
import { lazySchema as
|
|
2908
|
-
import { z as
|
|
3120
|
+
import { lazySchema as lazySchema16, zodSchema as zodSchema16 } from "@ai-sdk/provider-utils";
|
|
3121
|
+
import { z as z18 } from "zod/v4";
|
|
2909
3122
|
var TOP_LOGPROBS_MAX = 20;
|
|
2910
3123
|
var openaiResponsesReasoningModelIds = [
|
|
2911
3124
|
"o1",
|
|
@@ -2968,18 +3181,18 @@ var openaiResponsesModelIds = [
|
|
|
2968
3181
|
"gpt-5-chat-latest",
|
|
2969
3182
|
...openaiResponsesReasoningModelIds
|
|
2970
3183
|
];
|
|
2971
|
-
var openaiResponsesProviderOptionsSchema =
|
|
2972
|
-
() =>
|
|
2973
|
-
|
|
2974
|
-
include:
|
|
2975
|
-
|
|
3184
|
+
var openaiResponsesProviderOptionsSchema = lazySchema16(
|
|
3185
|
+
() => zodSchema16(
|
|
3186
|
+
z18.object({
|
|
3187
|
+
include: z18.array(
|
|
3188
|
+
z18.enum([
|
|
2976
3189
|
"reasoning.encrypted_content",
|
|
2977
3190
|
// handled internally by default, only needed for unknown reasoning models
|
|
2978
3191
|
"file_search_call.results",
|
|
2979
3192
|
"message.output_text.logprobs"
|
|
2980
3193
|
])
|
|
2981
3194
|
).nullish(),
|
|
2982
|
-
instructions:
|
|
3195
|
+
instructions: z18.string().nullish(),
|
|
2983
3196
|
/**
|
|
2984
3197
|
* Return the log probabilities of the tokens.
|
|
2985
3198
|
*
|
|
@@ -2992,26 +3205,26 @@ var openaiResponsesProviderOptionsSchema = lazySchema15(
|
|
|
2992
3205
|
* @see https://platform.openai.com/docs/api-reference/responses/create
|
|
2993
3206
|
* @see https://cookbook.openai.com/examples/using_logprobs
|
|
2994
3207
|
*/
|
|
2995
|
-
logprobs:
|
|
3208
|
+
logprobs: z18.union([z18.boolean(), z18.number().min(1).max(TOP_LOGPROBS_MAX)]).optional(),
|
|
2996
3209
|
/**
|
|
2997
3210
|
* The maximum number of total calls to built-in tools that can be processed in a response.
|
|
2998
3211
|
* This maximum number applies across all built-in tool calls, not per individual tool.
|
|
2999
3212
|
* Any further attempts to call a tool by the model will be ignored.
|
|
3000
3213
|
*/
|
|
3001
|
-
maxToolCalls:
|
|
3002
|
-
metadata:
|
|
3003
|
-
parallelToolCalls:
|
|
3004
|
-
previousResponseId:
|
|
3005
|
-
promptCacheKey:
|
|
3006
|
-
reasoningEffort:
|
|
3007
|
-
reasoningSummary:
|
|
3008
|
-
safetyIdentifier:
|
|
3009
|
-
serviceTier:
|
|
3010
|
-
store:
|
|
3011
|
-
strictJsonSchema:
|
|
3012
|
-
textVerbosity:
|
|
3013
|
-
truncation:
|
|
3014
|
-
user:
|
|
3214
|
+
maxToolCalls: z18.number().nullish(),
|
|
3215
|
+
metadata: z18.any().nullish(),
|
|
3216
|
+
parallelToolCalls: z18.boolean().nullish(),
|
|
3217
|
+
previousResponseId: z18.string().nullish(),
|
|
3218
|
+
promptCacheKey: z18.string().nullish(),
|
|
3219
|
+
reasoningEffort: z18.string().nullish(),
|
|
3220
|
+
reasoningSummary: z18.string().nullish(),
|
|
3221
|
+
safetyIdentifier: z18.string().nullish(),
|
|
3222
|
+
serviceTier: z18.enum(["auto", "flex", "priority", "default"]).nullish(),
|
|
3223
|
+
store: z18.boolean().nullish(),
|
|
3224
|
+
strictJsonSchema: z18.boolean().nullish(),
|
|
3225
|
+
textVerbosity: z18.enum(["low", "medium", "high"]).nullish(),
|
|
3226
|
+
truncation: z18.enum(["auto", "disabled"]).nullish(),
|
|
3227
|
+
user: z18.string().nullish()
|
|
3015
3228
|
})
|
|
3016
3229
|
)
|
|
3017
3230
|
);
|
|
@@ -3127,6 +3340,36 @@ async function prepareResponsesTools({
|
|
|
3127
3340
|
});
|
|
3128
3341
|
break;
|
|
3129
3342
|
}
|
|
3343
|
+
case "openai.mcp": {
|
|
3344
|
+
const args = await validateTypes2({
|
|
3345
|
+
value: tool.args,
|
|
3346
|
+
schema: mcpArgsSchema
|
|
3347
|
+
});
|
|
3348
|
+
openaiTools2.push({
|
|
3349
|
+
type: "mcp",
|
|
3350
|
+
server_label: args.serverLabel,
|
|
3351
|
+
allowed_tools: Array.isArray(args.allowedTools) ? args.allowedTools : args.allowedTools ? {
|
|
3352
|
+
read_only: args.allowedTools.readOnly,
|
|
3353
|
+
tool_names: args.allowedTools.toolNames
|
|
3354
|
+
} : void 0,
|
|
3355
|
+
authorization: args.authorization,
|
|
3356
|
+
connector_id: args.connectorId,
|
|
3357
|
+
headers: args.headers,
|
|
3358
|
+
// require_approval:
|
|
3359
|
+
// typeof args.requireApproval === 'string'
|
|
3360
|
+
// ? args.requireApproval
|
|
3361
|
+
// : args.requireApproval
|
|
3362
|
+
// ? {
|
|
3363
|
+
// read_only: args.requireApproval.readOnly,
|
|
3364
|
+
// tool_names: args.requireApproval.toolNames,
|
|
3365
|
+
// }
|
|
3366
|
+
// : undefined,
|
|
3367
|
+
require_approval: "never",
|
|
3368
|
+
server_description: args.serverDescription,
|
|
3369
|
+
server_url: args.serverUrl
|
|
3370
|
+
});
|
|
3371
|
+
break;
|
|
3372
|
+
}
|
|
3130
3373
|
}
|
|
3131
3374
|
break;
|
|
3132
3375
|
}
|
|
@@ -3147,7 +3390,7 @@ async function prepareResponsesTools({
|
|
|
3147
3390
|
case "tool":
|
|
3148
3391
|
return {
|
|
3149
3392
|
tools: openaiTools2,
|
|
3150
|
-
toolChoice: toolChoice.toolName === "code_interpreter" || toolChoice.toolName === "file_search" || toolChoice.toolName === "image_generation" || toolChoice.toolName === "web_search_preview" || toolChoice.toolName === "web_search" ? { type: toolChoice.toolName } : { type: "function", name: toolChoice.toolName },
|
|
3393
|
+
toolChoice: toolChoice.toolName === "code_interpreter" || toolChoice.toolName === "file_search" || toolChoice.toolName === "image_generation" || toolChoice.toolName === "web_search_preview" || toolChoice.toolName === "web_search" || toolChoice.toolName === "mcp" ? { type: toolChoice.toolName } : { type: "function", name: toolChoice.toolName },
|
|
3151
3394
|
toolWarnings
|
|
3152
3395
|
};
|
|
3153
3396
|
default: {
|
|
@@ -3577,6 +3820,80 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
3577
3820
|
});
|
|
3578
3821
|
break;
|
|
3579
3822
|
}
|
|
3823
|
+
case "mcp_call": {
|
|
3824
|
+
content.push({
|
|
3825
|
+
type: "tool-call",
|
|
3826
|
+
toolCallId: part.id,
|
|
3827
|
+
toolName: "mcp",
|
|
3828
|
+
input: JSON.stringify({}),
|
|
3829
|
+
providerExecuted: true
|
|
3830
|
+
});
|
|
3831
|
+
content.push({
|
|
3832
|
+
type: "tool-result",
|
|
3833
|
+
toolCallId: part.id,
|
|
3834
|
+
toolName: "mcp",
|
|
3835
|
+
result: {
|
|
3836
|
+
type: "call",
|
|
3837
|
+
serverLabel: part.server_label,
|
|
3838
|
+
name: part.name,
|
|
3839
|
+
arguments: part.arguments,
|
|
3840
|
+
...part.output != null ? { output: part.output } : {},
|
|
3841
|
+
...part.error != null ? { error: part.error } : {}
|
|
3842
|
+
}
|
|
3843
|
+
});
|
|
3844
|
+
break;
|
|
3845
|
+
}
|
|
3846
|
+
case "mcp_list_tools": {
|
|
3847
|
+
content.push({
|
|
3848
|
+
type: "tool-call",
|
|
3849
|
+
toolCallId: part.id,
|
|
3850
|
+
toolName: "mcp",
|
|
3851
|
+
input: JSON.stringify({}),
|
|
3852
|
+
providerExecuted: true
|
|
3853
|
+
});
|
|
3854
|
+
content.push({
|
|
3855
|
+
type: "tool-result",
|
|
3856
|
+
toolCallId: part.id,
|
|
3857
|
+
toolName: "mcp",
|
|
3858
|
+
result: {
|
|
3859
|
+
type: "listTools",
|
|
3860
|
+
serverLabel: part.server_label,
|
|
3861
|
+
tools: part.tools.map((t) => {
|
|
3862
|
+
var _a2, _b2;
|
|
3863
|
+
return {
|
|
3864
|
+
name: t.name,
|
|
3865
|
+
description: (_a2 = t.description) != null ? _a2 : void 0,
|
|
3866
|
+
inputSchema: t.input_schema,
|
|
3867
|
+
annotations: (_b2 = t.annotations) != null ? _b2 : void 0
|
|
3868
|
+
};
|
|
3869
|
+
}),
|
|
3870
|
+
...part.error != null ? { error: part.error } : {}
|
|
3871
|
+
}
|
|
3872
|
+
});
|
|
3873
|
+
break;
|
|
3874
|
+
}
|
|
3875
|
+
case "mcp_approval_request": {
|
|
3876
|
+
content.push({
|
|
3877
|
+
type: "tool-call",
|
|
3878
|
+
toolCallId: part.id,
|
|
3879
|
+
toolName: "mcp",
|
|
3880
|
+
input: JSON.stringify({}),
|
|
3881
|
+
providerExecuted: true
|
|
3882
|
+
});
|
|
3883
|
+
content.push({
|
|
3884
|
+
type: "tool-result",
|
|
3885
|
+
toolCallId: part.id,
|
|
3886
|
+
toolName: "mcp",
|
|
3887
|
+
result: {
|
|
3888
|
+
type: "approvalRequest",
|
|
3889
|
+
serverLabel: part.server_label,
|
|
3890
|
+
name: part.name,
|
|
3891
|
+
arguments: part.arguments,
|
|
3892
|
+
approvalRequestId: part.approval_request_id
|
|
3893
|
+
}
|
|
3894
|
+
});
|
|
3895
|
+
break;
|
|
3896
|
+
}
|
|
3580
3897
|
case "computer_call": {
|
|
3581
3898
|
content.push({
|
|
3582
3899
|
type: "tool-call",
|
|
@@ -3811,6 +4128,14 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
3811
4128
|
input: "{}",
|
|
3812
4129
|
providerExecuted: true
|
|
3813
4130
|
});
|
|
4131
|
+
} else if (value.item.type === "mcp_call" || value.item.type === "mcp_list_tools" || value.item.type === "mcp_approval_request") {
|
|
4132
|
+
controller.enqueue({
|
|
4133
|
+
type: "tool-call",
|
|
4134
|
+
toolCallId: value.item.id,
|
|
4135
|
+
toolName: "mcp",
|
|
4136
|
+
input: "{}",
|
|
4137
|
+
providerExecuted: true
|
|
4138
|
+
});
|
|
3814
4139
|
} else if (value.item.type === "message") {
|
|
3815
4140
|
controller.enqueue({
|
|
3816
4141
|
type: "text-start",
|
|
@@ -3922,6 +4247,56 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
3922
4247
|
result: value.item.result
|
|
3923
4248
|
}
|
|
3924
4249
|
});
|
|
4250
|
+
} else if (value.item.type === "mcp_call") {
|
|
4251
|
+
ongoingToolCalls[value.output_index] = void 0;
|
|
4252
|
+
controller.enqueue({
|
|
4253
|
+
type: "tool-result",
|
|
4254
|
+
toolCallId: value.item.id,
|
|
4255
|
+
toolName: "mcp",
|
|
4256
|
+
result: {
|
|
4257
|
+
type: "call",
|
|
4258
|
+
serverLabel: value.item.server_label,
|
|
4259
|
+
name: value.item.name,
|
|
4260
|
+
arguments: value.item.arguments,
|
|
4261
|
+
...value.item.output != null ? { output: value.item.output } : {},
|
|
4262
|
+
...value.item.error != null ? { error: value.item.error } : {}
|
|
4263
|
+
}
|
|
4264
|
+
});
|
|
4265
|
+
} else if (value.item.type === "mcp_list_tools") {
|
|
4266
|
+
ongoingToolCalls[value.output_index] = void 0;
|
|
4267
|
+
controller.enqueue({
|
|
4268
|
+
type: "tool-result",
|
|
4269
|
+
toolCallId: value.item.id,
|
|
4270
|
+
toolName: "mcp",
|
|
4271
|
+
result: {
|
|
4272
|
+
type: "listTools",
|
|
4273
|
+
serverLabel: value.item.server_label,
|
|
4274
|
+
tools: value.item.tools.map((t) => {
|
|
4275
|
+
var _a2, _b2;
|
|
4276
|
+
return {
|
|
4277
|
+
name: t.name,
|
|
4278
|
+
description: (_a2 = t.description) != null ? _a2 : void 0,
|
|
4279
|
+
inputSchema: t.input_schema,
|
|
4280
|
+
annotations: (_b2 = t.annotations) != null ? _b2 : void 0
|
|
4281
|
+
};
|
|
4282
|
+
}),
|
|
4283
|
+
...value.item.error != null ? { error: value.item.error } : {}
|
|
4284
|
+
}
|
|
4285
|
+
});
|
|
4286
|
+
} else if (value.item.type === "mcp_approval_request") {
|
|
4287
|
+
ongoingToolCalls[value.output_index] = void 0;
|
|
4288
|
+
controller.enqueue({
|
|
4289
|
+
type: "tool-result",
|
|
4290
|
+
toolCallId: value.item.id,
|
|
4291
|
+
toolName: "mcp",
|
|
4292
|
+
result: {
|
|
4293
|
+
type: "approvalRequest",
|
|
4294
|
+
serverLabel: value.item.server_label,
|
|
4295
|
+
name: value.item.name,
|
|
4296
|
+
arguments: value.item.arguments,
|
|
4297
|
+
approvalRequestId: value.item.approval_request_id
|
|
4298
|
+
}
|
|
4299
|
+
});
|
|
3925
4300
|
} else if (value.item.type === "local_shell_call") {
|
|
3926
4301
|
ongoingToolCalls[value.output_index] = void 0;
|
|
3927
4302
|
controller.enqueue({
|
|
@@ -4261,13 +4636,13 @@ import {
|
|
|
4261
4636
|
} from "@ai-sdk/provider-utils";
|
|
4262
4637
|
|
|
4263
4638
|
// src/speech/openai-speech-options.ts
|
|
4264
|
-
import { lazySchema as
|
|
4265
|
-
import { z as
|
|
4266
|
-
var openaiSpeechProviderOptionsSchema =
|
|
4267
|
-
() =>
|
|
4268
|
-
|
|
4269
|
-
instructions:
|
|
4270
|
-
speed:
|
|
4639
|
+
import { lazySchema as lazySchema17, zodSchema as zodSchema17 } from "@ai-sdk/provider-utils";
|
|
4640
|
+
import { z as z19 } from "zod/v4";
|
|
4641
|
+
var openaiSpeechProviderOptionsSchema = lazySchema17(
|
|
4642
|
+
() => zodSchema17(
|
|
4643
|
+
z19.object({
|
|
4644
|
+
instructions: z19.string().nullish(),
|
|
4645
|
+
speed: z19.number().min(0.25).max(4).default(1).nullish()
|
|
4271
4646
|
})
|
|
4272
4647
|
)
|
|
4273
4648
|
);
|
|
@@ -4384,33 +4759,33 @@ import {
|
|
|
4384
4759
|
} from "@ai-sdk/provider-utils";
|
|
4385
4760
|
|
|
4386
4761
|
// src/transcription/openai-transcription-api.ts
|
|
4387
|
-
import { lazySchema as
|
|
4388
|
-
import { z as
|
|
4389
|
-
var openaiTranscriptionResponseSchema =
|
|
4390
|
-
() =>
|
|
4391
|
-
|
|
4392
|
-
text:
|
|
4393
|
-
language:
|
|
4394
|
-
duration:
|
|
4395
|
-
words:
|
|
4396
|
-
|
|
4397
|
-
word:
|
|
4398
|
-
start:
|
|
4399
|
-
end:
|
|
4762
|
+
import { lazySchema as lazySchema18, zodSchema as zodSchema18 } from "@ai-sdk/provider-utils";
|
|
4763
|
+
import { z as z20 } from "zod/v4";
|
|
4764
|
+
var openaiTranscriptionResponseSchema = lazySchema18(
|
|
4765
|
+
() => zodSchema18(
|
|
4766
|
+
z20.object({
|
|
4767
|
+
text: z20.string(),
|
|
4768
|
+
language: z20.string().nullish(),
|
|
4769
|
+
duration: z20.number().nullish(),
|
|
4770
|
+
words: z20.array(
|
|
4771
|
+
z20.object({
|
|
4772
|
+
word: z20.string(),
|
|
4773
|
+
start: z20.number(),
|
|
4774
|
+
end: z20.number()
|
|
4400
4775
|
})
|
|
4401
4776
|
).nullish(),
|
|
4402
|
-
segments:
|
|
4403
|
-
|
|
4404
|
-
id:
|
|
4405
|
-
seek:
|
|
4406
|
-
start:
|
|
4407
|
-
end:
|
|
4408
|
-
text:
|
|
4409
|
-
tokens:
|
|
4410
|
-
temperature:
|
|
4411
|
-
avg_logprob:
|
|
4412
|
-
compression_ratio:
|
|
4413
|
-
no_speech_prob:
|
|
4777
|
+
segments: z20.array(
|
|
4778
|
+
z20.object({
|
|
4779
|
+
id: z20.number(),
|
|
4780
|
+
seek: z20.number(),
|
|
4781
|
+
start: z20.number(),
|
|
4782
|
+
end: z20.number(),
|
|
4783
|
+
text: z20.string(),
|
|
4784
|
+
tokens: z20.array(z20.number()),
|
|
4785
|
+
temperature: z20.number(),
|
|
4786
|
+
avg_logprob: z20.number(),
|
|
4787
|
+
compression_ratio: z20.number(),
|
|
4788
|
+
no_speech_prob: z20.number()
|
|
4414
4789
|
})
|
|
4415
4790
|
).nullish()
|
|
4416
4791
|
})
|
|
@@ -4418,33 +4793,33 @@ var openaiTranscriptionResponseSchema = lazySchema17(
|
|
|
4418
4793
|
);
|
|
4419
4794
|
|
|
4420
4795
|
// src/transcription/openai-transcription-options.ts
|
|
4421
|
-
import { lazySchema as
|
|
4422
|
-
import { z as
|
|
4423
|
-
var openAITranscriptionProviderOptions =
|
|
4424
|
-
() =>
|
|
4425
|
-
|
|
4796
|
+
import { lazySchema as lazySchema19, zodSchema as zodSchema19 } from "@ai-sdk/provider-utils";
|
|
4797
|
+
import { z as z21 } from "zod/v4";
|
|
4798
|
+
var openAITranscriptionProviderOptions = lazySchema19(
|
|
4799
|
+
() => zodSchema19(
|
|
4800
|
+
z21.object({
|
|
4426
4801
|
/**
|
|
4427
4802
|
* Additional information to include in the transcription response.
|
|
4428
4803
|
*/
|
|
4429
|
-
include:
|
|
4804
|
+
include: z21.array(z21.string()).optional(),
|
|
4430
4805
|
/**
|
|
4431
4806
|
* The language of the input audio in ISO-639-1 format.
|
|
4432
4807
|
*/
|
|
4433
|
-
language:
|
|
4808
|
+
language: z21.string().optional(),
|
|
4434
4809
|
/**
|
|
4435
4810
|
* An optional text to guide the model's style or continue a previous audio segment.
|
|
4436
4811
|
*/
|
|
4437
|
-
prompt:
|
|
4812
|
+
prompt: z21.string().optional(),
|
|
4438
4813
|
/**
|
|
4439
4814
|
* The sampling temperature, between 0 and 1.
|
|
4440
4815
|
* @default 0
|
|
4441
4816
|
*/
|
|
4442
|
-
temperature:
|
|
4817
|
+
temperature: z21.number().min(0).max(1).default(0).optional(),
|
|
4443
4818
|
/**
|
|
4444
4819
|
* The timestamp granularities to populate for this transcription.
|
|
4445
4820
|
* @default ['segment']
|
|
4446
4821
|
*/
|
|
4447
|
-
timestampGranularities:
|
|
4822
|
+
timestampGranularities: z21.array(z21.enum(["word", "segment"])).default(["segment"]).optional()
|
|
4448
4823
|
})
|
|
4449
4824
|
)
|
|
4450
4825
|
);
|
|
@@ -4617,7 +4992,7 @@ var OpenAITranscriptionModel = class {
|
|
|
4617
4992
|
};
|
|
4618
4993
|
|
|
4619
4994
|
// src/version.ts
|
|
4620
|
-
var VERSION = true ? "3.0.0-beta.
|
|
4995
|
+
var VERSION = true ? "3.0.0-beta.56" : "0.0.0-test";
|
|
4621
4996
|
|
|
4622
4997
|
// src/openai-provider.ts
|
|
4623
4998
|
function createOpenAI(options = {}) {
|