zerochat 10.28.0__tar.gz → 10.29.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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: zerochat
3
- Version: 10.28.0
3
+ Version: 10.29.0
4
4
  Summary: Private local web client for AI models, tools and MCP services
5
5
  Author: Alberto Alday
6
6
  License-Expression: MIT
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "zerochat"
7
- version = "10.28.0"
7
+ version = "10.29.0"
8
8
  description = "Private local web client for AI models, tools and MCP services"
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.10"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: zerochat
3
- Version: 10.28.0
3
+ Version: 10.29.0
4
4
  Summary: Private local web client for AI models, tools and MCP services
5
5
  Author: Alberto Alday
6
6
  License-Expression: MIT
@@ -1575,7 +1575,7 @@ def dispatch_browser(method: str, params: dict) -> RpcOutcome:
1575
1575
 
1576
1576
 
1577
1577
 
1578
- SOURCE_BACKEND_VERSION = "10.28.0"
1578
+ SOURCE_BACKEND_VERSION = "10.29.0"
1579
1579
 
1580
1580
 
1581
1581
  def _read_source_version(filename: str) -> str | None:
@@ -6907,7 +6907,9 @@ class AccessController:
6907
6907
  base, sep, rest = pattern.partition("*")
6908
6908
  if base:
6909
6909
  # Mismo resolutor que SecurityContext.resolve_path (destino y base de la regla).
6910
- target = Path(base) if (not workspace_dir or os.path.isabs(base)) else Path(workspace_dir) / base
6910
+ target = Path(base)
6911
+ if workspace_dir and not target.is_absolute():
6912
+ target = Path(workspace_dir) / target
6911
6913
  real_base = normalize_directory_path(str(target.resolve(strict=False)))
6912
6914
  if sep and base.endswith("/") and not real_base.endswith("/"):
6913
6915
  real_base += "/"
@@ -6924,6 +6926,10 @@ class AccessController:
6924
6926
  if not normalized_dest:
6925
6927
  return {"allowed": False, "rule": None, "path": ""}
6926
6928
 
6929
+ full_rule = self._full_directory_access_rule(user_rules)
6930
+ if full_rule and access in ("R", "W"):
6931
+ return {"allowed": True, "rule": full_rule, "path": normalized_dest}
6932
+
6927
6933
  matching_user_rules = []
6928
6934
  for raw_rule in user_rules:
6929
6935
  parsed = parse_directory_rule(raw_rule)
@@ -7162,14 +7168,18 @@ class AccessController:
7162
7168
  return POLICY_ASK, "mcp_default_ask", "", None
7163
7169
 
7164
7170
  @staticmethod
7165
- def _has_full_directory_access(rules: list[str]) -> bool:
7171
+ def _full_directory_access_rule(rules: list[str]) -> str | None:
7172
+ """Primera regla RW sobre la raíz (RW:/** o RW:/), o None."""
7173
+ for raw in rules:
7174
+ parsed = parse_directory_rule(raw)
7175
+ if parsed is not None and parsed["access"] == "RW" and parsed["path"] in ("/**", "/"):
7176
+ return parsed["rule"]
7177
+ return None
7178
+
7179
+ @classmethod
7180
+ def _has_full_directory_access(cls, rules: list[str]) -> bool:
7166
7181
  """Indica si el proyecto tiene acceso RW a todo el sistema de ficheros (RW:/** o RW:/)."""
7167
- return any(
7168
- (parsed := parse_directory_rule(raw)) is not None
7169
- and parsed["access"] == "RW"
7170
- and parsed["path"] in ("/**", "/")
7171
- for raw in rules
7172
- )
7182
+ return cls._full_directory_access_rule(rules) is not None
7173
7183
 
7174
7184
  @staticmethod
7175
7185
  def _command_target(cwd: Path, raw_path: str) -> str:
File without changes
File without changes
File without changes