Skip to content

Commit ca750d5

Browse files
committed
Fix Composio CI type surfaces
1 parent b6946e8 commit ca750d5

3 files changed

Lines changed: 13 additions & 13 deletions

File tree

packages/agent-runtime/src/tools/handlers/list.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,9 @@ import type { ToolName } from '@codebuff/common/tools/constants'
5252
* - Any additional arguments for the tool
5353
* - Returns a promise that will be awaited
5454
*/
55-
export const codebuffToolHandlers = {
55+
export const codebuffToolHandlers: {
56+
[K in ToolName]: CodebuffToolHandlerFunction<K>
57+
} = {
5658
add_message: handleAddMessage,
5759
add_subgoal: handleAddSubgoal,
5860
apply_patch: handleApplyPatch,
@@ -92,6 +94,4 @@ export const codebuffToolHandlers = {
9294
web_search: handleWebSearch,
9395
write_file: handleWriteFile,
9496
write_todos: handleWriteTodos,
95-
} satisfies {
96-
[K in ToolName]: CodebuffToolHandlerFunction<K>
9797
}

packages/agent-runtime/src/tools/handlers/tool/composio.ts

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,10 @@ import type { ComposioMetaToolName } from '@codebuff/common/constants/composio'
22
import type { CodebuffToolOutput } from '@codebuff/common/tools/list'
33
import type { CodebuffToolHandlerFunction } from '../handler-function-type'
44

5-
function makeComposioHandler<T extends ComposioMetaToolName>() {
6-
return (async ({ toolCall, requestClientToolCall }) => {
5+
function makeComposioHandler<
6+
T extends ComposioMetaToolName,
7+
>(): CodebuffToolHandlerFunction<T> {
8+
return async ({ toolCall, requestClientToolCall }) => {
79
if (!requestClientToolCall) {
810
return {
911
output: [
@@ -22,14 +24,14 @@ function makeComposioHandler<T extends ComposioMetaToolName>() {
2224
toolCall,
2325
)) as CodebuffToolOutput<T>,
2426
}
25-
}) satisfies CodebuffToolHandlerFunction<T>
27+
}
2628
}
2729

28-
export const handleComposioManageConnections =
30+
export const handleComposioManageConnections: CodebuffToolHandlerFunction<'COMPOSIO_MANAGE_CONNECTIONS'> =
2931
makeComposioHandler<'COMPOSIO_MANAGE_CONNECTIONS'>()
30-
export const handleComposioMultiExecute =
32+
export const handleComposioMultiExecute: CodebuffToolHandlerFunction<'COMPOSIO_MULTI_EXECUTE_TOOL'> =
3133
makeComposioHandler<'COMPOSIO_MULTI_EXECUTE_TOOL'>()
32-
export const handleComposioSearchTools =
34+
export const handleComposioSearchTools: CodebuffToolHandlerFunction<'COMPOSIO_SEARCH_TOOLS'> =
3335
makeComposioHandler<'COMPOSIO_SEARCH_TOOLS'>()
34-
export const handleComposioGetToolSchemas =
36+
export const handleComposioGetToolSchemas: CodebuffToolHandlerFunction<'COMPOSIO_GET_TOOL_SCHEMAS'> =
3537
makeComposioHandler<'COMPOSIO_GET_TOOL_SCHEMAS'>()

sdk/src/run.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,9 +75,7 @@ const wrapContentForUserMessage = (
7575
}
7676

7777
type OverrideToolHandlers = {
78-
[K in PublishedClientToolName]?: (
79-
input: Record<string, unknown>,
80-
) => Promise<ToolResultOutput[]>
78+
[K in PublishedClientToolName]?: (input: any) => Promise<ToolResultOutput[]>
8179
} & {
8280
// Include read_files separately, since it has a different signature.
8381
read_files?: (input: {

0 commit comments

Comments
 (0)