forgexa-cli 1.105.0__tar.gz → 1.106.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 (40) hide show
  1. {forgexa_cli-1.105.0 → forgexa_cli-1.106.0}/PKG-INFO +1 -1
  2. {forgexa_cli-1.105.0 → forgexa_cli-1.106.0}/forgexa_cli/__init__.py +1 -1
  3. {forgexa_cli-1.105.0 → forgexa_cli-1.106.0}/forgexa_cli/agent_core.py +24 -3
  4. {forgexa_cli-1.105.0 → forgexa_cli-1.106.0}/forgexa_cli/daemon.py +22 -2
  5. {forgexa_cli-1.105.0 → forgexa_cli-1.106.0}/forgexa_cli/observability_evidence.py +23 -13
  6. {forgexa_cli-1.105.0 → forgexa_cli-1.106.0}/forgexa_cli.egg-info/PKG-INFO +1 -1
  7. {forgexa_cli-1.105.0 → forgexa_cli-1.106.0}/pyproject.toml +1 -1
  8. {forgexa_cli-1.105.0 → forgexa_cli-1.106.0}/README.md +0 -0
  9. {forgexa_cli-1.105.0 → forgexa_cli-1.106.0}/forgexa_cli/_build_config.py +0 -0
  10. {forgexa_cli-1.105.0 → forgexa_cli-1.106.0}/forgexa_cli/_local_bind.py +0 -0
  11. {forgexa_cli-1.105.0 → forgexa_cli-1.106.0}/forgexa_cli/autoupgrade.py +0 -0
  12. {forgexa_cli-1.105.0 → forgexa_cli-1.106.0}/forgexa_cli/aws_evidence.py +0 -0
  13. {forgexa_cli-1.105.0 → forgexa_cli-1.106.0}/forgexa_cli/aws_logs_evidence.py +0 -0
  14. {forgexa_cli-1.105.0 → forgexa_cli-1.106.0}/forgexa_cli/code_review_rules.py +0 -0
  15. {forgexa_cli-1.105.0 → forgexa_cli-1.106.0}/forgexa_cli/component_runtime.py +0 -0
  16. {forgexa_cli-1.105.0 → forgexa_cli-1.106.0}/forgexa_cli/main.py +0 -0
  17. {forgexa_cli-1.105.0 → forgexa_cli-1.106.0}/forgexa_cli/observability_contract.py +0 -0
  18. {forgexa_cli-1.105.0 → forgexa_cli-1.106.0}/forgexa_cli/ocr_adapter.py +0 -0
  19. {forgexa_cli-1.105.0 → forgexa_cli-1.106.0}/forgexa_cli/py.typed +0 -0
  20. {forgexa_cli-1.105.0 → forgexa_cli-1.106.0}/forgexa_cli/runtime_evidence.py +0 -0
  21. {forgexa_cli-1.105.0 → forgexa_cli-1.106.0}/forgexa_cli/workspace_storage.py +0 -0
  22. {forgexa_cli-1.105.0 → forgexa_cli-1.106.0}/forgexa_cli/zcode_protocol.py +0 -0
  23. {forgexa_cli-1.105.0 → forgexa_cli-1.106.0}/forgexa_cli.egg-info/SOURCES.txt +0 -0
  24. {forgexa_cli-1.105.0 → forgexa_cli-1.106.0}/forgexa_cli.egg-info/dependency_links.txt +0 -0
  25. {forgexa_cli-1.105.0 → forgexa_cli-1.106.0}/forgexa_cli.egg-info/entry_points.txt +0 -0
  26. {forgexa_cli-1.105.0 → forgexa_cli-1.106.0}/forgexa_cli.egg-info/requires.txt +0 -0
  27. {forgexa_cli-1.105.0 → forgexa_cli-1.106.0}/forgexa_cli.egg-info/top_level.txt +0 -0
  28. {forgexa_cli-1.105.0 → forgexa_cli-1.106.0}/setup.cfg +0 -0
  29. {forgexa_cli-1.105.0 → forgexa_cli-1.106.0}/tests/test_auth_and_runtime_commands.py +0 -0
  30. {forgexa_cli-1.105.0 → forgexa_cli-1.106.0}/tests/test_autoupgrade.py +0 -0
  31. {forgexa_cli-1.105.0 → forgexa_cli-1.106.0}/tests/test_check_command.py +0 -0
  32. {forgexa_cli-1.105.0 → forgexa_cli-1.106.0}/tests/test_delivery_review_packaged.py +0 -0
  33. {forgexa_cli-1.105.0 → forgexa_cli-1.106.0}/tests/test_expiry_warnings_and_revoke.py +0 -0
  34. {forgexa_cli-1.105.0 → forgexa_cli-1.106.0}/tests/test_local_bind_commands.py +0 -0
  35. {forgexa_cli-1.105.0 → forgexa_cli-1.106.0}/tests/test_publish_script.py +0 -0
  36. {forgexa_cli-1.105.0 → forgexa_cli-1.106.0}/tests/test_runtime_credentials.py +0 -0
  37. {forgexa_cli-1.105.0 → forgexa_cli-1.106.0}/tests/test_session_credentials.py +0 -0
  38. {forgexa_cli-1.105.0 → forgexa_cli-1.106.0}/tests/test_silent_install.py +0 -0
  39. {forgexa_cli-1.105.0 → forgexa_cli-1.106.0}/tests/test_upgrade_observability.py +0 -0
  40. {forgexa_cli-1.105.0 → forgexa_cli-1.106.0}/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.105.0
3
+ Version: 1.106.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.105.0"
2
+ __version__ = "1.106.0"
@@ -2070,12 +2070,21 @@ class AgentDiscovery:
2070
2070
  / "globalStorage" / "github.copilot-chat" / "copilotCli"
2071
2071
  )
2072
2072
  if sys.platform == "linux":
2073
- # GitHub Copilot CLI on Linux VSCode
2073
+ # Homebrew is also an official Copilot CLI installation method on Linux.
2074
+ extra_dirs += [
2075
+ Path("/home/linuxbrew/.linuxbrew/bin"),
2076
+ home / ".linuxbrew" / "bin",
2077
+ ]
2078
+ # VS Code desktop and Remote/WSL extension-managed Linux CLIs.
2074
2079
  for config_dir in (
2075
2080
  home / ".config" / "Code" / "User" / "globalStorage"
2076
2081
  / "github.copilot-chat" / "copilotCli",
2077
2082
  home / ".config" / "Code - Insiders" / "User" / "globalStorage"
2078
2083
  / "github.copilot-chat" / "copilotCli",
2084
+ home / ".vscode-server" / "data" / "User" / "globalStorage"
2085
+ / "github.copilot-chat" / "copilotCli",
2086
+ home / ".vscode-server-insiders" / "data" / "User" / "globalStorage"
2087
+ / "github.copilot-chat" / "copilotCli",
2079
2088
  ):
2080
2089
  extra_dirs.append(config_dir)
2081
2090
  # nvm (macOS + Linux). Probe the default ~/.nvm root AND the
@@ -6408,6 +6417,18 @@ def copilot_base_env(env: dict[str, str], *, copilot_home: str | Path) -> dict[s
6408
6417
 
6409
6418
 
6410
6419
  COPILOT_TOKEN_ENV_VARS = ("COPILOT_GITHUB_TOKEN", "GH_TOKEN", "GITHUB_TOKEN")
6420
+ # Writer bindings contain filesystem identities, not portable configuration.
6421
+ COPILOT_HOME_RUNTIME_ENTRIES = frozenset({
6422
+ "session-state", "logs", ".mcp-writer.lock", ".mcp-writer.binding",
6423
+ })
6424
+
6425
+
6426
+ def is_copilot_shared_writer_identity_error(*messages: str | None) -> bool:
6427
+ """Recognize rejection of a directory-bound Copilot writer identity."""
6428
+ return any(
6429
+ "the shared writer lock or its directory changed" in str(message or "").lower()
6430
+ for message in messages
6431
+ )
6411
6432
 
6412
6433
 
6413
6434
  def copilot_interactive_home() -> Path:
@@ -6902,7 +6923,7 @@ def prepare_copilot_home() -> str:
6902
6923
  if not migration_marker.exists():
6903
6924
  cleanup_succeeded = True
6904
6925
  for target_child in list(target_root.iterdir()):
6905
- if target_child.name in {"session-state", "logs"}:
6926
+ if target_child.name in COPILOT_HOME_RUNTIME_ENTRIES:
6906
6927
  continue
6907
6928
  if target_child.name not in source_names:
6908
6929
  try:
@@ -6937,7 +6958,7 @@ def prepare_copilot_home() -> str:
6937
6958
  )
6938
6959
  source_config_synced = False
6939
6960
  for child in source_root.iterdir():
6940
- if child.name in {"logs", "session-state"}:
6961
+ if child.name in COPILOT_HOME_RUNTIME_ENTRIES:
6941
6962
  continue
6942
6963
 
6943
6964
  dest = target_root / child.name
@@ -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.105.0"
1431
+ DAEMON_VERSION = "1.106.0"
1432
1432
 
1433
1433
 
1434
1434
  def _detect_client_type() -> str:
@@ -9280,7 +9280,7 @@ class ProcessManager:
9280
9280
  _isolated_copilot_home = tempfile.mkdtemp(prefix=f"copilot-{task_id[:8]}-")
9281
9281
  try:
