(state: SessionState, messages: WithParts[])
| 140 | } |
| 141 | |
| 142 | export function buildToolIdList(state: SessionState, messages: WithParts[]): string[] { |
| 143 | const toolIds: string[] = [] |
| 144 | for (const msg of messages) { |
| 145 | if (isMessageCompacted(state, msg)) { |
| 146 | continue |
| 147 | } |
| 148 | const parts = Array.isArray(msg.parts) ? msg.parts : [] |
| 149 | if (parts.length > 0) { |
| 150 | for (const part of parts) { |
| 151 | if (part.type === "tool" && part.callID && part.tool) { |
| 152 | toolIds.push(part.callID) |
| 153 | } |
| 154 | } |
| 155 | } |
| 156 | } |
| 157 | state.toolIdList = toolIds |
| 158 | return toolIds |
| 159 | } |
| 160 | |
| 161 | export const replaceBlockIdsWithBlocked = (text: string): string => { |
| 162 | return text.replace(DCP_BLOCK_ID_TAG_REGEX, "$1BLOCKED$2") |
no test coverage detected