import { type RunningChildProcess } from './child-process.js'; import { ControllerAgentRuntime } from './provider-runtime.js'; import { type AgentRuntimeFollowupInput, type AgentRuntimeFollowupResult, type AgentRuntimeInput, type AgentRuntimeResult, type GrokCliAgentProviderConfig } from './contract.js'; /** * Launch args for ACP. Never carries `--effort`: reasoning effort is applied after * session init via a live-capability-gated `session/set_model`, so the ACP catalog * is the single authority (a name heuristic could pass `--effort` to a model that * silently ignores it). */ export declare function grokAcpLaunchArgs(config: GrokCliAgentProviderConfig): string[]; export declare class GrokCliAgentRuntime extends ControllerAgentRuntime { readonly command: string; readonly env: Record | undefined; readonly kind = "grok-cli"; private readonly config; private retainedFollowups?; constructor(config: GrokCliAgentProviderConfig, command: string); run(input: AgentRuntimeInput): Promise; appendToActiveRun(input: AgentRuntimeFollowupInput): Promise; private followupsForItem; private ensureController; } declare class GrokAcpController { private readonly child; private readonly configuredEffort?; private readonly configuredModel?; private readonly stdoutLines; private initialized?; private nextRequestId; private readonly pending; private readonly pendingTools; private currentTurn?; private readonly activeToolIds; private readonly quiescentWaiters; private readonly usageCaptureId; private usageSequence; private latestUsage?; private turnCompletion?; /** True while a session/prompt RPC is outstanding. */ private promptInFlight; private actualModel?; private contextWindow?; private currentEffortSnapshot?; private appliedEffort; readonly completion: Promise<{ stdout: string; stderr: string; }>; sessionId: string; constructor(child: RunningChildProcess, configuredEffort?: string | undefined, configuredModel?: string | undefined); ensureSession(input: AgentRuntimeInput): Promise; startTurn(input: AgentRuntimeInput, prompt: string, followups: string[]): Promise; cancelActiveTurn(): Promise; appendPrompt(prompt: string): boolean; acceptStdoutChunk(chunk: string): Promise; acceptStderrChunk(chunk: string): Promise; kill(signal?: NodeJS.Signals): void; snapshot(): import("../../shared/snapshot.js").ProviderChildHealthSnapshot; waitForQuiescent(signal?: AbortSignal): Promise; private initializeSession; private createSession; private runTurnQueue; private runOnePrompt; private acceptLine; private handleResponse; private handleAgentRequest; private notify; private captureModelAuthority; /** * Apply the configured reasoning effort via a same-model `session/set_model`, * exactly once, before the first prompt. Fail closed: skip when nothing is * configured, when the live current model is unknown, when no capability snapshot * was captured for *that exact* model, or when the effort is not advertised — never * infer support from the model name, and never reuse a snapshot from another model. */ private applyReasoningEffort; private handleNotification; private handleToolCallStart; private handleToolCallUpdate; private emitDeferredToolStarted; private emitToolStarted; private request; private abortCurrentTurn; private clearCurrentTurn; private finishCurrentTurn; private resolveQuiescentWaitersIfReady; private rejectQuiescentWaiters; private rejectAllPending; private writeJson; } /** * Resolve Grok ACP tool identity for Activity. Prefer canonical * `_meta['x.ai/tool'].name` (e.g. list_dir), then title/kind patterns. * Live ListDir shape: title `List \`path\``, kind Other, meta name list_dir. */ export declare function grokToolName(data: Record): string; /** * Tool identity from a single ACP frame, or undefined when the frame supplies no * identity signal (no meta name / title / kind / name). Distinguishing "identity * absent" from the intentional `Tool` fallback lets a terminal update without * identity keep the start frame's already-resolved name instead of clobbering it. */ export declare function grokToolIdentity(data: Record): string | undefined; /** Exported for unit tests — keep Activity targets aligned with live Grok ACP. */ export declare function summarizeGrokToolInput(name: string, input: Record, data?: Record): { command?: string; diff?: string; target?: string; }; export {}; //# sourceMappingURL=grok.d.ts.map