9282
9282
  for child in Path(_master_copilot_home).iterdir():
9283
- if child.name in {"session-state", "logs"}:
9283
+ if child.name in agent_core.COPILOT_HOME_RUNTIME_ENTRIES:
9284
9284
  continue
9285
9285
  dest = Path(_isolated_copilot_home) / child.name
9286
9286
  try:
@@ -9488,6 +9488,26 @@ class ProcessManager:
9488
9488
  break
9489
9489
  effective_rc = copilot_exit if copilot_exit is not None else returncode
9490
9490
 
9491
+ if (
9492
+ agent_core.is_copilot_shared_writer_identity_error(stderr, *structured_errors)
9493
+ and not (copilot_exit == 0 and returncode == 0)
9494
+ ):
9495
+ detail = (
9496
+ "Copilot could not validate its shared writer state: "
9497
+ "The shared writer lock or its directory changed. "
9498
+ "Update and restart the executing Forgexa daemon so new task homes "
9499
+ "exclude foreign .mcp-writer.lock and .mcp-writer.binding files. "
9500
+ "Do not delete live locks or retry unchanged state."
9501
+ )
9502
+ logger.error(
9503
+ "Copilot task %s failed state identity validation: %s", task_id, detail,
9504
+ )
9505
+ return TaskResult(
9506
+ status="failed", exit_code=effective_rc or 1,
9507
+ stdout=stdout[-settings.AGENT_MAX_OUTPUT_SIZE:], stderr=stderr[-10000:],
9508
+ error=detail, failure_code="copilot_state_identity_changed", metrics=metrics,
9509
+ )
9510
+
9491
9511
  builtin_mcp_error = (
9492
9512
  self._copilot_builtin_mcp_failure(stdout)
9493
9513
  if not disable_builtin_mcps
@@ -20,22 +20,34 @@ class EvidenceError(ValueError):
20
20
  def _contract():
21
21
  try:
22
22
  if __package__ == "app":
23
- module = import_module("app.schemas.observability_evidence")
24
- serialization = import_module("app.observability_lifecycle")
23
+ try:
24
+ module = import_module("app.observability_contract")
25
+ except ModuleNotFoundError as error:
26
+ if error.name != "app.observability_contract":
27
+ raise
28
+ module = import_module("app.schemas.observability_evidence")
29
+ serialization = import_module("app.observability_lifecycle")
30
+ else:
31
+ serialization = module
25
32
  else:
26
33
  module = import_module(
27
34
  f"{__package__}.observability_contract" if __package__ else "observability_contract"
28
35
  )
29
36
  serialization = module
30
37
  except ImportError as error:
31
- if getattr(error, "name", None) in {"pydantic", "pydantic_core"}:
38
+ if (getattr(error, "name", None) or "").split(".")[0] in {
39
+ "pydantic", "pydantic_core", "annotated_types", "typing_extensions", "typing_inspection",
40
+ }:
32
41
  raise EvidenceError("observability_evidence_runtime_dependency_missing") from None
33
42
  raise EvidenceError("observability_evidence_protocol_unsupported") from None
34
- return (
35
- module.ObservabilityEvidenceReference, module.ObservabilityAttachmentMetadata,
36
- module.ObservabilityAttachmentPayload,
37
- serialization.canonical_bytes, serialization.strict_json_loads,
38
- )
43
+ try:
44
+ return (
45
+ module.ObservabilityEvidenceReference, module.ObservabilityAttachmentMetadata,
46
+ module.ObservabilityAttachmentPayload,
47
+ serialization.canonical_bytes, serialization.strict_json_loads,
48
+ )
49
+ except AttributeError:
50
+ raise EvidenceError("observability_evidence_protocol_unsupported") from None
39
51
 
40
52
 
41
53
  def validate_reference(reference) -> dict:
@@ -53,11 +65,9 @@ def validate_reference(reference) -> dict:
53
65
  @lru_cache(maxsize=1)
54
66
  def _transaction_contract():
55
67
  try:
56
- module = import_module(
57
- "app.schemas.newrelic_transactions" if __package__ == "app"
58
- else f"{__package__}.observability_contract"
59
- if __package__ else "observability_contract"
60
- )
68
+ reference_module = _contract()[0].__module__
69
+ module = import_module("app.schemas.newrelic_transactions" if reference_module.startswith("app.schemas.")
70
+ else reference_module)
61
71
  return module.NewRelicTransactionAttachmentPayload
62
72
  except (ImportError, AttributeError):
63
73
  raise EvidenceError("observability_evidence_protocol_unsupported") from None
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: forgexa-cli
3
- Version: 1.105.0
3
+ Version: 1.106.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,6 +1,6 @@
1
1
  [project]
2
2
  name = "forgexa-cli"
3
- version = "1.105.0"
3
+ version = "1.106.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