mirror of
https://github.com/anomalyco/opencode.git
synced 2026-04-23 22:34:53 +00:00
fix: adjust imports in github copilot sdk to be v6 compat
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { createProviderDefinedToolFactoryWithOutputSchema } from "@ai-sdk/provider-utils"
|
||||
import { createProviderToolFactoryWithOutputSchema } from "@ai-sdk/provider-utils"
|
||||
import { z } from "zod/v4"
|
||||
|
||||
export const codeInterpreterInputSchema = z.object({
|
||||
@@ -37,7 +37,7 @@ type CodeInterpreterArgs = {
|
||||
container?: string | { fileIds?: string[] }
|
||||
}
|
||||
|
||||
export const codeInterpreterToolFactory = createProviderDefinedToolFactoryWithOutputSchema<
|
||||
export const codeInterpreterToolFactory = createProviderToolFactoryWithOutputSchema<
|
||||
{
|
||||
/**
|
||||
* The code to run, or null if not available.
|
||||
@@ -76,7 +76,6 @@ export const codeInterpreterToolFactory = createProviderDefinedToolFactoryWithOu
|
||||
CodeInterpreterArgs
|
||||
>({
|
||||
id: "openai.code_interpreter",
|
||||
name: "code_interpreter",
|
||||
inputSchema: codeInterpreterInputSchema,
|
||||
outputSchema: codeInterpreterOutputSchema,
|
||||
})
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { createProviderDefinedToolFactoryWithOutputSchema } from "@ai-sdk/provider-utils"
|
||||
import { createProviderToolFactoryWithOutputSchema } from "@ai-sdk/provider-utils"
|
||||
import type {
|
||||
OpenAIResponsesFileSearchToolComparisonFilter,
|
||||
OpenAIResponsesFileSearchToolCompoundFilter,
|
||||
@@ -43,7 +43,7 @@ export const fileSearchOutputSchema = z.object({
|
||||
.nullable(),
|
||||
})
|
||||
|
||||
export const fileSearch = createProviderDefinedToolFactoryWithOutputSchema<
|
||||
export const fileSearch = createProviderToolFactoryWithOutputSchema<
|
||||
{},
|
||||
{
|
||||
/**
|
||||
@@ -122,7 +122,6 @@ export const fileSearch = createProviderDefinedToolFactoryWithOutputSchema<
|
||||
}
|
||||
>({
|
||||
id: "openai.file_search",
|
||||
name: "file_search",
|
||||
inputSchema: z.object({}),
|
||||
outputSchema: fileSearchOutputSchema,
|
||||
})
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { createProviderDefinedToolFactoryWithOutputSchema } from "@ai-sdk/provider-utils"
|
||||
import { createProviderToolFactoryWithOutputSchema } from "@ai-sdk/provider-utils"
|
||||
import { z } from "zod/v4"
|
||||
|
||||
export const imageGenerationArgsSchema = z
|
||||
@@ -92,7 +92,7 @@ type ImageGenerationArgs = {
|
||||
size?: "auto" | "1024x1024" | "1024x1536" | "1536x1024"
|
||||
}
|
||||
|
||||
const imageGenerationToolFactory = createProviderDefinedToolFactoryWithOutputSchema<
|
||||
const imageGenerationToolFactory = createProviderToolFactoryWithOutputSchema<
|
||||
{},
|
||||
{
|
||||
/**
|
||||
@@ -103,7 +103,6 @@ const imageGenerationToolFactory = createProviderDefinedToolFactoryWithOutputSch
|
||||
ImageGenerationArgs
|
||||
>({
|
||||
id: "openai.image_generation",
|
||||
name: "image_generation",
|
||||
inputSchema: z.object({}),
|
||||
outputSchema: imageGenerationOutputSchema,
|
||||
})
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { createProviderDefinedToolFactoryWithOutputSchema } from "@ai-sdk/provider-utils"
|
||||
import { createProviderToolFactoryWithOutputSchema } from "@ai-sdk/provider-utils"
|
||||
import { z } from "zod/v4"
|
||||
|
||||
export const localShellInputSchema = z.object({
|
||||
@@ -16,7 +16,7 @@ export const localShellOutputSchema = z.object({
|
||||
output: z.string(),
|
||||
})
|
||||
|
||||
export const localShell = createProviderDefinedToolFactoryWithOutputSchema<
|
||||
export const localShell = createProviderToolFactoryWithOutputSchema<
|
||||
{
|
||||
/**
|
||||
* Execute a shell command on the server.
|
||||
@@ -59,7 +59,6 @@ export const localShell = createProviderDefinedToolFactoryWithOutputSchema<
|
||||
{}
|
||||
>({
|
||||
id: "openai.local_shell",
|
||||
name: "local_shell",
|
||||
inputSchema: localShellInputSchema,
|
||||
outputSchema: localShellOutputSchema,
|
||||
})
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { createProviderDefinedToolFactory } from "@ai-sdk/provider-utils"
|
||||
import { createProviderToolFactory } from "@ai-sdk/provider-utils"
|
||||
import { z } from "zod/v4"
|
||||
|
||||
// Args validation schema
|
||||
@@ -40,7 +40,7 @@ export const webSearchPreviewArgsSchema = z.object({
|
||||
.optional(),
|
||||
})
|
||||
|
||||
export const webSearchPreview = createProviderDefinedToolFactory<
|
||||
export const webSearchPreview = createProviderToolFactory<
|
||||
{
|
||||
// Web search doesn't take input parameters - it's controlled by the prompt
|
||||
},
|
||||
@@ -81,7 +81,6 @@ export const webSearchPreview = createProviderDefinedToolFactory<
|
||||
}
|
||||
>({
|
||||
id: "openai.web_search_preview",
|
||||
name: "web_search_preview",
|
||||
inputSchema: z.object({
|
||||
action: z
|
||||
.discriminatedUnion("type", [
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { createProviderDefinedToolFactory } from "@ai-sdk/provider-utils"
|
||||
import { createProviderToolFactory } from "@ai-sdk/provider-utils"
|
||||
import { z } from "zod/v4"
|
||||
|
||||
export const webSearchArgsSchema = z.object({
|
||||
@@ -21,7 +21,7 @@ export const webSearchArgsSchema = z.object({
|
||||
.optional(),
|
||||
})
|
||||
|
||||
export const webSearchToolFactory = createProviderDefinedToolFactory<
|
||||
export const webSearchToolFactory = createProviderToolFactory<
|
||||
{
|
||||
// Web search doesn't take input parameters - it's controlled by the prompt
|
||||
},
|
||||
@@ -74,7 +74,6 @@ export const webSearchToolFactory = createProviderDefinedToolFactory<
|
||||
}
|
||||
>({
|
||||
id: "openai.web_search",
|
||||
name: "web_search",
|
||||
inputSchema: z.object({
|
||||
action: z
|
||||
.discriminatedUnion("type", [
|
||||
|
||||
Reference in New Issue
Block a user