swiftgate-cli 1.0.5__tar.gz → 1.0.6__tar.gz
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.
- {swiftgate_cli-1.0.5 → swiftgate_cli-1.0.6}/PKG-INFO +1 -1
- {swiftgate_cli-1.0.5 → swiftgate_cli-1.0.6}/pyproject.toml +1 -1
- {swiftgate_cli-1.0.5 → swiftgate_cli-1.0.6}/src/swiftgate_cli/agent_bridge.py +28 -24
- {swiftgate_cli-1.0.5 → swiftgate_cli-1.0.6}/src/swiftgate_cli/main.py +1 -1
- {swiftgate_cli-1.0.5 → swiftgate_cli-1.0.6}/.gitignore +0 -0
- {swiftgate_cli-1.0.5 → swiftgate_cli-1.0.6}/LICENSE +0 -0
- {swiftgate_cli-1.0.5 → swiftgate_cli-1.0.6}/README.md +0 -0
- {swiftgate_cli-1.0.5 → swiftgate_cli-1.0.6}/src/swiftgate_cli/__init__.py +0 -0
- {swiftgate_cli-1.0.5 → swiftgate_cli-1.0.6}/src/swiftgate_cli/__main__.py +0 -0
- {swiftgate_cli-1.0.5 → swiftgate_cli-1.0.6}/src/swiftgate_cli/api_client.py +0 -0
- {swiftgate_cli-1.0.5 → swiftgate_cli-1.0.6}/src/swiftgate_cli/config.py +0 -0
- {swiftgate_cli-1.0.5 → swiftgate_cli-1.0.6}/src/swiftgate_cli/sse_listener.py +0 -0
- {swiftgate_cli-1.0.5 → swiftgate_cli-1.0.6}/tests/test_agent_bridge.py +0 -0
- {swiftgate_cli-1.0.5 → swiftgate_cli-1.0.6}/tests/test_config.py +0 -0
- {swiftgate_cli-1.0.5 → swiftgate_cli-1.0.6}/tests/test_sse_listener.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: swiftgate-cli
|
|
3
|
-
Version: 1.0.
|
|
3
|
+
Version: 1.0.6
|
|
4
4
|
Summary: SwiftGate CLI — autonomous bidirectional agent bridge for SwiftGate OS
|
|
5
5
|
Project-URL: Homepage, https://swiftgate.ai
|
|
6
6
|
Project-URL: Repository, https://github.com/thetaroot/swiftgate
|
|
@@ -159,6 +159,7 @@ class AgentBridge:
|
|
|
159
159
|
"""Forward stdin → agent pty, agent pty → stdout.
|
|
160
160
|
|
|
161
161
|
Runs in the asyncio event loop. Blocks until agent exits.
|
|
162
|
+
Monitors terminal size every 250ms and propagates to the pty.
|
|
162
163
|
"""
|
|
163
164
|
if not self._running or self._master_fd is None:
|
|
164
165
|
return
|
|
@@ -179,23 +180,26 @@ class AgentBridge:
|
|
|
179
180
|
except (termios.error, OSError):
|
|
180
181
|
pass
|
|
181
182
|
|
|
182
|
-
#
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
183
|
+
# Periodic terminal resize poller — robust across ttyd/container envs
|
|
184
|
+
_last_cols = 0
|
|
185
|
+
_last_rows = 0
|
|
186
|
+
|
|
187
|
+
async def _resize_poller():
|
|
188
|
+
nonlocal _last_cols, _last_rows
|
|
189
|
+
while self._running:
|
|
190
|
+
await asyncio.sleep(0.25)
|
|
191
|
+
try:
|
|
192
|
+
term_size = os.get_terminal_size()
|
|
193
|
+
if (term_size.columns, term_size.lines) != (_last_cols, _last_rows):
|
|
194
|
+
winsize = struct.pack("HHHH", term_size.lines, term_size.columns, 0, 0)
|
|
195
|
+
fcntl.ioctl(master_fd, termios.TIOCSWINSZ, winsize)
|
|
196
|
+
os.environ["COLUMNS"] = str(term_size.columns)
|
|
197
|
+
os.environ["LINES"] = str(term_size.lines)
|
|
198
|
+
_last_cols, _last_rows = term_size.columns, term_size.lines
|
|
199
|
+
except OSError:
|
|
200
|
+
pass
|
|
201
|
+
|
|
202
|
+
resize_task = asyncio.create_task(_resize_poller())
|
|
199
203
|
|
|
200
204
|
stop_event = asyncio.Event()
|
|
201
205
|
|
|
@@ -240,6 +244,13 @@ class AgentBridge:
|
|
|
240
244
|
except Exception:
|
|
241
245
|
pass
|
|
242
246
|
|
|
247
|
+
# Cleanup resize poller
|
|
248
|
+
resize_task.cancel()
|
|
249
|
+
try:
|
|
250
|
+
await resize_task
|
|
251
|
+
except (asyncio.CancelledError, Exception):
|
|
252
|
+
pass
|
|
253
|
+
|
|
243
254
|
# Restore terminal
|
|
244
255
|
if old_tc:
|
|
245
256
|
try:
|
|
@@ -247,13 +258,6 @@ class AgentBridge:
|
|
|
247
258
|
except (termios.error, OSError):
|
|
248
259
|
pass
|
|
249
260
|
|
|
250
|
-
# Restore SIGWINCH handler
|
|
251
|
-
if old_winch != signal.SIG_DFL:
|
|
252
|
-
try:
|
|
253
|
-
signal.signal(signal.SIGWINCH, old_winch)
|
|
254
|
-
except OSError:
|
|
255
|
-
pass
|
|
256
|
-
|
|
257
261
|
# ── Lifecycle ────────────────────────────────────────────────────────────
|
|
258
262
|
|
|
259
263
|
async def wait(self) -> int:
|
|
@@ -39,7 +39,7 @@ logger = logging.getLogger("swiftgate")
|
|
|
39
39
|
|
|
40
40
|
|
|
41
41
|
@click.group()
|
|
42
|
-
@click.version_option(version="1.0.
|
|
42
|
+
@click.version_option(version="1.0.6", prog_name="swiftgate-cli")
|
|
43
43
|
def cli():
|
|
44
44
|
"""swiftgate-cli — Autonomous bidirectional agent bridge for SwiftGate OS.
|
|
45
45
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|