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.

39 lines • 1.82 kB
/** * Claude CLI flag preflight (mock-hidden-gap audit, 2026-05-27, gap 5 — cc-cli * counterpart of codex-preflight.ts). * * Why this exists: `execClaude` (cc-cli.ts) drives auto-relay by spawning * `claude --resume <id> --dangerously-skip-permissions --no-session-persistence * --strict-mcp-config -p <msg>`. The unit tests mock `child_process`, so they * only prove the args we *intend* — NOT that the installed `claude` accepts them. * Startup previously ran only `claude --version`, which does not validate flag * parsing. This preflight runs `claude --help` and warns loudly if the installed * CLI drops/renames a flag we depend on, instead of failing on the first * auto-relay. Mirrors codex-preflight.ts exactly. */ /** * The long-form flags `execClaude` emits. Keep in sync with `execClaude` in * cc-cli.ts. We assert long forms (`--print` documents the `-p` we pass; the * short form always co-documents with its long form in claude --help). */ export declare const EXPECTED_CLAUDE_FLAGS: ReadonlyArray<{ flag: string; usedFor: string; }>; export interface ClaudeFlagAnalysis { missing: string[]; checked: string[]; } /** * Pure decision logic: given the text of `claude --help`, return which expected * flags are absent. Unit-testable with no spawning. */ export declare function analyzeClaudeHelp(helpText: string): ClaudeFlagAnalysis; /** * Verify the claude binary exists and that `claude --help` documents the flags * auto-relay emits. Never throws — a preflight failure must not stop startup; we * only want visibility. Returns the analysis, or null if help could not be * obtained (binary missing / call failed). */ export declare function preflightClaude(claudePath: string): Promise<ClaudeFlagAnalysis | null>; //# sourceMappingURL=claude-preflight.d.ts.map