forgexa-cli 1.104.0__tar.gz → 1.104.1__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 (40) hide show
  1. {forgexa_cli-1.104.0 → forgexa_cli-1.104.1}/PKG-INFO +1 -1
  2. {forgexa_cli-1.104.0 → forgexa_cli-1.104.1}/forgexa_cli/__init__.py +1 -1
  3. {forgexa_cli-1.104.0 → forgexa_cli-1.104.1}/forgexa_cli/agent_core.py +18 -2
  4. {forgexa_cli-1.104.0 → forgexa_cli-1.104.1}/forgexa_cli/daemon.py +50 -3
  5. {forgexa_cli-1.104.0 → forgexa_cli-1.104.1}/forgexa_cli.egg-info/PKG-INFO +1 -1
  6. {forgexa_cli-1.104.0 → forgexa_cli-1.104.1}/pyproject.toml +1 -1
  7. {forgexa_cli-1.104.0 → forgexa_cli-1.104.1}/README.md +0 -0
  8. {forgexa_cli-1.104.0 → forgexa_cli-1.104.1}/forgexa_cli/_build_config.py +0 -0
  9. {forgexa_cli-1.104.0 → forgexa_cli-1.104.1}/forgexa_cli/_local_bind.py +0 -0
  10. {forgexa_cli-1.104.0 → forgexa_cli-1.104.1}/forgexa_cli/autoupgrade.py +0 -0
  11. {forgexa_cli-1.104.0 → forgexa_cli-1.104.1}/forgexa_cli/aws_evidence.py +0 -0
  12. {forgexa_cli-1.104.0 → forgexa_cli-1.104.1}/forgexa_cli/aws_logs_evidence.py +0 -0
  13. {forgexa_cli-1.104.0 → forgexa_cli-1.104.1}/forgexa_cli/code_review_rules.py +0 -0
  14. {forgexa_cli-1.104.0 → forgexa_cli-1.104.1}/forgexa_cli/component_runtime.py +0 -0
  15. {forgexa_cli-1.104.0 → forgexa_cli-1.104.1}/forgexa_cli/main.py +0 -0
  16. {forgexa_cli-1.104.0 → forgexa_cli-1.104.1}/forgexa_cli/observability_contract.py +0 -0
  17. {forgexa_cli-1.104.0 → forgexa_cli-1.104.1}/forgexa_cli/observability_evidence.py +0 -0
  18. {forgexa_cli-1.104.0 → forgexa_cli-1.104.1}/forgexa_cli/ocr_adapter.py +0 -0
  19. {forgexa_cli-1.104.0 → forgexa_cli-1.104.1}/forgexa_cli/py.typed +0 -0
  20. {forgexa_cli-1.104.0 → forgexa_cli-1.104.1}/forgexa_cli/runtime_evidence.py +0 -0
  21. {forgexa_cli-1.104.0 → forgexa_cli-1.104.1}/forgexa_cli/workspace_storage.py +0 -0
  22. {forgexa_cli-1.104.0 → forgexa_cli-1.104.1}/forgexa_cli/zcode_protocol.py +0 -0
  23. {forgexa_cli-1.104.0 → forgexa_cli-1.104.1}/forgexa_cli.egg-info/SOURCES.txt +0 -0
  24. {forgexa_cli-1.104.0 → forgexa_cli-1.104.1}/forgexa_cli.egg-info/dependency_links.txt +0 -0
  25. {forgexa_cli-1.104.0 → forgexa_cli-1.104.1}/forgexa_cli.egg-info/entry_points.txt +0 -0
  26. {forgexa_cli-1.104.0 → forgexa_cli-1.104.1}/forgexa_cli.egg-info/requires.txt +0 -0
  27. {forgexa_cli-1.104.0 → forgexa_cli-1.104.1}/forgexa_cli.egg-info/top_level.txt +0 -0
  28. {forgexa_cli-1.104.0 → forgexa_cli-1.104.1}/setup.cfg +0 -0
  29. {forgexa_cli-1.104.0 → forgexa_cli-1.104.1}/tests/test_auth_and_runtime_commands.py +0 -0
  30. {forgexa_cli-1.104.0 → forgexa_cli-1.104.1}/tests/test_autoupgrade.py +0 -0
  31. {forgexa_cli-1.104.0 → forgexa_cli-1.104.1}/tests/test_check_command.py +0 -0
  32. {forgexa_cli-1.104.0 → forgexa_cli-1.104.1}/tests/test_delivery_review_packaged.py +0 -0
  33. {forgexa_cli-1.104.0 → forgexa_cli-1.104.1}/tests/test_expiry_warnings_and_revoke.py +0 -0
  34. {forgexa_cli-1.104.0 → forgexa_cli-1.104.1}/tests/test_local_bind_commands.py +0 -0
  35. {forgexa_cli-1.104.0 → forgexa_cli-1.104.1}/tests/test_publish_script.py +0 -0
  36. {forgexa_cli-1.104.0 → forgexa_cli-1.104.1}/tests/test_runtime_credentials.py +0 -0
  37. {forgexa_cli-1.104.0 → forgexa_cli-1.104.1}/tests/test_session_credentials.py +0 -0
  38. {forgexa_cli-1.104.0 → forgexa_cli-1.104.1}/tests/test_silent_install.py +0 -0
  39. {forgexa_cli-1.104.0 → forgexa_cli-1.104.1}/tests/test_upgrade_observability.py +0 -0
  40. {forgexa_cli-1.104.0 → forgexa_cli-1.104.1}/tests/test_workspace_storage.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: forgexa-cli
