Skip to content

feat(playground): AI deck-editing tool layer - #106

Merged
leoafarias merged 1 commit into
mainfrom
feat/deck-edit-tools
Aug 13, 2026
Merged

feat(playground): AI deck-editing tool layer#106
leoafarias merged 1 commit into
mainfrom
feat/deck-edit-tools

Conversation

@leoafarias

Copy link
Copy Markdown
Member

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 on wip/deck-editor-on-main).

What's here

  • DeckMarkdownCodec — one owner for editor Markdown ↔ canonical slides. MemoryDeckLoader now decodes through it, so the live preview and the deck tools can never parse the same document differently. That invariant is what EditorDeckStore'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/updateStyle are 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 updateStyle tool 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.throwWithStackTrace so typed tool errors keep the original stack trace.

Impacted packages

  • playground only.

Verification

Check Result
dart analyze (playground) no issues
dcm analyze . --fatal-style --fatal-warnings no issues
flutter test (playground) 444 passed (411 baseline + 33 new)
dart format 0 changed

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.
@github-actions

Copy link
Copy Markdown

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

@leoafarias
leoafarias merged commit 0693e1a into main Aug 13, 2026
5 checks passed
@leoafarias
leoafarias deleted the feat/deck-edit-tools branch August 13, 2026 17:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant