协作头脑风暴
brainstorming
在实现前澄清需求、探索设计选择,并形成清晰的开发方向。
markstream-vue【开发与工程】Integrate markstream-vue into a Vue 3 app. Use when Codex needs to add the Vue 3 renderer, import CSS in the right order, choose renderer and DOM modes, choose built-in, plain, or custom code-block paths, choose between `content` and `nodes`, coordinate long AI timelines with `MarkstreamVirtualTimeline`, `useMarkstreamVirtualAdapter`, or `vue-virtual…
独立 GitHub 快照 · 自动分类 · 以原作者文档为准
content and nodes, coordinate long AI timelines with MarkstreamVirtualTimeline, useMarkstreamVirtualAdapter, or vue-virtual-scroller, enable optional peers such as stream-diffs, Mermaid, KaTeX, D2, or Infographic, or wire scoped custom components in a non-Nuxt Vue repository.Use this skill when the host app is plain Vue 3, typically Vite-based, and not Nuxt.
markstream-vue plus only the optional peers required by the requested features.markstream-vue/index.css after resets.
@import 'markstream-vue/index.css' layer(components);.markstream-vue/index.css or markstream-vue/index.px.css explicitly.content and choose the renderer mode by surface.
mode="chat" for AI chat or SSE output. It uses lightweight batches, fade=false, and max-live-nodes=0; smooth-streaming="auto" paces visible output.mode="docs" for rich document surfaces. It is the default and enables larger batches, tooltips, and fade.mode="minimal" when the surface is lightweight but not chat.CodeBlockNode, enhanced by stream-diffs when that optional peer is installed and otherwise falling back to <pre><code>. Set render-code-blocks-as-pre=true to force the plain path, or replace code_block through scoped setCustomComponents(...) when the app owns the renderer.dom-mode="minimal" only when the surface can also disable wrapper-dependent features such as fade, batching, deferral, virtualization, typewriter, and custom components; otherwise it falls back to full DOM.typewriter only controls the blinking cursor and defaults to false. Prefer typewriter="simple" for high-frequency chat and precise mode for complex inline cursor placement.:smooth-streaming="false" to preserve raw chunk cadence; set :smooth-streaming="true" to force smooth pacing even on first-screen content (may cause hydration mismatch in SSR).smooth-streaming controls output pacing and fade controls opacity; they can be enabled together. mode="chat" keeps fade=false as a lightweight default. Add fade when gradual text reveal is desired; keep it off when animation cost matters more. Vue 3 append fades use stable batches (200 ms, 50 ms coalescing window, at most four batches per text node); later appends do not restart earlier batches.MarkdownRender starts streaming and later switches to history when final=true.
mode="chat" and final; add fade for text reveal and typewriter only when a cursor is wanted.mode="chat" on the same chat row to avoid switching layout strategy when final=true; use :smooth-streaming="false", typewriter=false, and choose fade independently for the desired entry/reveal effect. Do not bind it to the inverse of streaming state unless that visual policy is intentional.mode="minimal" for lightweight non-chat recovered content, and use mode="docs" only for rich document surfaces, not for finalizing an existing chat message.nodes plus final only when the app needs custom AST control, worker preparsing, or structural updates beyond pacing.html-policy now defaults to safe, and Mermaid strict mode is on by default through mermaid-props.MarkstreamVirtualTimeline when the app does not already own timeline virtualization.vue-virtual-scroller DynamicScroller, use useMarkstreamVirtualAdapter() and bind adapter.markdownProps(item, index) to Markdown items.adapter.measureItem(item, index, el) on the outer timeline row so row chrome is included in item height.metrics.totalHeight through the adapter/virtualizer), not the renderer element's current offsetHeight, because Markdown node virtualization may only mount the live window.adapter.captureThreadState() together with the scroller cache; restore the scroller cache before restoring the Markstream anchor.custom-id plus scoped setCustomComponents(...) for local overrides, or import { VueRendererMarkdown } from markstream-vue and install it when the repo already has an app-level plugin entry.content; choose mode before fine-tuning lower-level render props.mode only when the surface should use rich docs defaults.smooth-streaming="auto") is on by default when typewriter or max-live-nodes <= 0. It only paces the content path; nodes mode is never affected.nodes, use useSmoothMarkdownStream directly: enqueue() chunks, finish() when done, render from visible, and wait for caughtUp before final parsing.useStickToBottom from markstream-vue/utils and call scheduleScrollToBottom() after Vue commits new content. It coalesces writes and preserves manual scrollback; do not run scrollIntoView({ behavior: 'smooth' }) for every token. For long mixed timelines, use MarkstreamVirtualTimeline with stick-to-bottom="auto" instead.mode="docs" only when moving content into a separate rich document surface. See docs/guide/ai-chat-streaming.md for full examples.virtual-scroll only on large Markdown messages.vue-virtual-scroller, keep sessionKey tied to content identity (thread:item:revision) and measurementKey tied to layout identity such as width, theme, font, and density.preloadCodeBlockRuntime. For intentional low-level controller use, import the advanced API directly from stream-diffs; do not depend on a raw-runtime getter from markstream-vue.stream-diffs only; do not install stream-monaco.@pierre/diffs WorkerPoolManager via setStreamDiffsWorkerPool(...) from markstream-vue. The host builds the pool with its own bundler (@pierre/diffs/worker/worker.js?worker) and adds @pierre/diffs as a direct dependency; markstream-vue forwards it as the workerManager runtime option and syncs the active isDark/theme/themes theme to the pool on every change. Without injection, or when the pool reports itself unavailable, highlighting stays on the main thread (unchanged behavior). Do not bundle or spawn the worker inside the library.code-block-options or direct CodeBlockNode.codeBlockOptions. Keep header/toolbar props in code-block-props; Markstream retains ownership of theme, code/language, streaming lifecycle, header, mount/reveal timing, and disposal.html-policy="safe" and Mermaid strict mode unless the task is explicitly preserving trusted legacy behavior.html-policy="trusted" and :mermaid-props="{ isStrict: false }", and call out the trust boundary in the final handoff.markstream-nuxt.docs/guide/quick-start.mddocs/guide/installation.mddocs/guide/usage.mddocs/guide/ai-chat-streaming.mddocs/guide/performance.mddocs/guide/component-overrides.mddocs/guide/code-block-runtime.md