File tree Expand file tree Collapse file tree 1 file changed +7
-7
lines changed
Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Original file line number Diff line number Diff line change 11import { z } from 'zod/v4'
22
3- import type { ToolName as CodebuffToolName } from '../../common/src/tools/constants'
3+ import type { ToolName } from '../../common/src/tools/constants'
44import type { ToolResultOutput } from '../../common/src/types/messages/content-part'
55import type { JSONSchema } from 'zod/v4/core'
66
@@ -30,7 +30,7 @@ export type CustomToolDefinition<
3030 * @returns a {@linkcode CustomToolDefinition} object
3131 */
3232export function getCustomToolDefinition <
33- ToolName extends string ,
33+ TN extends string ,
3434 Args extends any ,
3535 Input extends any ,
3636> ( {
@@ -41,17 +41,17 @@ export function getCustomToolDefinition<
4141 exampleInputs = [ ] ,
4242 execute,
4343} : {
44- toolName : ToolName extends CodebuffToolName
45- ? ToolName & {
46- error : `Use overrideTools instead of custom tool for name: ${ToolName } `
44+ toolName : TN extends ToolName
45+ ? TN & {
46+ error : `Hi there. This is a message from the Codebuff team: You have used a custom tool where you needed to use overrideTools instead for name: ${TN } `
4747 }
48- : ToolName
48+ : TN
4949 inputSchema : z . ZodType < Args , Input >
5050 description : string
5151 endsAgentStep ?: boolean
5252 exampleInputs ?: Input [ ]
5353 execute : ( params : Args ) => Promise < ToolResultOutput [ ] > | ToolResultOutput [ ]
54- } ) : CustomToolDefinition < ToolName , Args , Input > {
54+ } ) : CustomToolDefinition < TN , Args , Input > {
5555 return {
5656 toolName,
5757 zodSchema : inputSchema ,
You can’t perform that action at this time.
0 commit comments