glaip-sdk 0.7.27__py3-none-any.whl → 0.7.28__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- glaip_sdk/cli/slash/tui/__init__.py +2 -2
- glaip_sdk/cli/slash/tui/accounts_app.py +109 -47
- glaip_sdk/cli/slash/tui/remote_runs_app.py +854 -580
- glaip_sdk/cli/slash/tui/toast.py +29 -3
- {glaip_sdk-0.7.27.dist-info → glaip_sdk-0.7.28.dist-info}/METADATA +1 -1
- {glaip_sdk-0.7.27.dist-info → glaip_sdk-0.7.28.dist-info}/RECORD +9 -9
- {glaip_sdk-0.7.27.dist-info → glaip_sdk-0.7.28.dist-info}/WHEEL +0 -0
- {glaip_sdk-0.7.27.dist-info → glaip_sdk-0.7.28.dist-info}/entry_points.txt +0 -0
- {glaip_sdk-0.7.27.dist-info → glaip_sdk-0.7.28.dist-info}/top_level.txt +0 -0
glaip_sdk/cli/slash/tui/toast.py
CHANGED
|
@@ -9,6 +9,7 @@ from enum import Enum
|
|
|
9
9
|
from typing import Any, cast
|
|
10
10
|
|
|
11
11
|
from rich.text import Text
|
|
12
|
+
from textual.app import ComposeResult
|
|
12
13
|
from textual.message import Message
|
|
13
14
|
from textual.widget import Widget
|
|
14
15
|
from textual.widgets import Static
|
|
@@ -55,13 +56,25 @@ class ToastBus:
|
|
|
55
56
|
"""Initialize the toast bus with optional change callback."""
|
|
56
57
|
self._state: ToastState | None = None
|
|
57
58
|
self._dismiss_task: asyncio.Task[None] | None = None
|
|
58
|
-
self.
|
|
59
|
+
self._subscribers: list[Callable[[ToastBus.Changed], None]] = []
|
|
60
|
+
if on_change is not None:
|
|
61
|
+
self._subscribers.append(on_change)
|
|
59
62
|
|
|
60
63
|
@property
|
|
61
64
|
def state(self) -> ToastState | None:
|
|
62
65
|
"""Return the current toast state, or None if no toast is shown."""
|
|
63
66
|
return self._state
|
|
64
67
|
|
|
68
|
+
def subscribe(self, callback: Callable[[ToastBus.Changed], None]) -> None:
|
|
69
|
+
"""Register a callback to be notified of toast state changes."""
|
|
70
|
+
if callback not in self._subscribers:
|
|
71
|
+
self._subscribers.append(callback)
|
|
72
|
+
|
|
73
|
+
def unsubscribe(self, callback: Callable[[ToastBus.Changed], None]) -> None:
|
|
74
|
+
"""Unregister a toast callback."""
|
|
75
|
+
if callback in self._subscribers:
|
|
76
|
+
self._subscribers.remove(callback)
|
|
77
|
+
|
|
65
78
|
def show(
|
|
66
79
|
self,
|
|
67
80
|
message: str,
|
|
@@ -146,8 +159,12 @@ class ToastBus:
|
|
|
146
159
|
self._notify_changed()
|
|
147
160
|
|
|
148
161
|
def _notify_changed(self) -> None:
|
|
149
|
-
|
|
150
|
-
|
|
162
|
+
message = ToastBus.Changed(self._state)
|
|
163
|
+
for callback in tuple(self._subscribers):
|
|
164
|
+
try:
|
|
165
|
+
callback(message)
|
|
166
|
+
except Exception:
|
|
167
|
+
pass
|
|
151
168
|
|
|
152
169
|
|
|
153
170
|
class ToastHandlerMixin:
|
|
@@ -303,6 +320,15 @@ class ToastContainer(Widget):
|
|
|
303
320
|
yield ToastContainer(Toast(), id="toast-container")
|
|
304
321
|
"""
|
|
305
322
|
|
|
323
|
+
def __init__(self, toast: Toast, id: str | None = None) -> None:
|
|
324
|
+
"""Initialize the toast container with a toast widget."""
|
|
325
|
+
super().__init__(id=id)
|
|
326
|
+
self._toast = toast
|
|
327
|
+
|
|
328
|
+
def compose(self) -> ComposeResult:
|
|
329
|
+
"""Compose the container by yielding the toast widget."""
|
|
330
|
+
yield self._toast
|
|
331
|
+
|
|
306
332
|
|
|
307
333
|
class Toast(Static):
|
|
308
334
|
"""A Textual widget that displays toast notifications at the top-right of the screen.
|
|
@@ -81,18 +81,18 @@ glaip_sdk/cli/slash/agent_session.py,sha256=tuVOme-NbEyr6rwJvsBEKZYWQmsaRf4piJeR
|
|
|
81
81
|
glaip_sdk/cli/slash/prompt.py,sha256=q4f1c2zr7ZMUeO6AgOBF2Nz4qgMOXrVPt6WzPRQMbAM,8501
|
|
82
82
|
glaip_sdk/cli/slash/remote_runs_controller.py,sha256=iLl4a-mu9QU7dcedgEILewPtDIVtFUJkbKGtcx1F66U,21445
|
|
83
83
|
glaip_sdk/cli/slash/session.py,sha256=lWK4iCb4HGnHZf251kP_1iyH8J0BaTlwSs3XJWfYOuI,76146
|
|
84
|
-
glaip_sdk/cli/slash/tui/__init__.py,sha256=
|
|
84
|
+
glaip_sdk/cli/slash/tui/__init__.py,sha256=mhX89VfkWFLCvSnu7ffIssbBgtqeTAJ3s90uf11HoFs,1107
|
|
85
85
|
glaip_sdk/cli/slash/tui/accounts.tcss,sha256=5iVZZfS10CTJhnoZ9AFJejtj8nyQXH9xV7u9k8jSkGE,2411
|
|
86
|
-
glaip_sdk/cli/slash/tui/accounts_app.py,sha256=
|
|
86
|
+
glaip_sdk/cli/slash/tui/accounts_app.py,sha256=TXAs2VmXvBeK0r09InL1H5liean789r4iTii9kRLm7Q,75578
|
|
87
87
|
glaip_sdk/cli/slash/tui/background_tasks.py,sha256=SAe1mV2vXB3mJcSGhelU950vf8Lifjhws9iomyIVFKw,2422
|
|
88
88
|
glaip_sdk/cli/slash/tui/clipboard.py,sha256=Rb1n6nYsjTgMfSMTVo4HisW8ZM3na2REtd3OHEy-Lz0,11255
|
|
89
89
|
glaip_sdk/cli/slash/tui/context.py,sha256=mzI4TDXnfZd42osACp5uo10d10y1_A0z6IxRK1KVoVk,3320
|
|
90
90
|
glaip_sdk/cli/slash/tui/indicators.py,sha256=jV3fFvEVWQ0inWJJ-B1fMsdkF0Uq2zwX3xcl0YWPHSE,11768
|
|
91
91
|
glaip_sdk/cli/slash/tui/keybind_registry.py,sha256=_rK05BxTxNudYc4iJ9gDxpgeUkjDAq8rarIT-9A-jyM,6739
|
|
92
92
|
glaip_sdk/cli/slash/tui/loading.py,sha256=Ku7HyQ_h-r2dJQ5aIEaCOi5PUu5gSsYle8oiKHIxfKI,2336
|
|
93
|
-
glaip_sdk/cli/slash/tui/remote_runs_app.py,sha256=
|
|
93
|
+
glaip_sdk/cli/slash/tui/remote_runs_app.py,sha256=Rm_Fo8WNyTHWNj2aGwTnYsV-QVUCCSbT380D8Cio3uM,40618
|
|
94
94
|
glaip_sdk/cli/slash/tui/terminal.py,sha256=ZAC3sB17TGpl-GFeRVm_nI8DQTN3pyti3ynlZ41wT_A,12323
|
|
95
|
-
glaip_sdk/cli/slash/tui/toast.py,sha256=
|
|
95
|
+
glaip_sdk/cli/slash/tui/toast.py,sha256=UmP0_UAQcp0mOdX1iIS8W3gGDb14Z3kYGmbN_NvYDls,13494
|
|
96
96
|
glaip_sdk/cli/slash/tui/layouts/__init__.py,sha256=KT77pZHa7Wz84QlHYT2mfhQ_AXUA-T0eHv_HtAvc1ac,473
|
|
97
97
|
glaip_sdk/cli/slash/tui/layouts/harlequin.py,sha256=JOsaK18jTojzZ-Py-87foxfijuRDWwi8LIWmqM6qS0k,5644
|
|
98
98
|
glaip_sdk/cli/slash/tui/theme/__init__.py,sha256=rtM2ik83YNCRcI1qh_Sf3rnxco2OvCNNT3NbHY6cLvw,432
|
|
@@ -220,8 +220,8 @@ glaip_sdk/utils/rendering/steps/format.py,sha256=Chnq7OBaj8XMeBntSBxrX5zSmrYeGcO
|
|
|
220
220
|
glaip_sdk/utils/rendering/steps/manager.py,sha256=BiBmTeQMQhjRMykgICXsXNYh1hGsss-fH9BIGVMWFi0,13194
|
|
221
221
|
glaip_sdk/utils/rendering/viewer/__init__.py,sha256=XrxmE2cMAozqrzo1jtDFm8HqNtvDcYi2mAhXLXn5CjI,457
|
|
222
222
|
glaip_sdk/utils/rendering/viewer/presenter.py,sha256=mlLMTjnyeyPVtsyrAbz1BJu9lFGQSlS-voZ-_Cuugv0,5725
|
|
223
|
-
glaip_sdk-0.7.
|
|
224
|
-
glaip_sdk-0.7.
|
|
225
|
-
glaip_sdk-0.7.
|
|
226
|
-
glaip_sdk-0.7.
|
|
227
|
-
glaip_sdk-0.7.
|
|
223
|
+
glaip_sdk-0.7.28.dist-info/METADATA,sha256=NLsPQhywv5Gba0deG2zIQX3FRZc0p_LZoDAp82Dawzg,8686
|
|
224
|
+
glaip_sdk-0.7.28.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
|
|
225
|
+
glaip_sdk-0.7.28.dist-info/entry_points.txt,sha256=NkhO6FfgX9Zrjn63GuKphf-dLw7KNJvucAcXc7P3aMk,54
|
|
226
|
+
glaip_sdk-0.7.28.dist-info/top_level.txt,sha256=td7yXttiYX2s94-4wFhv-5KdT0rSZ-pnJRSire341hw,10
|
|
227
|
+
glaip_sdk-0.7.28.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|