remove min/max in tool schemas

This commit is contained in:
Dax Raad
2025-07-29 17:39:31 -04:00
parent 4a46144419
commit 7e9ac35666
4 changed files with 3 additions and 12 deletions

View File

@@ -1,14 +1,10 @@
import { Server } from "../../server/server" import { Server } from "../../server/server"
import fs from "fs/promises"
import type { CommandModule } from "yargs" import type { CommandModule } from "yargs"
export const GenerateCommand = { export const GenerateCommand = {
command: "generate", command: "generate",
handler: async () => { handler: async () => {
const specs = await Server.openapi() 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)) process.stdout.write(JSON.stringify(specs, null, 2))
}, },
} satisfies CommandModule } satisfies CommandModule

View File

@@ -11,7 +11,7 @@ export const BashTool = Tool.define("bash", {
description: DESCRIPTION, description: DESCRIPTION,
parameters: z.object({ parameters: z.object({
command: z.string().describe("The command to execute"), 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 description: z
.string() .string()
.describe( .describe(

View File

@@ -4,7 +4,7 @@ import DESCRIPTION_WRITE from "./todowrite.txt"
import { App } from "../app/app" import { App } from "../app/app"
const TodoInfo = z.object({ 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"), 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"), priority: z.enum(["high", "medium", "low"]).describe("Priority level of the task"),
id: z.string().describe("Unique identifier for the todo item"), id: z.string().describe("Unique identifier for the todo item"),

View File

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