forgexa-cli 1.98.4__tar.gz → 1.98.5__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.4 → forgexa_cli-1.98.5}/PKG-INFO +1 -1
- {forgexa_cli-1.98.4 → forgexa_cli-1.98.5}/forgexa_cli/__init__.py +1 -1
- {forgexa_cli-1.98.4 → forgexa_cli-1.98.5}/forgexa_cli/agent_core.py +1 -1
- {forgexa_cli-1.98.4 → forgexa_cli-1.98.5}/forgexa_cli/component_runtime.py +65 -9
- {forgexa_cli-1.98.4 → forgexa_cli-1.98.5}/forgexa_cli/daemon.py +1 -1
- {forgexa_cli-1.98.4 → forgexa_cli-1.98.5}/forgexa_cli.egg-info/PKG-INFO +1 -1
- {forgexa_cli-1.98.4 → forgexa_cli-1.98.5}/pyproject.toml +1 -1
- {forgexa_cli-1.98.4 → forgexa_cli-1.98.5}/README.md +0 -0
- {forgexa_cli-1.98.4 → forgexa_cli-1.98.5}/forgexa_cli/_build_config.py +0 -0
- {forgexa_cli-1.98.4 → forgexa_cli-1.98.5}/forgexa_cli/_local_bind.py +0 -0
- {forgexa_cli-1.98.4 → forgexa_cli-1.98.5}/forgexa_cli/autoupgrade.py +0 -0
- {forgexa_cli-1.98.4 → forgexa_cli-1.98.5}/forgexa_cli/aws_evidence.py +0 -0
- {forgexa_cli-1.98.4 → forgexa_cli-1.98.5}/forgexa_cli/aws_logs_evidence.py +0 -0
- {forgexa_cli-1.98.4 → forgexa_cli-1.98.5}/forgexa_cli/main.py +0 -0
- {forgexa_cli-1.98.4 → forgexa_cli-1.98.5}/forgexa_cli/observability_contract.py +0 -0
- {forgexa_cli-1.98.4 → forgexa_cli-1.98.5}/forgexa_cli/observability_evidence.py +0 -0
- {forgexa_cli-1.98.4 → forgexa_cli-1.98.5}/forgexa_cli/ocr_adapter.py +0 -0
- {forgexa_cli-1.98.4 → forgexa_cli-1.98.5}/forgexa_cli/py.typed +0 -0
- {forgexa_cli-1.98.4 → forgexa_cli-1.98.5}/forgexa_cli/runtime_evidence.py +0 -0
- {forgexa_cli-1.98.4 → forgexa_cli-1.98.5}/forgexa_cli/workspace_storage.py +0 -0
- {forgexa_cli-1.98.4 → forgexa_cli-1.98.5}/forgexa_cli/zcode_protocol.py +0 -0
- {forgexa_cli-1.98.4 → forgexa_cli-1.98.5}/forgexa_cli.egg-info/SOURCES.txt +0 -0
- {forgexa_cli-1.98.4 → forgexa_cli-1.98.5}/forgexa_cli.egg-info/dependency_links.txt +0 -0
- {forgexa_cli-1.98.4 → forgexa_cli-1.98.5}/forgexa_cli.egg-info/entry_points.txt +0 -0
- {forgexa_cli-1.98.4 → forgexa_cli-1.98.5}/forgexa_cli.egg-info/requires.txt +0 -0
- {forgexa_cli-1.98.4 → forgexa_cli-1.98.5}/forgexa_cli.egg-info/top_level.txt +0 -0
- {forgexa_cli-1.98.4 → forgexa_cli-1.98.5}/setup.cfg +0 -0
- {forgexa_cli-1.98.4 → forgexa_cli-1.98.5}/tests/test_auth_and_runtime_commands.py +0 -0
- {forgexa_cli-1.98.4 → forgexa_cli-1.98.5}/tests/test_autoupgrade.py +0 -0
- {forgexa_cli-1.98.4 → forgexa_cli-1.98.5}/tests/test_check_command.py +0 -0
- {forgexa_cli-1.98.4 → forgexa_cli-1.98.5}/tests/test_expiry_warnings_and_revoke.py +0 -0
- {forgexa_cli-1.98.4 → forgexa_cli-1.98.5}/tests/test_local_bind_commands.py +0 -0
- {forgexa_cli-1.98.4 → forgexa_cli-1.98.5}/tests/test_publish_script.py +0 -0
- {forgexa_cli-1.98.4 → forgexa_cli-1.98.5}/tests/test_runtime_credentials.py +0 -0
- {forgexa_cli-1.98.4 → forgexa_cli-1.98.5}/tests/test_session_credentials.py +0 -0
- {forgexa_cli-1.98.4 → forgexa_cli-1.98.5}/tests/test_silent_install.py +0 -0
- {forgexa_cli-1.98.4 → forgexa_cli-1.98.5}/tests/test_upgrade_observability.py +0 -0
- {forgexa_cli-1.98.4 → forgexa_cli-1.98.5}/tests/test_workspace_storage.py +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"""forgexa-cli — Forgexa command-line client."""
|
|
2
|
-
__version__ = "1.98.
|
|
2
|
+
__version__ = "1.98.5"
|
|
@@ -2096,7 +2096,7 @@ class AgentDiscovery:
|
|
|
2096
2096
|
current_set = set(current.split(os.pathsep))
|
|
2097
2097
|
additions = [str(d) for d in extra_dirs if d.is_dir() and str(d) not in current_set]
|
|
2098
2098
|
if additions:
|
|
2099
|
-
os.environ["PATH"] = os.pathsep.join(additions)
|
|
2099
|
+
os.environ["PATH"] = os.pathsep.join(filter(None, (current, *additions)))
|
|
2100
2100
|
logger.debug("Expanded PATH with: %s", ", ".join(additions))
|
|
2101
2101
|
for component in (*AgentDiscovery.AGENT_REGISTRY, "forgexa.ocr"):
|
|
2102
2102
|
official_base = home / ".forgexa" / "official" / component
|
|
@@ -931,6 +931,27 @@ def _valid_external_selection_path(path: Any) -> bool:
|
|
|
931
931
|
)
|
|
932
932
|
|
|
933
933
|
|
|
934
|
+
def _wsl_external_selection(component_id: str) -> dict[str, Any] | None:
|
|
935
|
+
base = Path.home() / ".forgexa" / "wsl-workspace"
|
|
936
|
+
path = base / f"component-{component_id}.json"
|
|
937
|
+
try:
|
|
938
|
+
path.lstat()
|
|
939
|
+
except FileNotFoundError:
|
|
940
|
+
return None
|
|
941
|
+
for directory, private in ((base.parent, False), (base, True)):
|
|
942
|
+
metadata = directory.lstat()
|
|
943
|
+
if (not stat.S_ISDIR(metadata.st_mode) or metadata.st_uid != os.getuid()
|
|
944
|
+
or metadata.st_mode & (0o077 if private else 0o022)):
|
|
945
|
+
raise ComponentRuntimeError("component_storage_invalid")
|
|
946
|
+
selection = _record(path, {"schema_version", "component_id", "revision", "enabled", "external_path"})
|
|
947
|
+
if (selection is None or selection["component_id"] != component_id
|
|
948
|
+
or type(selection["revision"]) is not int or not 1 <= selection["revision"] <= 9_007_199_254_740_991
|
|
949
|
+
or type(selection["enabled"]) is not bool
|
|
950
|
+
or (selection["external_path"] is not None and not _valid_external_selection_path(selection["external_path"]))):
|
|
951
|
+
raise ComponentRuntimeError("component_selection_invalid")
|
|
952
|
+
return selection
|
|
953
|
+
|
|
954
|
+
|
|
934
955
|
def _acquire_component(
|
|
935
956
|
component_id: str, root: Path | None = None, override: str | None = None,
|
|
936
957
|
kind: str = "agent",
|
|
@@ -941,9 +962,17 @@ def _acquire_component(
|
|
|
941
962
|
root = default_store_root() if root is None else root
|
|
942
963
|
if root.is_symlink():
|
|
943
964
|
raise ComponentRuntimeError("component_storage_invalid")
|
|
965
|
+
if os.name == "posix" and os.environ.get("WSL_DISTRO_NAME"):
|
|
966
|
+
if root.exists():
|
|
967
|
+
_require_absent_unverified_selection(root, component_id)
|
|
968
|
+
if kind == "agent":
|
|
969
|
+
selection = _wsl_external_selection(component_id)
|
|
970
|
+
if selection is not None and not selection["enabled"]:
|
|
971
|
+
raise ComponentRuntimeError("component_disabled")
|
|
972
|
+
return None
|
|
944
973
|
if not root.exists():
|
|
945
974
|
return None
|
|
946
|
-
if os.name != "posix"
|
|
975
|
+
if os.name != "posix":
|
|
947
976
|
_require_absent_unverified_selection(root, component_id)
|
|
948
977
|
return None
|
|
949
978
|
import fcntl
|
|
@@ -1117,10 +1146,19 @@ def selected_external_agent_selection(component_id: str, root: Path | None = Non
|
|
|
1117
1146
|
root = default_store_root() if root is None else root
|
|
1118
1147
|
if root.is_symlink():
|
|
1119
1148
|
raise ComponentRuntimeError("component_storage_invalid")
|
|
1120
|
-
if not root.exists():
|
|
1121
|
-
return None, None
|
|
1122
1149
|
try:
|
|
1123
|
-
if os.name
|
|
1150
|
+
if os.name == "posix" and os.environ.get("WSL_DISTRO_NAME"):
|
|
1151
|
+
if root.exists():
|
|
1152
|
+
_require_absent_unverified_selection(root, component_id)
|
|
1153
|
+
selection = _wsl_external_selection(component_id)
|
|
1154
|
+
if selection is not None:
|
|
1155
|
+
if not selection["enabled"]:
|
|
1156
|
+
raise ComponentRuntimeError("component_disabled")
|
|
1157
|
+
return selection["external_path"], selection["revision"]
|
|
1158
|
+
return None, None
|
|
1159
|
+
if not root.exists():
|
|
1160
|
+
return None, None
|
|
1161
|
+
if os.name != "posix":
|
|
1124
1162
|
_require_absent_unverified_selection(root, component_id)
|
|
1125
1163
|
return None, None
|
|
1126
1164
|
with _ComponentManagerLock(root):
|
|
@@ -1155,9 +1193,18 @@ def require_unselected_component(component_id: str, root: Path | None = None) ->
|
|
|
1155
1193
|
root = default_store_root() if root is None else root
|
|
1156
1194
|
if root.is_symlink():
|
|
1157
1195
|
raise ComponentRuntimeError("component_storage_invalid")
|
|
1196
|
+
if os.name == "posix" and os.environ.get("WSL_DISTRO_NAME"):
|
|
1197
|
+
try:
|
|
1198
|
+
if root.exists():
|
|
1199
|
+
_require_absent_unverified_selection(root, component_id)
|
|
1200
|
+
if _wsl_external_selection(component_id) is not None:
|
|
1201
|
+
raise ComponentRuntimeError("component_selection_changed")
|
|
1202
|
+
except OSError as error:
|
|
1203
|
+
raise ComponentRuntimeError("component_storage_unavailable") from error
|
|
1204
|
+
return
|
|
1158
1205
|
if not root.exists():
|
|
1159
1206
|
return
|
|
1160
|
-
if os.name != "posix"
|
|
1207
|
+
if os.name != "posix":
|
|
1161
1208
|
try:
|
|
1162
1209
|
_require_absent_unverified_selection(root, component_id)
|
|
1163
1210
|
except OSError as error:
|
|
@@ -1188,11 +1235,20 @@ def require_external_selection(
|
|
|
1188
1235
|
root = default_store_root() if root is None else root
|
|
1189
1236
|
if root.is_symlink():
|
|
1190
1237
|
raise ComponentRuntimeError("component_storage_invalid")
|
|
1191
|
-
if not root.exists():
|
|
1192
|
-
raise ComponentRuntimeError("component_selection_changed")
|
|
1193
|
-
if os.name != "posix" or os.environ.get("WSL_DISTRO_NAME"):
|
|
1194
|
-
raise ComponentRuntimeError("component_platform_unverified")
|
|
1195
1238
|
try:
|
|
1239
|
+
if os.name == "posix" and os.environ.get("WSL_DISTRO_NAME"):
|
|
1240
|
+
if root.exists():
|
|
1241
|
+
_require_absent_unverified_selection(root, component_id)
|
|
1242
|
+
selection = _wsl_external_selection(component_id)
|
|
1243
|
+
if component_id != "forgexa.ocr" or selection is None or selection["revision"] != revision:
|
|
1244
|
+
raise ComponentRuntimeError("component_selection_changed")
|
|
1245
|
+
if not selection["enabled"] and not allow_disabled:
|
|
1246
|
+
raise ComponentRuntimeError("component_disabled")
|
|
1247
|
+
return selection["external_path"]
|
|
1248
|
+
if not root.exists():
|
|
1249
|
+
raise ComponentRuntimeError("component_selection_changed")
|
|
1250
|
+
if os.name != "posix":
|
|
1251
|
+
raise ComponentRuntimeError("component_platform_unverified")
|
|
1196
1252
|
with _ComponentManagerLock(root):
|
|
1197
1253
|
target = _component_target(root)
|
|
1198
1254
|
selection = _record(
|
|
@@ -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.98.
|
|
1415
|
+
DAEMON_VERSION = "1.98.5"
|
|
1416
1416
|
|
|
1417
1417
|
|
|
1418
1418
|
def _detect_client_type() -> str:
|
|
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
|