import type { TunnelHandshakeHeaders } from '../_vendored-contracts/skill-tunnel.js'; import type { LocalSkillRegistryEntry } from '../skill-runner/types.js'; export interface BuildHandshakeInput { agentToken: string; /** SKILLFM_SKILL_AUTH_SECRET — HMAC 共享密钥 */ authSecret: string; /** 本地已跑的 skill daemon 列表(来自 M1 readRegistry)*/ localSkills: LocalSkillRegistryEntry[]; /** @skillfm/local 运行时版本 */ skillfmLocalVersion: string; } export interface HandshakeArtifact { headers: TunnelHandshakeHeaders; /** 本次 nonce(保留供上层重放检测/调试;正式请求不传)*/ nonce: string; } /** 生成 16-byte nonce hex(契约 §5.1 16 byte hex = 32 字符)*/ export declare function generateNonce(): string; export declare function computeAgentId(agentToken: string): string; export declare function computeTunnelSignature(agentToken: string, nonce: string, authSecret: string): string; /** 组装 `slug@version,slug@version` */ export declare function formatLocalSkills(skills: LocalSkillRegistryEntry[]): string; /** 组装 `slug=http://127.0.0.1:port,slug=http://127.0.0.1:port` */ export declare function formatLocalSkillEndpoints(skills: LocalSkillRegistryEntry[]): string; /** * 构造一次握手所需的全部 9 个头。 * 每次 connect / reconnect 必须调用一次(nonce 随机)。 */ export declare function buildHandshakeHeaders(input: BuildHandshakeInput): HandshakeArtifact; /** * JSON-RPC meta.hmac 签名: HMAC-SHA256(id || method || JSON.stringify(params), secret) * DELTA §5.4 */ export declare function computeRpcMetaHmac(id: string, method: string, params: unknown, authSecret: string): string; //# sourceMappingURL=handshake.d.ts.map