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 origin/main into fix-536: integrate with frame-origin auth and conversation downloads
Emre Sokullud37c7f778296
diff --cc package.jsonindex ea5fb082a,11adf9f49..a04201aff--- a/package.json+++ b/package.json@@@ -70,8 -71,8 +71,8 @@@"benchmark:relevance": "node scripts/benchmark-offline-relevance.mjs --verbose","test:social-contract": "node --test test/social-publish-contract.mjs test/publication-quote-markup.mjs test/publication-prefetch.mjs","test:social-contract:dom": "node test/social-publish-contract-dom.mjs",- "test:runtime-lifecycle": "node test/bot-memory-dom.mjs && node --test test/agent-lifecycle.mjs test/runtime-startup.mjs test/run-ui-scheduled-lifecycle.mjs test/transport-deadlines.mjs test/cdp-worker-restart.mjs test/bot-memory.mjs test/bot-memory-registries.mjs test/bot-memory-cloud-controller.mjs test/cdp-clear-receipt.mjs test/cdp-field-submit-recovery.mjs test/conversation-persistence.mjs test/history-recovery-state.mjs test/history-recovery-scheduler.mjs test/history-recovery-atomic.mjs test/context-live-tool-group.mjs test/integration-races.mjs test/watch-completion-checkpoint.mjs test/runtime-model-identity.mjs test/provider-message-privacy.mjs test/runtime-task-authority.mjs test/planner-repair-authority.mjs test/runtime-progress-continuation.mjs test/chat-resume-chain.mjs test/chat-resume-completion.mjs test/native-chat-execution-ledger.mjs test/chat-send-dispatch-result.mjs test/chat-pre-enter-veto.mjs test/chat-reply-dedup-race.mjs test/memcode-lifecycle.mjs test/runtime-peer-review.mjs test/read-continuation-schema.mjs test/completion-submit-acknowledgement.mjs test/completion-live-status.mjs test/completion-iframe-submit.mjs test/form-validation-alert-readings.mjs test/control-effect-readings.mjs test/guard-reading-carry-over.mjs test/trusted-retry-readings.mjs test/completion-semantic-commit.mjs test/completion-diagnostics.mjs test/mastodon-publication.mjs test/calculator.mjs test/chat-recovery-protocol.mjs test/chat-pending-reconciliation.mjs test/semantic-page-retry.mjs test/pdf-detection.mjs test/runtime-lifecycle.mjs test/collection-read-progress.mjs test/network-lifecycle.mjs test/text-write-cancellation.mjs test/guard-advisory-writes.mjs test/trusted-field-preparation.mjs test/draftjs-text.mjs test/codemirror-text.mjs test/rich-text-frameworks.mjs test/cdp-managed-text-selection.mjs test/firefox-rich-text-readback.mjs test/contenteditable-beforeinput.mjs test/trusted-field-preparation-ownership.mjs test/typing-preparation-geometry.mjs test/chat-steering.mjs test/lifecycle-steering-restart.mjs test/resource-mutation-guards.mjs test/completion-steering-receipt-authority.mjs test/steering-revision-recovery.mjs test/pending-clarification-hydration.mjs test/run-ui-hidden-panel.mjs test/clarify-timeout-policy.mjs test/guard-ask-cards.mjs test/permission-steering-wakeup.mjs test/pure-calculation-reply.mjs test/pure-calculation-tools.mjs test/page-feedback.mjs test/page-feedback-progress.mjs test/page-feedback-unbindable-target.mjs test/guard-advisory-actions.mjs test/rich-text-preflight-page-change.mjs test/keyboard-receiver-frame.mjs test/ask-response-scope.mjs test/ask-completion-churn.mjs test/page-feedback-policy.mjs test/research-escalation-page-feedback.mjs test/page-feedback-transport-races.mjs test/page-feedback-recovery.mjs test/telegram-read-preparation-agent.mjs test/media-download-agent-handler.mjs test/code-scanning-url-recipient.mjs test/apocalypse-comm-parsing.mjs test/apocalypse-scalar-decoding.mjs test/bitgpu-chat-security.mjs test/social-media-url-upgrades.mjs test/downloaded-file-saved-bytes.mjs test/downloaded-file-local-probe.mjs test/formless-verification-recovery.mjs test/file-upload-accept.mjs test/file-upload-accept-agent.mjs test/workflow-route-generic-completion.mjs test/release-publication-completion.mjs test/workflow-implicit-metadata.mjs test/workflow-field-readings.mjs test/workflow-field-anchors.mjs test/user-turn-kind.mjs test/follow-up-task-context.mjs test/completion-current-execution-evidence.mjs test/monitor-intervention-contract.mjs test/monitor-owned-geometry.mjs test/monitor-viewport-remainder.mjs test/monitor-scroll-churn.mjs test/monitor-local-attribution.mjs test/monitor-lifecycle-leaks.mjs test/feedback-automatic-churn.mjs test/feedback-navigation-idle.mjs test/feedback-run-boundaries.mjs test/feedback-ask-viewing.mjs test/lifecycle-terminal-done.mjs test/incomplete-completion-recovery.mjs test/guard-advisory-completion.mjs test/guard-policy.mjs test/lean-mode.mjs test/prompt-unverified-pages.mjs test/prompt-missing-values.mjs test/lifecycle-planner-digest.mjs test/planner-clarify-loop.mjs test/lifecycle-vision-fallback.mjs test/guards-control-classification.mjs test/guards-unbound-deletion.mjs test/guards-steering-receipts.mjs && node test/ui-content-lifecycle.mjs && node --test test/native-telegram-chat.mjs test/native-telegram-recipient.mjs test/telegram-native-baseline.mjs test/telegram-native-latest.mjs test/native-chat-pre-enter-draft.mjs test/chat-draft-dispatch-ownership.mjs test/native-telegram-alias-preparation.mjs test/telegram-read-preparation-content.mjs test/queued-composer-ownership.mjs test/onboarding-provider-ready.mjs test/sidepanel-permission-gate-ui.mjs test/workflow-native-targets.mjs test/native-whatsapp-chat.mjs test/native-chat-context-identity.mjs test/native-whatsapp-contact.mjs test/whatsapp-chat-selection.mjs test/whatsapp-native-bootstrap.mjs test/whatsapp-drawer-identity.mjs test/whatsapp-read-latest.mjs test/whatsapp-read-preparation.mjs test/whatsapp-chat-completion.mjs test/whatsapp-chat-restart.mjs test/chat-goal-lifecycle.mjs test/chat-completion.mjs test/chat-generic-dispatch.mjs test/completion-live-status-browser.mjs test/native-confirmation-visibility.mjs test/read-continuation-browser.mjs test/iframe-preparation-focus.mjs test/contenteditable-literal.mjs test/native-chat-empty-editor.mjs test/native-chat-trusted-clear.mjs test/chat-steering-ui.mjs test/recipient-confirmation-ui.mjs test/assistant-message-visibility-ui.mjs test/slash-command-timeline-ui.mjs test/history-recovery.mjs test/history-recovery-ui.mjs test/page-monitor-ui.mjs test/x-compose-trusted-typing.mjs test/page-monitor-dialog.mjs test/page-monitor-dialog-native.mjs test/page-monitor-inline-post.mjs test/bluesky-composer-context.mjs test/page-monitor-anchored.mjs test/page-monitor-upload-owner.mjs test/page-monitor-upload-release.mjs test/page-monitor-native-controls.mjs test/page-monitor-native-preparation.mjs test/native-preparation-cold.mjs test/page-monitor-navigation.mjs test/page-monitor-main-owner.mjs test/page-monitor-collateral-controls.mjs test/accessibility-tree-scoped-budget.mjs test/ax-reference-origin.mjs test/page-monitor-decorative-hit.mjs test/social-ui-navigation.mjs test/native-resource-deletion-binding.mjs test/native-mastodon-confirmation.mjs test/dropdown-menu-inventory.mjs test/page-monitor-passive-progress.mjs test/page-monitor-feed-items.mjs test/media-download-binding.mjs test/media-download-capture-integration.mjs test/social-media-downloader-reinjection.mjs test/upload-file-local-state-guidance.mjs test/upload-file-source-approval.mjs && node test/message-recipient-upload.mjs && node test/message-recipient-clarify-binding.mjs && node --test test/message-recipient-whatsapp.mjs test/message-control-readings.mjs && node test/quality/integration-mv3.mjs --full-form && node test/quality/literal-calculate-midrun-mv3.mjs && node test/quality/ask-completion-churn-mv3.mjs && node test/quality/ask-person-activity-mv3.mjs && node test/quality/telegram-cold-preparation-mv3.mjs && node test/quality/native-chat-mv3.mjs && node test/quality/native-chat-presubmit-mv3.mjs && node test/quality/cloud-bot-memory-mv3.mjs && node test/quality/whatsapp-contact-matrix.mjs && node test/quality/pdf-detection-mv3.mjs && node test/quality/download-upload-mv3.mjs && node test/quality/upload-release-binding-mv3.mjs && node test/quality/release-review-world-mv3.mjs && node test/quality/downloaded-file-saved-bytes-mv3.mjs && node test/quality/file-upload-accept-mv3.mjs && node test/quality/bulk-resume-mv3.mjs && node test/quality/literal-frame-mv3.mjs && node test/quality/mastodon-publication-mv3.mjs && node test/quality/mastodon-reply-route-mv3.mjs && node test/quality/mastodon-deletion-mv3.mjs && node test/quality/mastodon-delete-confirmation-mv3.mjs && node test/quality/mastodon-delete-confirmation-mv3.mjs --menu-read && node test/quality/mastodon-delete-confirmation-mv3.mjs --vague && node test/quality/mastodon-delete-after-correction-mv3.mjs && node test/quality/unbound-deletion-mv3.mjs && node test/quality/recipient-clarify-mv3.mjs && node test/quality/open-chat-recipients-mv3.mjs && node test/quality/correction-cross-site-mv3.mjs && node test/quality/anchored-action-mv3.mjs && node test/quality/inline-social-composer-mv3.mjs && node test/quality/x-compose-dialog-mv3.mjs && node test/quality/bluesky-composer-mv3.mjs && node test/quality/dropdown-menu-matrix.mjs && node test/quality/mastodon-deletion-navigation-mv3.mjs && node test/quality/semantic-navigation-matrix.mjs && node test/quality/workflow-replay-mv3.mjs && node test/quality/generative-media-mv3.mjs && node test/quality/cdp-worker-restart-mv3.mjs && node test/quality/steering-worker-restart-mv3.mjs",- "test:page-feedback": "node --test test/trusted-field-preparation.mjs test/guard-advisory-writes.mjs test/draftjs-text.mjs test/codemirror-text.mjs test/rich-text-frameworks.mjs test/cdp-managed-text-selection.mjs test/firefox-rich-text-readback.mjs test/contenteditable-beforeinput.mjs test/trusted-field-preparation-ownership.mjs test/typing-preparation-geometry.mjs test/pure-calculation-reply.mjs test/pure-calculation-tools.mjs test/page-feedback.mjs test/page-feedback-progress.mjs test/page-feedback-unbindable-target.mjs test/guard-advisory-actions.mjs test/rich-text-preflight-page-change.mjs test/keyboard-receiver-frame.mjs test/ask-response-scope.mjs test/ask-completion-churn.mjs test/page-feedback-policy.mjs test/research-escalation-page-feedback.mjs test/page-feedback-transport-races.mjs test/page-feedback-recovery.mjs test/telegram-read-preparation-agent.mjs test/media-download-agent-handler.mjs test/page-monitor-ui.mjs test/x-compose-trusted-typing.mjs test/page-monitor-dialog.mjs test/page-monitor-dialog-native.mjs test/page-monitor-inline-post.mjs test/bluesky-composer-context.mjs test/page-monitor-anchored.mjs test/page-monitor-upload-owner.mjs test/page-monitor-upload-release.mjs test/page-monitor-native-controls.mjs test/page-monitor-passive-progress.mjs test/page-monitor-feed-items.mjs test/media-download-binding.mjs test/media-download-capture-integration.mjs test/monitor-intervention-contract.mjs test/monitor-owned-geometry.mjs test/monitor-viewport-remainder.mjs test/monitor-scroll-churn.mjs test/monitor-local-attribution.mjs test/monitor-lifecycle-leaks.mjs test/feedback-automatic-churn.mjs test/feedback-navigation-idle.mjs test/feedback-run-boundaries.mjs test/feedback-ask-viewing.mjs test/delivery-click-ax-response-loss.mjs test/delivery-stop-compound.mjs test/delivery-cdp-input.mjs test/delivery-click-locks.mjs test/delivery-native-button-geometry.mjs test/delivery-hover-transition.mjs test/delivery-native-button-route.mjs test/delivery-dispatch-boundary.mjs && node test/message-recipient-upload.mjs && node test/message-recipient-clarify-binding.mjs && node --test test/message-recipient-whatsapp.mjs test/page-feedback-held-time.mjs test/page-monitor-held-observation.mjs",- "test:runtime-lifecycle": "node test/bot-memory-dom.mjs && node --test test/agent-lifecycle.mjs test/runtime-startup.mjs test/run-ui-scheduled-lifecycle.mjs test/transport-deadlines.mjs test/cdp-worker-restart.mjs test/bot-memory.mjs test/bot-memory-registries.mjs test/bot-memory-cloud-controller.mjs test/cdp-clear-receipt.mjs test/cdp-field-submit-recovery.mjs test/conversation-persistence.mjs test/history-recovery-state.mjs test/history-recovery-scheduler.mjs test/history-recovery-atomic.mjs test/context-live-tool-group.mjs test/integration-races.mjs test/watch-completion-checkpoint.mjs test/runtime-model-identity.mjs test/provider-message-privacy.mjs test/runtime-task-authority.mjs test/planner-repair-authority.mjs test/runtime-progress-continuation.mjs test/chat-resume-chain.mjs test/chat-resume-completion.mjs test/native-chat-execution-ledger.mjs test/chat-send-dispatch-result.mjs test/chat-pre-enter-veto.mjs test/chat-reply-dedup-race.mjs test/memcode-lifecycle.mjs test/runtime-peer-review.mjs test/read-continuation-schema.mjs test/completion-submit-acknowledgement.mjs test/completion-live-status.mjs test/completion-iframe-submit.mjs test/form-validation-alert-readings.mjs test/control-effect-readings.mjs test/guard-reading-carry-over.mjs test/trusted-retry-readings.mjs test/completion-semantic-commit.mjs test/completion-diagnostics.mjs test/mastodon-publication.mjs test/calculator.mjs test/chat-recovery-protocol.mjs test/chat-pending-reconciliation.mjs test/semantic-page-retry.mjs test/pdf-detection.mjs test/runtime-lifecycle.mjs test/collection-read-progress.mjs test/network-lifecycle.mjs test/text-write-cancellation.mjs test/guard-advisory-writes.mjs test/trusted-field-preparation.mjs test/draftjs-text.mjs test/codemirror-text.mjs test/rich-text-frameworks.mjs test/cdp-managed-text-selection.mjs test/firefox-rich-text-readback.mjs test/contenteditable-beforeinput.mjs test/trusted-field-preparation-ownership.mjs test/typing-preparation-geometry.mjs test/chat-steering.mjs test/lifecycle-steering-restart.mjs test/resource-mutation-guards.mjs test/completion-steering-receipt-authority.mjs test/steering-revision-recovery.mjs test/pending-clarification-hydration.mjs test/run-ui-hidden-panel.mjs test/clarify-timeout-policy.mjs test/guard-ask-cards.mjs test/permission-steering-wakeup.mjs test/pure-calculation-reply.mjs test/pure-calculation-tools.mjs test/page-feedback.mjs test/page-feedback-progress.mjs test/page-feedback-unbindable-target.mjs test/guard-advisory-actions.mjs test/rich-text-preflight-page-change.mjs test/keyboard-receiver-frame.mjs test/input-receiving-frame.mjs test/ask-response-scope.mjs test/ask-completion-churn.mjs test/page-feedback-policy.mjs test/research-escalation-page-feedback.mjs test/page-feedback-transport-races.mjs test/page-feedback-recovery.mjs test/telegram-read-preparation-agent.mjs test/media-download-agent-handler.mjs test/code-scanning-url-recipient.mjs test/apocalypse-comm-parsing.mjs test/apocalypse-scalar-decoding.mjs test/bitgpu-chat-security.mjs test/social-media-url-upgrades.mjs test/downloaded-file-saved-bytes.mjs test/download-conversation-scope.mjs test/downloaded-file-local-probe.mjs test/formless-verification-recovery.mjs test/file-upload-accept.mjs test/file-upload-accept-agent.mjs test/workflow-route-generic-completion.mjs test/release-publication-completion.mjs test/workflow-implicit-metadata.mjs test/workflow-field-readings.mjs test/workflow-field-anchors.mjs test/user-turn-kind.mjs test/follow-up-task-context.mjs test/completion-current-execution-evidence.mjs test/monitor-intervention-contract.mjs test/monitor-owned-geometry.mjs test/monitor-viewport-remainder.mjs test/monitor-scroll-churn.mjs test/monitor-local-attribution.mjs test/monitor-lifecycle-leaks.mjs test/feedback-automatic-churn.mjs test/feedback-navigation-idle.mjs test/feedback-run-boundaries.mjs test/feedback-ask-viewing.mjs test/lifecycle-terminal-done.mjs test/incomplete-completion-recovery.mjs test/guard-advisory-completion.mjs test/guard-policy.mjs test/lean-mode.mjs test/prompt-unverified-pages.mjs test/prompt-missing-values.mjs test/lifecycle-planner-digest.mjs test/planner-clarify-loop.mjs test/lifecycle-vision-fallback.mjs test/guards-control-classification.mjs test/guards-unbound-deletion.mjs test/guards-steering-receipts.mjs && node test/ui-content-lifecycle.mjs && node --test test/native-telegram-chat.mjs test/native-telegram-recipient.mjs test/telegram-native-baseline.mjs test/telegram-native-latest.mjs test/native-chat-pre-enter-draft.mjs test/chat-draft-dispatch-ownership.mjs test/native-telegram-alias-preparation.mjs test/telegram-read-preparation-content.mjs test/queued-composer-ownership.mjs test/onboarding-provider-ready.mjs test/sidepanel-permission-gate-ui.mjs test/workflow-native-targets.mjs test/native-whatsapp-chat.mjs test/native-chat-context-identity.mjs test/native-whatsapp-contact.mjs test/whatsapp-chat-selection.mjs test/whatsapp-native-bootstrap.mjs test/whatsapp-drawer-identity.mjs test/whatsapp-read-latest.mjs test/whatsapp-read-preparation.mjs test/whatsapp-chat-completion.mjs test/whatsapp-chat-restart.mjs test/chat-goal-lifecycle.mjs test/chat-completion.mjs test/chat-generic-dispatch.mjs test/completion-live-status-browser.mjs test/native-confirmation-visibility.mjs test/read-continuation-browser.mjs test/iframe-preparation-focus.mjs test/contenteditable-literal.mjs test/native-chat-empty-editor.mjs test/native-chat-trusted-clear.mjs test/chat-steering-ui.mjs test/recipient-confirmation-ui.mjs test/assistant-message-visibility-ui.mjs test/slash-command-timeline-ui.mjs test/history-recovery.mjs test/history-recovery-ui.mjs test/page-monitor-ui.mjs test/x-compose-trusted-typing.mjs test/page-monitor-dialog.mjs test/page-monitor-dialog-native.mjs test/page-monitor-inline-post.mjs test/bluesky-composer-context.mjs test/page-monitor-anchored.mjs test/page-monitor-upload-owner.mjs test/page-monitor-upload-release.mjs test/page-monitor-native-controls.mjs test/page-monitor-native-preparation.mjs test/native-preparation-cold.mjs test/page-monitor-navigation.mjs test/page-monitor-main-owner.mjs test/page-monitor-collateral-controls.mjs test/accessibility-tree-scoped-budget.mjs test/ax-reference-origin.mjs test/page-monitor-decorative-hit.mjs test/social-ui-navigation.mjs test/native-resource-deletion-binding.mjs test/native-mastodon-confirmation.mjs test/dropdown-menu-inventory.mjs test/page-monitor-passive-progress.mjs test/page-monitor-feed-items.mjs test/media-download-binding.mjs test/media-download-capture-integration.mjs test/social-media-downloader-reinjection.mjs test/upload-file-local-state-guidance.mjs && node test/message-recipient-upload.mjs && node test/message-recipient-clarify-binding.mjs && node --test test/message-recipient-whatsapp.mjs test/message-control-readings.mjs && node test/quality/integration-mv3.mjs --full-form && node test/quality/literal-calculate-midrun-mv3.mjs && node test/quality/ask-completion-churn-mv3.mjs && node test/quality/ask-person-activity-mv3.mjs && node test/quality/telegram-cold-preparation-mv3.mjs && node test/quality/native-chat-mv3.mjs && node test/quality/native-chat-presubmit-mv3.mjs && node test/quality/cloud-bot-memory-mv3.mjs && node test/quality/whatsapp-contact-matrix.mjs && node test/quality/pdf-detection-mv3.mjs && node test/quality/download-upload-mv3.mjs && node test/quality/upload-release-binding-mv3.mjs && node test/quality/release-review-world-mv3.mjs && node test/quality/downloaded-file-saved-bytes-mv3.mjs && node test/quality/file-upload-accept-mv3.mjs && node test/quality/bulk-resume-mv3.mjs && node test/quality/literal-frame-mv3.mjs && node test/quality/mastodon-publication-mv3.mjs && node test/quality/mastodon-reply-route-mv3.mjs && node test/quality/mastodon-deletion-mv3.mjs && node test/quality/mastodon-delete-confirmation-mv3.mjs && node test/quality/mastodon-delete-confirmation-mv3.mjs --menu-read && node test/quality/mastodon-delete-confirmation-mv3.mjs --vague && node test/quality/mastodon-delete-after-correction-mv3.mjs && node test/quality/unbound-deletion-mv3.mjs && node test/quality/recipient-clarify-mv3.mjs && node test/quality/open-chat-recipients-mv3.mjs && node test/quality/correction-cross-site-mv3.mjs && node test/quality/anchored-action-mv3.mjs && node test/quality/inline-social-composer-mv3.mjs && node test/quality/x-compose-dialog-mv3.mjs && node test/quality/bluesky-composer-mv3.mjs && node test/quality/dropdown-menu-matrix.mjs && node test/quality/mastodon-deletion-navigation-mv3.mjs && node test/quality/semantic-navigation-matrix.mjs && node test/quality/workflow-replay-mv3.mjs && node test/quality/generative-media-mv3.mjs && node test/quality/cdp-worker-restart-mv3.mjs && node test/quality/steering-worker-restart-mv3.mjs",++ "test:runtime-lifecycle": "node test/bot-memory-dom.mjs && node --test test/agent-lifecycle.mjs test/runtime-startup.mjs test/run-ui-scheduled-lifecycle.mjs test/transport-deadlines.mjs test/cdp-worker-restart.mjs test/bot-memory.mjs test/bot-memory-registries.mjs test/bot-memory-cloud-controller.mjs test/cdp-clear-receipt.mjs test/cdp-field-submit-recovery.mjs test/conversation-persistence.mjs test/history-recovery-state.mjs test/history-recovery-scheduler.mjs test/history-recovery-atomic.mjs test/context-live-tool-group.mjs test/integration-races.mjs test/watch-completion-checkpoint.mjs test/runtime-model-identity.mjs test/provider-message-privacy.mjs test/runtime-task-authority.mjs test/planner-repair-authority.mjs test/runtime-progress-continuation.mjs test/chat-resume-chain.mjs test/chat-resume-completion.mjs test/native-chat-execution-ledger.mjs test/chat-send-dispatch-result.mjs test/chat-pre-enter-veto.mjs test/chat-reply-dedup-race.mjs test/memcode-lifecycle.mjs test/runtime-peer-review.mjs test/read-continuation-schema.mjs test/completion-submit-acknowledgement.mjs test/completion-live-status.mjs test/completion-iframe-submit.mjs test/form-validation-alert-readings.mjs test/control-effect-readings.mjs test/guard-reading-carry-over.mjs test/trusted-retry-readings.mjs test/completion-semantic-commit.mjs test/completion-diagnostics.mjs test/mastodon-publication.mjs test/calculator.mjs test/chat-recovery-protocol.mjs test/chat-pending-reconciliation.mjs test/semantic-page-retry.mjs test/pdf-detection.mjs test/runtime-lifecycle.mjs test/collection-read-progress.mjs test/network-lifecycle.mjs test/text-write-cancellation.mjs test/guard-advisory-writes.mjs test/trusted-field-preparation.mjs test/draftjs-text.mjs test/codemirror-text.mjs test/rich-text-frameworks.mjs test/cdp-managed-text-selection.mjs test/firefox-rich-text-readback.mjs test/contenteditable-beforeinput.mjs test/trusted-field-preparation-ownership.mjs test/typing-preparation-geometry.mjs test/chat-steering.mjs test/lifecycle-steering-restart.mjs test/resource-mutation-guards.mjs test/completion-steering-receipt-authority.mjs test/steering-revision-recovery.mjs test/pending-clarification-hydration.mjs test/run-ui-hidden-panel.mjs test/clarify-timeout-policy.mjs test/guard-ask-cards.mjs test/permission-steering-wakeup.mjs test/pure-calculation-reply.mjs test/pure-calculation-tools.mjs test/page-feedback.mjs test/page-feedback-progress.mjs test/page-feedback-unbindable-target.mjs test/guard-advisory-actions.mjs test/rich-text-preflight-page-change.mjs test/keyboard-receiver-frame.mjs test/input-receiving-frame.mjs test/ask-response-scope.mjs test/ask-completion-churn.mjs test/page-feedback-policy.mjs test/research-escalation-page-feedback.mjs test/page-feedback-transport-races.mjs test/page-feedback-recovery.mjs test/telegram-read-preparation-agent.mjs test/media-download-agent-handler.mjs test/code-scanning-url-recipient.mjs test/apocalypse-comm-parsing.mjs test/apocalypse-scalar-decoding.mjs test/bitgpu-chat-security.mjs test/social-media-url-upgrades.mjs test/downloaded-file-saved-bytes.mjs test/download-conversation-scope.mjs test/downloaded-file-local-probe.mjs test/formless-verification-recovery.mjs test/file-upload-accept.mjs test/file-upload-accept-agent.mjs test/workflow-route-generic-completion.mjs test/release-publication-completion.mjs test/workflow-implicit-metadata.mjs test/workflow-field-readings.mjs test/workflow-field-anchors.mjs test/user-turn-kind.mjs test/follow-up-task-context.mjs test/completion-current-execution-evidence.mjs test/monitor-intervention-contract.mjs test/monitor-owned-geometry.mjs test/monitor-viewport-remainder.mjs test/monitor-scroll-churn.mjs test/monitor-local-attribution.mjs test/monitor-lifecycle-leaks.mjs test/feedback-automatic-churn.mjs test/feedback-navigation-idle.mjs test/feedback-run-boundaries.mjs test/feedback-ask-viewing.mjs test/lifecycle-terminal-done.mjs test/incomplete-completion-recovery.mjs test/guard-advisory-completion.mjs test/guard-policy.mjs test/lean-mode.mjs test/prompt-unverified-pages.mjs test/prompt-missing-values.mjs test/lifecycle-planner-digest.mjs test/planner-clarify-loop.mjs test/lifecycle-vision-fallback.mjs test/guards-control-classification.mjs test/guards-unbound-deletion.mjs test/guards-steering-receipts.mjs && node test/ui-content-lifecycle.mjs && node --test test/native-telegram-chat.mjs test/native-telegram-recipient.mjs test/telegram-native-baseline.mjs test/telegram-native-latest.mjs test/native-chat-pre-enter-draft.mjs test/chat-draft-dispatch-ownership.mjs test/native-telegram-alias-preparation.mjs test/telegram-read-preparation-content.mjs test/queued-composer-ownership.mjs test/onboarding-provider-ready.mjs test/sidepanel-permission-gate-ui.mjs test/workflow-native-targets.mjs test/native-whatsapp-chat.mjs test/native-chat-context-identity.mjs test/native-whatsapp-contact.mjs test/whatsapp-chat-selection.mjs test/whatsapp-native-bootstrap.mjs test/whatsapp-drawer-identity.mjs test/whatsapp-read-latest.mjs test/whatsapp-read-preparation.mjs test/whatsapp-chat-completion.mjs test/whatsapp-chat-restart.mjs test/chat-goal-lifecycle.mjs test/chat-completion.mjs test/chat-generic-dispatch.mjs test/completion-live-status-browser.mjs test/native-confirmation-visibility.mjs test/read-continuation-browser.mjs test/iframe-preparation-focus.mjs test/contenteditable-literal.mjs test/native-chat-empty-editor.mjs test/native-chat-trusted-clear.mjs test/chat-steering-ui.mjs test/recipient-confirmation-ui.mjs test/assistant-message-visibility-ui.mjs test/slash-command-timeline-ui.mjs test/history-recovery.mjs test/history-recovery-ui.mjs test/page-monitor-ui.mjs test/x-compose-trusted-typing.mjs test/page-monitor-dialog.mjs test/page-monitor-dialog-native.mjs test/page-monitor-inline-post.mjs test/bluesky-composer-context.mjs test/page-monitor-anchored.mjs test/page-monitor-upload-owner.mjs test/page-monitor-upload-release.mjs test/page-monitor-native-controls.mjs test/page-monitor-native-preparation.mjs test/native-preparation-cold.mjs test/page-monitor-navigation.mjs test/page-monitor-main-owner.mjs test/page-monitor-collateral-controls.mjs test/accessibility-tree-scoped-budget.mjs test/ax-reference-origin.mjs test/page-monitor-decorative-hit.mjs test/social-ui-navigation.mjs test/native-resource-deletion-binding.mjs test/native-mastodon-confirmation.mjs test/dropdown-menu-inventory.mjs test/page-monitor-passive-progress.mjs test/page-monitor-feed-items.mjs test/media-download-binding.mjs test/media-download-capture-integration.mjs test/social-media-downloader-reinjection.mjs test/upload-file-local-state-guidance.mjs test/upload-file-source-approval.mjs && node test/message-recipient-upload.mjs && node test/message-recipient-clarify-binding.mjs && node --test test/message-recipient-whatsapp.mjs test/message-control-readings.mjs && node test/quality/integration-mv3.mjs --full-form && node test/quality/literal-calculate-midrun-mv3.mjs && node test/quality/ask-completion-churn-mv3.mjs && node test/quality/ask-person-activity-mv3.mjs && node test/quality/telegram-cold-preparation-mv3.mjs && node test/quality/native-chat-mv3.mjs && node test/quality/native-chat-presubmit-mv3.mjs && node test/quality/cloud-bot-memory-mv3.mjs && node test/quality/whatsapp-contact-matrix.mjs && node test/quality/pdf-detection-mv3.mjs && node test/quality/download-upload-mv3.mjs && node test/quality/upload-release-binding-mv3.mjs && node test/quality/release-review-world-mv3.mjs && node test/quality/downloaded-file-saved-bytes-mv3.mjs && node test/quality/file-upload-accept-mv3.mjs && node test/quality/bulk-resume-mv3.mjs && node test/quality/literal-frame-mv3.mjs && node test/quality/mastodon-publication-mv3.mjs && node test/quality/mastodon-reply-route-mv3.mjs && node test/quality/mastodon-deletion-mv3.mjs && node test/quality/mastodon-delete-confirmation-mv3.mjs && node test/quality/mastodon-delete-confirmation-mv3.mjs --menu-read && node test/quality/mastodon-delete-confirmation-mv3.mjs --vague && node test/quality/mastodon-delete-after-correction-mv3.mjs && node test/quality/unbound-deletion-mv3.mjs && node test/quality/recipient-clarify-mv3.mjs && node test/quality/open-chat-recipients-mv3.mjs && node test/quality/correction-cross-site-mv3.mjs && node test/quality/anchored-action-mv3.mjs && node test/quality/inline-social-composer-mv3.mjs && node test/quality/x-compose-dialog-mv3.mjs && node test/quality/bluesky-composer-mv3.mjs && node test/quality/dropdown-menu-matrix.mjs && node test/quality/mastodon-deletion-navigation-mv3.mjs && node test/quality/semantic-navigation-matrix.mjs && node test/quality/workflow-replay-mv3.mjs && node test/quality/generative-media-mv3.mjs && node test/quality/cdp-worker-restart-mv3.mjs && node test/quality/steering-worker-restart-mv3.mjs",+ "test:page-feedback": "node --test test/trusted-field-preparation.mjs test/guard-advisory-writes.mjs test/draftjs-text.mjs test/codemirror-text.mjs test/rich-text-frameworks.mjs test/cdp-managed-text-selection.mjs test/firefox-rich-text-readback.mjs test/contenteditable-beforeinput.mjs test/trusted-field-preparation-ownership.mjs test/typing-preparation-geometry.mjs test/pure-calculation-reply.mjs test/pure-calculation-tools.mjs test/page-feedback.mjs test/page-feedback-progress.mjs test/page-feedback-unbindable-target.mjs test/guard-advisory-actions.mjs test/rich-text-preflight-page-change.mjs test/keyboard-receiver-frame.mjs test/input-receiving-frame.mjs test/ask-response-scope.mjs test/ask-completion-churn.mjs test/page-feedback-policy.mjs test/research-escalation-page-feedback.mjs test/page-feedback-transport-races.mjs test/page-feedback-recovery.mjs test/telegram-read-preparation-agent.mjs test/media-download-agent-handler.mjs test/page-monitor-ui.mjs test/x-compose-trusted-typing.mjs test/page-monitor-dialog.mjs test/page-monitor-dialog-native.mjs test/page-monitor-inline-post.mjs test/bluesky-composer-context.mjs test/page-monitor-anchored.mjs test/page-monitor-upload-owner.mjs test/page-monitor-upload-release.mjs test/page-monitor-native-controls.mjs test/page-monitor-passive-progress.mjs test/page-monitor-feed-items.mjs test/media-download-binding.mjs test/media-download-capture-integration.mjs test/monitor-intervention-contract.mjs test/monitor-owned-geometry.mjs test/monitor-viewport-remainder.mjs test/monitor-scroll-churn.mjs test/monitor-local-attribution.mjs test/monitor-lifecycle-leaks.mjs test/feedback-automatic-churn.mjs test/feedback-navigation-idle.mjs test/feedback-run-boundaries.mjs test/feedback-ask-viewing.mjs test/delivery-click-ax-response-loss.mjs test/delivery-stop-compound.mjs test/delivery-cdp-input.mjs test/delivery-click-locks.mjs test/delivery-native-button-geometry.mjs test/delivery-hover-transition.mjs test/delivery-native-button-route.mjs test/delivery-dispatch-boundary.mjs && node test/message-recipient-upload.mjs && node test/message-recipient-clarify-binding.mjs && node --test test/message-recipient-whatsapp.mjs test/page-feedback-held-time.mjs test/page-monitor-held-observation.mjs","test:history-recovery": "node --test test/history-recovery.mjs test/history-recovery-ui.mjs test/history-recovery-state.mjs test/history-recovery-scheduler.mjs test/history-recovery-atomic.mjs test/conversation-persistence.mjs","test:chat-steering": "node --test test/chat-steering.mjs test/chat-steering-ui.mjs test/recipient-confirmation-ui.mjs test/lifecycle-steering-latency.mjs test/lifecycle-steering-restart.mjs test/lifecycle-run-ui.mjs test/lifecycle-menu-prompts-held.mjs","test:rich-text-dom": "node test/ui-content-lifecycle.mjs --dom",@@@ -105,10 -106,10 +106,15 @@@"test:chat-draft-recovery": "node --test test/native-chat-pre-enter-draft.mjs test/chat-draft-dispatch-ownership.mjs && node test/quality/native-chat-presubmit-mv3.mjs","test:upload-owner": "node --test test/page-monitor-upload-owner.mjs test/page-monitor-upload-release.mjs","test:shard:quick": "npm run test:cms && npm run test:markdown && npm run test:generative-media && npm run test:systemone && npm run test:systemone:fast && node --test test/guard-policy.mjs test/browser-dialogs.mjs test/capsolver-cloud-broker.mjs test/captcha-providers.mjs test/captcha-weighted-fallback.mjs test/captcha-hcaptcha-providers.mjs test/captcha-native-providers.mjs test/captcha-runtime-policy.mjs test/captcha-callback-bridge.mjs test/captcha-bridge-registration.mjs test/cookie-banner-host.mjs test/captcha-aws-recovery.mjs test/captcha-documented-contracts.mjs test/huggingface-signup-recovery.mjs test/trace-full-export.mjs test/slash-command-tab-ownership.mjs test/feedback-traces.mjs && npm run test:firefox-bidi && npm run test:billing-notice && npm run test:compass-quota && npm run test:provider-limits && npm run test:provider-catalog && npm run test:provider-instances:ui && npm run test:settings-pages:ui && npm run test:openrouter-capabilities && npm run test:anthropic && npm run test:browser-batch && npm run test:accessibility-tree-benchmark && npm run test:toolbar-guard && npm run test:cloud-bridge-approval && npm run test:discord && npm run test:pdf-read && npm run test:pdf-selection && npm run test:social-contract && npm run test:safesocial && npm run test:build-unpacked && npm run test:attachment-drop && npm run test:workflow-editor && node --test test/profile-sync-stats.mjs && node --test test/memcode-recall.mjs",++<<<<<<< HEAD+ "test:shard:runtime-unit": "node --test test/skill-download-wait.mjs && node --test test/agent-lifecycle.mjs test/runtime-startup.mjs test/run-ui-scheduled-lifecycle.mjs test/transport-deadlines.mjs test/cdp-worker-restart.mjs test/bot-memory.mjs test/bot-memory-click-guard.mjs test/bot-memory-registries.mjs test/bot-memory-cloud-controller.mjs test/cdp-clear-receipt.mjs test/cdp-field-submit-recovery.mjs test/conversation-persistence.mjs test/context-live-tool-group.mjs test/integration-races.mjs test/watch-completion-checkpoint.mjs test/runtime-model-identity.mjs test/provider-message-privacy.mjs test/runtime-task-authority.mjs test/planner-repair-authority.mjs test/runtime-progress-continuation.mjs test/chat-resume-chain.mjs test/chat-resume-completion.mjs test/native-chat-execution-ledger.mjs test/chat-send-dispatch-result.mjs test/chat-pre-enter-veto.mjs test/chat-reply-dedup-race.mjs test/memcode-lifecycle.mjs test/runtime-peer-review.mjs test/read-continuation-schema.mjs test/completion-submit-acknowledgement.mjs test/completion-live-status.mjs test/completion-iframe-submit.mjs test/form-validation-alert-readings.mjs test/control-effect-readings.mjs test/guard-reading-carry-over.mjs test/trusted-retry-readings.mjs test/completion-semantic-commit.mjs test/completion-diagnostics.mjs test/mastodon-publication.mjs test/calculator.mjs test/chat-recovery-protocol.mjs test/chat-pending-reconciliation.mjs test/semantic-page-retry.mjs test/pdf-detection.mjs test/runtime-lifecycle.mjs test/collection-read-progress.mjs test/network-lifecycle.mjs test/text-write-cancellation.mjs test/guard-advisory-writes.mjs test/trusted-field-preparation.mjs test/draftjs-text.mjs test/codemirror-text.mjs test/rich-text-frameworks.mjs test/cdp-managed-text-selection.mjs test/firefox-rich-text-readback.mjs test/contenteditable-beforeinput.mjs test/trusted-field-preparation-ownership.mjs test/typing-preparation-geometry.mjs test/chat-steering.mjs test/resource-mutation-guards.mjs test/completion-steering-receipt-authority.mjs test/steering-revision-recovery.mjs test/pending-clarification-hydration.mjs test/run-ui-hidden-panel.mjs test/clarify-timeout-policy.mjs test/guard-ask-cards.mjs test/permission-steering-wakeup.mjs test/pure-calculation-reply.mjs test/pure-calculation-tools.mjs test/page-feedback.mjs test/page-feedback-progress.mjs test/page-feedback-unbindable-target.mjs test/guard-advisory-actions.mjs test/rich-text-preflight-page-change.mjs test/keyboard-receiver-frame.mjs test/ask-response-scope.mjs test/auto-mode.mjs test/plan-when-needed.mjs test/model-picker-icon.mjs test/ask-completion-churn.mjs test/page-feedback-policy.mjs test/research-escalation-page-feedback.mjs test/page-feedback-transport-races.mjs test/page-feedback-recovery.mjs test/telegram-read-preparation-agent.mjs test/media-download-agent-handler.mjs test/code-scanning-url-recipient.mjs test/apocalypse-comm-parsing.mjs test/apocalypse-scalar-decoding.mjs test/bitgpu-chat-security.mjs test/social-media-url-upgrades.mjs test/downloaded-file-saved-bytes.mjs test/downloaded-file-local-probe.mjs test/formless-verification-recovery.mjs test/file-upload-accept.mjs test/file-upload-accept-agent.mjs test/workflow-route-generic-completion.mjs test/release-publication-completion.mjs test/workflow-implicit-metadata.mjs test/workflow-field-readings.mjs test/workflow-field-anchors.mjs test/user-turn-kind.mjs test/follow-up-task-context.mjs test/completion-current-execution-evidence.mjs test/video-upload-attachment.mjs test/feedback-automatic-churn.mjs test/feedback-navigation-idle.mjs test/feedback-run-boundaries.mjs test/feedback-ask-viewing.mjs test/lifecycle-terminal-done.mjs test/incomplete-completion-recovery.mjs test/guard-advisory-completion.mjs test/lean-mode.mjs test/prompt-unverified-pages.mjs test/prompt-missing-values.mjs test/lifecycle-planner-digest.mjs test/planner-clarify-loop.mjs test/lifecycle-steering-latency.mjs test/lifecycle-steering-restart.mjs test/lifecycle-vision-fallback.mjs test/delivery-click-locks.mjs test/guards-steering-receipts.mjs test/terminal-user-messages.mjs test/improver-providers.mjs test/improver-providers-agent.mjs test/improver-guards-ledger.mjs test/improver-guards-tools.mjs test/improver-clarify.mjs test/improver-clarify-scheduler.mjs test/improver-misc.mjs test/improver-forms.mjs test/improver-forms-strict-secrets.mjs test/improver-content-press-keys-hint.mjs && npm run test:plan-notifications",+ "test:shard:browser-a": "node --test test/captcha-draft-content.mjs test/captcha-challenge-surfaces.mjs && node test/bot-memory-dom.mjs && node test/bot-memory-click-dom.mjs && node test/ui-content-lifecycle.mjs && node --test test/native-telegram-chat.mjs test/native-telegram-recipient.mjs test/telegram-native-baseline.mjs test/telegram-native-latest.mjs test/native-chat-pre-enter-draft.mjs test/chat-draft-dispatch-ownership.mjs test/native-telegram-alias-preparation.mjs test/telegram-read-preparation-content.mjs test/queued-composer-ownership.mjs test/onboarding-provider-ready.mjs test/sidepanel-permission-gate-ui.mjs test/model-picker-status-ui.mjs test/workflow-native-targets.mjs test/native-whatsapp-chat.mjs test/native-chat-context-identity.mjs test/native-whatsapp-contact.mjs test/whatsapp-chat-selection.mjs test/whatsapp-native-bootstrap.mjs test/whatsapp-drawer-identity.mjs test/whatsapp-read-latest.mjs test/whatsapp-read-preparation.mjs test/whatsapp-chat-completion.mjs test/whatsapp-chat-restart.mjs test/chat-goal-lifecycle.mjs test/chat-completion.mjs test/chat-generic-dispatch.mjs test/completion-live-status-browser.mjs test/native-confirmation-visibility.mjs test/native-button-preparation.mjs test/read-continuation-browser.mjs test/iframe-preparation-focus.mjs test/contenteditable-literal.mjs test/native-chat-empty-editor.mjs test/native-chat-trusted-clear.mjs test/chat-steering-ui.mjs test/activity-brain-ui.mjs test/recipient-confirmation-ui.mjs test/assistant-message-visibility-ui.mjs test/slash-command-timeline-ui.mjs test/page-monitor-ui.mjs test/x-compose-trusted-typing.mjs test/page-monitor-dialog.mjs test/page-monitor-dialog-native.mjs test/page-monitor-inline-post.mjs test/bluesky-composer-context.mjs test/page-monitor-anchored.mjs test/page-monitor-upload-owner.mjs test/page-monitor-upload-release.mjs test/page-monitor-native-controls.mjs test/page-monitor-native-preparation.mjs test/native-preparation-cold.mjs test/page-monitor-navigation.mjs test/page-monitor-main-owner.mjs test/page-monitor-collateral-controls.mjs test/accessibility-tree-scoped-budget.mjs test/ax-reference-origin.mjs test/page-monitor-decorative-hit.mjs test/social-ui-navigation.mjs test/native-resource-deletion-binding.mjs test/native-mastodon-confirmation.mjs test/dropdown-menu-inventory.mjs test/page-monitor-passive-progress.mjs test/page-monitor-feed-items.mjs test/media-download-binding.mjs test/media-download-capture-integration.mjs test/social-media-downloader-reinjection.mjs test/upload-file-local-state-guidance.mjs test/upload-file-source-approval.mjs test/monitor-intervention-contract.mjs test/monitor-owned-geometry.mjs test/monitor-viewport-remainder.mjs test/monitor-scroll-churn.mjs test/monitor-local-attribution.mjs test/monitor-lifecycle-leaks.mjs test/lifecycle-run-ui.mjs test/lifecycle-menu-prompts-held.mjs test/delivery-cdp-input.mjs test/delivery-click-ax-response-loss.mjs test/delivery-native-button-geometry.mjs test/delivery-hover-transition.mjs test/delivery-native-button-route.mjs test/delivery-dispatch-boundary.mjs test/delivery-stop-compound.mjs test/guards-control-classification.mjs test/guards-unbound-deletion.mjs test/submit-probe-readings.mjs test/declined-submission-identity.mjs test/improver-content-account-chrome.mjs test/improver-content-recipient.mjs test/improver-content-truncated-replacement.mjs test/improver-forms-probe.mjs test/improver-misc-trace-browser.mjs test/page-feedback-held-time.mjs test/page-monitor-held-observation.mjs",++=======+ "test:shard:runtime-unit": "node --test test/skill-download-wait.mjs && node --test test/agent-lifecycle.mjs test/runtime-startup.mjs test/run-ui-scheduled-lifecycle.mjs test/transport-deadlines.mjs test/cdp-worker-restart.mjs test/bot-memory.mjs test/bot-memory-click-guard.mjs test/bot-memory-registries.mjs test/bot-memory-cloud-controller.mjs test/cdp-clear-receipt.mjs test/cdp-field-submit-recovery.mjs test/conversation-persistence.mjs test/context-live-tool-group.mjs test/integration-races.mjs test/watch-completion-checkpoint.mjs test/runtime-model-identity.mjs test/provider-message-privacy.mjs test/runtime-task-authority.mjs test/planner-repair-authority.mjs test/runtime-progress-continuation.mjs test/chat-resume-chain.mjs test/chat-resume-completion.mjs test/native-chat-execution-ledger.mjs test/chat-send-dispatch-result.mjs test/chat-pre-enter-veto.mjs test/chat-reply-dedup-race.mjs test/memcode-lifecycle.mjs test/runtime-peer-review.mjs test/read-continuation-schema.mjs test/completion-submit-acknowledgement.mjs test/completion-live-status.mjs test/completion-iframe-submit.mjs test/form-validation-alert-readings.mjs test/control-effect-readings.mjs test/guard-reading-carry-over.mjs test/trusted-retry-readings.mjs test/completion-semantic-commit.mjs test/completion-diagnostics.mjs test/mastodon-publication.mjs test/calculator.mjs test/chat-recovery-protocol.mjs test/chat-pending-reconciliation.mjs test/semantic-page-retry.mjs test/pdf-detection.mjs test/runtime-lifecycle.mjs test/collection-read-progress.mjs test/network-lifecycle.mjs test/text-write-cancellation.mjs test/guard-advisory-writes.mjs test/trusted-field-preparation.mjs test/draftjs-text.mjs test/codemirror-text.mjs test/rich-text-frameworks.mjs test/cdp-managed-text-selection.mjs test/firefox-rich-text-readback.mjs test/contenteditable-beforeinput.mjs test/trusted-field-preparation-ownership.mjs test/typing-preparation-geometry.mjs test/chat-steering.mjs test/resource-mutation-guards.mjs test/completion-steering-receipt-authority.mjs test/steering-revision-recovery.mjs test/pending-clarification-hydration.mjs test/run-ui-hidden-panel.mjs test/clarify-timeout-policy.mjs test/guard-ask-cards.mjs test/permission-steering-wakeup.mjs test/pure-calculation-reply.mjs test/pure-calculation-tools.mjs test/page-feedback.mjs test/page-feedback-progress.mjs test/page-feedback-unbindable-target.mjs test/guard-advisory-actions.mjs test/rich-text-preflight-page-change.mjs test/keyboard-receiver-frame.mjs test/input-receiving-frame.mjs test/ask-response-scope.mjs test/auto-mode.mjs test/plan-when-needed.mjs test/model-picker-icon.mjs test/ask-completion-churn.mjs test/page-feedback-policy.mjs test/research-escalation-page-feedback.mjs test/page-feedback-transport-races.mjs test/page-feedback-recovery.mjs test/telegram-read-preparation-agent.mjs test/media-download-agent-handler.mjs test/code-scanning-url-recipient.mjs test/apocalypse-comm-parsing.mjs test/apocalypse-scalar-decoding.mjs test/bitgpu-chat-security.mjs test/social-media-url-upgrades.mjs test/downloaded-file-saved-bytes.mjs test/download-conversation-scope.mjs test/downloaded-file-local-probe.mjs test/formless-verification-recovery.mjs test/file-upload-accept.mjs test/file-upload-accept-agent.mjs test/workflow-route-generic-completion.mjs test/release-publication-completion.mjs test/workflow-implicit-metadata.mjs test/workflow-field-readings.mjs test/workflow-field-anchors.mjs test/user-turn-kind.mjs test/follow-up-task-context.mjs test/completion-current-execution-evidence.mjs test/video-upload-attachment.mjs test/feedback-automatic-churn.mjs test/feedback-navigation-idle.mjs test/feedback-run-boundaries.mjs test/feedback-ask-viewing.mjs test/lifecycle-terminal-done.mjs test/incomplete-completion-recovery.mjs test/guard-advisory-completion.mjs test/lean-mode.mjs test/prompt-unverified-pages.mjs test/prompt-missing-values.mjs test/lifecycle-planner-digest.mjs test/planner-clarify-loop.mjs test/lifecycle-steering-latency.mjs test/lifecycle-steering-restart.mjs test/lifecycle-vision-fallback.mjs test/delivery-click-locks.mjs test/guards-steering-receipts.mjs test/terminal-user-messages.mjs test/improver-providers.mjs test/improver-providers-agent.mjs test/improver-guards-ledger.mjs test/improver-guards-tools.mjs test/improver-clarify.mjs test/improver-clarify-scheduler.mjs test/improver-misc.mjs test/improver-forms.mjs test/improver-forms-strict-secrets.mjs test/improver-content-press-keys-hint.mjs && npm run test:plan-notifications",+ "test:shard:browser-a": "node --test test/captcha-draft-content.mjs test/captcha-challenge-surfaces.mjs && node test/bot-memory-dom.mjs && node test/bot-memory-click-dom.mjs && node test/ui-content-lifecycle.mjs && node --test test/native-telegram-chat.mjs test/native-telegram-recipient.mjs test/telegram-native-baseline.mjs test/telegram-native-latest.mjs test/native-chat-pre-enter-draft.mjs test/chat-draft-dispatch-ownership.mjs test/native-telegram-alias-preparation.mjs test/telegram-read-preparation-content.mjs test/queued-composer-ownership.mjs test/onboarding-provider-ready.mjs test/sidepanel-permission-gate-ui.mjs test/model-picker-status-ui.mjs test/workflow-native-targets.mjs test/native-whatsapp-chat.mjs test/native-chat-context-identity.mjs test/native-whatsapp-contact.mjs test/whatsapp-chat-selection.mjs test/whatsapp-native-bootstrap.mjs test/whatsapp-drawer-identity.mjs test/whatsapp-read-latest.mjs test/whatsapp-read-preparation.mjs test/whatsapp-chat-completion.mjs test/whatsapp-chat-restart.mjs test/chat-goal-lifecycle.mjs test/chat-completion.mjs test/chat-generic-dispatch.mjs test/completion-live-status-browser.mjs test/native-confirmation-visibility.mjs test/native-button-preparation.mjs test/read-continuation-browser.mjs test/iframe-preparation-focus.mjs test/contenteditable-literal.mjs test/native-chat-empty-editor.mjs test/native-chat-trusted-clear.mjs test/chat-steering-ui.mjs test/activity-brain-ui.mjs test/recipient-confirmation-ui.mjs test/assistant-message-visibility-ui.mjs test/slash-command-timeline-ui.mjs test/page-monitor-ui.mjs test/x-compose-trusted-typing.mjs test/page-monitor-dialog.mjs test/page-monitor-dialog-native.mjs test/page-monitor-inline-post.mjs test/bluesky-composer-context.mjs test/page-monitor-anchored.mjs test/page-monitor-upload-owner.mjs test/page-monitor-upload-release.mjs test/page-monitor-native-controls.mjs test/page-monitor-native-preparation.mjs test/native-preparation-cold.mjs test/page-monitor-navigation.mjs test/page-monitor-main-owner.mjs test/page-monitor-collateral-controls.mjs test/accessibility-tree-scoped-budget.mjs test/ax-reference-origin.mjs test/page-monitor-decorative-hit.mjs test/social-ui-navigation.mjs test/native-resource-deletion-binding.mjs test/native-mastodon-confirmation.mjs test/dropdown-menu-inventory.mjs test/page-monitor-passive-progress.mjs test/page-monitor-feed-items.mjs test/media-download-binding.mjs test/media-download-capture-integration.mjs test/social-media-downloader-reinjection.mjs test/upload-file-local-state-guidance.mjs test/monitor-intervention-contract.mjs test/monitor-owned-geometry.mjs test/monitor-viewport-remainder.mjs test/monitor-scroll-churn.mjs test/monitor-local-attribution.mjs test/monitor-lifecycle-leaks.mjs test/lifecycle-run-ui.mjs test/lifecycle-menu-prompts-held.mjs test/delivery-cdp-input.mjs test/delivery-click-ax-response-loss.mjs test/delivery-native-button-geometry.mjs test/delivery-hover-transition.mjs test/delivery-native-button-route.mjs test/delivery-dispatch-boundary.mjs test/delivery-stop-compound.mjs test/guards-control-classification.mjs test/guards-unbound-deletion.mjs test/submit-probe-readings.mjs test/declined-submission-identity.mjs test/improver-content-account-chrome.mjs test/improver-content-recipient.mjs test/improver-content-truncated-replacement.mjs test/improver-forms-probe.mjs test/improver-misc-trace-browser.mjs test/page-feedback-held-time.mjs test/page-monitor-held-observation.mjs",++>>>>>>> origin/main"test:shard:browser-b1": "node test/message-recipient-upload.mjs && node test/message-recipient-clarify-binding.mjs && node --test test/message-recipient-whatsapp.mjs test/message-control-readings.mjs && node test/quality/integration-mv3.mjs --full-form && node test/quality/integration-mv3.mjs --batch && node test/quality/literal-calculate-midrun-mv3.mjs && node test/quality/ask-completion-churn-mv3.mjs && node test/quality/ask-person-activity-mv3.mjs && node test/quality/telegram-cold-preparation-mv3.mjs && node test/quality/native-chat-mv3.mjs && node test/quality/native-chat-presubmit-mv3.mjs && node test/quality/cloud-bot-memory-mv3.mjs",- "test:shard:browser-b2": "node test/quality/whatsapp-contact-matrix.mjs && node test/quality/pdf-detection-mv3.mjs && node test/quality/download-upload-mv3.mjs && node test/quality/upload-release-binding-mv3.mjs && node test/quality/upload-release-binding-mv3.mjs --selector-recovery && node test/quality/upload-release-binding-mv3.mjs --sequential-assets && node test/quality/release-review-world-mv3.mjs && node test/quality/downloaded-file-saved-bytes-mv3.mjs && node test/quality/file-upload-accept-mv3.mjs && node test/quality/bulk-resume-mv3.mjs && node test/quality/shared-action-guards-mv3.mjs && node test/quality/video-upload-attachment-mv3.mjs && node --test test/iframe-probe-match-index.mjs",+ "test:shard:browser-b2": "node test/quality/whatsapp-contact-matrix.mjs && node test/quality/pdf-detection-mv3.mjs && node test/quality/download-upload-mv3.mjs && node test/quality/upload-release-binding-mv3.mjs && node test/quality/upload-release-binding-mv3.mjs --selector-recovery && node test/quality/upload-release-binding-mv3.mjs --sequential-assets && node test/quality/release-review-world-mv3.mjs && node test/quality/downloaded-file-saved-bytes-mv3.mjs && npm run test:quality:resolved-address && node test/quality/file-upload-accept-mv3.mjs && node test/quality/bulk-resume-mv3.mjs && node test/quality/shared-action-guards-mv3.mjs && node test/quality/video-upload-attachment-mv3.mjs && node --test test/iframe-probe-match-index.mjs","test:shard:browser-c": "node test/quality/literal-frame-mv3.mjs && node test/quality/mastodon-publication-mv3.mjs && node test/quality/mastodon-reply-route-mv3.mjs && node test/quality/mastodon-deletion-mv3.mjs && node test/quality/mastodon-delete-confirmation-mv3.mjs && node test/quality/mastodon-delete-confirmation-mv3.mjs --menu-read && node test/quality/mastodon-delete-confirmation-mv3.mjs --vague && node test/quality/mastodon-delete-after-correction-mv3.mjs && node test/quality/unbound-deletion-mv3.mjs && node test/quality/recipient-clarify-mv3.mjs && node test/quality/open-chat-recipients-mv3.mjs && node test/quality/correction-cross-site-mv3.mjs && node test/quality/anchored-action-mv3.mjs && node test/quality/inline-social-composer-mv3.mjs && node test/quality/x-compose-dialog-mv3.mjs && node test/quality/bluesky-composer-mv3.mjs && node test/quality/dropdown-menu-matrix.mjs && node test/quality/mastodon-deletion-navigation-mv3.mjs && node test/quality/semantic-navigation-matrix.mjs && node test/quality/workflow-replay-mv3.mjs && node test/quality/generative-media-mv3.mjs && node test/quality/cdp-worker-restart-mv3.mjs && node test/quality/steering-worker-restart-mv3.mjs && npm run test:vision-mode","test:shard:tail": "node test/run.js && node test/selection-scope-restoration.mjs && node scripts/benchmark-offline-relevance.mjs && npm run test:security && node --test test/placeholder-submit-probe.mjs","test:composer-context": "node --test test/page-monitor-inline-post.mjs test/bluesky-composer-context.mjs && node test/quality/inline-social-composer-mv3.mjs && node test/quality/x-compose-dialog-mv3.mjs && node test/quality/bluesky-composer-mv3.mjs",diff --cc src/chrome/src/agent/agent.jsindex 726f6e6ae,5c84feed6..3a2bf7fdf--- a/src/chrome/src/agent/agent.js+++ b/src/chrome/src/agent/agent.js@@@ -134,7 -135,7 +135,7 @@@ importnormalizeCloudflareManagedChallengeState,} from './cloudflare-managed-challenge.js';import { getRecordingStateFresh as recorderStateFresh } from '../recorder/host.js';- import { Capability, CAPABILITY_LABEL, SubmitRisk, capabilitiesFor, classifySearchNavigation, classifySubmitRisk, requiredHosts, frameHostMatches, urlFilterHostHint, isNetworkMutation, normalizeHost, registrableHost, PermissionManager, submitActionKey, uploadApprovalCard, uploadApprovalKey, uploadApprovalQuestion, UNTRUSTED_CONTENT_TOOLS } from './permission-gate.js';-import { Capability, CAPABILITY_LABEL, SubmitRisk, capabilitiesFor, classifySearchNavigation, classifySubmitRisk, requiredHosts, inputReachesReceivingFrame, frameHostMatches, urlFilterHostHint, isNetworkMutation, normalizeHost, registrableHost, PermissionManager, submitActionKey, UNTRUSTED_CONTENT_TOOLS } from './permission-gate.js';++import { Capability, CAPABILITY_LABEL, SubmitRisk, capabilitiesFor, classifySearchNavigation, classifySubmitRisk, requiredHosts, inputReachesReceivingFrame, frameHostMatches, urlFilterHostHint, isNetworkMutation, normalizeHost, registrableHost, PermissionManager, submitActionKey, uploadApprovalCard, uploadApprovalKey, uploadApprovalQuestion, UNTRUSTED_CONTENT_TOOLS } from './permission-gate.js';import {buildPlannerMessages,buildPlannerAlignmentMessages,@@@ -39738,30 -39794,116 +39833,129 @@@ Rules: no prose intro, no conclusion, n}/**- * Remember the downloads this run's own download tools saved, so upload_file- * can tell them from any other file on the disk (_uploadFileSource). The ids- * come from chrome.downloads through WebBrain's own tool code, never from- * the page or the model.+ * The downloads this tab's conversation produced: the ids WebBrain's own+ * download tools returned here (_pinDownloadId) and every download that+ * started while a run was active on this tab, such as a clicked "Export"+ * link or download_social_media's page-side saves (_watchRunDownloads).+ * Only these are listed by list_downloads and read by read_downloaded_file+ * without asking. The rest of the browser's download history is the user's+ * own: reading one of those files needs the user's approval of that exact+ * file (_authorizeDownloadRead). Saved with the conversation, so a worker+ * restart keeps them; a new, forked or cleared conversation starts empty.*/+ _rememberConversationDownload(tabId, downloadId) {+ if (tabId == null || !Number.isSafeInteger(downloadId) || downloadId < 0) return;+ let ids = this._conversationDownloads.get(tabId);+ if (!ids) this._conversationDownloads.set(tabId, ids = new Set());+ if (ids.has(downloadId)) return;+ ids.add(downloadId);+ while (ids.size > CONVERSATION_DOWNLOAD_LIMIT) ids.delete(ids.values().next().value);+ this._persist(tabId);+ }++ _isConversationDownload(tabId, downloadId) {+ return this._conversationDownloads.get(tabId)?.has(downloadId) === true;+ }++ _rememberRunDownloads(tabId, name, result) {+ try {+ if (!result || result.error || result.success === false) return;- const ids = [];+ if (name === 'download_files' || name === 'download_file') {- for (const d of (result.downloads || [])) if (d && d.success && d.downloadId != null) ids.push(d.downloadId);- } else if (name === 'download_resource_from_page'- || this._activeSkillToolForName(tabId, name)?.requiresDownloadPermission) {- ids.push(result.downloadId);++ for (const d of (result.downloads || [])) if (d && d.success && d.downloadId != null) this._rememberConversationDownload(tabId, d.downloadId);++ } else if (name === 'download_resource_from_page' || this._activeSkillToolForName?.(tabId, name)?.requiresDownloadPermission) {++ if (result.downloadId != null) this._rememberConversationDownload(tabId, result.downloadId);+ } else if (name === 'download_social_media') {- ids.push(result.savedFile?.downloadId);- }- for (const raw of ids) {- const id = Number(raw);- if (raw == null || !Number.isSafeInteger(id) || id < 0) continue;- if (!this._runDownloadIds.has(tabId)) this._runDownloadIds.set(tabId, new Set());- this._runDownloadIds.get(tabId).add(id);++ if (result.savedFile?.downloadId != null) this._rememberConversationDownload(tabId, result.savedFile.downloadId);+ }- } catch { /* best-effort: an unremembered download is only asked about */ }++ } catch { /* best effort */ }++ }+++ // Added with the first run and kept for the worker's lifetime; outside runs+ // nothing is recorded. A download names no tab, so one that starts while+ // several tabs run belongs to each of their conversations.+ _watchRunDownloads() {+ if (this._runDownloadListener) return;+ const listener = item => {+ for (const tabId of this._runningTabs) this._rememberConversationDownload(tabId, item?.id);+ };+ try {+ if (!chrome.downloads?.onCreated?.addListener) return;+ chrome.downloads.onCreated.addListener(listener);+ this._runDownloadListener = listener;+ } catch { /* without the event only tool-returned ids are kept */ }+ }++ /**+ * read_downloaded_file sends a local file's bytes to the model's provider.+ * A download this conversation produced is read as before. Any other+ * download is the user's own file: WebBrain names it on its own card and+ * reads it only on the user's "Read once". The model's arguments, page text+ * and an unattended run never approve it. Returns null when the read may go+ * ahead, otherwise the result for the model.+ */+ async _authorizeDownloadRead(tabId, downloadId, onUpdate = null) {+ // readDownloadedFile reports an invalid id itself.+ if (!Number.isSafeInteger(downloadId) || downloadId < 0 || this._isConversationDownload(tabId, downloadId)) return null;+ const refused = (error, extra = {}) => ({ success: false, code: 'download_not_from_conversation', ...extra, error });+ const find = async () => {+ try { return (await chrome.downloads.search({ id: downloadId })).find(item => item.id === downloadId) || null; }+ catch { return null; }+ };+ const item = await find();+ if (!item || item.state !== 'complete' || item.exists === false || !item.filename) {+ return refused(`Download #${downloadId} is not a file downloaded in this conversation. Use a downloadId from this conversation's download results or list_downloads; if the user wants another downloaded file read, ask them to attach it.`);+ }+ let host = '';+ try { host = new URL(item.finalUrl || item.url).hostname; } catch {}+ const choice = await this._promptDownloadReadConfirmation(tabId, { filename: downloadBasename(item.filename), host }, onUpdate);+ if (choice === null) return refused('The user stopped or corrected the task before approving this file, so nothing was read.', { cancelled: true });+ if (choice === 'unavailable') {+ return refused(`Download #${downloadId} is not a file downloaded in this conversation, and the user cannot be asked to approve reading it in this run, so nothing was read.`);+ }+ if (choice !== 'once') {+ return refused('The user did not approve reading this downloaded file, so nothing was read. Do not ask again; continue without it.', { readDeclined: true });+ }+ // The answer covers the file the card named.+ if ((await find())?.filename !== item.filename) return refused('The downloaded file changed while the user was deciding, so nothing was read.');+ return null;+ }++ /**+ * The card for _authorizeDownloadRead: the file's name (the download's own,+ * page-settable name, which the side panel shows as text only) and the site+ * it came from. Like a permission prompt it never times out and never+ * answers itself; an unattended scheduled run cannot ask. Returns 'once',+ * 'deny', 'unavailable', or null when Stop or a correction cancelled it.+ */+ async _promptDownloadReadConfirmation(tabId, details = {}, onUpdate = null) {+ const confirmation = {+ filename: String(details.filename || '').slice(0, 260),+ host: String(details.host || '').slice(0, 300),+ };+ if (this.scheduledRunPolicies.get(tabId)?.requireConsequentialConfirmation === false) return 'unavailable';+ if (typeof onUpdate !== 'function') return 'unavailable';+ const clarifyId = `download_read_${secureRandomBase36Token(12)}`;+ const tabPending = this._pendingClarifications.get(tabId) || new Map();+ this._pendingClarifications.set(tabId, tabPending);+ const responsePromise = new Promise((resolve) => {+ tabPending.set(clarifyId, { resolve, ts: Date.now(), timer: null, settled: false, timeoutSec: 0, deadlineTs: 0, onUpdate });+ });+ try {+ onUpdate('clarify', {+ promptKind: 'download_read',+ clarifyId,+ // English for traces and surfaces without the side panel's localized copy.+ question: `Let WebBrain read ${confirmation.filename || 'this file'} from your downloads? Its contents go to your AI provider.`,+ downloadReadConfirmation: confirmation,+ options: ['once', 'deny'],+ });+ } catch { /* UI emit must never break the run */ }+ const response = await responsePromise;+ tabPending.delete(clarifyId);+ if (tabPending.size === 0 && this._pendingClarifications.get(tabId) === tabPending) this._pendingClarifications.delete(tabId);+ if (response?.cancelled) return null;+ if (['timeout', 'auto'].includes(response?.source)) return 'deny';+ return String(response?.answer || '').trim().toLowerCase() === 'once' ? 'once' : 'deny';}// βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ@@@ -44886,100 -45028,6 +45080,100 @@@};}+ async _uploadDownloadItem(id) {+ if (!Number.isSafeInteger(id) || id < 0 || typeof globalThis.chrome?.downloads?.search !== 'function') return null;+ try {+ const items = await new Promise((resolve, reject) => {+ const pending = chrome.downloads.search({ id }, (res) => {+ if (chrome.runtime?.lastError) reject(new Error(chrome.runtime.lastError.message));+ else resolve(res);+ });+ if (pending && typeof pending.then === 'function') pending.then(resolve, reject);+ });+ return (items && items[0]) || null;+ } catch {+ return null;+ }+ }++ /**+ * The file an upload_file call would attach, resolved in the handler's own+ * order: attachmentId, then a complete downloadId, then filePath. runOwned+ * marks a file the user attached to this run or one this run's download+ * tools saved (a path counts only when it is such a download's saved path);+ * anything else could be any file on the disk. Kind "none" means the handler+ * has nothing it could read and will fail on its own.+ */+ async _uploadFileSource(tabId, args = {}, promptTier = this._resolvePromptTier()) {+ args = args || {};+ const given = key => args[key] != null && !(typeof args[key] === 'string' && !args[key].trim());+ if (given('attachmentId')) {+ const id = String(args.attachmentId).trim();+ const attachment = this._userAttachmentHandles.get(tabId)?.get(id);+ return { kind: 'attachment', key: `attachment:${id}`, runOwned: true,+ name: attachment ? this._sanitizeAttachmentName(attachment.name) : '' };+ }+ const none = { kind: 'none', key: 'none', runOwned: true };+ if (promptTier === 'compact') return none;- const runIds = this._runDownloadIds.get(tabId);++ const convIds = this._conversationDownloads.get(tabId);+ if (args.downloadId != null) {+ const id = Number(args.downloadId);+ const item = await this._uploadDownloadItem(id);+ if (item && item.state === 'complete' && item.filename) {- return { kind: 'download', key: `download:${id}`, downloadId: id, runOwned: !!runIds?.has(id),++ return { kind: 'download', key: `download:${id}`, downloadId: id, runOwned: this._isConversationDownload(tabId, id),+ path: String(item.filename), sourceUrl: String(item.finalUrl || item.url || '') };+ }+ }+ if (!given('filePath')) return none;+ const filePath = String(args.filePath);+ let runOwned = false;- for (const id of runIds || []) {++ for (const id of convIds || []) {+ if ((await this._uploadDownloadItem(id))?.filename === filePath) { runOwned = true; break; }+ }+ return { kind: 'path', key: `path:${filePath}`, runOwned, path: filePath };+ }++ /**+ * The permission gate for upload_file. A page can read a File the moment it+ * lands in its input, so the approval names the exact file and the page+ * host: a host-wide upload grant no longer approves a file, though a+ * standing deny still refuses. A file the user attached to this run or one+ * this run downloaded keeps the ordinary gate (skipped when prompts are off)+ * and its approval lasts for the turn. Any other local file is approved on+ * the card one call at a time, with prompts on or off; a run that cannot+ * show the card refuses it. Returns { allowed, sourceKey } for the handler+ * to re-check, { aborted }, or { allowed: false, result }.+ */+ async _authorizeUploadFileSource(tabId, args, onUpdate, { promptTier, gateBypassed = false, unattended = false } = {}) {+ const source = await this._uploadFileSource(tabId, args, promptTier);+ const allowed = { allowed: true, sourceKey: source.key };+ if (source.kind === 'none' || (gateBypassed && source.runOwned)) return allowed;+ const refused = error => ({ allowed: false,+ result: { success: false, denied: true, dispatched: false, noDispatch: true, permissionRequired: true, error } });+ const host = requiredHosts(Capability.UPLOAD, args, await this._currentUrl(tabId), 'upload_file')[0] || '';+ if (!host) return refused('Cannot run upload_file: the page host could not be identified, so the file cannot be approved for it.');+ const file = source.kind === 'download' ? `downloadId ${source.downloadId}`+ : source.kind === 'path' ? 'the given filePath' : 'this file';+ if (!source.runOwned && (unattended || typeof onUpdate !== 'function')) {+ return refused(`Nothing was attached: ${file} is neither a file the user attached nor one this run downloaded, so the user must approve this exact file, and this run cannot ask. Use a file the user attached or one this run downloaded, or report that the upload needs the user.`);+ }+ const denied = refused(`The user did not allow attaching ${file} to a page on ${host}. Do NOT retry it. If the task needs a file, ask the user to attach it in the chat.`);+ await this.permissions.hydrate();+ const standing = this.permissions.check(host, Capability.UPLOAD, tabId);+ if (!standing.needsPrompt && !standing.allowed) return denied;+ const key = uploadApprovalKey(host, source.key);+ const prior = this.permissions.checkIntent(key, tabId, Capability.UPLOAD);+ if (!prior.needsPrompt) return prior.allowed ? allowed : denied;+ const choice = await this._promptPermission(tabId, Capability.UPLOAD, host, onUpdate, source);+ if (choice === null) return { allowed: false, aborted: true };+ if (choice !== 'once') {+ this.permissions.recordIntent(key, [Capability.UPLOAD], 'deny', tabId);+ return { ...denied, prompted: true };+ }+ if (source.runOwned) this.permissions.recordIntent(key, [Capability.UPLOAD], 'allow', tabId);+ return { ...allowed, prompted: true };+ }+_userAttachmentNotice(attachments, options = {}) {const entries = (attachments || []).map(att => ({attachmentId: String(att?.attachmentId || '').trim(),diff --cc src/firefox/src/agent/agent.jsindex 4696ca19a,004c5506e..840ff4dbb--- a/src/firefox/src/agent/agent.js+++ b/src/firefox/src/agent/agent.js@@@ -126,7 -127,7 +127,7 @@@ importcloudflareManagedChallengeStorageKey,normalizeCloudflareManagedChallengeState,} from './cloudflare-managed-challenge.js';- import { Capability, CAPABILITY_LABEL, SubmitRisk, capabilitiesFor, classifySearchNavigation, classifySubmitRisk, requiredHosts, frameHostMatches, urlFilterHostHint, isNetworkMutation, normalizeHost, registrableHost, PermissionManager, submitActionKey, uploadApprovalCard, uploadApprovalKey, uploadApprovalQuestion, UNTRUSTED_CONTENT_TOOLS } from './permission-gate.js';-import { Capability, CAPABILITY_LABEL, SubmitRisk, capabilitiesFor, classifySearchNavigation, classifySubmitRisk, requiredHosts, inputReachesReceivingFrame, frameHostMatches, urlFilterHostHint, isNetworkMutation, normalizeHost, registrableHost, PermissionManager, submitActionKey, UNTRUSTED_CONTENT_TOOLS } from './permission-gate.js';++import { Capability, CAPABILITY_LABEL, SubmitRisk, capabilitiesFor, classifySearchNavigation, classifySubmitRisk, requiredHosts, inputReachesReceivingFrame, frameHostMatches, urlFilterHostHint, isNetworkMutation, normalizeHost, registrableHost, PermissionManager, submitActionKey, uploadApprovalCard, uploadApprovalKey, uploadApprovalQuestion, UNTRUSTED_CONTENT_TOOLS } from './permission-gate.js';import {buildPlannerMessages,buildPlannerAlignmentMessages,@@@ -36181,30 -36199,119 +36238,132 @@@ Rules: no prose intro, no conclusion, n}/**- * Remember the downloads this run's own download tools saved, so upload_file- * can tell them from any other download (_uploadFileSource). The ids come- * from browser.downloads through WebBrain's own tool code, never from the- * page or the model.+ * The downloads this tab's conversation produced: the ids WebBrain's own+ * download tools returned here (_pinDownloadId) and every download that+ * started while a run was active on this tab, such as a clicked "Export"+ * link or download_social_media's page-side saves (_watchRunDownloads).+ * Only these are listed by list_downloads and read by read_downloaded_file+ * without asking. The rest of the browser's download history is the user's+ * own: reading one of those files needs the user's approval of that exact+ * file (_authorizeDownloadRead). Saved with the conversation, so a worker+ * restart keeps them; a new, forked or cleared conversation starts empty.*/+ _rememberConversationDownload(tabId, downloadId) {+ if (tabId == null || !Number.isSafeInteger(downloadId) || downloadId < 0) return;+ let ids = this._conversationDownloads.get(tabId);+ if (!ids) this._conversationDownloads.set(tabId, ids = new Set());+ if (ids.has(downloadId)) return;+ ids.add(downloadId);+ while (ids.size > CONVERSATION_DOWNLOAD_LIMIT) ids.delete(ids.values().next().value);+ this._persist(tabId);+ }++ _isConversationDownload(tabId, downloadId) {+ return this._conversationDownloads.get(tabId)?.has(downloadId) === true;+ }++ _rememberRunDownloads(tabId, name, result) {+ try {+ if (!result || result.error || result.success === false) return;- const ids = [];+ if (name === 'download_files' || name === 'download_file') {- for (const d of (result.downloads || [])) if (d && d.success && d.downloadId != null) ids.push(d.downloadId);- } else if (name === 'download_resource_from_page'- || this._activeSkillToolForName(tabId, name)?.requiresDownloadPermission) {- ids.push(result.downloadId);++ for (const d of (result.downloads || [])) if (d && d.success && d.downloadId != null) this._rememberConversationDownload(tabId, d.downloadId);++ } else if (name === 'download_resource_from_page' || this._activeSkillToolForName?.(tabId, name)?.requiresDownloadPermission) {++ if (result.downloadId != null) this._rememberConversationDownload(tabId, result.downloadId);+ } else if (name === 'download_social_media') {- ids.push(result.savedFile?.downloadId);- }- for (const raw of ids) {- const id = Number(raw);- if (raw == null || !Number.isSafeInteger(id) || id < 0) continue;- if (!this._runDownloadIds.has(tabId)) this._runDownloadIds.set(tabId, new Set());- this._runDownloadIds.get(tabId).add(id);++ if (result.savedFile?.downloadId != null) this._rememberConversationDownload(tabId, result.savedFile.downloadId);+ }- } catch { /* best-effort: an unremembered download is only asked about */ }++ } catch { /* best effort */ }++ }+++ // Added with the first run and kept for the worker's lifetime; outside runs+ // nothing is recorded. A download names no tab, so one that starts while+ // several tabs run belongs to each of their conversations.+ _watchRunDownloads() {+ if (this._runDownloadListener) return;+ const listener = item => {+ for (const tabId of this._runningTabs) this._rememberConversationDownload(tabId, item?.id);+ };+ try {+ if (!browser.downloads?.onCreated?.addListener) return;+ browser.downloads.onCreated.addListener(listener);+ this._runDownloadListener = listener;+ } catch { /* without the event only tool-returned ids are kept */ }+ }++ /**+ * read_downloaded_file sends a local file's bytes to the model's provider.+ * A download this conversation produced is read as before. Any other+ * download is the user's own file: WebBrain names it on its own card and+ * reads it only on the user's "Read once". The model's arguments, page text+ * and an unattended run never approve it. Returns null when the read may go+ * ahead, otherwise the result for the model.+ */+ async _authorizeDownloadRead(tabId, downloadId, onUpdate = null) {+ // readDownloadedFile reports an invalid id itself.+ if (!Number.isSafeInteger(downloadId) || downloadId < 0 || this._isConversationDownload(tabId, downloadId)) return null;+ const refused = (error, extra = {}) => ({ success: false, code: 'download_not_from_conversation', ...extra, error });+ const find = async () => {+ try { return (await browser.downloads.search({ id: downloadId })).find(item => item.id === downloadId) || null; }+ catch { return null; }+ };+ const item = await find();+ // Firefox reads only a captured data: payload (readDownloadedFile), so a+ // card about any other file would approve nothing.+ if (!item || item.state !== 'complete' || item.exists === false || !item.filename+ || typeof item.url !== 'string' || !item.url.startsWith('data:')) {+ return refused(`Download #${downloadId} is not a file downloaded in this conversation. Use a downloadId from this conversation's download results or list_downloads; if the user wants another downloaded file read, ask them to attach it.`);+ }+ let host = '';+ try { host = new URL(item.finalUrl || item.url).hostname; } catch {}+ const choice = await this._promptDownloadReadConfirmation(tabId, { filename: downloadBasename(item.filename), host }, onUpdate);+ if (choice === null) return refused('The user stopped or corrected the task before approving this file, so nothing was read.', { cancelled: true });+ if (choice === 'unavailable') {+ return refused(`Download #${downloadId} is not a file downloaded in this conversation, and the user cannot be asked to approve reading it in this run, so nothing was read.`);+ }+ if (choice !== 'once') {+ return refused('The user did not approve reading this downloaded file, so nothing was read. Do not ask again; continue without it.', { readDeclined: true });+ }+ // The answer covers the file the card named.+ if ((await find())?.filename !== item.filename) return refused('The downloaded file changed while the user was deciding, so nothing was read.');+ return null;+ }++ /**+ * The card for _authorizeDownloadRead: the file's name (the download's own,+ * page-settable name, which the side panel shows as text only) and the site+ * it came from. Like a permission prompt it never times out and never+ * answers itself; an unattended scheduled run cannot ask. Returns 'once',+ * 'deny', 'unavailable', or null when Stop or a correction cancelled it.+ */+ async _promptDownloadReadConfirmation(tabId, details = {}, onUpdate = null) {+ const confirmation = {+ filename: String(details.filename || '').slice(0, 260),+ host: String(details.host || '').slice(0, 300),+ };+ if (this.scheduledRunPolicies.get(tabId)?.requireConsequentialConfirmation === false) return 'unavailable';+ if (typeof onUpdate !== 'function') return 'unavailable';+ const clarifyId = `download_read_${secureRandomBase36Token(12)}`;+ const tabPending = this._pendingClarifications.get(tabId) || new Map();+ this._pendingClarifications.set(tabId, tabPending);+ const responsePromise = new Promise((resolve) => {+ tabPending.set(clarifyId, { resolve, ts: Date.now(), timer: null, settled: false, timeoutSec: 0, deadlineTs: 0, onUpdate });+ });+ try {+ onUpdate('clarify', {+ promptKind: 'download_read',+ clarifyId,+ // English for traces and surfaces without the side panel's localized copy.+ question: `Let WebBrain read ${confirmation.filename || 'this file'} from your downloads? Its contents go to your AI provider.`,+ downloadReadConfirmation: confirmation,+ options: ['once', 'deny'],+ });+ } catch { /* UI emit must never break the run */ }+ const response = await responsePromise;+ tabPending.delete(clarifyId);+ if (tabPending.size === 0 && this._pendingClarifications.get(tabId) === tabPending) this._pendingClarifications.delete(tabId);+ if (response?.cancelled) return null;+ if (['timeout', 'auto'].includes(response?.source)) return 'deny';+ return String(response?.answer || '').trim().toLowerCase() === 'once' ? 'once' : 'deny';}_isCompressionPlaceholderResponse(text) {const normalized = String(text || '').trim().toLowerCase();@@@ -41311,86 -41418,6 +41470,86 @@@};}+ async _uploadDownloadItem(id) {+ if (!Number.isSafeInteger(id) || id < 0 || typeof globalThis.browser?.downloads?.search !== 'function') return null;+ try {+ const items = await browser.downloads.search({ id });+ return (items && items[0]) || null;+ } catch {+ return null;+ }+ }++ /**+ * The file an upload_file call would attach, resolved in the handler's own+ * order: a filePath is refused before anything is read, then attachmentId,+ * then a complete downloadId, else WebBrain's file picker, where the user+ * chooses the file. runOwned marks a file the user attached or chooses, or+ * one this run's download tools saved; any other download could be any+ * file the browser ever saved. Kind "none" means the handler has nothing it+ * could read and will fail on its own.+ */+ async _uploadFileSource(tabId, args = {}, promptTier = this._resolvePromptTier()) {+ args = args || {};+ const given = key => args[key] != null && !(typeof args[key] === 'string' && !args[key].trim());+ const none = { kind: 'none', key: 'none', runOwned: true };+ if (given('filePath')) return none;+ if (promptTier === 'compact' && (given('selector') || args.downloadId != null)) return none;+ if (given('attachmentId')) {+ const id = String(args.attachmentId).trim();+ const attachment = this._userAttachmentHandles.get(tabId)?.get(id);+ return { kind: 'attachment', key: `attachment:${id}`, runOwned: true,+ name: attachment ? this._sanitizeAttachmentName(attachment.name) : '' };+ }+ if (args.downloadId == null) return { kind: 'picker', key: 'picker', runOwned: true };+ const id = Number(args.downloadId);+ const item = await this._uploadDownloadItem(id);+ if (!item || !item.url || item.state !== 'complete') return none;- return { kind: 'download', key: `download:${id}`, downloadId: id, runOwned: !!this._runDownloadIds.get(tabId)?.has(id),++ return { kind: 'download', key: `download:${id}`, downloadId: id, runOwned: this._isConversationDownload(tabId, id),+ path: String(item.filename || ''), sourceUrl: String(item.url || '') };+ }++ /**+ * The permission gate for upload_file. A page can read a File the moment it+ * lands in its input, so the approval names the exact file and the page+ * host: a host-wide upload grant no longer approves a file, though a+ * standing deny still refuses. A file the user attached or chooses, or one+ * this run downloaded, keeps the ordinary gate (skipped when prompts are+ * off) and its approval lasts for the turn. Any other download is approved+ * on the card one call at a time, with prompts on or off; a run that cannot+ * show the card refuses it. Returns { allowed, sourceKey } for the handler+ * to re-check, { aborted }, or { allowed: false, result }.+ */+ async _authorizeUploadFileSource(tabId, args, onUpdate, { promptTier, gateBypassed = false, unattended = false } = {}) {+ const source = await this._uploadFileSource(tabId, args, promptTier);+ const allowed = { allowed: true, sourceKey: source.key };+ if (source.kind === 'none' || (gateBypassed && source.runOwned)) return allowed;+ const refused = error => ({ allowed: false,+ result: { success: false, denied: true, dispatched: false, noDispatch: true, permissionRequired: true, error } });+ const host = requiredHosts(Capability.UPLOAD, args, await this._currentUrl(tabId), 'upload_file')[0] || '';+ if (!host) return refused('Cannot run upload_file: the page host could not be identified, so the file cannot be approved for it.');+ const file = source.kind === 'download' ? `downloadId ${source.downloadId}`+ : source.kind === 'picker' ? 'a file the user chooses' : 'this file';+ if (!source.runOwned && (unattended || typeof onUpdate !== 'function')) {+ return refused(`Nothing was attached: ${file} is neither a file the user attached nor one this run downloaded, so the user must approve this exact file, and this run cannot ask. Use a file the user attached or one this run downloaded, or report that the upload needs the user.`);+ }+ const denied = refused(`The user did not allow attaching ${file} to a page on ${host}. Do NOT retry it. If the task needs a file, ask the user to attach it in the chat.`);+ await this.permissions.hydrate();+ const standing = this.permissions.check(host, Capability.UPLOAD, tabId);+ if (!standing.needsPrompt && !standing.allowed) return denied;+ const key = uploadApprovalKey(host, source.key);+ const prior = this.permissions.checkIntent(key, tabId, Capability.UPLOAD);+ if (!prior.needsPrompt) return prior.allowed ? allowed : denied;+ const choice = await this._promptPermission(tabId, Capability.UPLOAD, host, onUpdate, source);+ if (choice === null) return { allowed: false, aborted: true };+ if (choice !== 'once') {+ this.permissions.recordIntent(key, [Capability.UPLOAD], 'deny', tabId);+ return { ...denied, prompted: true };+ }+ if (source.runOwned) this.permissions.recordIntent(key, [Capability.UPLOAD], 'allow', tabId);+ return { ...allowed, prompted: true };+ }+_userAttachmentNotice(attachments, options = {}) {const entries = (attachments || []).map(att => ({attachmentId: String(att?.attachmentId || '').trim(),