Skip to content

Commit 2928dd3

Browse files
committed
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
1 parent 77d9dcd commit 2928dd3

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

src/core/assistant-message/parseAssistantMessage.ts

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,19 @@ import { type ToolName, toolNames } from "@roo-code/types"
22

33
import { TextContent, ToolUse, ToolParamName, toolParamNames } from "../../shared/tools"
44

5-
export type AssistantMessageContent = TextContent | ToolUse
5+
// Type aliases for this file
6+
export type TextDirective = TextContent
7+
export type ToolDirective = ToolUse
8+
export type Directive = TextDirective | ToolDirective
69

7-
export function parseAssistantMessage(assistantMessage: string): AssistantMessageContent[] {
8-
let contentBlocks: AssistantMessageContent[] = []
9-
let currentTextContent: TextContent | undefined = undefined
10+
// Backward compatibility alias
11+
export type AssistantMessageContent = Directive
12+
13+
export function parseAssistantMessage(assistantMessage: string): Directive[] {
14+
let contentBlocks: Directive[] = []
15+
let currentTextContent: TextDirective | undefined = undefined
1016
let currentTextContentStartIndex = 0
11-
let currentToolUse: ToolUse | undefined = undefined
17+
let currentToolUse: ToolDirective | undefined = undefined
1218
let currentToolUseStartIndex = 0
1319
let currentParamName: ToolParamName | undefined = undefined
1420
let currentParamValueStartIndex = 0

0 commit comments

Comments
 (0)