docs/plans/2026-03-26-ai-preview-tf-api-refactor.md
tf.ai RefactorReplace the low-level AI preview snapshot helper surface with tf.ai.* lifecycle transforms, keep the full-document snapshot strategy private, migrate insert-mode preview callers, and preserve the current no-history preview behavior.
tf.ai.* preview transforms in BaseAIPluginpackages/ai and apps/wwwpackages/ai/src/lib/transforms/aiStreamSnapshot.ts as a WeakMap keyed by editor.acceptAIChat, undoAI, resetAIChat, the editor AI kit, and the streaming integration test.AIPlugin already owns editor mutation semantics like insertNodes, removeMarks, removeNodes, and undo, so preview lifecycle belongs there too.tf.ai.*, while library internals and stricter callsites can still reach the same transforms through editor.getTransforms(BaseAIPlugin).ai where generic editor typing is narrower.@platejs/ai; filtered apps/www typecheck still has unrelated workspace export/type failures after the required root pnpm build, so that debt remains outside this refactor.