|
@@ -1,197 +1,8 @@
|
|
|
// This is the json schema exported from browser-use, change page_id to tab_id
|
|
|
// TODO: don't know why zod can not generate the same schema, need to fix it
|
|
|
export const jsonNavigatorOutputSchema = {
|
|
|
- $defs: {
|
|
|
- ActionModel: {
|
|
|
- properties: {
|
|
|
- done: {
|
|
|
- anyOf: [
|
|
|
- {
|
|
|
- $ref: '#/$defs/DoneAction',
|
|
|
- },
|
|
|
- {
|
|
|
- type: 'null',
|
|
|
- },
|
|
|
- ],
|
|
|
- default: null,
|
|
|
- description: 'Complete task',
|
|
|
- },
|
|
|
- search_google: {
|
|
|
- anyOf: [
|
|
|
- {
|
|
|
- $ref: '#/$defs/SearchGoogleAction',
|
|
|
- },
|
|
|
- {
|
|
|
- type: 'null',
|
|
|
- },
|
|
|
- ],
|
|
|
- default: null,
|
|
|
- description:
|
|
|
- 'Search the query in Google in the current tab, the query should be a search query like humans search in Google, concrete and not vague or super long. More the single most important items. ',
|
|
|
- },
|
|
|
- go_to_url: {
|
|
|
- anyOf: [
|
|
|
- {
|
|
|
- $ref: '#/$defs/GoToUrlAction',
|
|
|
- },
|
|
|
- {
|
|
|
- type: 'null',
|
|
|
- },
|
|
|
- ],
|
|
|
- default: null,
|
|
|
- description: 'Navigate to URL in the current tab',
|
|
|
- },
|
|
|
- go_back: {
|
|
|
- anyOf: [
|
|
|
- {
|
|
|
- $ref: '#/$defs/NoParamsAction',
|
|
|
- },
|
|
|
- {
|
|
|
- type: 'null',
|
|
|
- },
|
|
|
- ],
|
|
|
- default: null,
|
|
|
- description: 'Go back',
|
|
|
- },
|
|
|
- click_element: {
|
|
|
- anyOf: [
|
|
|
- {
|
|
|
- $ref: '#/$defs/ClickElementAction',
|
|
|
- },
|
|
|
- {
|
|
|
- type: 'null',
|
|
|
- },
|
|
|
- ],
|
|
|
- default: null,
|
|
|
- description: 'Click element',
|
|
|
- },
|
|
|
- input_text: {
|
|
|
- anyOf: [
|
|
|
- {
|
|
|
- $ref: '#/$defs/InputTextAction',
|
|
|
- },
|
|
|
- {
|
|
|
- type: 'null',
|
|
|
- },
|
|
|
- ],
|
|
|
- default: null,
|
|
|
- description: 'Input text into a input interactive element',
|
|
|
- },
|
|
|
- switch_tab: {
|
|
|
- anyOf: [
|
|
|
- {
|
|
|
- $ref: '#/$defs/SwitchTabAction',
|
|
|
- },
|
|
|
- {
|
|
|
- type: 'null',
|
|
|
- },
|
|
|
- ],
|
|
|
- default: null,
|
|
|
- description: 'Switch tab',
|
|
|
- },
|
|
|
- open_tab: {
|
|
|
- anyOf: [
|
|
|
- {
|
|
|
- $ref: '#/$defs/OpenTabAction',
|
|
|
- },
|
|
|
- {
|
|
|
- type: 'null',
|
|
|
- },
|
|
|
- ],
|
|
|
- default: null,
|
|
|
- description: 'Open url in new tab',
|
|
|
- },
|
|
|
- cache_content: {
|
|
|
- anyOf: [
|
|
|
- {
|
|
|
- $ref: '#/$defs/cache_content_parameters',
|
|
|
- },
|
|
|
- {
|
|
|
- type: 'null',
|
|
|
- },
|
|
|
- ],
|
|
|
- default: null,
|
|
|
- description: 'Cache what you have found so far from the current page so that it can be used in future steps',
|
|
|
- },
|
|
|
- scroll_down: {
|
|
|
- anyOf: [
|
|
|
- {
|
|
|
- $ref: '#/$defs/ScrollAction',
|
|
|
- },
|
|
|
- {
|
|
|
- type: 'null',
|
|
|
- },
|
|
|
- ],
|
|
|
- default: null,
|
|
|
- description: 'Scroll down the page by pixel amount - if no amount is specified, scroll down one page',
|
|
|
- },
|
|
|
- scroll_up: {
|
|
|
- anyOf: [
|
|
|
- {
|
|
|
- $ref: '#/$defs/ScrollAction',
|
|
|
- },
|
|
|
- {
|
|
|
- type: 'null',
|
|
|
- },
|
|
|
- ],
|
|
|
- default: null,
|
|
|
- description: 'Scroll up the page by pixel amount - if no amount is specified, scroll up one page',
|
|
|
- },
|
|
|
- send_keys: {
|
|
|
- anyOf: [
|
|
|
- {
|
|
|
- $ref: '#/$defs/SendKeysAction',
|
|
|
- },
|
|
|
- {
|
|
|
- type: 'null',
|
|
|
- },
|
|
|
- ],
|
|
|
- default: null,
|
|
|
- description:
|
|
|
- 'Send strings of special keys like Backspace, Insert, PageDown, Delete, Enter, Shortcuts such as `Control+o`, `Control+Shift+T` are supported as well. This gets used in keyboard.press. Be aware of different operating systems and their shortcuts',
|
|
|
- },
|
|
|
- scroll_to_text: {
|
|
|
- anyOf: [
|
|
|
- {
|
|
|
- $ref: '#/$defs/scroll_to_text_parameters',
|
|
|
- },
|
|
|
- {
|
|
|
- type: 'null',
|
|
|
- },
|
|
|
- ],
|
|
|
- default: null,
|
|
|
- description: 'If you dont find something which you want to interact with, scroll to it',
|
|
|
- },
|
|
|
- get_dropdown_options: {
|
|
|
- anyOf: [
|
|
|
- {
|
|
|
- $ref: '#/$defs/get_dropdown_options_parameters',
|
|
|
- },
|
|
|
- {
|
|
|
- type: 'null',
|
|
|
- },
|
|
|
- ],
|
|
|
- default: null,
|
|
|
- description: 'Get all options from a native dropdown',
|
|
|
- },
|
|
|
- select_dropdown_option: {
|
|
|
- anyOf: [
|
|
|
- {
|
|
|
- $ref: '#/$defs/select_dropdown_option_parameters',
|
|
|
- },
|
|
|
- {
|
|
|
- type: 'null',
|
|
|
- },
|
|
|
- ],
|
|
|
- default: null,
|
|
|
- description:
|
|
|
- 'Select dropdown option for interactive element index by the text of the option you want to select',
|
|
|
- },
|
|
|
- },
|
|
|
- title: 'ActionModel',
|
|
|
- type: 'object',
|
|
|
- },
|
|
|
- AgentBrain: {
|
|
|
+ properties: {
|
|
|
+ current_state: {
|
|
|
description: 'Current state of the agent',
|
|
|
properties: {
|
|
|
page_summary: {
|
|
@@ -215,229 +26,239 @@ export const jsonNavigatorOutputSchema = {
|
|
|
title: 'AgentBrain',
|
|
|
type: 'object',
|
|
|
},
|
|
|
- ClickElementAction: {
|
|
|
- properties: {
|
|
|
- desc: {
|
|
|
- title: 'Description',
|
|
|
- type: 'string',
|
|
|
- description: 'Description of the purpose of calling this action',
|
|
|
- },
|
|
|
- index: {
|
|
|
- title: 'Index',
|
|
|
- type: 'integer',
|
|
|
- },
|
|
|
- xpath: {
|
|
|
- anyOf: [
|
|
|
- {
|
|
|
- type: 'string',
|
|
|
- },
|
|
|
- {
|
|
|
- type: 'null',
|
|
|
- },
|
|
|
- ],
|
|
|
- default: null,
|
|
|
- title: 'Xpath',
|
|
|
- },
|
|
|
- },
|
|
|
- required: ['index'],
|
|
|
- title: 'ClickElementAction',
|
|
|
- type: 'object',
|
|
|
- },
|
|
|
- DoneAction: {
|
|
|
- properties: {
|
|
|
- text: {
|
|
|
- title: 'Text',
|
|
|
- type: 'string',
|
|
|
- },
|
|
|
- },
|
|
|
- required: ['text'],
|
|
|
- title: 'DoneAction',
|
|
|
- type: 'object',
|
|
|
- },
|
|
|
- GoToUrlAction: {
|
|
|
- properties: {
|
|
|
- url: {
|
|
|
- title: 'Url',
|
|
|
- type: 'string',
|
|
|
- },
|
|
|
- },
|
|
|
- required: ['url'],
|
|
|
- title: 'GoToUrlAction',
|
|
|
- type: 'object',
|
|
|
- },
|
|
|
- InputTextAction: {
|
|
|
- properties: {
|
|
|
- desc: {
|
|
|
- title: 'Description',
|
|
|
- type: 'string',
|
|
|
- description: 'Description of the purpose of calling this action',
|
|
|
- },
|
|
|
- index: {
|
|
|
- title: 'Index',
|
|
|
- type: 'integer',
|
|
|
- },
|
|
|
- text: {
|
|
|
- title: 'Text',
|
|
|
- type: 'string',
|
|
|
- },
|
|
|
- xpath: {
|
|
|
- anyOf: [
|
|
|
- {
|
|
|
- type: 'string',
|
|
|
- },
|
|
|
- {
|
|
|
- type: 'null',
|
|
|
- },
|
|
|
- ],
|
|
|
- default: null,
|
|
|
- title: 'Xpath',
|
|
|
- },
|
|
|
- },
|
|
|
- required: ['index', 'text'],
|
|
|
- title: 'InputTextAction',
|
|
|
- type: 'object',
|
|
|
- },
|
|
|
- NoParamsAction: {
|
|
|
- additionalProperties: true,
|
|
|
- description:
|
|
|
- 'Accepts absolutely anything in the incoming data\nand discards it, so the final parsed model is empty.',
|
|
|
- properties: {},
|
|
|
- title: 'NoParamsAction',
|
|
|
- type: 'object',
|
|
|
- },
|
|
|
- OpenTabAction: {
|
|
|
- properties: {
|
|
|
- url: {
|
|
|
- title: 'Url',
|
|
|
- type: 'string',
|
|
|
- },
|
|
|
- },
|
|
|
- required: ['url'],
|
|
|
- title: 'OpenTabAction',
|
|
|
- type: 'object',
|
|
|
- },
|
|
|
- ScrollAction: {
|
|
|
- properties: {
|
|
|
- desc: {
|
|
|
- title: 'Description',
|
|
|
- type: 'string',
|
|
|
- description: 'Description of the purpose of calling this action',
|
|
|
- },
|
|
|
- amount: {
|
|
|
- anyOf: [
|
|
|
- {
|
|
|
- type: 'integer',
|
|
|
- },
|
|
|
- {
|
|
|
- type: 'null',
|
|
|
- },
|
|
|
- ],
|
|
|
- default: null,
|
|
|
- title: 'Amount',
|
|
|
- },
|
|
|
- },
|
|
|
- title: 'ScrollAction',
|
|
|
- type: 'object',
|
|
|
- },
|
|
|
- SearchGoogleAction: {
|
|
|
- properties: {
|
|
|
- query: {
|
|
|
- title: 'Query',
|
|
|
- type: 'string',
|
|
|
- },
|
|
|
- },
|
|
|
- required: ['query'],
|
|
|
- title: 'SearchGoogleAction',
|
|
|
- type: 'object',
|
|
|
- },
|
|
|
- SendKeysAction: {
|
|
|
- properties: {
|
|
|
- desc: {
|
|
|
- title: 'Description',
|
|
|
- type: 'string',
|
|
|
- description: 'Description of the purpose of calling this action',
|
|
|
- },
|
|
|
- keys: {
|
|
|
- title: 'Keys',
|
|
|
- type: 'string',
|
|
|
- },
|
|
|
- },
|
|
|
- required: ['keys'],
|
|
|
- title: 'SendKeysAction',
|
|
|
- type: 'object',
|
|
|
- },
|
|
|
- SwitchTabAction: {
|
|
|
- properties: {
|
|
|
- tab_id: {
|
|
|
- title: 'Page Id',
|
|
|
- type: 'integer',
|
|
|
- },
|
|
|
- },
|
|
|
- required: ['tab_id'],
|
|
|
- title: 'SwitchTabAction',
|
|
|
- type: 'object',
|
|
|
- },
|
|
|
- cache_content_parameters: {
|
|
|
- properties: {
|
|
|
- content: {
|
|
|
- title: 'Content',
|
|
|
- type: 'string',
|
|
|
- },
|
|
|
- },
|
|
|
- required: ['content'],
|
|
|
- title: 'cache_content_parameters',
|
|
|
- type: 'object',
|
|
|
- },
|
|
|
- get_dropdown_options_parameters: {
|
|
|
- properties: {
|
|
|
- index: {
|
|
|
- title: 'Index',
|
|
|
- type: 'integer',
|
|
|
- },
|
|
|
- },
|
|
|
- required: ['index'],
|
|
|
- title: 'get_dropdown_options_parameters',
|
|
|
- type: 'object',
|
|
|
- },
|
|
|
- scroll_to_text_parameters: {
|
|
|
- properties: {
|
|
|
- desc: {
|
|
|
- title: 'Description',
|
|
|
- type: 'string',
|
|
|
- description: 'Description of the purpose of calling this action',
|
|
|
- },
|
|
|
- text: {
|
|
|
- title: 'Text',
|
|
|
- type: 'string',
|
|
|
- },
|
|
|
- },
|
|
|
- required: ['text'],
|
|
|
- title: 'scroll_to_text_parameters',
|
|
|
- type: 'object',
|
|
|
- },
|
|
|
- select_dropdown_option_parameters: {
|
|
|
- properties: {
|
|
|
- index: {
|
|
|
- title: 'Index',
|
|
|
- type: 'integer',
|
|
|
- },
|
|
|
- text: {
|
|
|
- title: 'Text',
|
|
|
- type: 'string',
|
|
|
- },
|
|
|
- },
|
|
|
- required: ['index', 'text'],
|
|
|
- title: 'select_dropdown_option_parameters',
|
|
|
- type: 'object',
|
|
|
- },
|
|
|
- },
|
|
|
- properties: {
|
|
|
- current_state: {
|
|
|
- $ref: '#/$defs/AgentBrain',
|
|
|
- },
|
|
|
action: {
|
|
|
items: {
|
|
|
- $ref: '#/$defs/ActionModel',
|
|
|
+ properties: {
|
|
|
+ done: {
|
|
|
+ properties: {
|
|
|
+ text: {
|
|
|
+ title: 'Text',
|
|
|
+ type: 'string',
|
|
|
+ },
|
|
|
+ },
|
|
|
+ required: ['text'],
|
|
|
+ title: 'DoneAction',
|
|
|
+ type: 'object',
|
|
|
+ nullable: true,
|
|
|
+ },
|
|
|
+ search_google: {
|
|
|
+ properties: {
|
|
|
+ query: {
|
|
|
+ title: 'Query',
|
|
|
+ type: 'string',
|
|
|
+ },
|
|
|
+ },
|
|
|
+ required: ['query'],
|
|
|
+ title: 'SearchGoogleAction',
|
|
|
+ type: 'object',
|
|
|
+ nullable: true,
|
|
|
+ },
|
|
|
+ go_to_url: {
|
|
|
+ properties: {
|
|
|
+ url: {
|
|
|
+ title: 'Url',
|
|
|
+ type: 'string',
|
|
|
+ },
|
|
|
+ },
|
|
|
+ required: ['url'],
|
|
|
+ title: 'GoToUrlAction',
|
|
|
+ type: 'object',
|
|
|
+ nullable: true,
|
|
|
+ },
|
|
|
+ go_back: {
|
|
|
+ additionalProperties: true,
|
|
|
+ description:
|
|
|
+ 'Accepts absolutely anything in the incoming data\nand discards it, so the final parsed model is empty.',
|
|
|
+ properties: {},
|
|
|
+ title: 'NoParamsAction',
|
|
|
+ type: 'object',
|
|
|
+ nullable: true,
|
|
|
+ },
|
|
|
+ click_element: {
|
|
|
+ properties: {
|
|
|
+ desc: {
|
|
|
+ title: 'Intent',
|
|
|
+ type: 'string',
|
|
|
+ description: 'Very short explanation of the intent or purpose for calling this action',
|
|
|
+ },
|
|
|
+ index: {
|
|
|
+ title: 'Index',
|
|
|
+ type: 'integer',
|
|
|
+ },
|
|
|
+ xpath: {
|
|
|
+ title: 'XPath',
|
|
|
+ type: 'string',
|
|
|
+ nullable: true,
|
|
|
+ },
|
|
|
+ },
|
|
|
+ required: ['desc', 'index'],
|
|
|
+ title: 'ClickElementAction',
|
|
|
+ type: 'object',
|
|
|
+ nullable: true,
|
|
|
+ },
|
|
|
+ input_text: {
|
|
|
+ properties: {
|
|
|
+ desc: {
|
|
|
+ title: 'Intent',
|
|
|
+ type: 'string',
|
|
|
+ description: 'Very short explanation of the intent or purpose for calling this action',
|
|
|
+ },
|
|
|
+ index: {
|
|
|
+ title: 'Index',
|
|
|
+ type: 'integer',
|
|
|
+ },
|
|
|
+ text: {
|
|
|
+ title: 'Text',
|
|
|
+ type: 'string',
|
|
|
+ },
|
|
|
+ xpath: {
|
|
|
+ title: 'XPath',
|
|
|
+ type: 'string',
|
|
|
+ nullable: true,
|
|
|
+ },
|
|
|
+ },
|
|
|
+ required: ['desc', 'index', 'text'],
|
|
|
+ title: 'InputTextAction',
|
|
|
+ type: 'object',
|
|
|
+ nullable: true,
|
|
|
+ },
|
|
|
+ switch_tab: {
|
|
|
+ properties: {
|
|
|
+ tab_id: {
|
|
|
+ title: 'Page Id',
|
|
|
+ type: 'integer',
|
|
|
+ },
|
|
|
+ },
|
|
|
+ required: ['tab_id'],
|
|
|
+ title: 'SwitchTabAction',
|
|
|
+ type: 'object',
|
|
|
+ nullable: true,
|
|
|
+ },
|
|
|
+ open_tab: {
|
|
|
+ properties: {
|
|
|
+ url: {
|
|
|
+ title: 'Url',
|
|
|
+ type: 'string',
|
|
|
+ },
|
|
|
+ },
|
|
|
+ required: ['url'],
|
|
|
+ title: 'OpenTabAction',
|
|
|
+ type: 'object',
|
|
|
+ nullable: true,
|
|
|
+ },
|
|
|
+ cache_content: {
|
|
|
+ properties: {
|
|
|
+ content: {
|
|
|
+ title: 'Content',
|
|
|
+ type: 'string',
|
|
|
+ },
|
|
|
+ },
|
|
|
+ required: ['content'],
|
|
|
+ title: 'cache_content_parameters',
|
|
|
+ type: 'object',
|
|
|
+ nullable: true,
|
|
|
+ },
|
|
|
+ scroll_down: {
|
|
|
+ properties: {
|
|
|
+ desc: {
|
|
|
+ title: 'Intent',
|
|
|
+ type: 'string',
|
|
|
+ description: 'Very short explanation of the intent or purpose for calling this action',
|
|
|
+ },
|
|
|
+ amount: {
|
|
|
+ title: 'Amount',
|
|
|
+ type: 'integer',
|
|
|
+ nullable: true,
|
|
|
+ },
|
|
|
+ },
|
|
|
+ required: ['desc'],
|
|
|
+ title: 'ScrollAction',
|
|
|
+ type: 'object',
|
|
|
+ nullable: true,
|
|
|
+ },
|
|
|
+ scroll_up: {
|
|
|
+ properties: {
|
|
|
+ desc: {
|
|
|
+ title: 'Intent',
|
|
|
+ type: 'string',
|
|
|
+ description: 'Very short explanation of the intent or purpose for calling this action',
|
|
|
+ },
|
|
|
+ amount: {
|
|
|
+ title: 'Amount',
|
|
|
+ type: 'integer',
|
|
|
+ nullable: true,
|
|
|
+ },
|
|
|
+ },
|
|
|
+ required: ['desc'],
|
|
|
+ title: 'ScrollAction',
|
|
|
+ type: 'object',
|
|
|
+ nullable: true,
|
|
|
+ },
|
|
|
+ send_keys: {
|
|
|
+ properties: {
|
|
|
+ desc: {
|
|
|
+ title: 'Intent',
|
|
|
+ type: 'string',
|
|
|
+ description: 'Very short explanation of the intent or purpose for calling this action',
|
|
|
+ },
|
|
|
+ keys: {
|
|
|
+ title: 'Keys',
|
|
|
+ type: 'string',
|
|
|
+ },
|
|
|
+ },
|
|
|
+ required: ['desc', 'keys'],
|
|
|
+ title: 'SendKeysAction',
|
|
|
+ type: 'object',
|
|
|
+ nullable: true,
|
|
|
+ },
|
|
|
+ scroll_to_text: {
|
|
|
+ properties: {
|
|
|
+ desc: {
|
|
|
+ title: 'Intent',
|
|
|
+ type: 'string',
|
|
|
+ description: 'Very short explanation of the intent or purpose for calling this action',
|
|
|
+ },
|
|
|
+ text: {
|
|
|
+ title: 'Text',
|
|
|
+ type: 'string',
|
|
|
+ },
|
|
|
+ },
|
|
|
+ required: ['desc', 'text'],
|
|
|
+ title: 'scroll_to_text_parameters',
|
|
|
+ type: 'object',
|
|
|
+ nullable: true,
|
|
|
+ },
|
|
|
+ get_dropdown_options: {
|
|
|
+ properties: {
|
|
|
+ index: {
|
|
|
+ title: 'Index',
|
|
|
+ type: 'integer',
|
|
|
+ },
|
|
|
+ },
|
|
|
+ required: ['index'],
|
|
|
+ title: 'get_dropdown_options_parameters',
|
|
|
+ type: 'object',
|
|
|
+ nullable: true,
|
|
|
+ },
|
|
|
+ select_dropdown_option: {
|
|
|
+ properties: {
|
|
|
+ index: {
|
|
|
+ title: 'Index',
|
|
|
+ type: 'integer',
|
|
|
+ },
|
|
|
+ text: {
|
|
|
+ title: 'Text',
|
|
|
+ type: 'string',
|
|
|
+ },
|
|
|
+ },
|
|
|
+ required: ['index', 'text'],
|
|
|
+ title: 'select_dropdown_option_parameters',
|
|
|
+ type: 'object',
|
|
|
+ nullable: true,
|
|
|
+ },
|
|
|
+ },
|
|
|
+ title: 'ActionModel',
|
|
|
+ type: 'object',
|
|
|
},
|
|
|
title: 'Action',
|
|
|
type: 'array',
|