@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.
50 lines • 1.87 kB
TypeScript
export declare enum BridgeErrorCode {
CLI_NOT_FOUND = "CLI_NOT_FOUND",
CLI_TIMEOUT = "CLI_TIMEOUT",
CLI_EXEC_FAILED = "CLI_EXEC_FAILED",
STATE_CORRUPT = "STATE_CORRUPT",
STATE_WRITE_FAILED = "STATE_WRITE_FAILED",
LOCK_TIMEOUT = "LOCK_TIMEOUT",
LOCK_STALE = "LOCK_STALE",
PEER_NOT_FOUND = "PEER_NOT_FOUND",
INVALID_INPUT = "INVALID_INPUT",
STARTUP_FAILED = "STARTUP_FAILED",
DIR_NOT_WRITABLE = "DIR_NOT_WRITABLE",
NETWORK_TIMEOUT = "NETWORK_TIMEOUT",
JOIN_NOT_CONFIRMED = "JOIN_NOT_CONFIRMED",
/** cogent_join_session: the relay answered 404 to the name resolve (COG-81). Never any other status. */
CHANNEL_NOT_FOUND = "CHANNEL_NOT_FOUND",
/** The relay refused a peerId held by another connection (AUD-003). Never a reason to rename. */
PEER_NOT_YOURS = "PEER_NOT_YOURS",
/** COG-85: another live bridge in this folder holds the peerId (not this agent's own). Retry later, never rename. */
PEER_HELD_IN_FOLDER = "PEER_HELD_IN_FOLDER"
}
export declare class BridgeError extends Error {
readonly code: BridgeErrorCode;
readonly suggestion?: string;
/** Relay hint: ms until a refused peerId can be reclaimed (PEER_NOT_YOURS only). */
retryAfterMs?: number;
constructor(code: BridgeErrorCode, message: string, suggestion?: string);
}
export declare function toolResult(text: string, isError?: boolean): {
isError?: true | undefined;
content: {
type: "text";
text: string;
}[];
};
export declare function errorResult(error: unknown): {
isError?: true | undefined;
content: {
type: "text";
text: string;
}[];
};
export declare function successResult(data: Record<string, unknown>): {
isError?: true | undefined;
content: {
type: "text";
text: string;
}[];
};
//# sourceMappingURL=errors.d.ts.map