Skip to content

Commit 4895180

Browse files
committed
fix type checker for tool results
1 parent ee4dde9 commit 4895180

File tree

1 file changed

+7
-11
lines changed

1 file changed

+7
-11
lines changed

common/src/tools/list.ts

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -77,17 +77,13 @@ export type CodebuffToolCall<T extends ToolName = ToolName> = {
7777

7878
export type CodebuffToolOutput<
7979
T extends ToolName | ResultOnlyToolName = ToolName,
80-
> = T extends ToolName
81-
? {
82-
[K in ToolName]: z.infer<(typeof $toolParams)[K]['outputs']>
83-
}[T]
84-
: T extends ResultOnlyToolName
85-
? {
86-
[K in ResultOnlyToolName]: z.infer<
87-
(typeof additionalToolResultSchemas)[K]['outputs']
88-
>
89-
}[T]
90-
: never
80+
> = {
81+
[K in ToolName | ResultOnlyToolName]: K extends ToolName
82+
? z.infer<(typeof $toolParams)[K]['outputs']>
83+
: K extends ResultOnlyToolName
84+
? z.infer<(typeof additionalToolResultSchemas)[K]['outputs']>
85+
: never
86+
}[T]
9187
export type CodebuffToolResult<
9288
T extends ToolName | ResultOnlyToolName = ToolName,
9389
> = {

0 commit comments

Comments
 (0)