/** * Subscription-backed providers — use an installed agentic coding CLI (Claude Code, * Codex) as a plain text-completion backend, authenticated by the user's *login* * rather than an API key. * * The value: a user with a Claude Pro/Max or ChatGPT Plus/Pro subscription can power * DQL's AI without pasting an API key. There is no "subscription API key" — the only * sanctioned path is to shell out to the vendor's own client, which owns the OAuth * login. We constrain each CLI to behave as a one-shot text generator (no tools, no * file access, isolated cwd, neutral system prompt) so it slots into the existing * {@link AgentProvider} interface and every downstream flow (routing, synthesis, * conversation) works unchanged. * * Tradeoffs the caller should know: each call spawns a fresh CLI process (seconds of * cold-start latency), and — for Claude — programmatic usage draws from the plan's * Agent-SDK credit, then standard API rates, not the interactive chat pool. */ import { type AgentMessage, type AgentProvider, type ProviderName, type ProviderRunOptions } from '@duckcodeailabs/dql-agent'; export declare function resolveSubscriptionCliTimeoutMs(env?: NodeJS.ProcessEnv): number; /** Detection status surfaced to the UI so users know whether a CLI is usable. */ export interface CliAuthStatus { installed: boolean; loggedIn: boolean; authMethod?: string; subscriptionType?: string; email?: string; detail?: string; } export declare class ClaudeCodeCliProvider implements AgentProvider { readonly name: ProviderName; private readonly command; private readonly defaultModel?; constructor(opts?: { command?: string; model?: string; }); /** Installed AND logged in (checked via `claude auth status --json`). */ available(): Promise; /** Rich detection for the settings UI. */ static detect(command?: string): Promise; generate(messages: AgentMessage[], options?: ProviderRunOptions): Promise; } /** Parse `claude -p --output-format json` stdout (a single result object). */ export declare function parseClaudeResult(stdout: string): { text: string; isError: boolean; } | undefined; export declare class CodexCliProvider implements AgentProvider { readonly name: ProviderName; private readonly command; private readonly defaultModel?; constructor(opts?: { command?: string; model?: string; }); available(): Promise; /** * Detection: binary present + a stored auth file. Codex has no documented * non-interactive `login status` command, so we check `~/.codex/auth.json` * (written by `codex login` for both ChatGPT-account and API-key auth). */ static detect(command?: string): Promise; generate(messages: AgentMessage[], options?: ProviderRunOptions): Promise; } /** Parse `codex exec --json` JSONL for the final `agent_message` text. */ export declare function parseCodexFinalMessage(stdout: string): string | undefined; //# sourceMappingURL=subscription-cli.d.ts.map