@essentialai/cogent-bridge
Version:
Cogent Bridge — cross-agent comms for Claude Code, OpenAI Codex and Slack. Codex users: install with `curl -fsSL https://cogent.tools/install.sh | sh`, then start with `cogent-codex` for real-time peer wake.
35 lines • 1.66 kB
TypeScript
import type { HttpClient } from "../cloud/http-client.js";
/**
* Get the relay's version, using a 60s TTL cache. Returns null on fetch
* failure or malformed response. Does not throw.
*
* @param http Authenticated HttpClient (typically `HttpBackend.http`).
* @param nowFn Override for `Date.now()` (test seam). Defaults to `Date.now`.
*/
export declare function getRelayVersion(http: HttpClient, nowFn?: () => number): Promise<string | null>;
/**
* Wire contracts the relay advertises, or null when the relay could not be reached.
*
* 🔴 null and [] MEAN DIFFERENT THINGS and callers must treat both as "no support":
* - `[]` the relay answered and named nothing (an older build).
* - `null` we do not know (unreachable / malformed).
* Use relaySupports() rather than inspecting this directly.
*/
export declare function getRelayCapabilities(http: HttpClient, nowFn?: () => number): Promise<string[] | null>;
/**
* Does the relay accept this wire contract?
*
* 🔴 FAILS SAFE. Unknown is NOT support. The message POST schema is `.strict()`, so guessing wrong
* in the optimistic direction is a hard 400 on every send — the 2026-08-07 outage and the
* 2026-09-02 near-miss were both exactly that. Guessing wrong in this direction merely omits an
* optional field.
*/
export declare function relaySupports(http: HttpClient, capability: string, nowFn?: () => number): Promise<boolean>;
/**
* Test-only helper to clear the module-scoped cache. Call from beforeEach
* in test suites that exercise the cache.
*
* @internal
*/
export declare function __resetCacheForTest(): void;
//# sourceMappingURL=relay-version-cache.d.ts.map