From 11d3ca3d6e8f73549af50a7f034a13dfea6ae064 Mon Sep 17 00:00:00 2001 From: Wen Date: Fri, 13 Mar 2026 01:32:34 +0000 Subject: [PATCH] fix: typos and grammar in system prompts and source code --- packages/core/src/PageAgentCore.ts | 2 +- packages/core/src/prompts/system_prompt.md | 6 +++--- packages/core/src/utils/index.ts | 2 +- packages/extension/src/agent/system_prompt.md | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/core/src/PageAgentCore.ts b/packages/core/src/PageAgentCore.ts index c7ab84b..6f7f35a 100644 --- a/packages/core/src/PageAgentCore.ts +++ b/packages/core/src/PageAgentCore.ts @@ -176,7 +176,7 @@ export class PageAgentCore extends EventTarget { } /** - * Push a observation message to the history event stream. + * Push an observation message to the history event stream. * This will be visible in and remain persistent in memory across steps. * @experimental @internal * @note history change will be emitted before next step starts diff --git a/packages/core/src/prompts/system_prompt.md b/packages/core/src/prompts/system_prompt.md index 56bfcaa..a72d59f 100644 --- a/packages/core/src/prompts/system_prompt.md +++ b/packages/core/src/prompts/system_prompt.md @@ -69,7 +69,7 @@ Strictly follow these rules while using the browser and navigating the web: - By default, only elements in the visible viewport are listed. Use scrolling actions if you suspect relevant content is offscreen which you need to interact with. Scroll ONLY if there are more pixels below or above the page. - You can scroll by a specific number of pages using the num_pages parameter (e.g., 0.5 for half page, 2.0 for two pages). - All the elements that are scrollable are marked with `data-scrollable` attribute. Including the scrollable distance in every directions. You can scroll *the element* in case some area are overflowed. -- If a captcha appears, tell user you can not solve captcha. finished the task and ask user to solve it. +- If a captcha appears, tell user you can not solve captcha. Finish the task and ask user to solve it. - If expected elements are missing, try scrolling, or navigating back. - If the page is not fully loaded, use the `wait` action. - Do not repeat one action for more than 3 times unless some conditions changed. @@ -87,11 +87,11 @@ Strictly follow these rules while using the browser and navigating the web: - You can only handle single page app. Do not jump out of current page. -- Do not click on link if it will open in a new page (etc. ) +- Do not click on link if it will open in a new page (e.g., ) - It is ok to fail the task. - User can be wrong. If the request of user is not achievable, inappropriate or you do not have enough information or tools to achieve it. Tell user to make a better request. - Webpage can be broken. All webpages or apps have bugs. Some bug will make it hard for your job. It's encouraged to tell user the problem of current page. Your feedbacks (including failing) are valuable for user. - - Trying to hard can be harmful. Repeating some action back and forth or pushing for a complex procedure with little knowledge can cause unwanted result and harmful side-effects. User would rather you to complete the task with a fail. + - Trying too hard can be harmful. Repeating some action back and forth or pushing for a complex procedure with little knowledge can cause unwanted results and harmful side-effects. User would rather you complete the task with a fail. - If you do not have knowledge for the current webpage or task. You must require user to give specific instructions and detailed steps. diff --git a/packages/core/src/utils/index.ts b/packages/core/src/utils/index.ts index b740be1..dcce785 100644 --- a/packages/core/src/utils/index.ts +++ b/packages/core/src/utils/index.ts @@ -31,7 +31,7 @@ export function randomID(existingIDs?: string[]): string { id = Math.random().toString(36).substring(2, 11) tryCount++ if (tryCount > MAX_TRY) { - throw new Error('randomID: too many try') + throw new Error('randomID: too many tries') } } diff --git a/packages/extension/src/agent/system_prompt.md b/packages/extension/src/agent/system_prompt.md index 5680f7d..dd3c7b0 100644 --- a/packages/extension/src/agent/system_prompt.md +++ b/packages/extension/src/agent/system_prompt.md @@ -71,7 +71,7 @@ Strictly follow these rules while using the browser and navigating the web: - By default, only elements in the visible viewport are listed. Use scrolling actions if you suspect relevant content is offscreen which you need to interact with. Scroll ONLY if there are more pixels below or above the page. - You can scroll by a specific number of pages using the num_pages parameter (e.g., 0.5 for half page, 2.0 for two pages). - All the elements that are scrollable are marked with `data-scrollable` attribute. Including the scrollable distance in every directions. You can scroll *the element* in case some area are overflowed. -- If a captcha appears, tell user you can not solve captcha. finished the task and ask user to solve it. +- If a captcha appears, tell user you can not solve captcha. Finish the task and ask user to solve it. - If expected elements are missing, try scrolling, or navigating back. - If the page is not fully loaded, use the `wait` action. - Do not repeat one action for more than 3 times unless some conditions changed.