mirror of
https://github.com/RooVetGit/Roo-Code.git
synced 2026-09-22 00:31:46 +00:00
21 lines
549 B
TypeScript
21 lines
549 B
TypeScript
import { type SerializedCustomToolDefinition, parametersSchema } from "@roo-code/types"
|
|
|
|
import type { StoredCustomTool } from "./types.js"
|
|
|
|
export function serializeCustomTool({
|
|
name,
|
|
description,
|
|
parameters,
|
|
source,
|
|
}: StoredCustomTool): SerializedCustomToolDefinition {
|
|
return {
|
|
name,
|
|
description,
|
|
parameters: parameters ? parametersSchema.toJSONSchema(parameters) : undefined,
|
|
source,
|
|
}
|
|
}
|
|
|
|
export function serializeCustomTools(tools: StoredCustomTool[]): SerializedCustomToolDefinition[] {
|
|
return tools.map(serializeCustomTool)
|
|
}
|