feat(ai-controllers): remove AiDigestController - #10089
Open
zone-live wants to merge 4 commits into
Open
Conversation
Clients construct AiDigestService and own digest freshness; empty-id validation moves onto the service.
Reorder Unreleased sections and use ([#10089]) PR link syntax expected by auto-changelog.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Explanation
AiDigestControllerwas leftover Engine glue after digest freshness moved to React Query: empty state, empty-id checks, and a passthrough toAiDigestService.This PR deletes the controller and related messenger/state exports.
AiDigestServiceremains the fetch+validate layer (GET, 404→null, Superstruct). EmptyassetIdentifier/ front-pageidnow throw on the service instead of the controller. Clients constructAiDigestServicethemselves and own cache/freshness.References
@metamask/ai-controllersat the preview build from this PRChecklist
Note
Medium Risk
Breaking public API removal requires consumer migration off messenger/controller wiring; runtime digest behavior is largely unchanged aside from where empty-id errors originate.
Overview
Breaking change:
@metamask/ai-controllersdropsAiDigestControllerand all Engine/messenger surface (actions, events, state helpers, auto-generated method action types). Digest HTTP fetch and Superstruct validation stay onAiDigestService; apps instantiate the service directly and handle caching/freshness (e.g. React Query).Input validation for empty asset identifiers and front-page ids now throws in
AiDigestService.searchDigest/fetchFrontPageIteminstead of the removed controller, with matching service tests.The package no longer depends on
@metamask/base-controlleror@metamask/messenger(tsconfig references, yarn lock, README dependency graph, and messenger CLI scripts removed accordingly).Reviewed by Cursor Bugbot for commit 07fb507. Bugbot is set up for automated code reviews on this repo. Configure here.