CoAgent8 - Source API
    Preparing search index...

    Interface CliAdapter

    Unified contract implemented by all CLI backend adapters.

    interface CliAdapter {
        effortReplacesModelSuffix?: boolean;
        id: string;
        name: string;
        execute(
            prompt: string,
            options?: ExecutionOptions,
        ): Promise<TerminalExecutionResult>;
        inheritedTools?(
            context?: BackendReadContext,
        ): Promise<InheritedTools | undefined>;
        inspectQuota?(
            probe?: AdapterProbeResult,
            context?: BackendReadContext,
        ): Promise<
            | {
                buckets?: {
                    id: string;
                    name: string;
                    remainingFraction: number;
                    resetTime: string;
                    window: string;
                }[];
                headroomPercent?: number
                | null;
                measured: boolean;
                resetsAt?: string | null;
                usedPercent?: number | null;
                window?: string;
            }
            | undefined,
        >;
        listModels?(
            probe?: AdapterProbeResult,
            context?: BackendReadContext,
        ): Promise<ModelCatalog | undefined>;
        observeModel?(
            requested?: string,
            probe?: AdapterProbeResult,
            context?: BackendReadContext,
        ): Promise<string | undefined>;
        probe(context?: BackendReadContext): Promise<AdapterProbeResult>;
    }
    Index
    effortReplacesModelSuffix?: boolean

    The CLI drops an effort suffix of the model and runs the variant of a separately passed effort (agy), so the user's model rules see that variant (EffortRun in contracts/models.ts).

    id: string

    Unique backend identifier.

    name: string

    Human-readable backend name.

    • Reads measured native quota without a model call, for adapters whose probe does not include it. Called by native quota diagnostics; ordinary routing reuses cached measurements. Never called by execute.

      Parameters

      Returns Promise<
          | {
              buckets?: {
                  id: string;
                  name: string;
                  remainingFraction: number;
                  resetTime: string;
                  window: string;
              }[];
              headroomPercent?: number
              | null;
              measured: boolean;
              resetsAt?: string | null;
              usedPercent?: number | null;
              window?: string;
          }
          | undefined,
      >

    • Asks the CLI, without a model turn, which concrete model it runs for a requested name, or without one, for CLIs that resolve names themselves (Claude Code aliases, its account default). The controller passes the answer to execute, so consent and the turn name the same model. Undefined when the CLI cannot say.

      Parameters

      Returns Promise<string | undefined>