feat(playground): AI deck-editing tool layer - #106
Merged
Conversation
Stage 1 of 2 for the "edit this deck with AI" session: the tool layer only. The conversation UI (screen, session controller, routes, catalog, profile) follows in a dedicated PR once it is rebuilt on the current AI subsystem; until then this layer is exercised by its tests. - DeckMarkdownCodec: one owner for editor Markdown <-> canonical slides. MemoryDeckLoader decodes through it, so the live preview and the deck tools can never parse the same document differently. - DeckStore + EditorDeckStore: canonical document operations bridging the editor document and the rendered preview, with a reactive barrier that completes only after the preview observes each write. - DeckToolsService: five slide operations plus readSlide and an updateStyle seam, serialized through one error-recovering FIFO queue. - DeckToolsAdapter: six Dartantic tools (getDeck, createSlide, updateSlide, deleteSlide, moveSlide, readSlide) with Ack-validated arguments and stable wire error codes. updateStyle is not registered yet: its schema and applier targeted the pre-#102 style contract and return with the UI PR on the brand/theme contract. - DeckSlideReader: captures one rendered slide as a PNG thumbnail from the live configuration list. Error translation sites use Error.throwWithStackTrace so typed tool errors keep the original stack trace.
|
Visit the preview URL for this PR (updated for commit 1f2a8d2): https://superdeck-dev--pr106-feat-deck-edit-tools-xif2rmds.web.app (expires Sat, 12 Sep 2026 16:44:36 GMT) 🔥 via Firebase Hosting GitHub Action 🌎 Sign: bd68fc230762285849207e7e120aaf87cd4ca2f9 |
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.
Intent
Stage 1 of 2 for the "edit this deck with AI" session: the tool layer only — the seven-operation contract that lets a model read and mutate the live deck. The conversation UI follows in a dedicated PR.
This is the reimplementation the repo asked for in 492a9bc, which removed the first (unwired) version of these tools and left a spec to rebuild them. The full feature was built on
feat/playground-framework-support-v2, but #102 rewrote the playground's AI subsystem underneath its conversation layer (wizard-state-driven view model, deleted chat UI, new style contract). The tool layer is the part that is independent of that churn, already tested, and durable — so it lands first, and the UI is rebuilt on the current subsystem separately (analysis preserved in the workspace; WIP port onwip/deck-editor-on-main).What's here
DeckMarkdownCodec— one owner for editor Markdown ↔ canonical slides.MemoryDeckLoadernow decodes through it, so the live preview and the deck tools can never parse the same document differently. That invariant is whatEditorDeckStore's synchronization barrier relies on.DeckStore+EditorDeckStore— canonical document operations bridging the editor document and the rendered preview; each write completes only after the preview observes it (reactive barrier with timeout).DeckToolsService— slide operations serialized through one error-recovering FIFO queue;readSlide/updateStyleare injectable seams.DeckToolsAdapter— six Dartantic tools (getDeck,createSlide,updateSlide,deleteSlide,moveSlide,readSlide) with Ack-validated arguments and stable wire error codes; slides cross the boundary keyless.DeckSlideReader— captures one rendered slide as a PNG thumbnail.Deliberately not here: the
updateStyletool registration. Its schema and applier targeted the pre-#102 style contract (DeckStyleType, deleted in #102); it returns with the UI PR on the brand/theme contract. The service keeps the seam so the contract is already tested.Error-translation sites use
Error.throwWithStackTraceso typed tool errors keep the original stack trace.Impacted packages
playgroundonly.Verification
dart analyze(playground)dcm analyze . --fatal-style --fatal-warningsflutter test(playground)dart format