wsz987/dsh-channels--packages-channel-control ↗★ 2
@wsz987/channel-control
用于管理 DSH 渠道配置、凭据、认证会话及生命周期的通用渠道控制面插件。
AI 分析
核心用途是提供统一的渠道接入与控制逻辑。适合需要开发或管理多种第三方即时通讯渠道(如钉钉等)接入 DSH 的开发者。
安裝
此插件尚未提供可驗證的 bundle,或相容性檢查未通過。請先閱讀倉庫說明。 閱讀完整 README ↗
說明文件
閱讀完整 README ↗@wsz987/channel-control
Universal Channel Control Plane for DeepSeek Harness Channels.
Mounts a Cordis service at ctx.channelControl that owns channel configuration,
credentials, interactive auth sessions and runtime lifecycle. It is
adapter-agnostic: every channel is driven through its ChannelDefinition, never
through per-channel conditional code.
Install
pnpm add @wsz987/channel-control
As a Cordis plugin:
- id: channels-control
name: '@wsz987/channel-control/plugin'
inject:
- channels
- credentials
What it does
| Manager | Responsibility |
|---|---|
definitions (ChannelDefinitionRegistry) | Holds one ChannelDefinition per channel, registered by channel plugins |
credentials (CredentialManager) | Thin structural seam over ctx.credentials; secret values are never returned |
auth (AuthSessionManager) | Drives QR/credential auth sessions (beginAuth, pollAuth, submitAuthInput, cancelAuth) |
runtime (ChannelRuntimeManager) | Mounts/starts/stops/restarts adapter instances and tracks health |
The service auto-starts configured channels when their definition is registered, and stops all mounts when the owning Cordis fiber unloads. A single misconfigured channel never crashes profile activation.
API surface
ctx.channelControl.listChannels(); // ChannelSummary[]
ctx.channelControl.getSetup('qq'); // setup descriptor
ctx.channelControl.getConfiguredState('qq');
ctx.channelControl.saveConfig('qq', patch); // rejects secret fields
ctx.channelControl.saveCredential('qq', 'appSecret', value);
ctx.channelControl.applySetup('qq', input); // transactional setup + reconcile
ctx.channelControl.beginAuth('weixin', input);
ctx.channelControl.pollAuth(sessionId);
Development
pnpm --filter @wsz987/channel-control build
pnpm --filter @wsz987/channel-control typecheck
pnpm --filter @wsz987/channel-control test