Skip to content

Commit 5134b8a

Browse files
committed
fix ToolCall type for agent-config
1 parent af35d18 commit 5134b8a

File tree

3 files changed

+14
-10
lines changed

3 files changed

+14
-10
lines changed

.agents/file-picker.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@ const config: AgentConfig = {
2828
stepPrompt:
2929
'Do not use the find_files tool or any tools again. Just give your response.',
3030
handleSteps: function* ({ agentState, prompt, params }) {
31-
yield {
31+
const toolResult = yield {
3232
toolName: 'find_files',
33-
args: { prompt },
33+
args: { prompt: prompt ?? '' },
3434
}
3535
yield 'STEP_ALL'
3636
},

.agents/types/agent-config.d.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -186,10 +186,12 @@ export interface AgentStepContext {
186186
/**
187187
* Tool call object for handleSteps generator
188188
*/
189-
export interface ToolCall<T extends ToolName = ToolName> {
190-
toolName: T
191-
args?: Tools.GetToolParams<T>
192-
}
189+
export type ToolCall<T extends ToolName = ToolName> = {
190+
[K in T]: {
191+
toolName: K
192+
args?: Tools.GetToolParams<K>
193+
}
194+
}[T]
193195

194196
/**
195197
* Result from executing a tool

common/src/util/types/agent-config.d.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -186,10 +186,12 @@ export interface AgentStepContext {
186186
/**
187187
* Tool call object for handleSteps generator
188188
*/
189-
export interface ToolCall<T extends ToolName = ToolName> {
190-
toolName: T
191-
args?: Tools.GetToolParams<T>
192-
}
189+
export type ToolCall<T extends ToolName = ToolName> = {
190+
[K in T]: {
191+
toolName: K
192+
args?: Tools.GetToolParams<K>
193+
}
194+
}[T]
193195

194196
/**
195197
* Result from executing a tool

0 commit comments

Comments
 (0)