From 0a9337d2bb219e3096a3707ca143968dc4bcc005 Mon Sep 17 00:00:00 2001 From: Adolanium <94890352+Adolanium@users.noreply.github.com> Date: Sun, 16 Aug 2026 11:30:27 +0300 Subject: [PATCH] feat(desktop): expose busy turn flags on plugin SDK Plugins can now read host.state.busy and host.state.awaitingResponse for the focused chat. These follow the same session slice the chat pane uses, so a draft falls back to the global flags and a background turn does not leak. --- apps/desktop/src/plugins/example/plugin.tsx | 3 +- apps/desktop/src/sdk/index.test.ts | 66 +++++++++++++++++++ apps/desktop/src/sdk/index.ts | 9 +++ .../references/desktop-plugins.md | 8 ++- .../developer-guide/desktop-plugin-sdk.md | 13 ++++ 5 files changed, 95 insertions(+), 4 deletions(-) create mode 100644 apps/desktop/src/sdk/index.test.ts diff --git a/apps/desktop/src/plugins/example/plugin.tsx b/apps/desktop/src/plugins/example/plugin.tsx index 7d13206784..f4c1ee1187 100644 --- a/apps/desktop/src/plugins/example/plugin.tsx +++ b/apps/desktop/src/plugins/example/plugin.tsx @@ -39,10 +39,11 @@ const $events = atom(0) function ClickCounter() { const count = useValue($clicks) const events = useValue($events) + const busy = useValue(host.state.busy) const gateway = useValue(host.state.gateway) return ( - +