mirror of
https://github.com/getcompanion-ai/co-mono.git
synced 2026-04-16 03:01:56 +00:00
feat(hooks): add setWidget API for multi-line status displays
- ctx.ui.setWidget(key, lines) for multi-line displays above editor - Widgets appear below 'Working...' indicator, above editor - Supports ANSI styling including strikethrough - Added theme.strikethrough() method - Plan-mode hook now shows todo list with checkboxes - Completed items show checked box and strikethrough text
This commit is contained in:
parent
537d672f17
commit
dc44816051
11 changed files with 127 additions and 6 deletions
|
|
@ -131,6 +131,17 @@ export async function runRpcMode(session: AgentSession): Promise<never> {
|
|||
} as RpcHookUIRequest);
|
||||
},
|
||||
|
||||
setWidget(key: string, lines: string[] | undefined): void {
|
||||
// Fire and forget - host can implement widget display
|
||||
output({
|
||||
type: "hook_ui_request",
|
||||
id: crypto.randomUUID(),
|
||||
method: "setWidget",
|
||||
widgetKey: key,
|
||||
widgetLines: lines,
|
||||
} as RpcHookUIRequest);
|
||||
},
|
||||
|
||||
async custom() {
|
||||
// Custom UI not supported in RPC mode
|
||||
return undefined as never;
|
||||
|
|
|
|||
|
|
@ -189,6 +189,13 @@ export type RpcHookUIRequest =
|
|||
notifyType?: "info" | "warning" | "error";
|
||||
}
|
||||
| { type: "hook_ui_request"; id: string; method: "setStatus"; statusKey: string; statusText: string | undefined }
|
||||
| {
|
||||
type: "hook_ui_request";
|
||||
id: string;
|
||||
method: "setWidget";
|
||||
widgetKey: string;
|
||||
widgetLines: string[] | undefined;
|
||||
}
|
||||
| { type: "hook_ui_request"; id: string; method: "set_editor_text"; text: string };
|
||||
|
||||
// ============================================================================
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue