mirror of
https://github.com/RooVetGit/Roo-Code.git
synced 2026-09-07 08:26:51 +00:00
Refactor: Replace 'any' with 'ToolName' in message parsing files
This commit is contained in:
parent
36c993bed3
commit
bcf71c5c9f
2 changed files with 4 additions and 3 deletions
|
|
@ -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}>`),
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue