/** * AgentBBS MCP Tools — Federated business-domain BBS room surface (ADR-164 Phase 1). * * Exposes the `agentbbs@~0.1.0` (a sibling BBS-style federation peer by the same * author as ruflo) as MCP tools so ruflo agents can register business rooms * (#sales, #finance, #marketing, ...), publish/watch typed envelopes, and * mint single-use human-join tokens for SSH/web cockpit access. * * Motivation: * ADR-164 wires the "business autopilot" cockpit on top of the existing * ruflo federation primitives (FederationEnvelope, PII pipeline, budget * circuit breaker). The 4 tools here are the ruflo-side handles into the * agentbbs Rust workspace (`crates/agentbbs-federation/` and * `crates/agentbbs-mcp/`) that already implement Ed25519-signed envelopes * and an MCP transport. Phase 1 ships the surface; Phases 2-5 wire deeper. * * Architectural constraint (mirrors metaharness-tools.ts / agenticow-tools.ts): * - `agentbbs` lives in `optionalDependencies` — must NOT be a hard runtime dep * - When the package is missing, every tool returns * `{success: true, degraded: true, reason: 'agentbbs-not-found'}` * so callers see one contract regardless of install state * - Phase 1: polling-based watch (streaming subscriptions are Phase 4) * * Presence check: the published `agentbbs` package (as of 0.2.1) is a CLI-only * launcher — a `bin` script with no importable JS entry point (no `main` / * `exports` field) — that downloads/builds a Rust binary and shells out to it. * `await import('agentbbs')` can therefore never resolve, even when the CLI is * correctly installed and on PATH: there is no module for Node to find. This * previously made every tool report `degraded: true` unconditionally, * regardless of install state. Detect real availability instead by probing the * CLI itself, matching how the rest of this codebase treats optional * command-line tools (`shutil.which()`-style guards) rather than assuming a * package shape the dependency doesn't have. * * @module @claude-flow/cli/mcp-tools/agentbbs */ import type { MCPTool } from './types.js'; /** Last envelope's seq by scanning only the file tail; full-read fallback keeps it exact. */ export declare function nextSeq(path: string): number; /** Timestamp (ms) of the most recent PeerHello for a room, or -Infinity if none. */ export declare function lastPeerHelloMs(logPath: string): number; /** * Whether a `register` call should append a PeerHello: only for a genuinely new * registration, or once the heartbeat window has elapsed since the last one. * A re-register within the window is a retry and must NOT spam a near-identical * hello. Pure — the decision the handler makes, exported for test. */ export declare function shouldEmitHello(alreadyRegistered: boolean, nowMs: number, lastHelloMs: number, windowSecs: number): boolean; /** Collapse duplicate envelopeIds, preserving order (first occurrence wins). Pure. */ export declare function dedupEnvelopes(list: T[]): T[]; export declare const agentbbsTools: MCPTool[]; //# sourceMappingURL=agentbbs-tools.d.ts.map