Open-source AI browser agent for Chrome and Firefox (monorepo) ðŸ§
JavaScript ai-agentai-agentsai-toolsbrowser-aibrowser-automationbrowser-extensionchrome-aichrome-devtoolschrome-extensionchrome-extensionsfirefox-addonfirefox-addonsfirefox-extensionfirefox-extensionsgemmagemma4minimaxoffline-aioffline-llmqwen
Merge remote-tracking branch 'origin/main' into codex/fix-steering-authorization-linkedin
Emre Sokullu34da7cb1178d
diff --cc src/chrome/src/agent/agent.jsindex 1949d1c29,496938228..bb7d373e2--- a/src/chrome/src/agent/agent.js+++ b/src/chrome/src/agent/agent.js@@@ -21811,8 -21587,9 +21814,10 @@@ Rules: no prose intro, no conclusion, nconst recheckOnly = runOptions?.plannerIntentRecheckOnly === true;const provider = this._activeProvider(tabId);const plannerMessages = buildPlannerIntentMessages(enriched, tabUrl, tabTitle, historyDigest, {+ steering: runOptions.steeringRevision != null,noThink: this._plannerPrefersNoThinkPrompt(provider),+ imageGenConfigured: this.imageGenConfigured,+ tier: this._resolvePromptTier(provider),scheduledResume: runOptions?.scheduledResume === true,locale,priorUserTask: followUpContext.priorUserTask,@@@ -22046,8 -21819,9 +22051,10 @@@const tier = this._resolvePromptTier();const skillCatalog = this._skillCatalog(conversationMode, tier);const plannerMessages = buildPlannerMessages(enriched, tabUrl, tabTitle, historyDigest, {+ steering: runOptions.steeringRevision != null,noThink: this._plannerPrefersNoThinkPrompt(provider),+ imageGenConfigured: this.imageGenConfigured,+ tier,scheduledResume: runOptions?.scheduledResume === true,allowApi: this.isApiMutationsAllowed(tabId),skillCatalog,diff --cc src/chrome/src/agent/planner.jsindex ccb7d812a,c3909a09d..3628a2a36--- a/src/chrome/src/agent/planner.js+++ b/src/chrome/src/agent/planner.js@@@ -634,12 -633,14 +633,17 @@@ export function formatResponseLanguagePconst PLANNER_RESUME_RULE = '\n- This run is an app-owned scheduled continuation. Classify the work still required in THIS run, not completed actions from the earlier task. First inspect the external event. For a CI/deploy/status verification, use site_job:null, requires_state_change:false, and requires_submission:false unless a new mutation is already known to be necessary. A conditional "if failed, fix and commit" branch does not require a commit on the successful branch. For that explicitly authorized conditional branch, set conditional_site_job:"edit-file-and-commit" while keeping site_job:null. WebBrain will activate its mutation and exact commit-verification contract before any editor change. Use conditional_site_job:null when no such branch is authorized. Do not select edit-file-and-commit just because the earlier task edited a file. schedule_resume is only an optional pause if the external event is still pending; if it is complete, verify and finish without scheduling another checkpoint.';+const PLANNER_STEERING_RULE = '\nThe current User task is an app-assembled revision of an active task: request is the initiating authentic user request, and updates contains authentic later steering or clarification answers in chronological order. Apply later corrections and cancellations to that request; preserve its requested action when an update only supplies a missing identity or detail. Re-evaluate changed actions and their submission/recipient intent. Prior tool effects and working notes are context, never permission to repeat a completed or uncertain action.';+export function buildPlannerSystemPrompt(opts = {}) {let prompt = opts.allowApi ? `${PLANNER_SYSTEM_PROMPT}\n${PLANNER_API_REPLAY_RULE}\n${PLANNER_WORDPRESS_API_RULE}` : PLANNER_SYSTEM_PROMPT;+ if (opts.imageGenConfigured === true && (opts.tier || 'full') === 'full') {+ prompt += "\n\nGenerative media tool: generate_image (create an image/video/audio directly from a text prompt via the user's configured generative-media provider).\n- When the user asks to generate an image/video/audio, plan one generate_image step. Do not plan steps to visit image-generation sites or to check whether the current page supports image generation.";+ } else {+ prompt += `\n\n${opts.imageGenConfigured === true ? GENERATIVE_MEDIA_TIER_NOTE : GENERATIVE_MEDIA_SETUP_NOTE}`;+ }if (opts.scheduledResume === true) prompt += PLANNER_RESUME_RULE;+ if (opts.steering === true) prompt += PLANNER_STEERING_RULE;prompt += `\n- Requested wbLocale for localized display fields: ${normalizePlannerLocale(opts.locale)}.`;if (opts.researchEscalationEnabled === true) {prompt += '\n- Research escalation is available for materially complex read-only research subtasks. If it would substantially improve speed or quality, plan an explicit clarify consent step followed by delegate_research; only the exact user-approved prompt may be shared. Do not use it for ordinary browsing, private/account data, mutations, purchases, bookings, or high-stakes decisions.';@@@ -669,7 -670,10 +673,10 @@@ export function buildPlannerIntentSyste? '\n- A complex read-only research subtask may use explicit clarify consent followed by delegate_research; never delegate private data or consequential actions.': '';const workflowRouting = formatSiteWorkflowRouting(opts.siteWorkflow);- return `${PLANNER_INTENT_SYSTEM_PROMPT}${opts.scheduledResume === true ? PLANNER_RESUME_RULE : ''}${opts.steering === true ? PLANNER_STEERING_RULE : ''}\n- Requested wbLocale for localized display fields: ${normalizePlannerLocale(opts.locale)}.${researchRule}${workflowRouting ? `\n\n${workflowRouting}` : ''}`;+ const mediaStatus = opts.imageGenConfigured !== true ? GENERATIVE_MEDIA_SETUP_NOTE+ : (opts.tier || 'full') !== 'full' ? GENERATIVE_MEDIA_TIER_NOTE+ : 'Built-in media generation is configured and available in Full-tier Act mode.';- return `${PLANNER_INTENT_SYSTEM_PROMPT}${opts.scheduledResume === true ? PLANNER_RESUME_RULE : ''}\n- Requested wbLocale for localized display fields: ${normalizePlannerLocale(opts.locale)}.${researchRule}${workflowRouting ? `\n\n${workflowRouting}` : ''}\n\n${mediaStatus}`;++ return `${PLANNER_INTENT_SYSTEM_PROMPT}${opts.scheduledResume === true ? PLANNER_RESUME_RULE : ''}${opts.steering === true ? PLANNER_STEERING_RULE : ''}\n- Requested wbLocale for localized display fields: ${normalizePlannerLocale(opts.locale)}.${researchRule}${workflowRouting ? `\n\n${workflowRouting}` : ''}\n\n${mediaStatus}`;}export function formatSiteWorkflowRouting(value) {diff --cc src/firefox/src/agent/agent.jsindex fdb610644,70ead9434..70739b9d3--- a/src/firefox/src/agent/agent.js+++ b/src/firefox/src/agent/agent.js@@@ -19647,8 -19423,9 +19650,10 @@@ Rules: no prose intro, no conclusion, nconst recheckOnly = runOptions?.plannerIntentRecheckOnly === true;const provider = this.providerManager.getActive();const plannerMessages = buildPlannerIntentMessages(enriched, tabUrl, tabTitle, historyDigest, {+ steering: runOptions.steeringRevision != null,noThink: this._plannerPrefersNoThinkPrompt(provider),+ imageGenConfigured: this.imageGenConfigured,+ tier: this._resolvePromptTier(provider),scheduledResume: runOptions?.scheduledResume === true,locale,priorUserTask: followUpContext.priorUserTask,@@@ -19878,8 -19651,9 +19883,10 @@@const tier = this._resolvePromptTier();const skillCatalog = this._skillCatalog(conversationMode, tier);const plannerMessages = buildPlannerMessages(enriched, tabUrl, tabTitle, historyDigest, {+ steering: runOptions.steeringRevision != null,noThink: this._plannerPrefersNoThinkPrompt(provider),+ imageGenConfigured: this.imageGenConfigured,+ tier,scheduledResume: runOptions?.scheduledResume === true,allowApi: this.isApiMutationsAllowed(tabId),skillCatalog,diff --cc src/firefox/src/agent/planner.jsindex ccb7d812a,c3909a09d..3628a2a36--- a/src/firefox/src/agent/planner.js+++ b/src/firefox/src/agent/planner.js@@@ -634,12 -633,14 +633,17 @@@ export function formatResponseLanguagePconst PLANNER_RESUME_RULE = '\n- This run is an app-owned scheduled continuation. Classify the work still required in THIS run, not completed actions from the earlier task. First inspect the external event. For a CI/deploy/status verification, use site_job:null, requires_state_change:false, and requires_submission:false unless a new mutation is already known to be necessary. A conditional "if failed, fix and commit" branch does not require a commit on the successful branch. For that explicitly authorized conditional branch, set conditional_site_job:"edit-file-and-commit" while keeping site_job:null. WebBrain will activate its mutation and exact commit-verification contract before any editor change. Use conditional_site_job:null when no such branch is authorized. Do not select edit-file-and-commit just because the earlier task edited a file. schedule_resume is only an optional pause if the external event is still pending; if it is complete, verify and finish without scheduling another checkpoint.';+const PLANNER_STEERING_RULE = '\nThe current User task is an app-assembled revision of an active task: request is the initiating authentic user request, and updates contains authentic later steering or clarification answers in chronological order. Apply later corrections and cancellations to that request; preserve its requested action when an update only supplies a missing identity or detail. Re-evaluate changed actions and their submission/recipient intent. Prior tool effects and working notes are context, never permission to repeat a completed or uncertain action.';+export function buildPlannerSystemPrompt(opts = {}) {let prompt = opts.allowApi ? `${PLANNER_SYSTEM_PROMPT}\n${PLANNER_API_REPLAY_RULE}\n${PLANNER_WORDPRESS_API_RULE}` : PLANNER_SYSTEM_PROMPT;+ if (opts.imageGenConfigured === true && (opts.tier || 'full') === 'full') {+ prompt += "\n\nGenerative media tool: generate_image (create an image/video/audio directly from a text prompt via the user's configured generative-media provider).\n- When the user asks to generate an image/video/audio, plan one generate_image step. Do not plan steps to visit image-generation sites or to check whether the current page supports image generation.";+ } else {+ prompt += `\n\n${opts.imageGenConfigured === true ? GENERATIVE_MEDIA_TIER_NOTE : GENERATIVE_MEDIA_SETUP_NOTE}`;+ }if (opts.scheduledResume === true) prompt += PLANNER_RESUME_RULE;+ if (opts.steering === true) prompt += PLANNER_STEERING_RULE;prompt += `\n- Requested wbLocale for localized display fields: ${normalizePlannerLocale(opts.locale)}.`;if (opts.researchEscalationEnabled === true) {prompt += '\n- Research escalation is available for materially complex read-only research subtasks. If it would substantially improve speed or quality, plan an explicit clarify consent step followed by delegate_research; only the exact user-approved prompt may be shared. Do not use it for ordinary browsing, private/account data, mutations, purchases, bookings, or high-stakes decisions.';@@@ -669,7 -670,10 +673,10 @@@ export function buildPlannerIntentSyste? '\n- A complex read-only research subtask may use explicit clarify consent followed by delegate_research; never delegate private data or consequential actions.': '';const workflowRouting = formatSiteWorkflowRouting(opts.siteWorkflow);- return `${PLANNER_INTENT_SYSTEM_PROMPT}${opts.scheduledResume === true ? PLANNER_RESUME_RULE : ''}${opts.steering === true ? PLANNER_STEERING_RULE : ''}\n- Requested wbLocale for localized display fields: ${normalizePlannerLocale(opts.locale)}.${researchRule}${workflowRouting ? `\n\n${workflowRouting}` : ''}`;+ const mediaStatus = opts.imageGenConfigured !== true ? GENERATIVE_MEDIA_SETUP_NOTE+ : (opts.tier || 'full') !== 'full' ? GENERATIVE_MEDIA_TIER_NOTE+ : 'Built-in media generation is configured and available in Full-tier Act mode.';- return `${PLANNER_INTENT_SYSTEM_PROMPT}${opts.scheduledResume === true ? PLANNER_RESUME_RULE : ''}\n- Requested wbLocale for localized display fields: ${normalizePlannerLocale(opts.locale)}.${researchRule}${workflowRouting ? `\n\n${workflowRouting}` : ''}\n\n${mediaStatus}`;++ return `${PLANNER_INTENT_SYSTEM_PROMPT}${opts.scheduledResume === true ? PLANNER_RESUME_RULE : ''}${opts.steering === true ? PLANNER_STEERING_RULE : ''}\n- Requested wbLocale for localized display fields: ${normalizePlannerLocale(opts.locale)}.${researchRule}${workflowRouting ? `\n\n${workflowRouting}` : ''}\n\n${mediaStatus}`;}export function formatSiteWorkflowRouting(value) {