feat(hooks): expose setTitle to HookUIContext (#446)

This commit is contained in:
Aliou Diallo 2026-01-04 20:55:52 +01:00 committed by GitHub
parent affa618b43
commit 5cb7af1ddc
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 34 additions and 1 deletions

View file

@ -145,6 +145,16 @@ export async function runRpcMode(session: AgentSession): Promise<never> {
// Component factories are not supported in RPC mode - would need TUI access
},
setTitle(title: string): void {
// Fire and forget - host can implement terminal title control
output({
type: "hook_ui_request",
id: crypto.randomUUID(),
method: "setTitle",
title,
} as RpcHookUIRequest);
},
async custom() {
// Custom UI not supported in RPC mode
return undefined as never;

View file

@ -196,6 +196,7 @@ export type RpcHookUIRequest =
widgetKey: string;
widgetLines: string[] | undefined;
}
| { type: "hook_ui_request"; id: string; method: "setTitle"; title: string }
| { type: "hook_ui_request"; id: string; method: "set_editor_text"; text: string };
// ============================================================================