oficina / slides Public

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.
Paul Campbell pushed by claude agent, operated by paul@keymail.dev 944a9fff9f528a053abebc7ecf458500f79fa30c parent d047eef
26 files changed, +3,172 −18
  • AGENTS.md +24 −0
  • cmd/slides/main.go +9 −0
  • fixtures/assist-panel.mjs +132 −0
  • fixtures/assist.mjs +127 −0
  • fixtures/assist.test.mjs +269 −0
  • fixtures/editor-entry.js +40 −2
  • internal/slides/app.go +18 −0
  • internal/slides/assist.go +386 −0
  • internal/slides/assist/provider.go +284 −0
  • internal/slides/assist/provider_test.go +183 −0
  • internal/slides/assist/reply.go +80 −0
  • internal/slides/assist_ops.go +301 −0
  • internal/slides/assist_prompt.go +262 −0
  • internal/slides/assist_test.go +303 −0
  • internal/slides/config.go +11 −0
  • internal/slides/config_ai.go +125 −0
  • internal/slides/credits/assets.json +1 −1
  • internal/slides/editor.go +50 −0
  • internal/slides/handlers.go +4 −0
  • internal/slides/icons/icons.go +1 −0
  • internal/slides/locales/en.toml +29 −0
  • internal/slides/static/{editor.dbe1616ac10c8b57.js => editor.c3fbe7c9ae1c7c02.js} +15 −15
  • internal/slides/static/editor.css +149 −0
  • internal/slides/team_guard_test.go +18 −0
  • internal/slides/templates/editor.html +53 −0
  • internal/slidestest/assist_test.go +298 −0

CI passed — run details

landed from feat/assistant

AGENTS.md

Loading diff…

cmd/slides/main.go

Loading diff…

fixtures/assist-panel.mjs

Loading diff…

fixtures/assist.mjs

Loading diff…

fixtures/assist.test.mjs

Loading diff…

fixtures/editor-entry.js

Loading diff…

internal/slides/app.go

Loading diff…

internal/slides/assist.go

Loading diff…

internal/slides/assist/provider.go

Loading diff…

internal/slides/assist/provider_test.go

Loading diff…

internal/slides/assist/reply.go

Loading diff…

internal/slides/assist_ops.go

Loading diff…

internal/slides/assist_prompt.go

Loading diff…

internal/slides/assist_test.go

Loading diff…

internal/slides/config.go

Loading diff…

internal/slides/config_ai.go

Loading diff…

internal/slides/credits/assets.json

Loading diff…

internal/slides/editor.go

Loading diff…

internal/slides/handlers.go

Loading diff…

internal/slides/icons/icons.go

Loading diff…

internal/slides/locales/en.toml

Loading diff…

internal/slides/static/{editor.dbe1616ac10c8b57.js => editor.c3fbe7c9ae1c7c02.js}

Loading diff…

internal/slides/static/editor.css

Loading diff…

internal/slides/team_guard_test.go

Loading diff…

internal/slides/templates/editor.html

Loading diff…

internal/slidestest/assist_test.go

Loading diff…