UNPKG

@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.

31 lines • 1.18 kB
import { type PersistedCredentials } from "../cloud/credential-store.js"; import { pollOnce } from "./poll-client.js"; import { notify as notifyOs } from "./notifier.js"; import { type WatchTarget } from "./filter.js"; export interface WatchConfig { peerId: string; label?: string; intervalSec: number; cwd?: string; } export interface WatchState { lastMessageId?: string; seen: Set<string>; } export interface WatchContext { creds: PersistedCredentials; target: WatchTarget; poll: typeof pollOnce; notify: typeof notifyOs; } /** Parse `watch` flags. Throws if --peer is missing. */ export declare function parseWatchArgs(argv: string[]): WatchConfig; /** One poll → notify cycle. Advances state; never re-notifies a seen message. */ export declare function runTick(state: WatchState, ctx: WatchContext): Promise<void>; /** * Entry point for `cogent-bridge watch`. Loads creds, primes state (seeds `seen` * from the current backlog WITHOUT notifying), then loops with exponential backoff * on error. Runs until SIGINT/SIGTERM. */ export declare function runWatch(argv: string[]): Promise<void>; //# sourceMappingURL=index.d.ts.map