chore: flatten tool calling, prep for timeout handling (#205)
This commit is contained in:
parent
cea347d067
commit
7e4a964b0a
16 changed files with 484 additions and 336 deletions
|
|
@ -29,13 +29,17 @@ const console: Tool = {
|
|||
inputSchema: zodToJsonSchema(consoleSchema),
|
||||
},
|
||||
handle: async context => {
|
||||
const messages = await context.currentTab().console();
|
||||
const messages = await context.currentTabOrDie().console();
|
||||
const log = messages.map(message => `[${message.type().toUpperCase()}] ${message.text()}`).join('\n');
|
||||
return {
|
||||
content: [{
|
||||
type: 'text',
|
||||
text: log
|
||||
}],
|
||||
code: [`// <internal code to get console messages>`],
|
||||
action: async () => {
|
||||
return {
|
||||
content: [{ type: 'text', text: log }]
|
||||
};
|
||||
},
|
||||
captureSnapshot: false,
|
||||
waitForNetwork: false,
|
||||
};
|
||||
},
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue