Refactor: Replace 'any' with 'ToolName' in message parsing files

This commit is contained in:
Steven T. Cramer 2025-06-17 10:26:20 +07:00
parent 36c993bed3
commit bcf71c5c9f
2 changed files with 4 additions and 3 deletions

View file

@ -1,6 +1,6 @@
import { Directive, ToolDirective } from "./directives"
import { TextDirective, LogDirective } from "./directives"
import { toolNames } from "@roo-code/types"
import { ToolName, toolNames } from "@roo-code/types"
export class FallbackParser {
static parse(assistantMessage: string): Directive[] {
@ -154,7 +154,7 @@ export class FallbackParser {
const ToolDirective: ToolDirective = {
type: "tool_use",
name: toolName as any,
name: toolName as ToolName,
params,
partial: !assistantMessage.includes(`</${toolName}>`),
}

View file

@ -3,6 +3,7 @@ import { BaseDirectiveHandler } from "./BaseDirectiveHandler"
import { ParseContext, CodeBlockState } from "../ParseContext"
import { ToolDirective, ToolParamName } from "../directives"
import { CodeBlockStateMachine } from "../CodeBlockStateMachine"
import { ToolName } from "@roo-code/types"
export class ToolDirectiveHandler extends BaseDirectiveHandler {
readonly tagName: string
@ -23,7 +24,7 @@ export class ToolDirectiveHandler extends BaseDirectiveHandler {
this.flushCurrentText(context)
this.currentToolDirective = {
type: "tool_use",
name: this.tagName as any,
name: this.tagName as ToolName,
params: {},
partial: true,
}