import { type ExecResult } from "../../exec/exec"; import type { ExtensionContext, InputEvent, InputEventResult } from "./types"; export declare const OOO_BRIDGE_RECURSION_ENV = "_OUROBOROS_GJC_BRIDGE_DEPTH"; export declare const OOO_BRIDGE_CONTINUE_EXIT_CODE = 78; export declare const OOO_BRIDGE_TIMEOUT_ENV = "OUROBOROS_GJC_BRIDGE_TIMEOUT_MS"; export interface ExactPrefixCommandBridgeOptions { /** Bare command prefix to intercept, without trailing whitespace. */ prefix: string; /** Command executable to run when the prefix matches. */ command: string; /** Arguments inserted before the intercepted input text. */ args?: string[]; /** Environment variable used as the recursion-depth guard. */ recursionEnv?: string; /** Exit code that maps to extension pass-through instead of handled input. */ continueExitCode?: number; /** Optional dispatch timeout in milliseconds. */ timeout?: number; /** Dispatch implementation. Defaults to the shared command executor in the extension context cwd. */ dispatch?: (command: string, args: string[], ctx: ExtensionContext, options: { timeout?: number; }) => Promise; } /** * Build an extension `input` handler for an exact-prefix command bridge. * * Matching input is passed to `command` as `args + [event.text]`. A zero exit code * handles the input, `continueExitCode` returns pass-through, and any other * non-zero exit code surfaces an error and handles the input so the failed * command is not forwarded to the model. The recursion * guard prevents extension-originated or nested dispatch from re-entering the * bridge while the child command runs. */ export declare function createExactPrefixCommandBridge(options: ExactPrefixCommandBridgeOptions): (event: InputEvent, ctx: ExtensionContext) => Promise;