{"version":3,"file":"agent/actions/json_schema.mjs","sources":["webpack://@agent-infra/browser-use/./src/agent/actions/json_schema.ts"],"sourcesContent":["/**\n * The following code is modified based on\n * https://github.com/nanobrowser/nanobrowser/blob/master/chrome-extension/src/background/agent/actions/json_schema.ts\n *\n * Apache-2.0 License\n * Copyright (c) 2024 alexchenzl\n * https://github.com/nanobrowser/nanobrowser/blob/master/LICENSE\n */\n// This is the json schema exported from browser-use, change page_id to tab_id\n// TODO: don't know why zod can not generate the same schema, need to fix it\nexport const jsonNavigatorOutputSchema = {\n  properties: {\n    current_state: {\n      description: 'Current state of the agent',\n      properties: {\n        page_summary: {\n          title: 'Page Summary',\n          type: 'string',\n        },\n        evaluation_previous_goal: {\n          title: 'Evaluation Previous Goal',\n          type: 'string',\n        },\n        memory: {\n          title: 'Memory',\n          type: 'string',\n        },\n        next_goal: {\n          title: 'Next Goal',\n          type: 'string',\n        },\n      },\n      required: [\n        'page_summary',\n        'evaluation_previous_goal',\n        'memory',\n        'next_goal',\n      ],\n      title: 'AgentBrain',\n      type: 'object',\n    },\n    action: {\n      items: {\n        properties: {\n          done: {\n            properties: {\n              text: {\n                title: 'Text',\n                type: 'string',\n              },\n            },\n            required: ['text'],\n            title: 'DoneAction',\n            type: 'object',\n            nullable: true,\n          },\n          search_google: {\n            properties: {\n              query: {\n                title: 'Query',\n                type: 'string',\n              },\n            },\n            required: ['query'],\n            title: 'SearchGoogleAction',\n            type: 'object',\n            nullable: true,\n          },\n          go_to_url: {\n            properties: {\n              url: {\n                title: 'Url',\n                type: 'string',\n              },\n            },\n            required: ['url'],\n            title: 'GoToUrlAction',\n            type: 'object',\n            nullable: true,\n          },\n          go_back: {\n            additionalProperties: true,\n            description:\n              'Accepts absolutely anything in the incoming data\\nand discards it, so the final parsed model is empty.',\n            properties: {},\n            title: 'NoParamsAction',\n            type: 'object',\n            nullable: true,\n          },\n          click_element: {\n            properties: {\n              desc: {\n                title: 'Intent',\n                type: 'string',\n                description:\n                  'Very short explanation of the intent or purpose for calling this action',\n              },\n              index: {\n                title: 'Index',\n                type: 'integer',\n              },\n              xpath: {\n                title: 'XPath',\n                type: 'string',\n                nullable: true,\n              },\n            },\n            required: ['desc', 'index'],\n            title: 'ClickElementAction',\n            type: 'object',\n            nullable: true,\n          },\n          input_text: {\n            properties: {\n              desc: {\n                title: 'Intent',\n                type: 'string',\n                description:\n                  'Very short explanation of the intent or purpose for calling this action',\n              },\n              index: {\n                title: 'Index',\n                type: 'integer',\n              },\n              text: {\n                title: 'Text',\n                type: 'string',\n              },\n              xpath: {\n                title: 'XPath',\n                type: 'string',\n                nullable: true,\n              },\n            },\n            required: ['desc', 'index', 'text'],\n            title: 'InputTextAction',\n            type: 'object',\n            nullable: true,\n          },\n          switch_tab: {\n            properties: {\n              tab_id: {\n                title: 'Page Id',\n                type: 'integer',\n              },\n            },\n            required: ['tab_id'],\n            title: 'SwitchTabAction',\n            type: 'object',\n            nullable: true,\n          },\n          open_tab: {\n            properties: {\n              url: {\n                title: 'Url',\n                type: 'string',\n              },\n            },\n            required: ['url'],\n            title: 'OpenTabAction',\n            type: 'object',\n            nullable: true,\n          },\n          cache_content: {\n            properties: {\n              content: {\n                title: 'Content',\n                type: 'string',\n              },\n            },\n            required: ['content'],\n            title: 'cache_content_parameters',\n            type: 'object',\n            nullable: true,\n          },\n          scroll_down: {\n            properties: {\n              desc: {\n                title: 'Intent',\n                type: 'string',\n                description:\n                  'Very short explanation of the intent or purpose for calling this action',\n              },\n              amount: {\n                title: 'Amount',\n                type: 'integer',\n                nullable: true,\n              },\n            },\n            required: ['desc'],\n            title: 'ScrollAction',\n            type: 'object',\n            nullable: true,\n          },\n          scroll_up: {\n            properties: {\n              desc: {\n                title: 'Intent',\n                type: 'string',\n                description:\n                  'Very short explanation of the intent or purpose for calling this action',\n              },\n              amount: {\n                title: 'Amount',\n                type: 'integer',\n                nullable: true,\n              },\n            },\n            required: ['desc'],\n            title: 'ScrollAction',\n            type: 'object',\n            nullable: true,\n          },\n          send_keys: {\n            properties: {\n              desc: {\n                title: 'Intent',\n                type: 'string',\n                description:\n                  'Very short explanation of the intent or purpose for calling this action',\n              },\n              keys: {\n                title: 'Keys',\n                type: 'string',\n              },\n            },\n            required: ['desc', 'keys'],\n            title: 'SendKeysAction',\n            type: 'object',\n            nullable: true,\n          },\n          scroll_to_text: {\n            properties: {\n              desc: {\n                title: 'Intent',\n                type: 'string',\n                description:\n                  'Very short explanation of the intent or purpose for calling this action',\n              },\n              text: {\n                title: 'Text',\n                type: 'string',\n              },\n            },\n            required: ['desc', 'text'],\n            title: 'scroll_to_text_parameters',\n            type: 'object',\n            nullable: true,\n          },\n          get_dropdown_options: {\n            properties: {\n              index: {\n                title: 'Index',\n                type: 'integer',\n              },\n            },\n            required: ['index'],\n            title: 'get_dropdown_options_parameters',\n            type: 'object',\n            nullable: true,\n          },\n          select_dropdown_option: {\n            properties: {\n              index: {\n                title: 'Index',\n                type: 'integer',\n              },\n              text: {\n                title: 'Text',\n                type: 'string',\n              },\n            },\n            required: ['index', 'text'],\n            title: 'select_dropdown_option_parameters',\n            type: 'object',\n            nullable: true,\n          },\n        },\n        title: 'ActionModel',\n        type: 'object',\n      },\n      title: 'Action',\n      type: 'array',\n    },\n  },\n  required: ['current_state', 'action'],\n  title: 'AgentOutput',\n  type: 'object',\n};\n"],"names":["jsonNavigatorOutputSchema"],"mappings":";;;;AAUO,MAAMA,4BAA4B;IACvC,YAAY;QACV,eAAe;YACb,aAAa;YACb,YAAY;gBACV,cAAc;oBACZ,OAAO;oBACP,MAAM;gBACR;gBACA,0BAA0B;oBACxB,OAAO;oBACP,MAAM;gBACR;gBACA,QAAQ;oBACN,OAAO;oBACP,MAAM;gBACR;gBACA,WAAW;oBACT,OAAO;oBACP,MAAM;gBACR;YACF;YACA,UAAU;gBACR;gBACA;gBACA;gBACA;aACD;YACD,OAAO;YACP,MAAM;QACR;QACA,QAAQ;YACN,OAAO;gBACL,YAAY;oBACV,MAAM;wBACJ,YAAY;4BACV,MAAM;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