mirror of
https://github.com/RooVetGit/Roo-Code.git
synced 2026-08-28 05:27:24 +00:00
refactor: rename AssistantMessageContent to Directive with type aliases
- Add TextDirective alias for TextContent - Add ToolDirective alias for ToolUse - Add Directive union type for TextDirective | ToolDirective - Maintain backward compatibility with AssistantMessageContent alias - Update internal usage to use new type names
This commit is contained in:
parent
77d9dcdc24
commit
2928dd390c
1 changed files with 11 additions and 5 deletions
|
|
@ -2,13 +2,19 @@ import { type ToolName, toolNames } from "@roo-code/types"
|
|||
|
||||
import { TextContent, ToolUse, ToolParamName, toolParamNames } from "../../shared/tools"
|
||||
|
||||
export type AssistantMessageContent = TextContent | ToolUse
|
||||
// Type aliases for this file
|
||||
export type TextDirective = TextContent
|
||||
export type ToolDirective = ToolUse
|
||||
export type Directive = TextDirective | ToolDirective
|
||||
|
||||
export function parseAssistantMessage(assistantMessage: string): AssistantMessageContent[] {
|
||||
let contentBlocks: AssistantMessageContent[] = []
|
||||
let currentTextContent: TextContent | undefined = undefined
|
||||
// Backward compatibility alias
|
||||
export type AssistantMessageContent = Directive
|
||||
|
||||
export function parseAssistantMessage(assistantMessage: string): Directive[] {
|
||||
let contentBlocks: Directive[] = []
|
||||
let currentTextContent: TextDirective | undefined = undefined
|
||||
let currentTextContentStartIndex = 0
|
||||
let currentToolUse: ToolUse | undefined = undefined
|
||||
let currentToolUse: ToolDirective | undefined = undefined
|
||||
let currentToolUseStartIndex = 0
|
||||
let currentParamName: ToolParamName | undefined = undefined
|
||||
let currentParamValueStartIndex = 0
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue