@code-yeongyu/senpi
Version:
Coding agent CLI with read, bash, edit, write tools and session management
24 lines • 1.73 kB
TypeScript
import type { ExtensionAPI, ExtensionContext, ToolDefinition } from "../../types.ts";
import { type EscapeResidueRetry } from "./escape-residue.ts";
import { type AskUserVariant, type QuestionRequest, type QuestionResponse } from "./schema.ts";
export interface AskUserState {
timedOut: boolean;
unavailable: boolean;
/** One refusal per turn of residue calls; the re-calls in a later turn open as written (oh-my-openagent#12797). */
escapeResidue: EscapeResidueRetry;
}
/**
* Deliver a settled async answer as one framed user message. The extension owns
* this so every surface (interactive TUI, RPC) only has to RESOLVE
* the question; a surface that delivered on its own would send it twice. It
* steers into a running turn and follows up when idle - a follow-up always
* triggers a turn, which is what wakes the model after a timeout. A cancelled
* question stays silent unless `showsPartialAnswers` holds: the user chose the
* cancel (or its UI failed) after answering part of it, and those answers go out.
*/
export declare function deliverAnswer(pi: Pick<ExtensionAPI, "sendUserMessage" | "events">, ctx: ExtensionContext, request: QuestionRequest, response: QuestionResponse, variant: "codex" | "claude"): void;
export declare function startQuestion(initialPi: Pick<ExtensionAPI, "sendUserMessage" | "events" | "appendEntry">, initialCtx: ExtensionContext, request: QuestionRequest, signal: AbortSignal | undefined, initialState: AskUserState, variant: "codex" | "claude", { resuming }?: {
resuming?: boolean;
}): Promise<QuestionResponse>;
export declare function createAskUserTool(variant: AskUserVariant, pi: ExtensionAPI, state: AskUserState): ToolDefinition;
//# sourceMappingURL=tool.d.ts.map