wsz987/dsh-channels--packages-channel-control2

@wsz987/channel-control

Universal Channel Control Plane for DeepSeek Harness Channels (configuration, credentials, auth sessions, runtime lifecycle)

包名
@wsz987/channel-control
版本
0.1.0
许可证
MIT
最近更新
2026年8月16日

安装

此插件尚未提供可验证的 bundle,或兼容性检查未通过。请先阅读仓库说明。 阅读完整 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

ManagerResponsibility
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

Related

License

MIT