@code-yeongyu/senpi
Version:
Coding agent CLI with read, bash, edit, write tools and session management
36 lines • 1.87 kB
TypeScript
import type { ExtensionAPI, ExtensionContext, ExtensionUIDialogOptions, QuestionCancelOrigin } from "../../types.ts";
import type { PendingQuestion } from "./pending.ts";
import type { QuestionRequest, QuestionResponse } from "./schema.ts";
import type { AskUserState } from "./tool.ts";
/** Additive options consumed by question-capable UI bridges. Delivery belongs to the UI. */
export interface QuestionDialogOptions extends ExtensionUIDialogOptions {
deliver: "tool-result" | "user-message";
hardDeadlineAtMs: number;
/** Live absolute idle deadline; question UI countdowns are display-only when supplied. */
getDeadlineAtMs?: () => number;
initialDraft?: {
answers: QuestionResponse["answers"];
comment?: string;
};
onProgress: (draft: {
answers?: QuestionResponse["answers"];
comment?: string;
}) => void;
}
export interface PendingQuestionEntry {
request: QuestionRequest;
pending: PendingQuestion;
completion: Promise<QuestionResponse>;
cancel(origin: QuestionCancelOrigin, message?: string, reportDetachedLoss?: boolean): void;
detach(): void;
rebind(pi: ExtensionAPI, ctx: ExtensionContext, state: AskUserState): void;
reattach(): void;
}
type QueuedOutcome = (pi: ExtensionAPI, ctx: ExtensionContext) => void;
/** A terminal request awaiting a live runner is no longer a pending question. */
export declare function queueQuestionOutcome(sessionId: string, outcome: QueuedOutcome): void;
export declare function deliverQueuedQuestionOutcomes(sessionId: string, pi: ExtensionAPI, ctx: ExtensionContext): void;
export declare function getPendingQuestions(sessionId: string): readonly PendingQuestionEntry[];
export declare function registerPendingQuestion(sessionId: string, entry: PendingQuestionEntry): () => void;
export {};
//# sourceMappingURL=registry.d.ts.map