Slot注册表纯核心库,提供SlotMap声明合并、单一register组合API、四种props共享类型、store-seat类型及renderer安装契约。无运行时依赖,仅含类型定义,供需要声明式UI插槽系统的dsh插件开发者使用
ⓘ 此插件是大仓库 deepseek-ai/deepseek-harness 的子包,星数与活跃度统计的是整个仓库。
- 语言
- TypeScript
- License
- MIT
- 分支
- master
安装
$ dsh plugin --profile web add npm:@deepseek-ai/dsh-client-ui-slots在终端中运行以上命令,通过 dsh CLI 安装此插件。可在右上角切换 Profile。 第一次用 dsh?看这篇新手教程
对话式安装
帮我安装 DeepSeek Harness 插件 deepseek-ai/deepseek-harness/packages/client/ui-slots:先查看仓库 https://github.com/deepseek-ai/deepseek-harness 确认安全性,然后执行安装命令并验证插件加载成功。
把这段指令粘贴给 DSH Web GUI 里的助手,由它代你完成安装与验证。
English | 中文
Slot registry pure core, slot terminal design: SlotMap declaration merging, the single register composition API on SlotCore, the four-share component-props type family, the store-seat type family, and the renderer installation contract. React types only at runtime — the package is React-free and cordis-free.
One register({ name, children?, store?, inject?, ...kind }, Component) call contributes a component into a declared slot and, in the same breath, declares child slots (declaration = render authorization = runtime spec, one table), a store seat, and the registrant's business face. The component is checked at the call site against ComposedProps — the intersection of four shares, each derived from its single source of truth:
| share | type | source |
|---|---|---|
| runtime | PropsRuntime<K> | SlotMap entry: owner (parent's renderSlot call site) + session standard kit + global seat |
| child render | PropsRenderSlots<S> | the register call's children key set (statically narrowed renderSlot) |
| store | PropsStore<H> | the declared handle: useStore selector hook + draft-stripped actions |
| business | I | inferred from the inject factory's return |
Chain-kind slots invert keyed routing — entries self-nominate instead of the dispatch site picking an entryKey: each registration carries a pure ChainSelect selector (plus optional ascending priority, ties in registration order), the first non-null return elects its entry and becomes the component's matched prop, and all-null falls to the owner's renderSlotChain fallback (ChainRenderOpts).
The standard-kit interfaces (SessionStandardProps, GlobalStandardProps) are declared empty here and merged by the runtime package (same declare-merge pattern as SlotMap keys). The renderer binds the runtime's session and workspace observable sources into selector hooks. Inject factory parameters derive from the declaration (InjectParams): session slots get sessionId, a declared store appends baked actions, nothing else — data access lives in the apply closure's ctx.
The store family (defineStore spec in / StoreHandle<T, A> out) types the store seat: init infers the state schema, actions is the complete draft-transform write set, BakedActions strips the draft parameter into the callbacks components and inject factories receive. The defineStore value implementation lives in the runtime package (the engine's home) and satisfies the DefineStore contract exported here. Engine products and the renderer host contract carry bare snapshot sources (getSnapshot/subscribe), never React hooks — hook binding belongs to the render machinery; only the props-contract hook type (SnapshotSelectorHook) lives here.
SlotCore seeds the a-priori 'root' slot at construction and enforces load-time validation (undeclared-slot registration, duplicate child declaration, one shared handle under two scopes, a chain registration without select — all throw at register). An entry's disposer collapses its declared child slots recursively: ledger rows, contributions, and store mounts die on one lifecycle axis. Each key also carries a declaration epoch that advances only on declaration and collapse; the runtime uses it for ctx.slots.inject, independently from ordinary entry versions. renderer.ts carries the installation contract (SlotRenderer, SlotRendererHost) plus StaleAuthorizationError/SlotOwnershipError; ui-renderer owns both the implementation and its plugin-lifecycle installation.
Model Experience
None, as the slot registry is browser-side UI plumbing; nothing here reaches a model request.
KV Cache effect
None; this package neither assembles nor sends a provider request.
Known Limitations and Deferred Work
isLivescans all records linearly — fine at UI-plugin registration counts (tens); revisit with an entry→record backref if ledgers ever grow hot.- The
__rendersphantom anchor is visible onPropsRenderSlots— the same accepted noise as the type-chain design's__accepts: generic method signatures compare loosely across key unions, so the contravariant marker is what enforces "component key set ⊆ children declaration".
收录徽章
[](https://deepseek-plugin.org/plugins/deepseek-ai/deepseek-harness/packages/client/ui-slots)把这段 markdown 粘贴到你的 GitHub README,链接回本插件详情页。徽章只声明已被本站收录,不代表安全认证。