civaapple-alt/mini-dsh--packages-plugins-counter ↗★ 7

@mini-dsh/plugin-counter

🚀 Educational & minimalist DeepSeek Harness (DSH) architecture implementation powered by Cordis microkernel. 极简版 DeepSeek Harness 架构实现与学习指南。 适合学习前后端插件协作的开发者,演示服务注册、路由与插槽组件。

Package
@mini-dsh/plugin-counter
Compatibility
Unverified
Version
0.1.0
License
MIT
Last updated
Aug 18, 2026

Install

This plugin has no verified bundle, or compatibility checks failed. Read the repository notes first. Read the full README ↗

@mini-dsh/plugin-counter

English | 中文

计数器服务全栈演示插件(Full-Stack Counter Plugin)。


插件架构与 Cordis 契约

  1. Host 后端 (src/index.ts):
    • 提供 ctx.counter(CounterService),在 Node 内存中维护 count 状态;
    • 依赖注入 ctx.inject(['server', 'counter']),挂载 /api/count(GET 获取当前值,POST 执行自增);
    • 依赖注入 ctx.inject(['clientModules']),向 Host 注册自己的前端 Bundle 路径。
  2. Client 前端 (src/client.ts):
    • 依赖注入 ctx.inject(['slots']);
    • 向 sidebar.widgets 插槽注册计数器小组件,支持实时展示与点击加一。

对应 DeepSeek Harness (dsh) 模块