feat: human error states, operator toasts and a queue/origin view in the omp UI

- classify transport and API failures into a short state with the next step
- count undelivered messages and show them next to the sent counter
- toast on owner paired, connection recovered and reply not delivered (throttled)
- second status line previews the next queued turns
- host spinner names the Telegram prompt while its turn runs
- sanitize every Telegram-controlled string that reaches the widget
This commit is contained in:
evandrodevbr committed 2026-10-01 17:33:37 -03:00
1 parent 9435ff709b
commit 057281a3bb
19 files changed
+862 -22

No files matched your search

+21
View File
@@ -260,6 +260,27 @@ export function isTerminalAgentEnd(event: AgentEndEvent): boolean {
return !("willContinue" in event && event.willContinue === true);
}
/** Show a one-off toast in the host UI; a no-op where the host has no UI. */
export function notifyExtensionContext(
ctx: ExtensionContext,
message: string,
level: "info" | "warning" | "error",
): void {
ctx.ui.notify(message, level);
}
/**
* Replace the host spinner text, or restore its default with `undefined`.
* Pi-compatible hosts do not all expose `setWorkingMessage`; the spinner text
* is cosmetic, so a host without it is skipped instead of failing the turn.
*/
export function setExtensionWorkingMessage(
ctx: ExtensionContext,
message?: string,
): void {
ctx.ui.setWorkingMessage?.(message);
}
export function isExtensionContextIdle(ctx: ExtensionContext): boolean {
return ctx.isIdle();
}