@eko-ai/eko 3.0.3 → 3.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/agent/base.d.ts +1 -1
- package/dist/agent/base.d.ts.map +1 -1
- package/dist/agent/browser/browser_labels.d.ts.map +1 -1
- package/dist/index.cjs.js +46 -79
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +46 -79
- package/dist/index.esm.js.map +1 -1
- package/dist/prompt/agent.d.ts.map +1 -1
- package/dist/prompt/plan.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/agent/base.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { AgentChain } from "../core/chain";
|
|
2
2
|
import Context, { AgentContext } from "../core/context";
|
|
3
|
-
import {
|
|
3
|
+
import { Tool, IMcpClient, LLMRequest, WorkflowAgent, ToolExecuter, ToolResult, StreamCallback, HumanCallback } from "../types";
|
|
4
4
|
import { LanguageModelV2FilePart, LanguageModelV2Prompt, LanguageModelV2TextPart, LanguageModelV2ToolCallPart } from "@ai-sdk/provider";
|
|
5
5
|
export type AgentParams = {
|
|
6
6
|
name: string;
|
package/dist/agent/base.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base.d.ts","sourceRoot":"","sources":["../../src/agent/base.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,UAAU,EAAa,MAAM,eAAe,CAAC;AACtD,OAAO,OAAO,EAAE,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAQxD,OAAO,EACL,
|
|
1
|
+
{"version":3,"file":"base.d.ts","sourceRoot":"","sources":["../../src/agent/base.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,UAAU,EAAa,MAAM,eAAe,CAAC;AACtD,OAAO,OAAO,EAAE,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAQxD,OAAO,EACL,IAAI,EACJ,UAAU,EACV,UAAU,EACV,aAAa,E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AUlD,OAAO,CAAC,IAAI,EAAE,IAAI;cAIT,YAAY,CAC1B,MAAM,EAAE,OAAO,GAAG,OAAO,GAAG,cAAc,EAC1C,MAAM,CAAC,EAAE,MAAM;IAOjB,IAAI,IAAI,IAAI,MAAM,EAAE,GAAG,SAAS,CAE/B;IAED,IAAI,IAAI,IAAI,MAAM,CAEjB;IAED,IAAI,WAAW,IAAI,MAAM,CAExB;IAED,IAAI,KAAK,IAAI,IAAI,EAAE,CAElB;IAED,IAAI,eAAe,uBAElB;IAED,IAAI,SAAS,2BAEZ;IAED,IAAI,YAAY,IAAI,YAAY,GAAG,SAAS,CAE3C;CACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"browser_labels.d.ts","sourceRoot":"","sources":["../../../src/agent/browser/browser_labels.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAElD,OAAO,EAAE,gBAAgB,EAAc,MAAM,gBAAgB,CAAC;AAC9D,OAAO,
|
|
1
|
+
{"version":3,"file":"browser_labels.d.ts","sourceRoot":"","sources":["../../../src/agent/browser/browser_labels.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAElD,OAAO,EAAE,gBAAgB,EAAc,MAAM,gBAAgB,CAAC;AAC9D,OAAO,EACL,qBAAqB,EAEtB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,IAAI,EAAc,UAAU,EAAE,MAAM,aAAa,CAAC;AAG3D,MAAM,CAAC,OAAO,CAAC,QAAQ,OAAO,sBAAuB,SAAQ,gBAAgB;gBAC/D,IAAI,CAAC,EAAE,MAAM,EAAE,EAAE,SAAS,CAAC,EAAE,IAAI,EAAE,EAAE,SAAS,CAAC,EAAE,UAAU;cA8CvD,UAAU,CACxB,YAAY,EAAE,YAAY,EAC1B,KAAK,EAAE,MAAM,EACb,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,OAAO,GACb,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,OAAO,CAAC,oBAAoB;IAkC5B,OAAO,CAAC,oBAAoB;CA0B7B;AA4SD,OAAO,EAAE,sBAAsB,EAAE,CAAC"}
|
package/dist/index.cjs.js
CHANGED
|
@@ -31396,28 +31396,6 @@ function extractUsedTool(messages, agentTools) {
|
|
|
31396
31396
|
}
|
|
31397
31397
|
return tools;
|
|
31398
31398
|
}
|
|
31399
|
-
function removeDuplicateToolUse(results) {
|
|
31400
|
-
if (results.length <= 1 ||
|
|
31401
|
-
results.filter((r) => r.type == "tool-call").length <= 1) {
|
|
31402
|
-
return results;
|
|
31403
|
-
}
|
|
31404
|
-
let _results = [];
|
|
31405
|
-
let tool_uniques = [];
|
|
31406
|
-
for (let i = 0; i < results.length; i++) {
|
|
31407
|
-
if (results[i].type === "tool-call") {
|
|
31408
|
-
let tool = results[i];
|
|
31409
|
-
let key = tool.toolName + tool.input;
|
|
31410
|
-
if (tool_uniques.indexOf(key) == -1) {
|
|
31411
|
-
_results.push(results[i]);
|
|
31412
|
-
tool_uniques.push(key);
|
|
31413
|
-
}
|
|
31414
|
-
}
|
|
31415
|
-
else {
|
|
31416
|
-
_results.push(results[i]);
|
|
31417
|
-
}
|
|
31418
|
-
}
|
|
31419
|
-
return _results;
|
|
31420
|
-
}
|
|
31421
31399
|
async function compressAgentMessages(agentContext, rlm, messages, tools) {
|
|
31422
31400
|
if (messages.length < 5) {
|
|
31423
31401
|
return;
|
|
@@ -32374,23 +32352,13 @@ You are {name}, an autonomous AI Agent Planner.
|
|
|
32374
32352
|
{example_prompt}
|
|
32375
32353
|
`;
|
|
32376
32354
|
const PLAN_TASK_DESCRIPTION = `Your task is to understand the user's requirements, dynamically plan the user's tasks based on the Agent list, and please follow the steps below:
|
|
32377
|
-
|
|
32378
|
-
|
|
32379
|
-
|
|
32380
|
-
|
|
32381
|
-
|
|
32382
|
-
|
|
32383
|
-
|
|
32384
|
-
const PLAN_CHAT_EXAMPLE = `User: hello.
|
|
32385
|
-
Output result:
|
|
32386
|
-
<root>
|
|
32387
|
-
<name>Chat</name>
|
|
32388
|
-
<thought>Alright, the user wrote "hello". That's pretty straightforward. I need to respond in a friendly and welcoming manner.</thought>
|
|
32389
|
-
<agents>
|
|
32390
|
-
<!-- Chat agents can exist without the <task> and <nodes> nodes. -->
|
|
32391
|
-
<agent name="Chat" id="0" dependsOn=""></agent>
|
|
32392
|
-
</agents>
|
|
32393
|
-
</root>`;
|
|
32355
|
+
- Analyze the Agents that need to be used based on the user's requirements.
|
|
32356
|
+
- Generate the Agent calling plan based on the analysis results.
|
|
32357
|
+
- About agent name, please do not arbitrarily fabricate non-existent agent names.
|
|
32358
|
+
- You only need to provide the steps to complete the user's task, key steps only, no need to be too detailed.
|
|
32359
|
+
- Try to break down tasks into independently completable subtasks, and for maximum efficiency, run multiple independent subtasks in parallel whenever possible.
|
|
32360
|
+
- Please strictly follow the output format and example output.
|
|
32361
|
+
- The output language should follow the language corresponding to the user's task.`;
|
|
32394
32362
|
const PLAN_EXAMPLE_LIST = [
|
|
32395
32363
|
`User: Open Boss Zhipin, find 10 operation positions in Chengdu, and send a personal introduction to the recruiters based on the page information.
|
|
32396
32364
|
Output result:
|
|
@@ -32571,13 +32539,9 @@ async function getPlanSystemPrompt(context, planTaskDescription, planExampleList
|
|
|
32571
32539
|
PLAN_TASK_DESCRIPTION;
|
|
32572
32540
|
const plan_example_list = context.variables.get("plan_example_list") ||
|
|
32573
32541
|
PLAN_EXAMPLE_LIST;
|
|
32574
|
-
const hasChatAgent = context.agents.filter((a) => a.Name == "Chat").length > 0;
|
|
32575
32542
|
let example_prompt = "";
|
|
32576
|
-
|
|
32577
|
-
|
|
32578
|
-
: [...plan_example_list];
|
|
32579
|
-
for (let i = 0; i < example_list.length; i++) {
|
|
32580
|
-
example_prompt += `## Example ${i + 1}\n${example_list[i]}\n\n`;
|
|
32543
|
+
for (let i = 0; i < plan_example_list.length; i++) {
|
|
32544
|
+
example_prompt += `## Example ${i + 1}\n${plan_example_list[i]}\n\n`;
|
|
32581
32545
|
}
|
|
32582
32546
|
return PLAN_SYSTEM_TEMPLATE.replace("{name}", config$1.name)
|
|
32583
32547
|
.replace("{task_description}", task_description)
|
|
@@ -35361,6 +35325,7 @@ You are {name}, an autonomous AI agent for {agent} agent.
|
|
|
35361
35325
|
</nodes>
|
|
35362
35326
|
</root>
|
|
35363
35327
|
|
|
35328
|
+
For maximum efficiency, whenever you need to perform multiple independent operations, invoke all relevant tools simultaneously rather than sequentially.
|
|
35364
35329
|
The output language should follow the language corresponding to the user's task.
|
|
35365
35330
|
`;
|
|
35366
35331
|
const HUMAN_PROMPT = `
|
|
@@ -35381,7 +35346,7 @@ const FOR_EACH_NODE = `
|
|
|
35381
35346
|
</forEach>`;
|
|
35382
35347
|
const FOR_EACH_PROMPT = `
|
|
35383
35348
|
* forEach node
|
|
35384
|
-
repetitive tasks, when executing
|
|
35349
|
+
For repetitive tasks, when executing a forEach node, the \`${TOOL_NAME$6}\` tool must be used. Loop tasks support parallel tool calls, and during parallel execution, this tool needs to be called interspersed throughout the process.
|
|
35385
35350
|
`;
|
|
35386
35351
|
const WATCH_NODE = `
|
|
35387
35352
|
<!-- monitor task node, the loop attribute specifies whether to listen in a loop or listen once -->
|
|
@@ -35549,7 +35514,7 @@ class Agent {
|
|
|
35549
35514
|
let context = agentContext.context;
|
|
35550
35515
|
let user_messages = [];
|
|
35551
35516
|
let toolResults = [];
|
|
35552
|
-
results = removeDuplicateToolUse(results);
|
|
35517
|
+
// results = memory.removeDuplicateToolUse(results);
|
|
35553
35518
|
if (results.length == 0) {
|
|
35554
35519
|
return null;
|
|
35555
35520
|
}
|
|
@@ -36073,7 +36038,7 @@ This is a computer GUI interface, observe the execution through screenshots, and
|
|
|
36073
36038
|
return [
|
|
36074
36039
|
{
|
|
36075
36040
|
name: "typing",
|
|
36076
|
-
description: "
|
|
36041
|
+
description: "Simulates keyboard typing to input text into the currently focused application or text field on the computer.",
|
|
36077
36042
|
parameters: {
|
|
36078
36043
|
type: "object",
|
|
36079
36044
|
properties: {
|
|
@@ -36090,27 +36055,27 @@ This is a computer GUI interface, observe the execution through screenshots, and
|
|
|
36090
36055
|
},
|
|
36091
36056
|
{
|
|
36092
36057
|
name: "click",
|
|
36093
|
-
description: "
|
|
36058
|
+
description: "Simulates mouse clicking at an absolute screen position (x, y) on the computer.",
|
|
36094
36059
|
parameters: {
|
|
36095
36060
|
type: "object",
|
|
36096
36061
|
properties: {
|
|
36097
36062
|
x: {
|
|
36098
36063
|
type: "number",
|
|
36099
|
-
description: "X coordinate",
|
|
36064
|
+
description: "Absolute X coordinate on the screen where the mouse will click",
|
|
36100
36065
|
},
|
|
36101
36066
|
y: {
|
|
36102
36067
|
type: "number",
|
|
36103
|
-
description: "Y coordinate",
|
|
36068
|
+
description: "Absolute Y coordinate on the screen where the mouse will click",
|
|
36104
36069
|
},
|
|
36105
36070
|
num_clicks: {
|
|
36106
36071
|
type: "number",
|
|
36107
|
-
description: "Number of
|
|
36072
|
+
description: "Number of times to click at the position",
|
|
36108
36073
|
enum: [1, 2, 3],
|
|
36109
36074
|
default: 1,
|
|
36110
36075
|
},
|
|
36111
36076
|
button: {
|
|
36112
36077
|
type: "string",
|
|
36113
|
-
description: "
|
|
36078
|
+
description: "Which mouse button to click",
|
|
36114
36079
|
enum: ["left", "right", "middle"],
|
|
36115
36080
|
default: "left",
|
|
36116
36081
|
},
|
|
@@ -36123,17 +36088,17 @@ This is a computer GUI interface, observe the execution through screenshots, and
|
|
|
36123
36088
|
},
|
|
36124
36089
|
{
|
|
36125
36090
|
name: "move_to",
|
|
36126
|
-
description: "
|
|
36091
|
+
description: "Moves the mouse cursor to the specified screen coordinates.",
|
|
36127
36092
|
parameters: {
|
|
36128
36093
|
type: "object",
|
|
36129
36094
|
properties: {
|
|
36130
36095
|
x: {
|
|
36131
36096
|
type: "number",
|
|
36132
|
-
description: "X coordinate",
|
|
36097
|
+
description: "Absolute X coordinate on the screen",
|
|
36133
36098
|
},
|
|
36134
36099
|
y: {
|
|
36135
36100
|
type: "number",
|
|
36136
|
-
description: "Y coordinate",
|
|
36101
|
+
description: "Absolute Y coordinate on the screen",
|
|
36137
36102
|
},
|
|
36138
36103
|
},
|
|
36139
36104
|
required: ["x", "y"],
|
|
@@ -36144,7 +36109,7 @@ This is a computer GUI interface, observe the execution through screenshots, and
|
|
|
36144
36109
|
},
|
|
36145
36110
|
{
|
|
36146
36111
|
name: "scroll",
|
|
36147
|
-
description: "Scroll the mouse wheel at current
|
|
36112
|
+
description: "Scroll the mouse wheel vertically at the current pointer location.",
|
|
36148
36113
|
parameters: {
|
|
36149
36114
|
type: "object",
|
|
36150
36115
|
properties: {
|
|
@@ -36170,13 +36135,13 @@ This is a computer GUI interface, observe the execution through screenshots, and
|
|
|
36170
36135
|
},
|
|
36171
36136
|
{
|
|
36172
36137
|
name: "press",
|
|
36173
|
-
description: "
|
|
36138
|
+
description: "Simulate pressing and releasing a specific keyboard key",
|
|
36174
36139
|
parameters: {
|
|
36175
36140
|
type: "object",
|
|
36176
36141
|
properties: {
|
|
36177
36142
|
key: {
|
|
36178
36143
|
type: "string",
|
|
36179
|
-
description: "
|
|
36144
|
+
description: "The keyboard key",
|
|
36180
36145
|
enum: keyboardKeys,
|
|
36181
36146
|
},
|
|
36182
36147
|
},
|
|
@@ -36188,13 +36153,13 @@ This is a computer GUI interface, observe the execution through screenshots, and
|
|
|
36188
36153
|
},
|
|
36189
36154
|
{
|
|
36190
36155
|
name: "hotkey",
|
|
36191
|
-
description: "
|
|
36156
|
+
description: "Simulate pressing one or more keyboard keys, including combinations.",
|
|
36192
36157
|
parameters: {
|
|
36193
36158
|
type: "object",
|
|
36194
36159
|
properties: {
|
|
36195
36160
|
keys: {
|
|
36196
36161
|
type: "string",
|
|
36197
|
-
description: "
|
|
36162
|
+
description: "A single key or a combination of keys to press. For combinations, use '+' to join keys.",
|
|
36198
36163
|
enum: keyboardKeys,
|
|
36199
36164
|
},
|
|
36200
36165
|
},
|
|
@@ -36206,25 +36171,25 @@ This is a computer GUI interface, observe the execution through screenshots, and
|
|
|
36206
36171
|
},
|
|
36207
36172
|
{
|
|
36208
36173
|
name: "drag_and_drop",
|
|
36209
|
-
description: "
|
|
36174
|
+
description: "Performs a mouse drag-and-drop operation from a starting point to a target point on the screen.",
|
|
36210
36175
|
parameters: {
|
|
36211
36176
|
type: "object",
|
|
36212
36177
|
properties: {
|
|
36213
36178
|
x1: {
|
|
36214
36179
|
type: "number",
|
|
36215
|
-
description: "
|
|
36180
|
+
description: "Absolute X coordinate of the starting point (in pixels).",
|
|
36216
36181
|
},
|
|
36217
36182
|
y1: {
|
|
36218
36183
|
type: "number",
|
|
36219
|
-
description: "
|
|
36184
|
+
description: "Absolute Y coordinate of the starting point (in pixels).",
|
|
36220
36185
|
},
|
|
36221
36186
|
x2: {
|
|
36222
36187
|
type: "number",
|
|
36223
|
-
description: "
|
|
36188
|
+
description: "Absolute X coordinate of the ending (target) point (in pixels).",
|
|
36224
36189
|
},
|
|
36225
36190
|
y2: {
|
|
36226
36191
|
type: "number",
|
|
36227
|
-
description: "
|
|
36192
|
+
description: "Absolute Y coordinate of the ending (target) point (in pixels).",
|
|
36228
36193
|
},
|
|
36229
36194
|
},
|
|
36230
36195
|
required: ["x1", "y1", "x2", "y2"],
|
|
@@ -36236,13 +36201,13 @@ This is a computer GUI interface, observe the execution through screenshots, and
|
|
|
36236
36201
|
{
|
|
36237
36202
|
name: "wait",
|
|
36238
36203
|
noPlan: true,
|
|
36239
|
-
description: "Wait for specified duration",
|
|
36204
|
+
description: "Wait/pause execution for a specified duration. Use this tool when you need to wait for data loading, or introduce delays between operations.",
|
|
36240
36205
|
parameters: {
|
|
36241
36206
|
type: "object",
|
|
36242
36207
|
properties: {
|
|
36243
36208
|
duration: {
|
|
36244
36209
|
type: "number",
|
|
36245
|
-
description: "
|
|
36210
|
+
description: "Wait duration in milliseconds",
|
|
36246
36211
|
default: 500,
|
|
36247
36212
|
minimum: 200,
|
|
36248
36213
|
maximum: 10000,
|
|
@@ -37212,6 +37177,8 @@ class BaseBrowserLabelsAgent extends BaseBrowserAgent {
|
|
|
37212
37177
|
* BROWSER OPERATION:
|
|
37213
37178
|
- Use scroll to find elements you are looking for, When extracting content, prioritize using extract_page_content, only scroll when you need to load more content
|
|
37214
37179
|
- Please follow user instructions and don't be lazy until the task is completed. For example, if a user asks you to find 30 people, don't just find 10 - keep searching until you find all 30
|
|
37180
|
+
* Parallelism:
|
|
37181
|
+
- When operating multiple independent steps, they should be executed in parallel as much as possible. For example, when filling out multiple form fields, they should be filled in parallel as much as possible to improve efficiency, rather than operating step by step.
|
|
37215
37182
|
* During execution, please output user-friendly step information. Do not output HTML-related element and index information to users, as this would cause user confusion.
|
|
37216
37183
|
`;
|
|
37217
37184
|
const _tools_ = [];
|
|
@@ -37331,13 +37298,13 @@ class BaseBrowserLabelsAgent extends BaseBrowserAgent {
|
|
|
37331
37298
|
return [
|
|
37332
37299
|
{
|
|
37333
37300
|
name: "navigate_to",
|
|
37334
|
-
description: "Navigate to a specific
|
|
37301
|
+
description: "Navigate to a specific URL in the browser. Use this tool when you need to visit a webpage or change the current page location.",
|
|
37335
37302
|
parameters: {
|
|
37336
37303
|
type: "object",
|
|
37337
37304
|
properties: {
|
|
37338
37305
|
url: {
|
|
37339
37306
|
type: "string",
|
|
37340
|
-
description: "The
|
|
37307
|
+
description: "The complete URL to navigate to",
|
|
37341
37308
|
},
|
|
37342
37309
|
},
|
|
37343
37310
|
required: ["url"],
|
|
@@ -37348,7 +37315,7 @@ class BaseBrowserLabelsAgent extends BaseBrowserAgent {
|
|
|
37348
37315
|
},
|
|
37349
37316
|
{
|
|
37350
37317
|
name: "current_page",
|
|
37351
|
-
description: "Get the
|
|
37318
|
+
description: "Get the currently active webpage information, return tabId, URL and title",
|
|
37352
37319
|
parameters: {
|
|
37353
37320
|
type: "object",
|
|
37354
37321
|
properties: {},
|
|
@@ -37359,7 +37326,7 @@ class BaseBrowserLabelsAgent extends BaseBrowserAgent {
|
|
|
37359
37326
|
},
|
|
37360
37327
|
{
|
|
37361
37328
|
name: "go_back",
|
|
37362
|
-
description: "
|
|
37329
|
+
description: "Go back to the previous page in browser history",
|
|
37363
37330
|
parameters: {
|
|
37364
37331
|
type: "object",
|
|
37365
37332
|
properties: {},
|
|
@@ -37370,7 +37337,7 @@ class BaseBrowserLabelsAgent extends BaseBrowserAgent {
|
|
|
37370
37337
|
},
|
|
37371
37338
|
{
|
|
37372
37339
|
name: "input_text",
|
|
37373
|
-
description: "
|
|
37340
|
+
description: "Inputs text into a element by first clicking to focus the element, then clearing any existing text and typing the new text. Optionally presses Enter after input completion.",
|
|
37374
37341
|
parameters: {
|
|
37375
37342
|
type: "object",
|
|
37376
37343
|
properties: {
|
|
@@ -37453,7 +37420,7 @@ class BaseBrowserLabelsAgent extends BaseBrowserAgent {
|
|
|
37453
37420
|
},
|
|
37454
37421
|
{
|
|
37455
37422
|
name: "hover_to_element",
|
|
37456
|
-
description: "
|
|
37423
|
+
description: "Hover the mouse over an element, use it when you need to hover to display more interactive information",
|
|
37457
37424
|
parameters: {
|
|
37458
37425
|
type: "object",
|
|
37459
37426
|
properties: {
|
|
@@ -37470,7 +37437,7 @@ class BaseBrowserLabelsAgent extends BaseBrowserAgent {
|
|
|
37470
37437
|
},
|
|
37471
37438
|
{
|
|
37472
37439
|
name: "extract_page_content",
|
|
37473
|
-
description: "
|
|
37440
|
+
description: "Extracts all content from the current webpage, including text and image links. Please use this tool when you need to retrieve webpage content.",
|
|
37474
37441
|
parameters: {
|
|
37475
37442
|
type: "object",
|
|
37476
37443
|
properties: {},
|
|
@@ -37519,7 +37486,7 @@ class BaseBrowserLabelsAgent extends BaseBrowserAgent {
|
|
|
37519
37486
|
},
|
|
37520
37487
|
{
|
|
37521
37488
|
name: "get_all_tabs",
|
|
37522
|
-
description: "Get all tabs of the current browser",
|
|
37489
|
+
description: "Get all tabs of the current browser, returns the tabId, URL, and title of all tab pages",
|
|
37523
37490
|
parameters: {
|
|
37524
37491
|
type: "object",
|
|
37525
37492
|
properties: {},
|
|
@@ -37530,7 +37497,7 @@ class BaseBrowserLabelsAgent extends BaseBrowserAgent {
|
|
|
37530
37497
|
},
|
|
37531
37498
|
{
|
|
37532
37499
|
name: "switch_tab",
|
|
37533
|
-
description: "Switch to the specified tab
|
|
37500
|
+
description: "Switch to the specified tab (based on tabId)",
|
|
37534
37501
|
parameters: {
|
|
37535
37502
|
type: "object",
|
|
37536
37503
|
properties: {
|
|
@@ -37548,13 +37515,13 @@ class BaseBrowserLabelsAgent extends BaseBrowserAgent {
|
|
|
37548
37515
|
{
|
|
37549
37516
|
name: "wait",
|
|
37550
37517
|
noPlan: true,
|
|
37551
|
-
description: "Wait for specified duration",
|
|
37518
|
+
description: "Wait/pause execution for a specified duration. Use this tool when you need to wait for data loading, page rendering, or introduce delays between operations.",
|
|
37552
37519
|
parameters: {
|
|
37553
37520
|
type: "object",
|
|
37554
37521
|
properties: {
|
|
37555
37522
|
duration: {
|
|
37556
37523
|
type: "number",
|
|
37557
|
-
description: "
|
|
37524
|
+
description: "Wait duration in milliseconds",
|
|
37558
37525
|
default: 500,
|
|
37559
37526
|
minimum: 200,
|
|
37560
37527
|
maximum: 10000,
|