forgexa-cli 1.97.3__tar.gz → 1.97.4__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.
Files changed (36) hide show
  1. {forgexa_cli-1.97.3 → forgexa_cli-1.97.4}/PKG-INFO +1 -1
  2. {forgexa_cli-1.97.3 → forgexa_cli-1.97.4}/forgexa_cli/__init__.py +1 -1
  3. {forgexa_cli-1.97.3 → forgexa_cli-1.97.4}/forgexa_cli/agent_core.py +14 -5
  4. {forgexa_cli-1.97.3 → forgexa_cli-1.97.4}/forgexa_cli/component_runtime.py +25 -2
  5. {forgexa_cli-1.97.3 → forgexa_cli-1.97.4}/forgexa_cli/daemon.py +1 -1
  6. {forgexa_cli-1.97.3 → forgexa_cli-1.97.4}/forgexa_cli.egg-info/PKG-INFO +1 -1
  7. {forgexa_cli-1.97.3 → forgexa_cli-1.97.4}/pyproject.toml +1 -1
  8. {forgexa_cli-1.97.3 → forgexa_cli-1.97.4}/README.md +0 -0
  9. {forgexa_cli-1.97.3 → forgexa_cli-1.97.4}/forgexa_cli/_build_config.py +0 -0
  10. {forgexa_cli-1.97.3 → forgexa_cli-1.97.4}/forgexa_cli/_local_bind.py +0 -0
  11. {forgexa_cli-1.97.3 → forgexa_cli-1.97.4}/forgexa_cli/autoupgrade.py +0 -0
  12. {forgexa_cli-1.97.3 → forgexa_cli-1.97.4}/forgexa_cli/aws_evidence.py +0 -0
  13. {forgexa_cli-1.97.3 → forgexa_cli-1.97.4}/forgexa_cli/aws_logs_evidence.py +0 -0
  14. {forgexa_cli-1.97.3 → forgexa_cli-1.97.4}/forgexa_cli/main.py +0 -0
  15. {forgexa_cli-1.97.3 → forgexa_cli-1.97.4}/forgexa_cli/observability_contract.py +0 -0
  16. {forgexa_cli-1.97.3 → forgexa_cli-1.97.4}/forgexa_cli/observability_evidence.py +0 -0
  17. {forgexa_cli-1.97.3 → forgexa_cli-1.97.4}/forgexa_cli/ocr_adapter.py +0 -0
  18. {forgexa_cli-1.97.3 → forgexa_cli-1.97.4}/forgexa_cli/py.typed +0 -0
  19. {forgexa_cli-1.97.3 → forgexa_cli-1.97.4}/forgexa_cli/runtime_evidence.py +0 -0
  20. {forgexa_cli-1.97.3 → forgexa_cli-1.97.4}/forgexa_cli/zcode_protocol.py +0 -0
  21. {forgexa_cli-1.97.3 → forgexa_cli-1.97.4}/forgexa_cli.egg-info/SOURCES.txt +0 -0
  22. {forgexa_cli-1.97.3 → forgexa_cli-1.97.4}/forgexa_cli.egg-info/dependency_links.txt +0 -0
  23. {forgexa_cli-1.97.3 → forgexa_cli-1.97.4}/forgexa_cli.egg-info/entry_points.txt +0 -0
  24. {forgexa_cli-1.97.3 → forgexa_cli-1.97.4}/forgexa_cli.egg-info/requires.txt +0 -0
  25. {forgexa_cli-1.97.3 → forgexa_cli-1.97.4}/forgexa_cli.egg-info/top_level.txt +0 -0
  26. {forgexa_cli-1.97.3 → forgexa_cli-1.97.4}/setup.cfg +0 -0
  27. {forgexa_cli-1.97.3 → forgexa_cli-1.97.4}/tests/test_auth_and_runtime_commands.py +0 -0
  28. {forgexa_cli-1.97.3 → forgexa_cli-1.97.4}/tests/test_autoupgrade.py +0 -0
  29. {forgexa_cli-1.97.3 → forgexa_cli-1.97.4}/tests/test_check_command.py +0 -0
  30. {forgexa_cli-1.97.3 → forgexa_cli-1.97.4}/tests/test_expiry_warnings_and_revoke.py +0 -0
  31. {forgexa_cli-1.97.3 → forgexa_cli-1.97.4}/tests/test_local_bind_commands.py +0 -0
  32. {forgexa_cli-1.97.3 → forgexa_cli-1.97.4}/tests/test_publish_script.py +0 -0
  33. {forgexa_cli-1.97.3 → forgexa_cli-1.97.4}/tests/test_runtime_credentials.py +0 -0
  34. {forgexa_cli-1.97.3 → forgexa_cli-1.97.4}/tests/test_session_credentials.py +0 -0
  35. {forgexa_cli-1.97.3 → forgexa_cli-1.97.4}/tests/test_silent_install.py +0 -0
  36. {forgexa_cli-1.97.3 → forgexa_cli-1.97.4}/tests/test_upgrade_observability.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: forgexa-cli
3
- Version: 1.97.3
3
+ Version: 1.97.4
4
4
  Summary: Forgexa CLI — command-line client and AI agent runtime for the Forgexa platform
5
5
  Author-email: Jason Sun <dev.winds@gmail.com>
6
6
  License-Expression: MIT
@@ -1,2 +1,2 @@
1
1
  """forgexa-cli — Forgexa command-line client."""
2
- __version__ = "1.97.3"
2
+ __version__ = "1.97.4"
@@ -2222,6 +2222,8 @@ class AgentDiscovery:
2222
2222
  cmd = managed.argv_prefix[-1] if managed is not None else custom_path or spec["commands"][0]
2223
2223
  resolved = shutil.which(cmd)
2224
2224
  if resolved:
2225
+ if managed is None:
2226
+ await asyncio.to_thread(component_runtime.validate_external_executable, resolved)
2225
2227
  issue = await asyncio.to_thread(self._wsl_execution_issue, resolved)
2226
2228
  if issue:
2227
2229
  logger.warning(
@@ -2341,10 +2343,9 @@ class AgentDiscovery:
2341
2343
  if probe_dir is None:
2342
2344
  probe_dir = tempfile.TemporaryDirectory(prefix="forgexa-managed-discovery-")
2343
2345
  env = managed.probe_environment(Path(probe_dir.name), env)
2344
- execution_lease = component_runtime.current_execution()
2345
- if managed is not None and managed is execution_lease:
2346
+ if managed is not None:
2346
2347
  await asyncio.to_thread(managed.begin_spawn)
2347
- proc = await asyncio.create_subprocess_exec(
2348
+ spawn = asyncio.create_task(asyncio.create_subprocess_exec(
2348
2349
  *parts,
2349
2350
  stdin=asyncio.subprocess.DEVNULL,
2350
2351
  stdout=asyncio.subprocess.PIPE,
@@ -2352,8 +2353,16 @@ class AgentDiscovery:
2352
2353
  env=env,
2353
2354
  cwd=probe_dir.name if managed is not None else None,
2354
2355
  **_agent_process_group_kwargs(),
2355
- )
2356
- if managed is not None and managed is execution_lease:
2356
+ ))
2357
+ try:
2358
+ proc = await asyncio.shield(spawn)
2359
+ except asyncio.CancelledError:
2360
+ try:
2361
+ proc = await spawn
2362
+ except Exception:
2363
+ pass
2364
+ raise
2365
+ if managed is not None:
2357
2366
  await asyncio.to_thread(managed.record_process, proc.pid)
2358
2367
  stdout, stderr = await asyncio.wait_for(proc.communicate(), timeout=10)
2359
2368
  if proc.returncode != 0:
@@ -49,7 +49,10 @@ def _private_directory(path: Path) -> None:
49
49
  raise ComponentRuntimeError("component_storage_invalid")
50
50
 
51
51
 
52
- def _record(path: Path, fields: set[str], limit: int = RECORD_LIMIT) -> dict[str, Any] | None:
52
+ def _record(
53
+ path: Path, fields: set[str], limit: int = RECORD_LIMIT,
54
+ optional_fields: set[str] | None = None,
55
+ ) -> dict[str, Any] | None:
53
56
  try:
54
57
  descriptor = os.open(
55
58
  path, os.O_RDONLY | getattr(os, "O_NOFOLLOW", 0) | getattr(os, "O_NONBLOCK", 0)
@@ -72,7 +75,7 @@ def _record(path: Path, fields: set[str], limit: int = RECORD_LIMIT) -> dict[str
72
75
  value = json.loads(data)
73
76
  except (ValueError, UnicodeError) as error:
74
77
  raise ComponentRuntimeError("component_record_invalid") from error
75
- if not isinstance(value, dict) or set(value) != fields:
78
+ if not isinstance(value, dict) or not fields <= set(value) or set(value) - fields - (optional_fields or set()):
76
79
  raise ComponentRuntimeError("component_schema_unsupported")
77
80
  if type(value.get("schema_version")) is not int or value["schema_version"] != 1:
78
81
  raise ComponentRuntimeError("component_schema_unsupported")
@@ -828,6 +831,7 @@ def _acquire_component(
828
831
  "installation_id",
829
832
  "enabled",
830
833
  },
834
+ optional_fields={"external"},
831
835
  )
832
836
  if selection is None:
833
837
  return None
@@ -842,8 +846,15 @@ def _acquire_component(
842
846
  or not 0 <= selection["revision"] <= 9_007_199_254_740_991
843
847
  ):
844
848
  raise ComponentRuntimeError("component_selection_invalid")
849
+ external = selection.get("external")
850
+ if (external is not None and external is not True) or (
851
+ external is True and (selection["installation_id"] is not None or kind != "agent")
852
+ ):
853
+ raise ComponentRuntimeError("component_selection_invalid")
845
854
  if not selection["enabled"]:
846
855
  raise ComponentRuntimeError("component_disabled")
856
+ if external is True:
857
+ return None
847
858
  installation_id = _identifier(selection["installation_id"])
848
859
  maintenance = _record(
849
860
  root / "maintenance" / f"{installation_id}.json",
@@ -970,6 +981,17 @@ def acquire_component(
970
981
  raise ComponentRuntimeError("component_storage_unavailable") from error
971
982
 
972
983
 
984
+ def validate_external_executable(binary_path: str, root: Path | None = None) -> None:
985
+ root = default_store_root() if root is None else root
986
+ try:
987
+ candidate = Path(binary_path).resolve()
988
+ store = root.resolve()
989
+ except (OSError, RuntimeError) as error:
990
+ raise ComponentRuntimeError("component_path_invalid") from error
991
+ if candidate == store or store in candidate.parents:
992
+ raise ComponentRuntimeError("component_external_path_managed")
993
+
994
+
973
995
  def admit_execution(
974
996
  component_id: str,
975
997
  binary_path: str,
@@ -982,6 +1004,7 @@ def admit_execution(
982
1004
  if lease is None:
983
1005
  if installation_id is not None or selection_revision is not None:
984
1006
  raise ComponentRuntimeError("component_instance_missing")
1007
+ validate_external_executable(binary_path, root)
985
1008
  return None
986
1009
  try:
987
1010
  if binary_path != lease.argv_prefix[-1]:
@@ -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.97.3"
1415
+ DAEMON_VERSION = "1.97.4"
1416
1416
 
1417
1417
 
1418
1418
  def _detect_client_type() -> str:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: forgexa-cli
3
- Version: 1.97.3
3
+ Version: 1.97.4
4
4
  Summary: Forgexa CLI — command-line client and AI agent runtime for the Forgexa platform
5
5
  Author-email: Jason Sun <dev.winds@gmail.com>
6
6
  License-Expression: MIT
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "forgexa-cli"
3
- version = "1.97.3"
3
+ version = "1.97.4"
4
4
  description = "Forgexa CLI — command-line client and AI agent runtime for the Forgexa platform"
5
5
  requires-python = ">=3.9"
6
6
  license = "MIT"
File without changes
File without changes