LeoYeAI/agent-master-skills / skills/agent-comm-hub
agent-comm-hub
Flagged多智能体协同通信基础设施——基于 MCP+SSE 的实时消息、任务调度、记忆共享与进化引擎。支持 WorkBuddy、Hermes、QClaw 及任意 MCP 兼容 Agent 接入。53 个 MCP 工具、4 级权限、零外部依赖 Python SDK。触发词:agent通信、智能体通信、hub通信、多智能体、跨agent通信、任务调度、assign_task、send_message、hermes通信、workbuddy通信、agent hub、通信hub、mcp通信、记忆共享、进化引擎、策略共享、经验分享、共享记忆,共同进化
src/dedup.d.ts
View on GitHub/**
* 获取 sender 的下一个 nonce(递增,持久化)
* @returns 递增后的 nonce 值
*/
export declare function nextNonce(senderId: string): number;
/**
* 获取 sender 的当前 nonce(不递增)
*/
export declare function currentNonce(senderId: string): number;
/**
* 重置 sender 的 nonce(测试用)
*/
export declare function resetNonce(senderId: string): void;
/**
* 计算去重哈希(不含 nonce)
* dedup_hash = sha256(sender + receiver + content)
* 用于检测完全相同的消息(防止重复发送)
*/
export declare function computeDedupHash(sender: string, receiver: string, content: string): string;
/**
* 计算消息完整性哈希(含 nonce)
* msg_hash = sha256(sender + receiver + content + nonce)
* 用于防篡改 + 客户端验证
*/
export declare function computeMsgHash(sender: string, receiver: string, content: string, nonce: number): string;
/**
* 检查消息是否重复(基于 msg_hash)
* @returns true = 重复(应拒绝),false = 新消息
*/
export declare function isDuplicate(msgHash: string): boolean;
/**
* 记录消息哈希到去重缓存
*/
export declare function recordHash(msgHash: string, senderId: string, nonce: number): void;
/**
* 消息体安全校验(防 prompt injection 和格式攻击)
*
* 检查项:
* 1. 内容非空
* 2. 长度限制(50KB)
* 3. 不包含 NULL 字节(\x00 分界符保留)
* 4. 不包含 SSE 注入模式(data: / event: / id:)
*
* @returns { safe: true } 或 { safe: false, reason: string }
*/
export declare function validateMessageBody(content: string): {
safe: boolean;
reason?: string;
};
/**
* 完整的消息去重流程
*
* 1. 校验消息体
* 2. 计算去重哈希(不含 nonce)并检查重复
* 3. 分配 nonce
* 4. 计算完整性哈希(含 nonce)
* 5. 记录去重哈希
*
* @returns
* - { ok: true, msgHash, nonce } — 消息可以发送
* - { ok: false, reason } — 消息被拒绝
*/
export declare function dedupMessage(sender: string, receiver: string, content: string): {
ok: true;
msgHash: string;
nonce: number;
} | {
ok: false;
reason: string;
};
/**
* 清理过期的去重缓存条目
*/
export declare function cleanupExpiredEntries(): number;
/**
* 启动 TTL 定时清理
*/
export declare function startDedupCleanup(): void;
/**
* 停止 TTL 定时清理
*/
export declare function stopDedupCleanup(): void;
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| reverse-engineer-anythingmorluto/reaReverse engineer native, managed, Electron/JavaScript, packaged, firmware, and browser targets with REA, and build agent environments (AgentEnv bundles) of web applications from a live instance or a capture, and of Linux desktop apps with a task from a request. Use shipped-artifact or requested runtime evidence to explain features, compare versions, decompile code, or guide a reconstruction. Skip REA for ordinary source-repository architecture analysis. | Stars: 472k | Updated | Claude CodeCodex | Verified | Install |
| diagnosing-superpowersobra/superpowersUse when a superpowers session went wrong and your human partner wants to know why — repeated work, ignored plans, stumbles, poor results, a skill that didn't fire, "it took too long", "why is it so expensive", "what is it doing" — or wants to build a bug report for the superpowers maintainers, for the current session or a past one identified by id or path, on any harness. | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| dispatching-parallel-agentsobra/superpowersUse when facing 2+ independent tasks that can be worked on without shared state or sequential dependencies | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| executing-plansobra/superpowersUse when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is available | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |