Agent Skills
› lichtblick-suite/lichtblick
› message-pipeline
message-pipeline
GitHub解析MessagePipeline数据总线,涵盖Zustand状态管理、React上下文、订阅合并及渲染流程。用于理解Player与Panel间的数据交互、状态更新机制及性能优化策略。
Trigger Scenarios
查询MessagePipeline架构或数据流
调试面板状态同步问题
了解订阅合并与去重逻辑
分析Zustand store结构
Install
npx skills add lichtblick-suite/lichtblick --skill message-pipeline -g -y
SKILL.md
Frontmatter
{
"name": "message-pipeline",
"description": "Deep MessagePipeline implementation knowledge: zustand store shape, React context provider, subscription merging\/memoization, render-state flow, and the Player→panel data bus."
}
Message Pipeline Skill
The MessagePipeline is the central data bus connecting Players to Panels.
Data Flow
Player (emits PlayerState)
│ playerListener callback
▼
MessagePipeline (zustand store + React context)
│ selector-based notifications
▼
PanelExtensionAdapter (per-panel bridge)
│
▼
Panel (receives RenderState)
Core Files
| File | Role |
|---|---|
packages/suite-base/src/components/MessagePipeline/index.tsx |
React context provider; creates the zustand store and connects to the Player |
packages/suite-base/src/components/MessagePipeline/store.ts |
MessagePipelineInternalState + dispatch actions |
packages/suite-base/src/components/MessagePipeline/types.ts |
MessagePipelineContext — the interface panels see |
packages/suite-base/src/components/MessagePipeline/subscriptions.ts |
Subscription merging + memoization |
packages/suite-base/src/components/MessagePipeline/selectors.ts |
Selector helpers for fine-grained subscriptions |
Store Update Flow
- Player emits state → the
playerListenercallback fires - Store dispatch → the
"update"action merges the newPlayerStateinto internal state - Selectors react → zustand subscribers (panels) are notified via selector equality checks
- Render state built →
PanelExtensionAdapterincrementally buildsRenderStateper panel
Internal Store Actions
"update"— newPlayerStatereceived from the player listener"set-subscriptions"— a panel's subscriptions changed"playback-seek"— user seeks to a new time"set-playback-speed"— playback rate changed
Subscription System
Panels declare the topics they need:
context.subscribe([{ topic: "/camera/image" }]);
The pipeline:
- Collects subscriptions from all active panels
- Merges overlapping subscriptions (deduplicates topics)
- Forwards the merged set to the Player via
player.setSubscriptions() - The Player only iterates topics that are actually subscribed
Subscription Memoization
subscriptions.tsuses reference equality to avoid recomputing the merged subscription set- A Player update is only triggered when the effective topic set changes
MessagePipelineContext (what panels access)
playerState— current player status (playing, paused, error)activeData— messages,currentTime,startTime,endTime, topics, datatypesmessagesByTopic—Map<topic, messages>for the current framesortedTopics— alphabetically sorted topic listsubscriptions— currently active subscriptionsseekPlayback(time)— seek to a specific timesetPlaybackSpeed(speed)— change playback rate
Performance Notes
- Zustand selectors enable per-panel, fine-grained updates (no full re-renders)
messagesByTopicis rebuilt only when new messages arrive (not every frame)- Subscription merging prevents redundant data iteration in the Player
- Render state is built incrementally — only changed fields are recomputed
Skills Reference
- For the panel-side bridge and
RenderStatecontract: loadpanel-extension-apiskill - For Player internals upstream of the pipeline: load
player-internalsskill
Version History
- cab9317 Current 2026-07-24 12:17