3
- Version: 1.104.0
3
+ Version: 1.104.1
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.104.0"
2
+ __version__ = "1.104.1"
@@ -3731,6 +3731,7 @@ DELIVERY_REVIEW_AGENT_IDS = frozenset({
3731
3731
  "claude", "codebuddy", "codex", "copilot", "deepseek", "gemini", "kimi",
3732
3732
  "mimo", "minimax", "opencode", "qoder", "qwen", "trae", "zcode",
3733
3733
  })
3734
+ LINUX_DELIVERY_REVIEW_AGENT_IDS = frozenset({"claude", "copilot", "opencode"})
3734
3735
  DELIVERY_REVIEW_SENSITIVE_PATTERNS = (
3735
3736
  r"/[.]env([.][^/]*)?$", r"[.](pem|key|p12|pfx)$", r"/(id_rsa|id_ed25519)([.][^/]*)?$",
3736
3737
  r"/[.]aws/credentials$", r"/[.](npmrc|netrc)$", r"/[.]git(/|$)",
@@ -3738,8 +3739,23 @@ DELIVERY_REVIEW_SENSITIVE_PATTERNS = (
3738
3739
 
3739
3740
 
3740
3741
  def delivery_review_sandbox_exec() -> str | None:
3741
- executable = "/usr/bin/sandbox-exec"
3742
- return executable if sys.platform == "darwin" and os.path.isfile(executable) and os.access(executable, os.X_OK) else None
3742
+ if sys.platform not in {"darwin", "linux"}:
3743
+ return None
3744
+ executable = "/usr/bin/sandbox-exec" if sys.platform == "darwin" else "/usr/bin/bwrap"
3745
+ if not os.path.isfile(executable) or not os.access(executable, os.X_OK):
3746
+ return None
3747
+ if sys.platform == "linux":
3748
+ try:
3749
+ probe = subprocess.run(
3750
+ [executable, "--unshare-all", "--die-with-parent", "--new-session",
3751
+ "--ro-bind", "/", "/", "--proc", "/proc", "--dev", "/dev", "--", "/bin/true"],
3752
+ stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL, timeout=3, check=False,
3753
+ )
3754
+ except (OSError, subprocess.SubprocessError):
3755
+ return None
3756
+ if probe.returncode != 0:
3757
+ return None
3758
+ return executable
3743
3759
 
3744
3760
 
3745
3761
  _OPENCODE_WORKER_DENIED_TOOLS = (
@@ -1428,7 +1428,7 @@ except (ImportError, ModuleNotFoundError):
1428
1428
  # DAEMON_VERSION is the protocol/logic version of the daemon code.
1429
1429
  # Kept in sync with pyproject.toml version via bump-version.sh.
1430
1430
  # CLIENT_TYPE identifies which packaging/distribution this daemon runs in.
1431
- DAEMON_VERSION = "1.104.0"
1431
+ DAEMON_VERSION = "1.104.1"
1432
1432
 
1433
1433
 
1434
1434
  def _detect_client_type() -> str:
@@ -6624,7 +6624,7 @@ def _delivery_review_capabilities() -> dict:
6624
6624
  return {"delivery_code_review": {
6625
6625
  "protocol_version": 2,
6626
6626
  "ocr_delegation_version": 1,
6627
- "agent_ids": sorted(agent_core.DELIVERY_REVIEW_AGENT_IDS),
6627
+ "agent_ids": sorted(agent_core.LINUX_DELIVERY_REVIEW_AGENT_IDS if sys.platform == "linux" else agent_core.DELIVERY_REVIEW_AGENT_IDS),
6628
6628
  }}
6629
6629
  return {}
6630
6630
 
@@ -6683,8 +6683,52 @@ def _delivery_review_sandbox_command(command: list[str], workspace: Path, home:
6683
6683
  virtualenv = executable_path.parent.parent
6684
6684
  if (virtualenv / "pyvenv.cfg").is_file():
6685
6685
  read_roots.add(str(virtualenv))
6686
+ if sys.platform == "linux":
6687
+ node_executable = shutil.which("node")
6688
+ if node_executable:
6689
+ read_roots.add(str(Path(node_executable).resolve().parent))
6690
+ for parent in executable_path.resolve().parents:
6691
+ if parent == user_home_path or parent in user_home_path.parents:
6692
+ break
6693
+ if (parent / "package.json").is_file():
6694
+ read_roots.add(str(parent))
6695
+ break
6686
6696
  if any(Path(root) == user_home_path or Path(root) in user_home_path.parents for root in read_roots):
6687
6697
  raise RuntimeError("delivery_review_sandbox_scope_invalid")
6698
+ if sys.platform == "linux":
6699
+ wrapped = [sandbox, "--unshare-all", "--die-with-parent", "--new-session", "--cap-drop", "ALL"]
6700
+ if network:
6701
+ wrapped.append("--share-net")
6702
+ system_paths = (
6703
+ "/usr", "/bin", "/sbin", "/lib", "/lib64", "/etc/ssl/certs", "/etc/ca-certificates",
6704
+ "/etc/pki", "/etc/resolv.conf", "/etc/hosts", "/etc/nsswitch.conf", "/etc/gai.conf",
6705
+ "/etc/localtime", "/etc/passwd", "/etc/group", "/etc/ld.so.cache", "/etc/alternatives",
6706
+ )
6707
+ for path in system_paths:
6708
+ if Path(path).exists():
6709
+ wrapped += ["--ro-bind", path, path]
6710
+ wrapped += ["--proc", "/proc", "--dev", "/dev", "--tmpfs", "/tmp", "--tmpfs", "/var/tmp"]
6711
+ for root in sorted(read_roots):
6712
+ if not Path(root).is_dir():
6713
+ raise RuntimeError("delivery_review_sandbox_scope_invalid")
6714
+ wrapped += ["--ro-bind", root, root]
6715
+ wrapped += ["--bind" if writable else "--ro-bind", str(workspace_path), str(workspace_path)]
6716
+ wrapped += ["--bind", str(home_path), str(home_path)]
6717
+ protected = {path.absolute() for path in (deny_paths or [])}
6718
+ for root in (workspace_path, home_path, *(Path(path) for path in read_roots if not str(path).startswith(("/usr/", "/bin", "/sbin", "/lib")))):
6719
+ for directory, directories, files in os.walk(root, followlinks=False):
6720
+ for name in [*directories, *files]:
6721
+ path = Path(directory) / name
6722
+ if any(re.search(pattern, str(path)) for pattern in agent_core.DELIVERY_REVIEW_SENSITIVE_PATTERNS):
6723
+ protected.add(path)
6724
+ if name in directories:
6725
+ directories.remove(name)
6726
+ for path in sorted(protected):
6727
+ if path.is_dir():
6728
+ wrapped += ["--tmpfs", str(path)]
6729
+ elif path.exists() or path.is_symlink():
6730
+ wrapped += ["--ro-bind", "/dev/null", str(path)]
6731
+ return [*wrapped, "--chdir", str(workspace_path), "--", *command]
6688
6732
  executable_rules = " ".join(f"(subpath {json.dumps(root)})" for root in sorted(read_roots))
6689
6733
  metadata_paths = {
6690
6734
  str(parent) for root in [*read_roots, str(workspace.resolve()), str(home.resolve())]
@@ -8091,7 +8135,7 @@ class ProcessManager:
8091
8135
  )
8092
8136
  # Copy auth.json so provider credentials are available.
8093
8137
  auth_src = Path.home() / ".local" / "share" / "opencode" / "auth.json"
8094
- if profile == "v1" and auth_src.exists():
8138
+ if (profile == "v1" or delivery_review) and auth_src.exists():
8095
8139
  shutil.copy2(auth_src, isolated_data_dir / "auth.json")
8096
8140
  try:
8097
8141
  env = agent_core.opencode_base_env(
@@ -8107,6 +8151,9 @@ class ProcessManager:
8107
8151
  env.update(TMPDIR=tmp_data_root, BUN_TMPDIR=tmp_data_root)
8108
8152
  if delivery_review:
8109
8153
  env.update(
8154
+ HOME=tmp_data_root,
8155
+ USERPROFILE=tmp_data_root,
8156
+ XDG_DATA_HOME=tmp_data_root,
8110
8157
  XDG_CONFIG_HOME=str(Path(tmp_data_root) / "config"),
8111
8158
  XDG_CACHE_HOME=str(Path(tmp_data_root) / "cache"),
8112
8159
  XDG_STATE_HOME=str(Path(tmp_data_root) / "state"),
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: forgexa-cli
3
- Version: 1.104.0
3
+ Version: 1.104.1
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.104.0"
3
+ version = "1.104.1"
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