forgexa-cli 1.98.5__tar.gz → 1.99.0__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.
- {forgexa_cli-1.98.5 → forgexa_cli-1.99.0}/PKG-INFO +1 -1
- {forgexa_cli-1.98.5 → forgexa_cli-1.99.0}/forgexa_cli/__init__.py +1 -1
- {forgexa_cli-1.98.5 → forgexa_cli-1.99.0}/forgexa_cli/daemon.py +1 -1
- {forgexa_cli-1.98.5 → forgexa_cli-1.99.0}/forgexa_cli/zcode_protocol.py +34 -16
- {forgexa_cli-1.98.5 → forgexa_cli-1.99.0}/forgexa_cli.egg-info/PKG-INFO +1 -1
- {forgexa_cli-1.98.5 → forgexa_cli-1.99.0}/pyproject.toml +1 -1
- {forgexa_cli-1.98.5 → forgexa_cli-1.99.0}/README.md +0 -0
- {forgexa_cli-1.98.5 → forgexa_cli-1.99.0}/forgexa_cli/_build_config.py +0 -0
- {forgexa_cli-1.98.5 → forgexa_cli-1.99.0}/forgexa_cli/_local_bind.py +0 -0
- {forgexa_cli-1.98.5 → forgexa_cli-1.99.0}/forgexa_cli/agent_core.py +0 -0
- {forgexa_cli-1.98.5 → forgexa_cli-1.99.0}/forgexa_cli/autoupgrade.py +0 -0
- {forgexa_cli-1.98.5 → forgexa_cli-1.99.0}/forgexa_cli/aws_evidence.py +0 -0
- {forgexa_cli-1.98.5 → forgexa_cli-1.99.0}/forgexa_cli/aws_logs_evidence.py +0 -0
- {forgexa_cli-1.98.5 → forgexa_cli-1.99.0}/forgexa_cli/component_runtime.py +0 -0
- {forgexa_cli-1.98.5 → forgexa_cli-1.99.0}/forgexa_cli/main.py +0 -0
- {forgexa_cli-1.98.5 → forgexa_cli-1.99.0}/forgexa_cli/observability_contract.py +0 -0
- {forgexa_cli-1.98.5 → forgexa_cli-1.99.0}/forgexa_cli/observability_evidence.py +0 -0
- {forgexa_cli-1.98.5 → forgexa_cli-1.99.0}/forgexa_cli/ocr_adapter.py +0 -0
- {forgexa_cli-1.98.5 → forgexa_cli-1.99.0}/forgexa_cli/py.typed +0 -0
- {forgexa_cli-1.98.5 → forgexa_cli-1.99.0}/forgexa_cli/runtime_evidence.py +0 -0
- {forgexa_cli-1.98.5 → forgexa_cli-1.99.0}/forgexa_cli/workspace_storage.py +0 -0
- {forgexa_cli-1.98.5 → forgexa_cli-1.99.0}/forgexa_cli.egg-info/SOURCES.txt +0 -0
- {forgexa_cli-1.98.5 → forgexa_cli-1.99.0}/forgexa_cli.egg-info/dependency_links.txt +0 -0
- {forgexa_cli-1.98.5 → forgexa_cli-1.99.0}/forgexa_cli.egg-info/entry_points.txt +0 -0
- {forgexa_cli-1.98.5 → forgexa_cli-1.99.0}/forgexa_cli.egg-info/requires.txt +0 -0
- {forgexa_cli-1.98.5 → forgexa_cli-1.99.0}/forgexa_cli.egg-info/top_level.txt +0 -0
- {forgexa_cli-1.98.5 → forgexa_cli-1.99.0}/setup.cfg +0 -0
- {forgexa_cli-1.98.5 → forgexa_cli-1.99.0}/tests/test_auth_and_runtime_commands.py +0 -0
- {forgexa_cli-1.98.5 → forgexa_cli-1.99.0}/tests/test_autoupgrade.py +0 -0
- {forgexa_cli-1.98.5 → forgexa_cli-1.99.0}/tests/test_check_command.py +0 -0
- {forgexa_cli-1.98.5 → forgexa_cli-1.99.0}/tests/test_expiry_warnings_and_revoke.py +0 -0
- {forgexa_cli-1.98.5 → forgexa_cli-1.99.0}/tests/test_local_bind_commands.py +0 -0
- {forgexa_cli-1.98.5 → forgexa_cli-1.99.0}/tests/test_publish_script.py +0 -0
- {forgexa_cli-1.98.5 → forgexa_cli-1.99.0}/tests/test_runtime_credentials.py +0 -0
- {forgexa_cli-1.98.5 → forgexa_cli-1.99.0}/tests/test_session_credentials.py +0 -0
- {forgexa_cli-1.98.5 → forgexa_cli-1.99.0}/tests/test_silent_install.py +0 -0
- {forgexa_cli-1.98.5 → forgexa_cli-1.99.0}/tests/test_upgrade_observability.py +0 -0
- {forgexa_cli-1.98.5 → forgexa_cli-1.99.0}/tests/test_workspace_storage.py +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"""forgexa-cli — Forgexa command-line client."""
|
|
2
|
-
__version__ = "1.
|
|
2
|
+
__version__ = "1.99.0"
|
|
@@ -1412,7 +1412,7 @@ except (ImportError, ModuleNotFoundError):
|
|
|
1412
1412
|
# DAEMON_VERSION is the protocol/logic version of the daemon code.
|
|
1413
1413
|
# Kept in sync with pyproject.toml version via bump-version.sh.
|
|
1414
1414
|
# CLIENT_TYPE identifies which packaging/distribution this daemon runs in.
|
|
1415
|
-
DAEMON_VERSION = "1.
|
|
1415
|
+
DAEMON_VERSION = "1.99.0"
|
|
1416
1416
|
|
|
1417
1417
|
|
|
1418
1418
|
def _detect_client_type() -> str:
|
|
@@ -149,13 +149,19 @@ class ZCodeProtocolSession:
|
|
|
149
149
|
on_event: EventHandler | None = None,
|
|
150
150
|
permission_handler: PermissionHandler | None = None,
|
|
151
151
|
component_lease: agent_core.component_runtime.ManagedComponentLease | None = None,
|
|
152
|
+
spawn_process: Callable[[list[str], dict[str, str] | None], Awaitable[Any]] | None = None,
|
|
153
|
+
stop_process: Callable[[Any], Awaitable[str]] | None = None,
|
|
152
154
|
) -> None:
|
|
155
|
+
if (spawn_process is None) != (stop_process is None) or (spawn_process is not None and component_lease is not None):
|
|
156
|
+
raise ValueError("ZCode process supervision is incomplete")
|
|
153
157
|
self.command = list(command)
|
|
154
158
|
self.cwd = str(cwd)
|
|
155
159
|
self.env = dict(env) if env is not None else None
|
|
156
160
|
self.on_event = on_event
|
|
157
161
|
self.permission_handler = permission_handler
|
|
158
162
|
self.component_lease = component_lease
|
|
163
|
+
self._spawn_process = spawn_process
|
|
164
|
+
self._stop_process = stop_process
|
|
159
165
|
self.session_id: str | None = None
|
|
160
166
|
self.protocol_version: int | None = None
|
|
161
167
|
self._process: asyncio.subprocess.Process | None = None
|
|
@@ -198,16 +204,19 @@ class ZCodeProtocolSession:
|
|
|
198
204
|
process_env = {**(process_env if process_env is not None else os.environ),
|
|
199
205
|
"DISABLE_UPDATES": "1", "DISABLE_AUTOUPDATER": "1"}
|
|
200
206
|
await asyncio.to_thread(self.component_lease.begin_spawn)
|
|
201
|
-
self.
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
207
|
+
if self._spawn_process is not None:
|
|
208
|
+
self._process = await self._spawn_process(command, process_env)
|
|
209
|
+
else:
|
|
210
|
+
self._process = await asyncio.create_subprocess_exec(
|
|
211
|
+
*command,
|
|
212
|
+
stdin=asyncio.subprocess.PIPE,
|
|
213
|
+
stdout=asyncio.subprocess.PIPE,
|
|
214
|
+
stderr=asyncio.subprocess.PIPE,
|
|
215
|
+
cwd=self.cwd,
|
|
216
|
+
env=process_env,
|
|
217
|
+
limit=1_048_576,
|
|
218
|
+
**agent_core._agent_process_group_kwargs(),
|
|
219
|
+
)
|
|
211
220
|
if self.component_lease is not None:
|
|
212
221
|
await asyncio.to_thread(self.component_lease.record_process, self._process.pid)
|
|
213
222
|
self._reader_task = asyncio.create_task(self._read_loop())
|
|
@@ -399,15 +408,24 @@ class ZCodeProtocolSession:
|
|
|
399
408
|
self._active_turn.set_exception(ZCodeProtocolError("ZCode Protocol session closed"))
|
|
400
409
|
self._fail_pending(ZCodeProtocolError("ZCode Protocol session closed"))
|
|
401
410
|
process = self._process
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
411
|
+
cleanup_confirmed = True
|
|
412
|
+
if process is not None:
|
|
413
|
+
if self._stop_process is not None:
|
|
414
|
+
try:
|
|
415
|
+
cleanup_confirmed = await self._stop_process(process) == "terminated"
|
|
416
|
+
except (OSError, ValueError, RuntimeError, asyncio.TimeoutError):
|
|
417
|
+
cleanup_confirmed = False
|
|
418
|
+
elif process.returncode is None:
|
|
419
|
+
agent_core._kill_proc(process)
|
|
420
|
+
try:
|
|
421
|
+
await asyncio.wait_for(process.wait(), timeout=5)
|
|
422
|
+
except (asyncio.TimeoutError, ProcessLookupError):
|
|
423
|
+
pass
|
|
408
424
|
for task in (self._reader_task, self._stderr_task):
|
|
409
425
|
if task is not None and not task.done():
|
|
410
426
|
task.cancel()
|
|
427
|
+
if not cleanup_confirmed:
|
|
428
|
+
raise ZCodeProtocolError("ZCode process cleanup is unconfirmed")
|
|
411
429
|
if self.component_lease is not None and process is not None and process.returncode is None:
|
|
412
430
|
raise agent_core.component_runtime.ComponentRuntimeError(
|
|
413
431
|
"component_process_cleanup_unconfirmed"
|
|
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
|
|
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
|