mirror of
https://github.com/pacnpal/Roo-Code.git
synced 2025-12-22 05:11:06 -05:00
Refactor claudeMessages
This commit is contained in:
@@ -32,7 +32,7 @@ export interface ExtensionState {
|
||||
customInstructions?: string
|
||||
alwaysAllowReadOnly?: boolean
|
||||
uriScheme?: string
|
||||
claudeMessages: ClineMessage[]
|
||||
clineMessages: ClineMessage[]
|
||||
taskHistory: HistoryItem[]
|
||||
shouldShowAnnouncement: boolean
|
||||
}
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
import { ClineMessage } from "./ExtensionMessage"
|
||||
|
||||
/**
|
||||
* Combines API request start and finish messages in an array of ClaudeMessages.
|
||||
* Combines API request start and finish messages in an array of ClineMessages.
|
||||
*
|
||||
* This function looks for pairs of 'api_req_started' and 'api_req_finished' messages.
|
||||
* When it finds a pair, it combines them into a single 'api_req_combined' message.
|
||||
* The JSON data in the text fields of both messages are merged.
|
||||
*
|
||||
* @param messages - An array of ClaudeMessage objects to process.
|
||||
* @returns A new array of ClaudeMessage objects with API requests combined.
|
||||
* @param messages - An array of ClineMessage objects to process.
|
||||
* @returns A new array of ClineMessage objects with API requests combined.
|
||||
*
|
||||
* @example
|
||||
* const messages = [
|
||||
|
||||
@@ -1,18 +1,18 @@
|
||||
import { ClineMessage } from "./ExtensionMessage"
|
||||
|
||||
/**
|
||||
* Combines sequences of command and command_output messages in an array of ClaudeMessages.
|
||||
* Combines sequences of command and command_output messages in an array of ClineMessages.
|
||||
*
|
||||
* This function processes an array of ClaudeMessage objects, looking for sequences
|
||||
* This function processes an array of ClineMessages objects, looking for sequences
|
||||
* where a 'command' message is followed by one or more 'command_output' messages.
|
||||
* When such a sequence is found, it combines them into a single message, merging
|
||||
* their text contents.
|
||||
*
|
||||
* @param messages - An array of ClaudeMessage objects to process.
|
||||
* @returns A new array of ClaudeMessage objects with command sequences combined.
|
||||
* @param messages - An array of ClineMessage objects to process.
|
||||
* @returns A new array of ClineMessage objects with command sequences combined.
|
||||
*
|
||||
* @example
|
||||
* const messages: ClaudeMessage[] = [
|
||||
* const messages: ClineMessage[] = [
|
||||
* { type: 'ask', ask: 'command', text: 'ls', ts: 1625097600000 },
|
||||
* { type: 'ask', ask: 'command_output', text: 'file1.txt', ts: 1625097601000 },
|
||||
* { type: 'ask', ask: 'command_output', text: 'file2.txt', ts: 1625097602000 }
|
||||
|
||||
Reference in New Issue
Block a user