portacode 0.3.11.dev1__tar.gz → 0.3.11.dev2__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.
- {portacode-0.3.11.dev1 → portacode-0.3.11.dev2}/PKG-INFO +1 -1
- {portacode-0.3.11.dev1 → portacode-0.3.11.dev2}/portacode/_version.py +2 -2
- {portacode-0.3.11.dev1 → portacode-0.3.11.dev2}/portacode/connection/handlers/terminal_handlers.py +19 -11
- {portacode-0.3.11.dev1 → portacode-0.3.11.dev2}/portacode.egg-info/PKG-INFO +1 -1
- {portacode-0.3.11.dev1 → portacode-0.3.11.dev2}/.gitignore +0 -0
- {portacode-0.3.11.dev1 → portacode-0.3.11.dev2}/.gitmodules +0 -0
- {portacode-0.3.11.dev1 → portacode-0.3.11.dev2}/LICENSE +0 -0
- {portacode-0.3.11.dev1 → portacode-0.3.11.dev2}/MANIFEST.in +0 -0
- {portacode-0.3.11.dev1 → portacode-0.3.11.dev2}/Makefile +0 -0
- {portacode-0.3.11.dev1 → portacode-0.3.11.dev2}/README.md +0 -0
- {portacode-0.3.11.dev1 → portacode-0.3.11.dev2}/docker-compose.yaml +0 -0
- {portacode-0.3.11.dev1 → portacode-0.3.11.dev2}/portacode/README.md +0 -0
- {portacode-0.3.11.dev1 → portacode-0.3.11.dev2}/portacode/__init__.py +0 -0
- {portacode-0.3.11.dev1 → portacode-0.3.11.dev2}/portacode/__main__.py +0 -0
- {portacode-0.3.11.dev1 → portacode-0.3.11.dev2}/portacode/cli.py +0 -0
- {portacode-0.3.11.dev1 → portacode-0.3.11.dev2}/portacode/connection/README.md +0 -0
- {portacode-0.3.11.dev1 → portacode-0.3.11.dev2}/portacode/connection/__init__.py +0 -0
- {portacode-0.3.11.dev1 → portacode-0.3.11.dev2}/portacode/connection/client.py +0 -0
- {portacode-0.3.11.dev1 → portacode-0.3.11.dev2}/portacode/connection/handlers/README.md +0 -0
- {portacode-0.3.11.dev1 → portacode-0.3.11.dev2}/portacode/connection/handlers/__init__.py +0 -0
- {portacode-0.3.11.dev1 → portacode-0.3.11.dev2}/portacode/connection/handlers/base.py +0 -0
- {portacode-0.3.11.dev1 → portacode-0.3.11.dev2}/portacode/connection/handlers/file_handlers.py +0 -0
- {portacode-0.3.11.dev1 → portacode-0.3.11.dev2}/portacode/connection/handlers/registry.py +0 -0
- {portacode-0.3.11.dev1 → portacode-0.3.11.dev2}/portacode/connection/handlers/session.py +0 -0
- {portacode-0.3.11.dev1 → portacode-0.3.11.dev2}/portacode/connection/handlers/system_handlers.py +0 -0
- {portacode-0.3.11.dev1 → portacode-0.3.11.dev2}/portacode/connection/multiplex.py +0 -0
- {portacode-0.3.11.dev1 → portacode-0.3.11.dev2}/portacode/connection/terminal.py +0 -0
- {portacode-0.3.11.dev1 → portacode-0.3.11.dev2}/portacode/data.py +0 -0
- {portacode-0.3.11.dev1 → portacode-0.3.11.dev2}/portacode/keypair.py +0 -0
- {portacode-0.3.11.dev1 → portacode-0.3.11.dev2}/portacode/service.py +0 -0
- {portacode-0.3.11.dev1 → portacode-0.3.11.dev2}/portacode.egg-info/SOURCES.txt +0 -0
- {portacode-0.3.11.dev1 → portacode-0.3.11.dev2}/portacode.egg-info/dependency_links.txt +0 -0
- {portacode-0.3.11.dev1 → portacode-0.3.11.dev2}/portacode.egg-info/entry_points.txt +0 -0
- {portacode-0.3.11.dev1 → portacode-0.3.11.dev2}/portacode.egg-info/requires.txt +0 -0
- {portacode-0.3.11.dev1 → portacode-0.3.11.dev2}/portacode.egg-info/top_level.txt +0 -0
- {portacode-0.3.11.dev1 → portacode-0.3.11.dev2}/pyproject.toml +0 -0
- {portacode-0.3.11.dev1 → portacode-0.3.11.dev2}/setup.cfg +0 -0
- {portacode-0.3.11.dev1 → portacode-0.3.11.dev2}/setup.py +0 -0
|
@@ -17,5 +17,5 @@ __version__: str
|
|
|
17
17
|
__version_tuple__: VERSION_TUPLE
|
|
18
18
|
version_tuple: VERSION_TUPLE
|
|
19
19
|
|
|
20
|
-
__version__ = version = '0.3.11.
|
|
21
|
-
__version_tuple__ = version_tuple = (0, 3, 11, '
|
|
20
|
+
__version__ = version = '0.3.11.dev2'
|
|
21
|
+
__version_tuple__ = version_tuple = (0, 3, 11, 'dev2')
|
{portacode-0.3.11.dev1 → portacode-0.3.11.dev2}/portacode/connection/handlers/terminal_handlers.py
RENAMED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import asyncio
|
|
4
4
|
import logging
|
|
5
|
-
from typing import Any, Dict
|
|
5
|
+
from typing import Any, Dict, Optional
|
|
6
6
|
|
|
7
7
|
from .base import AsyncHandler
|
|
8
8
|
from .session import SessionManager
|
|
@@ -55,6 +55,7 @@ class TerminalStartHandler(AsyncHandler):
|
|
|
55
55
|
"event": "terminal_exit",
|
|
56
56
|
"terminal_id": terminal_id,
|
|
57
57
|
"returncode": session.proc.returncode,
|
|
58
|
+
"project_id": session.project_id,
|
|
58
59
|
})
|
|
59
60
|
|
|
60
61
|
# Only cleanup session if it still exists (not already removed by stop handler)
|
|
@@ -118,28 +119,30 @@ class TerminalStopHandler(AsyncHandler):
|
|
|
118
119
|
if not session:
|
|
119
120
|
logger.warning("terminal_stop: Terminal %s not found, may have already been stopped", terminal_id)
|
|
120
121
|
# Send completion event immediately for not found terminals
|
|
121
|
-
asyncio.create_task(self._send_not_found_completion(terminal_id))
|
|
122
|
+
asyncio.create_task(self._send_not_found_completion(terminal_id, None))
|
|
122
123
|
return {
|
|
123
124
|
"event": "terminal_stopped",
|
|
124
125
|
"terminal_id": terminal_id,
|
|
125
126
|
"status": "not_found",
|
|
126
|
-
"message": "Terminal was not found or already stopped"
|
|
127
|
+
"message": "Terminal was not found or already stopped",
|
|
128
|
+
"project_id": None,
|
|
127
129
|
}
|
|
128
130
|
|
|
129
131
|
logger.info("terminal_stop: Found session for terminal %s (PID: %s), starting background stop process",
|
|
130
132
|
terminal_id, getattr(session.proc, 'pid', 'unknown'))
|
|
131
133
|
|
|
132
134
|
# Start stop process in background without blocking the control channel
|
|
133
|
-
asyncio.create_task(self._stop_session_safely(session, terminal_id))
|
|
135
|
+
asyncio.create_task(self._stop_session_safely(session, terminal_id, session.project_id))
|
|
134
136
|
|
|
135
137
|
return {
|
|
136
138
|
"event": "terminal_stopped",
|
|
137
139
|
"terminal_id": terminal_id,
|
|
138
140
|
"status": "stopping",
|
|
139
|
-
"message": "Terminal stop process initiated"
|
|
141
|
+
"message": "Terminal stop process initiated",
|
|
142
|
+
"project_id": session.project_id,
|
|
140
143
|
}
|
|
141
144
|
|
|
142
|
-
async def _stop_session_safely(self, session, terminal_id: str) -> None:
|
|
145
|
+
async def _stop_session_safely(self, session, terminal_id: str, project_id: Optional[str] = None) -> None:
|
|
143
146
|
"""Safely stop a session in the background with timeout and error handling."""
|
|
144
147
|
logger.info("terminal_stop: Starting background stop process for terminal %s", terminal_id)
|
|
145
148
|
|
|
@@ -153,7 +156,8 @@ class TerminalStopHandler(AsyncHandler):
|
|
|
153
156
|
"event": "terminal_stop_completed",
|
|
154
157
|
"terminal_id": terminal_id,
|
|
155
158
|
"status": "success",
|
|
156
|
-
"message": "Terminal stopped successfully"
|
|
159
|
+
"message": "Terminal stopped successfully",
|
|
160
|
+
"project_id": project_id,
|
|
157
161
|
})
|
|
158
162
|
|
|
159
163
|
except asyncio.TimeoutError:
|
|
@@ -175,7 +179,8 @@ class TerminalStopHandler(AsyncHandler):
|
|
|
175
179
|
"event": "terminal_stop_completed",
|
|
176
180
|
"terminal_id": terminal_id,
|
|
177
181
|
"status": "timeout",
|
|
178
|
-
"message": "Terminal stop timed out, process was force killed"
|
|
182
|
+
"message": "Terminal stop timed out, process was force killed",
|
|
183
|
+
"project_id": project_id,
|
|
179
184
|
})
|
|
180
185
|
|
|
181
186
|
except Exception as exc:
|
|
@@ -186,16 +191,18 @@ class TerminalStopHandler(AsyncHandler):
|
|
|
186
191
|
"event": "terminal_stop_completed",
|
|
187
192
|
"terminal_id": terminal_id,
|
|
188
193
|
"status": "error",
|
|
189
|
-
"message": f"Error stopping terminal: {str(exc)}"
|
|
194
|
+
"message": f"Error stopping terminal: {str(exc)}",
|
|
195
|
+
"project_id": project_id,
|
|
190
196
|
})
|
|
191
197
|
|
|
192
|
-
async def _send_not_found_completion(self, terminal_id: str) -> None:
|
|
198
|
+
async def _send_not_found_completion(self, terminal_id: str, project_id: Optional[str] = None) -> None:
|
|
193
199
|
"""Send completion event for not found terminals."""
|
|
194
200
|
await self.control_channel.send({
|
|
195
201
|
"event": "terminal_stop_completed",
|
|
196
202
|
"terminal_id": terminal_id,
|
|
197
203
|
"status": "not_found",
|
|
198
|
-
"message": "Terminal was not found or already stopped"
|
|
204
|
+
"message": "Terminal was not found or already stopped",
|
|
205
|
+
"project_id": project_id,
|
|
199
206
|
})
|
|
200
207
|
|
|
201
208
|
|
|
@@ -223,4 +230,5 @@ class TerminalListHandler(AsyncHandler):
|
|
|
223
230
|
return {
|
|
224
231
|
"event": "terminal_list",
|
|
225
232
|
"sessions": sessions,
|
|
233
|
+
"project_id": requested_project_id,
|
|
226
234
|
}
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{portacode-0.3.11.dev1 → portacode-0.3.11.dev2}/portacode/connection/handlers/file_handlers.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{portacode-0.3.11.dev1 → portacode-0.3.11.dev2}/portacode/connection/handlers/system_handlers.py
RENAMED
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|