chore: move state to tab, do not cache snapshot (#730)
This commit is contained in:
parent
cfcca40b90
commit
468c84eb8f
23 changed files with 291 additions and 355 deletions
|
|
@ -37,7 +37,7 @@ const listTabs = defineTool({
|
|||
resultOverride: {
|
||||
content: [{
|
||||
type: 'text',
|
||||
text: await context.listTabsMarkdown(),
|
||||
text: (await context.listTabsMarkdown()).join('\n'),
|
||||
}],
|
||||
},
|
||||
};
|
||||
|
|
@ -85,9 +85,9 @@ const newTab = defineTool({
|
|||
},
|
||||
|
||||
handle: async (context, params) => {
|
||||
await context.newTab();
|
||||
const tab = await context.newTab();
|
||||
if (params.url)
|
||||
await context.currentTabOrDie().navigate(params.url);
|
||||
await tab.navigate(params.url);
|
||||
|
||||
const code = [
|
||||
`// <internal code to open a new tab>`,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue