forgexa-cli 1.96.4__tar.gz → 1.97.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.
Files changed (36) hide show
  1. {forgexa_cli-1.96.4 → forgexa_cli-1.97.0}/PKG-INFO +1 -1
  2. {forgexa_cli-1.96.4 → forgexa_cli-1.97.0}/forgexa_cli/__init__.py +1 -1
  3. {forgexa_cli-1.96.4 → forgexa_cli-1.97.0}/forgexa_cli/component_runtime.py +92 -9
  4. {forgexa_cli-1.96.4 → forgexa_cli-1.97.0}/forgexa_cli/daemon.py +1 -1
  5. forgexa_cli-1.97.0/forgexa_cli/ocr_adapter.py +319 -0
  6. {forgexa_cli-1.96.4 → forgexa_cli-1.97.0}/forgexa_cli.egg-info/PKG-INFO +1 -1
  7. {forgexa_cli-1.96.4 → forgexa_cli-1.97.0}/forgexa_cli.egg-info/SOURCES.txt +1 -0
  8. {forgexa_cli-1.96.4 → forgexa_cli-1.97.0}/pyproject.toml +1 -1
  9. {forgexa_cli-1.96.4 → forgexa_cli-1.97.0}/README.md +0 -0
  10. {forgexa_cli-1.96.4 → forgexa_cli-1.97.0}/forgexa_cli/_build_config.py +0 -0
  11. {forgexa_cli-1.96.4 → forgexa_cli-1.97.0}/forgexa_cli/_local_bind.py +0 -0
  12. {forgexa_cli-1.96.4 → forgexa_cli-1.97.0}/forgexa_cli/agent_core.py +0 -0
  13. {forgexa_cli-1.96.4 → forgexa_cli-1.97.0}/forgexa_cli/autoupgrade.py +0 -0
  14. {forgexa_cli-1.96.4 → forgexa_cli-1.97.0}/forgexa_cli/aws_evidence.py +0 -0
  15. {forgexa_cli-1.96.4 → forgexa_cli-1.97.0}/forgexa_cli/aws_logs_evidence.py +0 -0
  16. {forgexa_cli-1.96.4 → forgexa_cli-1.97.0}/forgexa_cli/main.py +0 -0
  17. {forgexa_cli-1.96.4 → forgexa_cli-1.97.0}/forgexa_cli/observability_contract.py +0 -0
  18. {forgexa_cli-1.96.4 → forgexa_cli-1.97.0}/forgexa_cli/observability_evidence.py +0 -0
  19. {forgexa_cli-1.96.4 → forgexa_cli-1.97.0}/forgexa_cli/py.typed +0 -0
  20. {forgexa_cli-1.96.4 → forgexa_cli-1.97.0}/forgexa_cli/runtime_evidence.py +0 -0
  21. {forgexa_cli-1.96.4 → forgexa_cli-1.97.0}/forgexa_cli/zcode_protocol.py +0 -0
  22. {forgexa_cli-1.96.4 → forgexa_cli-1.97.0}/forgexa_cli.egg-info/dependency_links.txt +0 -0
  23. {forgexa_cli-1.96.4 → forgexa_cli-1.97.0}/forgexa_cli.egg-info/entry_points.txt +0 -0
  24. {forgexa_cli-1.96.4 → forgexa_cli-1.97.0}/forgexa_cli.egg-info/requires.txt +0 -0
  25. {forgexa_cli-1.96.4 → forgexa_cli-1.97.0}/forgexa_cli.egg-info/top_level.txt +0 -0
  26. {forgexa_cli-1.96.4 → forgexa_cli-1.97.0}/setup.cfg +0 -0
  27. {forgexa_cli-1.96.4 → forgexa_cli-1.97.0}/tests/test_auth_and_runtime_commands.py +0 -0
  28. {forgexa_cli-1.96.4 → forgexa_cli-1.97.0}/tests/test_autoupgrade.py +0 -0
  29. {forgexa_cli-1.96.4 → forgexa_cli-1.97.0}/tests/test_check_command.py +0 -0
  30. {forgexa_cli-1.96.4 → forgexa_cli-1.97.0}/tests/test_expiry_warnings_and_revoke.py +0 -0
  31. {forgexa_cli-1.96.4 → forgexa_cli-1.97.0}/tests/test_local_bind_commands.py +0 -0
  32. {forgexa_cli-1.96.4 → forgexa_cli-1.97.0}/tests/test_publish_script.py +0 -0
  33. {forgexa_cli-1.96.4 → forgexa_cli-1.97.0}/tests/test_runtime_credentials.py +0 -0
  34. {forgexa_cli-1.96.4 → forgexa_cli-1.97.0}/tests/test_session_credentials.py +0 -0
  35. {forgexa_cli-1.96.4 → forgexa_cli-1.97.0}/tests/test_silent_install.py +0 -0
  36. {forgexa_cli-1.96.4 → forgexa_cli-1.97.0}/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.96.4
3
+ Version: 1.97.0
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.96.4"
2
+ __version__ = "1.97.0"
@@ -695,10 +695,80 @@ def inspect_usage(lease_id: str, root: Path | None = None) -> dict[str, Any]:
695
695
  return result
696
696
 
697
697
 
698
- def runtime_capabilities(
699
- runtime_instance_id: str, root: Path | None = None
700
- ) -> dict[str, Any] | None:
701
- _identifier(runtime_instance_id)
698
+ def inspect_installation_usage(installation_id: str, root: Path | None = None) -> dict[str, Any]:
699
+ _identifier(installation_id)
700
+ root = default_store_root() if root is None else root
701
+ if os.name != "posix" or os.environ.get("WSL_DISTRO_NAME"):
702
+ raise ComponentRuntimeError("component_platform_unverified")
703
+
704
+ def snapshot() -> tuple[dict[str, Any], dict[str, Any], list[tuple[str, str, int]]]:
705
+ with _ComponentManagerLock(root):
706
+ target = _component_target(root)
707
+ _private_directory(root / "receipts")
708
+ receipt = _record(root / "receipts" / f"{installation_id}.json", {
709
+ "schema_version", "installation_id", "target_id", "release", "content_digest",
710
+ "entry_point", "files", "created_by_operation_id",
711
+ })
712
+ if (
713
+ receipt is None
714
+ or receipt["installation_id"] != installation_id
715
+ or receipt["target_id"] != target["target_id"]
716
+ ):
717
+ raise ComponentRuntimeError("component_receipt_invalid")
718
+ _private_directory(root / "leases")
719
+ records = []
720
+ for index, path in enumerate((root / "leases").iterdir(), 1):
721
+ if index > 4096:
722
+ raise ComponentRuntimeError("component_usage_unavailable")
723
+ if path.suffix != ".json":
724
+ continue
725
+ lease_id = _identifier(path.stem)
726
+ record = _record(path, {
727
+ "schema_version", "target_id", "installation_id", "lease_id", "process_id",
728
+ "owner_nonce",
729
+ }, 16_384)
730
+ if (
731
+ record is None
732
+ or record["lease_id"] != lease_id
733
+ or record["target_id"] != target["target_id"]
734
+ ):
735
+ raise ComponentRuntimeError("component_usage_changed")
736
+ _identifier(record["installation_id"])
737
+ owner_nonce = _digest(record["owner_nonce"])
738
+ process_id = record["process_id"]
739
+ if type(process_id) is not int or process_id <= 0:
740
+ raise ComponentRuntimeError("component_record_invalid")
741
+ if record["installation_id"] == installation_id:
742
+ if len(records) >= 64:
743
+ raise ComponentRuntimeError("component_usage_unavailable")
744
+ records.append((lease_id, owner_nonce, process_id))
745
+ return target, receipt, sorted(records)
746
+
747
+ target, receipt, records = snapshot()
748
+ counts = {"active": 0, "legacy_unknown": 0, "spawn_unknown": 0, "descendants_unknown": 0}
749
+ for lease_id, _owner_nonce, _process_id in records:
750
+ result = inspect_usage(lease_id, root=root)
751
+ if (
752
+ result["target_id"] != target["target_id"]
753
+ or result["generation"] != target["generation"]
754
+ or result["installation_id"] != installation_id
755
+ ):
756
+ raise ComponentRuntimeError("component_usage_changed")
757
+ counts[result["state"]] += 1
758
+ if snapshot() != (target, receipt, records):
759
+ raise ComponentRuntimeError("component_usage_changed")
760
+ return {
761
+ "schema_version": 1,
762
+ "target_id": target["target_id"],
763
+ "generation": target["generation"],
764
+ "installation_id": installation_id,
765
+ "state": "active" if counts["active"] else "unknown",
766
+ "descendant_coverage": "observed_only",
767
+ "counts": counts,
768
+ }
769
+
770
+
771
+ def inspect_target(root: Path | None = None) -> dict[str, Any] | None:
702
772
  root = default_store_root() if root is None else root
703
773
  if root.is_symlink():
704
774
  raise ComponentRuntimeError("component_storage_invalid")
@@ -707,7 +777,16 @@ def runtime_capabilities(
707
777
  if os.name != "posix" or os.environ.get("WSL_DISTRO_NAME"):
708
778
  raise ComponentRuntimeError("component_platform_unverified")
709
779
  with _ComponentManagerLock(root):
710
- target = _component_target(root)
780
+ return _component_target(root)
781
+
782
+
783
+ def runtime_capabilities(
784
+ runtime_instance_id: str, root: Path | None = None
785
+ ) -> dict[str, Any] | None:
786
+ _identifier(runtime_instance_id)
787
+ target = inspect_target(root)
788
+ if target is None:
789
+ return None
711
790
  process_id = os.getpid()
712
791
  return {
713
792
  "schema_version": 1,
@@ -722,9 +801,12 @@ def runtime_capabilities(
722
801
 
723
802
 
724
803
  def _acquire_component(
725
- component_id: str, root: Path | None = None, override: str | None = None
804
+ component_id: str, root: Path | None = None, override: str | None = None,
805
+ kind: str = "agent",
726
806
  ) -> ManagedComponentLease | None:
727
807
  _identifier(component_id)
808
+ if kind not in {"agent", "plugin"}:
809
+ raise ComponentRuntimeError("component_receipt_invalid")
728
810
  root = default_store_root() if root is None else root
729
811
  if root.is_symlink():
730
812
  raise ComponentRuntimeError("component_storage_invalid")
@@ -813,7 +895,7 @@ def _acquire_component(
813
895
  if (
814
896
  type(release["schema_version"]) is not int
815
897
  or release["schema_version"] != 1
816
- or release["kind"] != "agent"
898
+ or release["kind"] != kind
817
899
  ):
818
900
  raise ComponentRuntimeError("component_receipt_invalid")
819
901
  for name in ("component_id", "release_id", "protocol_generation"):
@@ -879,10 +961,11 @@ def _acquire_component(
879
961
 
880
962
 
881
963
  def acquire_component(
882
- component_id: str, root: Path | None = None, override: str | None = None
964
+ component_id: str, root: Path | None = None, override: str | None = None,
965
+ kind: str = "agent",
883
966
  ) -> ManagedComponentLease | None:
884
967
  try:
885
- return _acquire_component(component_id, root, override)
968
+ return _acquire_component(component_id, root, override, kind)
886
969
  except OSError as error:
887
970
  raise ComponentRuntimeError("component_storage_unavailable") from error
888
971
 
@@ -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.96.4"
1415
+ DAEMON_VERSION = "1.97.0"
1416
1416
 
1417
1417
 
1418
1418
  def _detect_client_type() -> str:
@@ -0,0 +1,319 @@
1
+ from __future__ import annotations
2
+
3
+ import asyncio
4
+ import json
5
+ import math
6
+ import os
7
+ import re
8
+ import shutil
9
+ import signal
10
+ import tempfile
11
+ from pathlib import Path, PurePosixPath
12
+ from typing import Any
13
+
14
+ if __package__:
15
+ from .component_runtime import ManagedComponentLease, observe_owned_process
16
+ else:
17
+ from component_runtime import ManagedComponentLease, observe_owned_process
18
+
19
+ OCR_COMPONENT_ID = "forgexa.ocr"
20
+ OCR_OUTPUT_LIMIT = 1024 * 1024
21
+ OCR_FILE_LIMIT = 5000
22
+
23
+
24
+ class OcrAdapterError(RuntimeError):
25
+ def __init__(self, code: str) -> None:
26
+ self.code = code
27
+ super().__init__(code)
28
+
29
+
30
+ def _object(pairs: list[tuple[str, Any]]) -> dict[str, Any]:
31
+ result: dict[str, Any] = {}
32
+ for key, value in pairs:
33
+ if key in result:
34
+ raise OcrAdapterError("ocr_output_invalid")
35
+ result[key] = value
36
+ return result
37
+
38
+
39
+ def _decode(payload: bytes | str) -> dict[str, Any]:
40
+ if len(payload if isinstance(payload, bytes) else payload.encode()) > OCR_OUTPUT_LIMIT:
41
+ raise OcrAdapterError("ocr_output_limit")
42
+ try:
43
+ value = json.loads(payload, object_pairs_hook=_object)
44
+ except (ValueError, UnicodeError) as exc:
45
+ raise OcrAdapterError("ocr_output_invalid") from exc
46
+ if not isinstance(value, dict) or value.get("schema_version") != "1":
47
+ raise OcrAdapterError("ocr_schema_unsupported")
48
+ return value
49
+
50
+
51
+ def _count(value: Any) -> int:
52
+ if type(value) is not int or value < 0 or value > 9_007_199_254_740_991:
53
+ raise OcrAdapterError("ocr_output_invalid")
54
+ return value
55
+
56
+
57
+ def _text(value: Any, limit: int) -> str:
58
+ if not isinstance(value, str) or len(value) > limit or "\x00" in value:
59
+ raise OcrAdapterError("ocr_output_invalid")
60
+ return value
61
+
62
+
63
+ def _path(value: Any) -> str:
64
+ try:
65
+ value = _text(value, 4096)
66
+ except OcrAdapterError as exc:
67
+ raise OcrAdapterError("ocr_path_invalid") from exc
68
+ path = PurePosixPath(value)
69
+ if not value or path.is_absolute() or "\\" in value or ":" in value:
70
+ raise OcrAdapterError("ocr_path_invalid")
71
+ if any(part in {"", ".", ".."} for part in value.split("/")):
72
+ raise OcrAdapterError("ocr_path_invalid")
73
+ if any(ord(character) < 32 for character in value):
74
+ raise OcrAdapterError("ocr_path_invalid")
75
+ return value
76
+
77
+
78
+ def parse_ocr_preview(payload: bytes | str, repository: Path) -> dict[str, Any]:
79
+ value = _decode(payload)
80
+ if value.get("mode") != "workspace" or any(value.get(key) for key in ("from", "to", "commit")):
81
+ raise OcrAdapterError("ocr_mode_unsupported")
82
+ returned = Path(_text(value.get("repository"), 4096))
83
+ if not returned.is_absolute() or returned.resolve() != repository.resolve():
84
+ raise OcrAdapterError("ocr_repository_changed")
85
+ paths: set[str] = set()
86
+ for key, count_key in (
87
+ ("reviewable_files", "reviewable_count"),
88
+ ("excluded_files", "excluded_count"),
89
+ ):
90
+ files = value.get(key)
91
+ if (
92
+ not isinstance(files, list)
93
+ or len(files) > OCR_FILE_LIMIT
94
+ or len(files) != _count(value.get(count_key))
95
+ ):
96
+ raise OcrAdapterError("ocr_output_invalid")
97
+ for entry in files:
98
+ if not isinstance(entry, dict):
99
+ raise OcrAdapterError("ocr_output_invalid")
100
+ path = _path(entry.get("path"))
101
+ if path in paths:
102
+ raise OcrAdapterError("ocr_output_invalid")
103
+ paths.add(path)
104
+ if not _text(entry.get("status"), 128):
105
+ raise OcrAdapterError("ocr_output_invalid")
106
+ _count(entry.get("insertions"))
107
+ _count(entry.get("deletions"))
108
+ if "exclude_reason" in entry:
109
+ _text(entry["exclude_reason"], 2048)
110
+ if _count(value.get("total_files")) != len(paths) or len(paths) > OCR_FILE_LIMIT:
111
+ raise OcrAdapterError("ocr_output_invalid")
112
+ _count(value.get("total_insertions"))
113
+ _count(value.get("total_deletions"))
114
+ return value
115
+
116
+
117
+ def parse_ocr_rules(payload: bytes | str, requested_paths: list[str]) -> dict[str, Any]:
118
+ requested = {_path(path) for path in requested_paths}
119
+ if not requested or len(requested_paths) != len(requested) or len(requested) > OCR_FILE_LIMIT:
120
+ raise OcrAdapterError("ocr_path_invalid")
121
+ value = _decode(payload)
122
+ groups = value.get("groups")
123
+ if not isinstance(groups, list) or len(groups) > OCR_FILE_LIMIT:
124
+ raise OcrAdapterError("ocr_output_invalid")
125
+ group_ids: set[int] = set()
126
+ covered: set[str] = set()
127
+ for group in groups:
128
+ if not isinstance(group, dict):
129
+ raise OcrAdapterError("ocr_output_invalid")
130
+ group_id = _count(group.get("group_id"))
131
+ if group_id < 1 or group_id in group_ids:
132
+ raise OcrAdapterError("ocr_output_invalid")
133
+ group_ids.add(group_id)
134
+ _text(group.get("source"), 4096)
135
+ _text(group.get("pattern"), 4096)
136
+ _text(group.get("rule"), 64 * 1024)
137
+ files = group.get("files")
138
+ if not isinstance(files, list) or len(files) > OCR_FILE_LIMIT:
139
+ raise OcrAdapterError("ocr_output_invalid")
140
+ for entry in files:
141
+ path = _path(entry)
142
+ if path not in requested:
143
+ raise OcrAdapterError("ocr_rule_scope_invalid")
144
+ covered.add(path)
145
+ if covered != requested:
146
+ raise OcrAdapterError("ocr_rule_scope_invalid")
147
+ return value
148
+
149
+
150
+ async def _read_output(stream: asyncio.StreamReader, limit: int) -> bytes:
151
+ output = bytearray()
152
+ while True:
153
+ chunk = await stream.read(16 * 1024)
154
+ if not chunk:
155
+ return bytes(output)
156
+ output.extend(chunk)
157
+ if len(output) > limit:
158
+ raise OcrAdapterError("ocr_output_limit")
159
+
160
+
161
+ async def _stop_process(process: asyncio.subprocess.Process) -> None:
162
+ if process.returncode is not None:
163
+ return
164
+ try:
165
+ os.killpg(process.pid, signal.SIGTERM)
166
+ await asyncio.wait_for(process.wait(), 1)
167
+ except asyncio.TimeoutError:
168
+ try:
169
+ os.killpg(process.pid, signal.SIGKILL)
170
+ await asyncio.wait_for(process.wait(), 5)
171
+ except (asyncio.TimeoutError, OSError) as exc:
172
+ raise OcrAdapterError("ocr_cleanup_unconfirmed") from exc
173
+ except ProcessLookupError:
174
+ try:
175
+ await asyncio.wait_for(process.wait(), 5)
176
+ except asyncio.TimeoutError as exc:
177
+ raise OcrAdapterError("ocr_cleanup_unconfirmed") from exc
178
+
179
+
180
+ async def _command_output(
181
+ command: list[str],
182
+ directory: Path,
183
+ environment: dict[str, str],
184
+ timeout: float,
185
+ lease: ManagedComponentLease | None = None,
186
+ ) -> bytes:
187
+ process = None
188
+ observer = None
189
+ readers: list[asyncio.Task] = []
190
+ deadline = asyncio.get_running_loop().time() + timeout
191
+ try:
192
+ if lease is not None:
193
+ lease.verify()
194
+ lease.begin_spawn()
195
+ spawn = asyncio.create_task(
196
+ asyncio.create_subprocess_exec(
197
+ *command,
198
+ cwd=str(directory),
199
+ env=environment,
200
+ stdin=asyncio.subprocess.DEVNULL,
201
+ stdout=asyncio.subprocess.PIPE,
202
+ stderr=asyncio.subprocess.PIPE,
203
+ start_new_session=True,
204
+ )
205
+ )
206
+ try:
207
+ process = await asyncio.shield(spawn)
208
+ except asyncio.CancelledError:
209
+ process = await spawn
210
+ raise
211
+ if lease is not None:
212
+ lease.record_process(process.pid)
213
+ observer = asyncio.create_task(observe_owned_process(lease, process))
214
+ readers = [
215
+ asyncio.create_task(_read_output(process.stdout, OCR_OUTPUT_LIMIT)),
216
+ asyncio.create_task(_read_output(process.stderr, 64 * 1024)),
217
+ ]
218
+ output, _stderr = await asyncio.wait_for(
219
+ asyncio.gather(*readers),
220
+ max(0, deadline - asyncio.get_running_loop().time()),
221
+ )
222
+ await asyncio.wait_for(process.wait(), max(0, deadline - asyncio.get_running_loop().time()))
223
+ if process.returncode != 0:
224
+ raise OcrAdapterError("ocr_execution_failed")
225
+ if lease is not None:
226
+ lease.verify()
227
+ return output
228
+ except asyncio.TimeoutError as exc:
229
+ raise OcrAdapterError("ocr_timeout") from exc
230
+ finally:
231
+ if observer is not None:
232
+ observer.cancel()
233
+ await asyncio.gather(observer, return_exceptions=True)
234
+ try:
235
+ if process is not None:
236
+ await _stop_process(process)
237
+ finally:
238
+ for reader in readers:
239
+ reader.cancel()
240
+ if readers:
241
+ await asyncio.gather(*readers, return_exceptions=True)
242
+
243
+
244
+ async def run_ocr_delegation(
245
+ lease: ManagedComponentLease,
246
+ repository: Path,
247
+ action: str,
248
+ paths: list[str] | None = None,
249
+ timeout: float = 30,
250
+ ) -> dict[str, Any]:
251
+ if os.name != "posix" or os.environ.get("WSL_DISTRO_NAME"):
252
+ raise OcrAdapterError("ocr_platform_unverified")
253
+ release = lease.receipt["release"]
254
+ if release["component_id"] != OCR_COMPONENT_ID or release["kind"] != "plugin":
255
+ raise OcrAdapterError("ocr_instance_changed")
256
+ if (
257
+ not isinstance(action, str)
258
+ or action not in {"preview", "rule"}
259
+ or type(timeout) not in {int, float}
260
+ or not math.isfinite(timeout)
261
+ or timeout <= 0
262
+ or timeout > 60
263
+ ):
264
+ raise OcrAdapterError("ocr_request_invalid")
265
+ paths = [] if paths is None else paths
266
+ if (
267
+ not isinstance(paths, list)
268
+ or (action == "preview" and paths)
269
+ or (action == "rule" and not paths)
270
+ or len(paths) > OCR_FILE_LIMIT
271
+ ):
272
+ raise OcrAdapterError("ocr_request_invalid")
273
+ for path in paths:
274
+ _path(path)
275
+ if len(set(paths)) != len(paths):
276
+ raise OcrAdapterError("ocr_path_invalid")
277
+ repository = repository.resolve(strict=True)
278
+ if not repository.is_dir():
279
+ raise OcrAdapterError("ocr_repository_changed")
280
+ for path in paths:
281
+ if not (repository / path).resolve().is_relative_to(repository):
282
+ raise OcrAdapterError("ocr_path_invalid")
283
+ git = shutil.which("git")
284
+ if not git:
285
+ raise OcrAdapterError("ocr_git_unavailable")
286
+ with tempfile.TemporaryDirectory(prefix="forgexa-ocr-delegate-") as temporary:
287
+ directory = Path(temporary)
288
+ environment = lease.probe_environment(directory, baseline={})
289
+ environment.update(
290
+ {
291
+ "PATH": f"{Path(git).parent}{os.pathsep}{environment['PATH']}",
292
+ "GIT_CONFIG_NOSYSTEM": "1",
293
+ "GIT_CONFIG_GLOBAL": os.devnull,
294
+ "GIT_TERMINAL_PROMPT": "0",
295
+ }
296
+ )
297
+ version = await _command_output([git, "--version"], directory, environment, 5)
298
+ match = re.match(rb"git version (\d+)\.(\d+)", version)
299
+ if match is None or tuple(int(part) for part in match.groups()) < (2, 41):
300
+ raise OcrAdapterError("ocr_git_incompatible")
301
+ command = [
302
+ *lease.argv_prefix,
303
+ "delegate",
304
+ action,
305
+ "--format",
306
+ "json",
307
+ "--repo",
308
+ str(repository),
309
+ "--max-git-procs",
310
+ "2",
311
+ ]
312
+ if paths:
313
+ command.extend(["--", *paths])
314
+ output = await _command_output(command, repository, environment, timeout, lease)
315
+ return (
316
+ parse_ocr_preview(output, repository)
317
+ if action == "preview"
318
+ else parse_ocr_rules(output, paths)
319
+ )
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: forgexa-cli
3
- Version: 1.96.4
3
+ Version: 1.97.0
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
@@ -12,6 +12,7 @@ forgexa_cli/daemon.py
12
12
  forgexa_cli/main.py
13
13
  forgexa_cli/observability_contract.py
14
14
  forgexa_cli/observability_evidence.py
15
+ forgexa_cli/ocr_adapter.py
15
16
  forgexa_cli/py.typed
16
17
  forgexa_cli/runtime_evidence.py
17
18
  forgexa_cli/zcode_protocol.py
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "forgexa-cli"
3
- version = "1.96.4"
3
+ version = "1.97.0"
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