Slides: the TensorX assistant — the model proposes op batches, the editor applies them
Paul, 2026-11-11: "integrate TensorX to let me ask e.g. GLM 5.3 Flash or
Deepseek to put together a slide-deck or make changes to the deck or
individual slides."
- The editor header has an Assistant button and panel: a request, This
slide or The whole deck, and a model.
- POST /d/{sqid}/assist sends the request and a compact deck view
(labelled as data) to TensorX. The provider client pins the host,
never follows redirects, caps size and time, and sends the key only
in a header.
- The server rebuilds the returned ops from an allowlist (the drive
vocabulary minus the asset ops and set_meta fonts), mints every id,
maps placeholders, and validates theme, accent and scope. It applies
the batch to a scratch core copy, never the log, then runs Check and
Parse, with one repair round.
- The browser saves its pending edits first, then applies the validated
batch through commit(): one undo step, font-gated, saved through the
queue and seen live by collaborators.
- Off unless SLIDES_AI=on with SLIDES_TENSORX_API_KEY. Models come from
SLIDES_AI_MODELS (default deepseek/deepseek-v4-flash-0731). Each
person gets one request at a time and 20 per 10 minutes. Team mode
guards it, CSRF protects it, and it sits in the lapse table.
- Transitions (fade) work now. Builds wait for the #34 spec.
Reviewed by Claude Fable 5.1 (claude-fable-5-1) on oficina/slides #42:
APPROVED at e7a62ee. Its P2 (fonts) and two P3s (panel Undo, flush
before asking) were taken at 9fa4b70. Hub CI green at 9fa4b70. Tested
against a fake model only; no TensorX key yet.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Squashed from feat/assistant into main.
26 files changed,
+3,172
−18
AGENTS.md+24 −0cmd/slides/main.go+9 −0fixtures/assist-panel.mjs+132 −0fixtures/assist.mjs+127 −0fixtures/assist.test.mjs+269 −0fixtures/editor-entry.js+40 −2internal/slides/app.go+18 −0internal/slides/assist.go+386 −0internal/slides/assist/provider.go+284 −0internal/slides/assist/provider_test.go+183 −0internal/slides/assist/reply.go+80 −0internal/slides/assist_ops.go+301 −0internal/slides/assist_prompt.go+262 −0internal/slides/assist_test.go+303 −0internal/slides/config.go+11 −0internal/slides/config_ai.go+125 −0internal/slides/credits/assets.json+1 −1internal/slides/editor.go+50 −0internal/slides/handlers.go+4 −0internal/slides/icons/icons.go+1 −0internal/slides/locales/en.toml+29 −0internal/slides/static/{editor.dbe1616ac10c8b57.js => editor.c3fbe7c9ae1c7c02.js}+15 −15internal/slides/static/editor.css+149 −0internal/slides/team_guard_test.go+18 −0internal/slides/templates/editor.html+53 −0internal/slidestest/assist_test.go+298 −0
CI passed — run details
AGENTS.mdLoading diff…
cmd/slides/main.goLoading diff…
fixtures/assist-panel.mjsLoading diff…
fixtures/assist.mjsLoading diff…
fixtures/assist.test.mjsLoading diff…
fixtures/editor-entry.jsLoading diff…
internal/slides/app.goLoading diff…
internal/slides/assist.goLoading diff…
internal/slides/assist/provider.goLoading diff…
internal/slides/assist/provider_test.goLoading diff…
internal/slides/assist/reply.goLoading diff…
internal/slides/assist_ops.goLoading diff…
internal/slides/assist_prompt.goLoading diff…
internal/slides/assist_test.goLoading diff…
internal/slides/config.goLoading diff…
internal/slides/config_ai.goLoading diff…
internal/slides/credits/assets.jsonLoading diff…
internal/slides/editor.goLoading diff…
internal/slides/handlers.goLoading diff…
internal/slides/icons/icons.goLoading diff…
internal/slides/locales/en.tomlLoading diff…
internal/slides/static/{editor.dbe1616ac10c8b57.js => editor.c3fbe7c9ae1c7c02.js}Loading diff…
internal/slides/static/editor.cssLoading diff…
internal/slides/team_guard_test.goLoading diff…
internal/slides/templates/editor.htmlLoading diff…
internal/slidestest/assist_test.goLoading diff…