@code-yeongyu/senpi
Version:
Coding agent CLI with read, bash, edit, write tools and session management
31 lines • 1.92 kB
TypeScript
import type { ExtensionUIInputOptions } from "../../core/extensions/types.ts";
import { type SealedAnswerReply, SecretInputRequests } from "../rpc/secret-input-requests.ts";
import type { SealedSecretSource } from "../rpc/secret-sealed-holders.ts";
/**
* A TUI session's own secret prompts offered, sealed, to its same-account presenters (D11 secret phase, S3-6b parity).
* The terminal stays the raiser: its local input and every sealed holder race one latch, and the first answer wins.
* Only the terminal process opens an answer, with the request key its latch holds.
*/
export declare class TerminalSealedSecrets {
readonly requests: SecretInputRequests;
private readonly owners;
private latch?;
private readonly source;
private readonly sessionId;
private readonly unsubscribe;
constructor(source: SealedSecretSource, sessionId: string, admit: () => void);
/** A sealed request for a prompt the terminal raises, or `undefined` when the session has no sealed holder. */
open(title: string, placeholder: string | undefined, opts: ExtensionUIInputOptions | undefined): {
readonly id: string;
readonly result: Promise<string | undefined>;
} | undefined;
receive(connection: string, frame: unknown): Promise<SealedAnswerReply>;
dispose(): void;
private route;
}
/**
* The terminal's secret input when sealed holders may answer too: the local component and the sealed request race,
* the first answer settles both, and the losing side is dismissed. Without a holder, the local component alone.
*/
export declare function raceTerminalSecretInput(sealed: TerminalSealedSecrets | undefined, local: (opts: ExtensionUIInputOptions | undefined) => Promise<string | undefined>, title: string, placeholder: string | undefined, opts: ExtensionUIInputOptions | undefined): Promise<string | undefined>;
//# sourceMappingURL=terminal-sealed-secrets.d.ts.map