UNPKG

@code-yeongyu/senpi

Version:

Coding agent CLI with read, bash, edit, write tools and session management

24 lines • 1.4 kB
/** * Bridge OAuth login prompts onto the RPC extension UI dialog channel. * * Providers whose flow needs mid-flow input (a pasted authorization code, an * account choice) call `interaction.prompt(...)`, which AuthStorage routes to * `onPrompt`/`onSelect`. Over RPC those become `extension_ui_request` dialogs * the client answers with `extension_ui_response`. * * Cancellation has two independent sources and both must release the dialog: * the login-wide signal (login_cancel, or the login having settled) and the * per-prompt `AuthPrompt.signal` a provider aborts when an out-of-band step * wins the race — e.g. the chatgpt-subscription login racing a manual-code * prompt against its local callback server. A released dialog rejects with "Login cancelled", * matching the interactive TUI. * * Only the prompt text, placeholder, and option labels cross the wire; the * client's answer is consumed in-process and never echoed back. */ import type { OAuthLoginCallbacks } from "@earendil-works/pi-ai"; import type { ExtensionUIContext } from "../../core/extensions/types.ts"; type RpcLoginPromptCallbacks = Pick<OAuthLoginCallbacks, "onPrompt" | "onSelect">; export declare function createRpcLoginPromptCallbacks(ui: Pick<ExtensionUIContext, "input" | "select" | "capabilities">, signal: AbortSignal): RpcLoginPromptCallbacks; export {}; //# sourceMappingURL=login-prompts.d.ts.map