Update chain metadata parsing to handle probing for extrinsic extensions, which
tells us if we need to supply an asset_id during the extrinsic signing process.
Note, adding extra/new fields to the Polkadot chain metadata doesn't require
manual migrations. If new fields are added then the initial parse from the Prefs
will fail which causes the metadata to be re-fetched which will then build the
new metadata properly and cache it, so there should be no issues in this regard.
In Polkadot, extrinsics may require specific signing extensions. This code
updates the metadata parsing routines to parse this data from the metadata blobs
we get from the remote and then persist the new field to the prefs.
* Add extracted_text field to UploadedFile mojom
Add an optional extracted_text string field to the UploadedFile mojom
struct for holding PDF text extracted at upload time via the PDF
rendering pipeline and ScreenAI OCR.
Update all UploadedFile::New() call sites to pass std::nullopt and
all TS UploadedFile object literals to include extractedText. Add
database migration v9->v10 for the encrypted extracted_text column,
update INSERT/SELECT queries, and add v9 SQL dump for migration tests.
* Integrate PdfTextExtractor into upload pipeline
Wire PdfTextExtractor into AIChatUIHandler via a new ProcessPdfFile
mojo endpoint for WebUI drag-and-drop PDF uploads.
- Add ProcessPdfFile to AIChatUIHandler mojom interface
- Implement on desktop (creates PdfTextExtractor, returns UploadedFile
with extracted_text) and iOS (no-op, returns raw data only)
- Update UploadFileHelper UploadedFile::New call sites for new field
- Update TypeScript: file_utils.ts, input_box, drag_overlay to call
processPdfFile for PDF files with fallback to raw data
- Update API layer and mock interfaces with processPdfFile endpoint
* Send extracted PDF text in engine layer, prefer over raw bytes
When a PDF has extracted_text, send it as a TextContentBlock prefixed
with "[PDF: filename]" instead of the raw FileContentBlock. Only fall
back to raw bytes when no text was extracted. This ensures local LLMs
that cannot process raw PDF bytes still get usable content.
The infobar is displayed when the PSST feature is available for the
website. Accepting the infobar allows the flow to proceed and the policy
script to run, otherwise, declining it interrupts the flow.
Resolves: https://github.com/brave/brave-browser/issues/53706
---------
Signed-off-by: Vadym Struts <vstruts@brave.com>
* [AIChat] Add id to completion event and NEAR verification status to conversation entry
* Remove id from completion event
* Wrap NEAR verification status in struct as workaround for iOS
* Update iOS AIChatResponseMessageView
* [AIChat] Persist NEAR verification status in database
* Remove `UpdateEntryVerificationStatus`
* Update to use `near_verification_status`
* Implement backend support of smart modes
- Add a dict preference for smart modes and methods to access/edit the
pref
- Add SubmitHumanConversationEntryWithMode API to create and submit
ConversationTurn with smart mode entry
- When smart mode entry presents, EngineConsumerOAI/ConversationAPI will
create a content block or a message to let agents to interpret the shortcut as the mapped
prompt right before the user message
- Expose CRUD APIs and observe method for smart modes to UI
- Persist smart mode entry data in conversation entries
- Unit tests
Before this PR, all content was associated with a Conversation and sent to the server at the beginning of a conversation. This PR changes that to associated content with a specific ConversationTurn and sends the content just before the turn it is associated with.
It is first stage of the PSST feature implementation. The main goal
was to make the existing code ready to the next implementation
steps and be consistent with feature requirements.
Resolves: https://github.com/brave/brave-browser/issues/46045
---------
Signed-off-by: Vadym Struts <vstruts@brave.com>