MCPcopy Create free account
hub / github.com/TanStack/ai / getMessages

Function getMessages

testing/panel/tests/helpers.ts:211–224  ·  view source on GitHub ↗
(page: Page)

Source from the content-addressed store, hash-verified

209 * Get all messages as parsed JSON from the debug panel
210 */
211export async function getMessages(page: Page): Promise<any[]> {
212 const messagesJson = page.locator('pre').filter({ hasText: '"role"' }).first()
213
214 try {
215 const jsonText = await messagesJson.textContent({ timeout: 5000 })
216 if (jsonText) {
217 return JSON.parse(jsonText)
218 }
219 } catch {
220 // Return empty array if parsing fails
221 }
222
223 return []
224}
225
226/**
227 * Check if the last message has tool calls

Callers 5

tool-flow.spec.tsFile · 0.90
getAssistantMessageFunction · 0.70
hasToolCallsFunction · 0.70
getToolCallNamesFunction · 0.70

Calls 1

parseMethod · 0.80

Tested by

no test coverage detected