Преглед изворни кода

remove min/max in tool schemas

Dax Raad пре 6 месеци
родитељ
комит
7e9ac35666

+ 0 - 4
packages/opencode/src/cli/cmd/generate.ts

@@ -1,14 +1,10 @@
 import { Server } from "../../server/server"
-import fs from "fs/promises"
 import type { CommandModule } from "yargs"
 
 export const GenerateCommand = {
   command: "generate",
   handler: async () => {
     const specs = await Server.openapi()
-    const dir = "gen"
-    await fs.rmdir(dir, { recursive: true }).catch(() => {})
-    await fs.mkdir(dir, { recursive: true })
     process.stdout.write(JSON.stringify(specs, null, 2))
   },
 } satisfies CommandModule

+ 1 - 1
packages/opencode/src/tool/bash.ts

@@ -11,7 +11,7 @@ export const BashTool = Tool.define("bash", {
   description: DESCRIPTION,
   parameters: z.object({
     command: z.string().describe("The command to execute"),
-    timeout: z.number().min(0).max(MAX_TIMEOUT).describe("Optional timeout in milliseconds").optional(),
+    timeout: z.number().describe("Optional timeout in milliseconds").optional(),
     description: z
       .string()
       .describe(

+ 1 - 1
packages/opencode/src/tool/todo.ts

@@ -4,7 +4,7 @@ import DESCRIPTION_WRITE from "./todowrite.txt"
 import { App } from "../app/app"
 
 const TodoInfo = z.object({
-  content: z.string().min(1).describe("Brief description of the task"),
+  content: z.string().describe("Brief description of the task"),
   status: z.enum(["pending", "in_progress", "completed", "cancelled"]).describe("Current status of the task"),
   priority: z.enum(["high", "medium", "low"]).describe("Priority level of the task"),
   id: z.string().describe("Unique identifier for the todo item"),

+ 1 - 6
packages/opencode/src/tool/webfetch.ts

@@ -14,12 +14,7 @@ export const WebFetchTool = Tool.define("webfetch", {
     format: z
       .enum(["text", "markdown", "html"])
       .describe("The format to return the content in (text, markdown, or html)"),
-    timeout: z
-      .number()
-      .min(0)
-      .max(MAX_TIMEOUT / 1000)
-      .describe("Optional timeout in seconds (max 120)")
-      .optional(),
+    timeout: z.number().describe("Optional timeout in seconds (max 120)").optional(),
   }),
   async execute(params, ctx) {
     // Validate URL