Skip to content

Commit 7e9ac35

Browse files
committed
remove min/max in tool schemas
1 parent 4a46144 commit 7e9ac35

File tree

4 files changed

+3
-12
lines changed

4 files changed

+3
-12
lines changed
Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,10 @@
11
import { Server } from "../../server/server"
2-
import fs from "fs/promises"
32
import type { CommandModule } from "yargs"
43

54
export const GenerateCommand = {
65
command: "generate",
76
handler: async () => {
87
const specs = await Server.openapi()
9-
const dir = "gen"
10-
await fs.rmdir(dir, { recursive: true }).catch(() => {})
11-
await fs.mkdir(dir, { recursive: true })
128
process.stdout.write(JSON.stringify(specs, null, 2))
139
},
1410
} satisfies CommandModule

packages/opencode/src/tool/bash.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ export const BashTool = Tool.define("bash", {
1111
description: DESCRIPTION,
1212
parameters: z.object({
1313
command: z.string().describe("The command to execute"),
14-
timeout: z.number().min(0).max(MAX_TIMEOUT).describe("Optional timeout in milliseconds").optional(),
14+
timeout: z.number().describe("Optional timeout in milliseconds").optional(),
1515
description: z
1616
.string()
1717
.describe(

packages/opencode/src/tool/todo.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import DESCRIPTION_WRITE from "./todowrite.txt"
44
import { App } from "../app/app"
55

66
const TodoInfo = z.object({
7-
content: z.string().min(1).describe("Brief description of the task"),
7+
content: z.string().describe("Brief description of the task"),
88
status: z.enum(["pending", "in_progress", "completed", "cancelled"]).describe("Current status of the task"),
99
priority: z.enum(["high", "medium", "low"]).describe("Priority level of the task"),
1010
id: z.string().describe("Unique identifier for the todo item"),

packages/opencode/src/tool/webfetch.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,7 @@ export const WebFetchTool = Tool.define("webfetch", {
1414
format: z
1515
.enum(["text", "markdown", "html"])
1616
.describe("The format to return the content in (text, markdown, or html)"),
17-
timeout: z
18-
.number()
19-
.min(0)
20-
.max(MAX_TIMEOUT / 1000)
21-
.describe("Optional timeout in seconds (max 120)")
22-
.optional(),
17+
timeout: z.number().describe("Optional timeout in seconds (max 120)").optional(),
2318
}),
2419
async execute(params, ctx) {
2520
// Validate URL

0 commit comments

Comments
 (0)