mirror of
https://github.com/NanmiCoder/cc-haha
synced 2026-07-16 13:03:31 +08:00
The desktop app and documentation need to present the new logo consistently, so the canonical 1024px source icon now feeds the Tauri icon family, desktop public assets, README images, and VitePress brand imagery. Constraint: Tauri bundle icons are generated assets and must be refreshed from the source icon rather than relying on README or public image replacement alone Rejected: Rename logo paths | existing README, desktop, and docs references can keep stable paths and pick up the new files directly Confidence: high Scope-risk: moderate Directive: Regenerate desktop/src-tauri/icons whenever desktop/src-tauri/app-icon.png changes Tested: cd desktop && bun run build; npm run --loglevel=error docs:build; git diff --check; iconutil expanded icon.icns size ladder Not-tested: full local quality gate per request
3.8 KiB
3.8 KiB
Claude Code Channel System Documentation
Complete technical analysis of remote Agent control via IM platforms
Documentation
01-channel-system.md — Channel System Architecture
A deep dive into the design and implementation of Claude Code's Channel system from a source code perspective, covering:
- What is a Channel: Core concepts of IM integration, MCP protocol foundations
- Architecture Overview: End-to-end message flow, component relationships
- Message Protocol: Inbound notifications, XML wrapping, outbound tool calls
- Six-Layer Access Control: Capability → Runtime gate → OAuth → Org policy → Session allowlist → Plugin approval
- Permission Relay System: Remote tool execution approval, 5-letter request IDs, multi-source racing
- Plugin Architecture: Channel manifest declarations, user config flow, scoped naming
- UI Components: Terminal message rendering, status notices, developer warning dialogs
- Security Design: XML injection prevention, marketplace verification, trust boundary analysis
Target audience: Developers, architects, and plugin authors interested in AI Agent IM integration architecture
Illustrations
All illustrations use a dark background (#1a1a2e) with Claude Code Haha orange-blue accents (#FF7A00).
| Image | Description | Document |
|---|---|---|
01-channel-overview.png |
Channel system architecture overview | Architecture |
02-message-flow.png |
End-to-end message flow: IM → Agent → IM | Architecture |
03-access-control.png |
Six-layer access control gates | Architecture |
04-permission-relay.png |
Permission relay system flow | Architecture |
Quick Start
Users
- Read the Channel System Architecture
- Learn how to start IM integration with
--channels - Understand how different platforms (Telegram, Feishu, Discord) connect
Plugin Developers
- Read the Plugin Architecture section
- Understand the
plugin.jsonChannel declaration format - Implement the MCP Server
notifications/claude/channelprotocol - Key source files:
src/services/mcp/channelNotification.ts— Core gating and message wrappingsrc/services/mcp/channelPermissions.ts— Permission relay systemsrc/services/mcp/channelAllowlist.ts— Allowlist managementsrc/utils/plugins/mcpPluginIntegration.ts— Plugin MCP integrationsrc/utils/plugins/schemas.ts— Plugin manifest Channel schema
Core Concepts Reference
| Concept | Description |
|---|---|
| Channel | An MCP Server declaring claude/channel capability that can push IM messages to the Agent |
| Channel Entry | Parsed --channels argument entry, either plugin or server kind |
| Channel Gate | Six-layer access control gate deciding whether to register notification handlers |
| Permission Relay | Mechanism for forwarding tool execution approval prompts to IM platforms |
| Channel Plugin | A plugin declaring channels field in its plugin.json |
| Scoped Name | Plugin server name with scope prefix: plugin:{pluginName}:{serverName} |
| Short Request ID | 5-letter permission request identifier generated via FNV-1a hash |
| Channel Tag | <channel> XML tag wrapping IM message content and metadata |
| Dev Channels | Channels loaded via --dangerously-load-development-channels for local development |
| tengu_harbor | GrowthBook runtime feature flag controlling the Channel system master switch |