zerochat 10.29.0__tar.gz → 10.30.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.29.0
3
+ Version: 10.30.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.29.0"
7
+ version = "10.30.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.29.0
3
+ Version: 10.30.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.29.0"
1578
+ SOURCE_BACKEND_VERSION = "10.30.0"
1579
1579
 
1580
1580
 
1581
1581
  def _read_source_version(filename: str) -> str | None:
@@ -2312,11 +2312,17 @@ class SecurityContext:
2312
2312
  Es la misma que evalúan los permisos (resolve_path): colapsa los '..' antes de seguir enlaces
2313
2313
  simbólicos, así 'enlace/../x' no se permite como una ruta y se abre como otra. ValueError si no es válida.
2314
2314
  """
2315
- norm = normalize_directory_path(str(Path(str(path).strip()).expanduser()))
2315
+ raw = str(path).strip()
2316
+ if not raw or "\0" in raw:
2317
+ raise ValueError(f"Ruta no válida: '{path}'.")
2318
+ expanded = Path(raw).expanduser()
2319
+ if contains_unresolved_reference(str(expanded)):
2320
+ raise ValueError(f"Ruta no válida: '{path}'.")
2321
+ candidate = expanded if expanded.is_absolute() else self.workspace_dir / expanded
2322
+ norm = normalize_directory_path(str(candidate))
2316
2323
  if not norm:
2317
2324
  raise ValueError(f"Ruta no válida: '{path}'.")
2318
- target = Path(norm)
2319
- return (target if target.is_absolute() else self.workspace_dir / target).resolve()
2325
+ return Path(norm).resolve()
2320
2326
 
2321
2327
  def resolve_path(self, path_str: str) -> Path | None:
2322
2328
  """La ruta de absolute() para evaluar permisos; None si no es válida o lleva referencias sin resolver ('~', '$VAR')."""
@@ -2392,7 +2398,7 @@ POLICY_ASK = "ask"
2392
2398
  SCOPE_PERMANENT = "permanent"
2393
2399
  SCOPE_SESSION = "session"
2394
2400
  AUTHORIZE_DECISIONS = ("allow_once", "allow_session", "allow_project", "allow_always", "allow_server_always")
2395
- DIRECTORY_RULE_PATTERN = re.compile(r"^(R|W|RW):(.+)$")
2401
+ DIRECTORY_RULE_PATTERN = re.compile(r"^([RWX]+):(.+)$")
2396
2402
  COMMAND_TOOL = "run_command"
2397
2403
  JOB_CONTROL_TOOL = "check_command"
2398
2404
  # Herramientas integradas que acceden al sistema de archivos por su argumento de ruta.
@@ -2427,13 +2433,16 @@ _COMMAND_INTERNAL_OUTSIDE_REF = re.compile(r"[\s:'\"](?:[\\/~]|[A-Za-z]:[\\/]|\.
2427
2433
 
2428
2434
 
2429
2435
  def parse_directory_rule(raw_rule: str) -> dict | None:
2430
- """Parsea una regla 'R:path', 'W:path' o 'RW:path' normalizando su ruta."""
2436
+ """Parsea una regla '<permisos>:path' (combinación sin repetidos de R, W, X) normalizando su ruta."""
2431
2437
  if not isinstance(raw_rule, str):
2432
2438
  return None
2433
2439
  match = DIRECTORY_RULE_PATTERN.match(raw_rule.strip())
2434
2440
  if not match:
2435
2441
  return None
2436
- access = match.group(1)
2442
+ raw_access = match.group(1)
2443
+ if len(set(raw_access)) != len(raw_access):
2444
+ return None
2445
+ access = "".join(ch for ch in ("R", "W", "X") if ch in raw_access)
2437
2446
  raw_path = match.group(2)
2438
2447
  path = normalize_directory_path(raw_path)
2439
2448
  if not path:
@@ -3586,6 +3595,15 @@ def secret_names(prefix: str) -> set[str]:
3586
3595
  SERVER_ID_KEY = "system:server_id"
3587
3596
 
3588
3597
 
3598
+ def conversations_revision() -> str:
3599
+ """Firma ligera del estado de conversaciones en SQLite para detectar cambios externos."""
3600
+ with open_storage() as conn:
3601
+ row = conn.execute(
3602
+ "SELECT COUNT(*) AS n, COALESCE(MAX(updated_at), 0) AS m, COALESCE(SUM(updated_at), 0) AS s FROM conversations;"
3603
+ ).fetchone()
3604
+ return f"{row['n']}:{row['m']}:{int(row['s'])}"
3605
+
3606
+
3589
3607
  def get_server_id() -> str:
3590
3608
  """Identificador único y persistente de este servidor en SQLite."""
3591
3609
  with _STORAGE_LOCK:
@@ -6665,7 +6683,7 @@ class AccessController:
6665
6683
  dir_rules = {
6666
6684
  str(project): list(rules)
6667
6685
  for project, rules in raw_dir_rules.items()
6668
- if isinstance(project, str) and isinstance(rules, list) and rules
6686
+ if isinstance(project, str) and isinstance(rules, list)
6669
6687
  } if isinstance(raw_dir_rules, dict) else {}
6670
6688
  # run_command nunca se guarda autorizado entero: sus permisos permanentes son patrones.
6671
6689
  tools = {tid: entry for tid, entry in dict(data.get("tools") or {}).items()
@@ -6690,15 +6708,18 @@ class AccessController:
6690
6708
  def _effective_state(self, context: SecurityContext) -> dict:
6691
6709
  """Una sola lectura del estado permanente combinada con la capa de sesión del proyecto."""
6692
6710
  state = self._read_permanent_state()
6711
+ default_rule = self.get_default_directory_rule(context)
6693
6712
  with self._lock:
6694
6713
  session = self._session(context)
6714
+ if session.directory_rules is not None:
6715
+ dir_rules = list(session.directory_rules)
6716
+ elif context.key in state["directoryRules"]:
6717
+ dir_rules = list(state["directoryRules"][context.key])
6718
+ else:
6719
+ dir_rules = [default_rule]
6695
6720
  return {
6696
6721
  "globalMcpPolicy": session.global_policy if session.global_policy is not None else state["globalMcpPolicy"],
6697
- "directoryRules": (
6698
- list(session.directory_rules)
6699
- if session.directory_rules is not None
6700
- else list(state["directoryRules"].get(context.key) or [])
6701
- ),
6722
+ "directoryRules": dir_rules,
6702
6723
  "tools": {**state["tools"], **session.tools},
6703
6724
  "servers": {**state["servers"], **session.servers},
6704
6725
  "commandPatterns": {**state["commandPatterns"], "session": list(session.command_patterns)}
@@ -6712,22 +6733,20 @@ class AccessController:
6712
6733
  def export_state(self, context: SecurityContext) -> dict:
6713
6734
  return {
6714
6735
  "version": POLICY_STATE_VERSION,
6715
- **self._effective_state(context),
6716
- "defaultDirectoryRule": self.get_default_directory_rule(context)
6736
+ **self._effective_state(context)
6717
6737
  }
6718
6738
 
6719
- def _validate_directory_rules(self, raw_rules: list | tuple, context: SecurityContext) -> list[str]:
6739
+ @staticmethod
6740
+ def _validate_directory_rules(raw_rules: list | tuple) -> list[str]:
6720
6741
  if not isinstance(raw_rules, (list, tuple)):
6721
6742
  raise ValueError("Las reglas de directorio deben ser una lista.")
6722
6743
  parsed_rules = []
6723
6744
  for raw in raw_rules:
6724
6745
  rule_obj = parse_directory_rule(raw)
6725
6746
  if not rule_obj:
6726
- raise ValueError(f"Regla de directorio inválida: '{raw}'. Formato esperado: R:path, W:path o RW:path.")
6747
+ raise ValueError(f"Regla de directorio inválida: '{raw}'. Formato esperado: combinación de R, W y X (p. ej. R:path, RW:path, RWX:path).")
6727
6748
  parsed_rules.append(rule_obj["rule"])
6728
- unique_rules = list(dict.fromkeys(parsed_rules))
6729
- default_rule = self.get_default_directory_rule(context)
6730
- return [r for r in unique_rules if r != default_rule]
6749
+ return list(dict.fromkeys(parsed_rules))
6731
6750
 
6732
6751
  @staticmethod
6733
6752
  def _validate_policy_entries(raw_entries: dict, kind: str, scope: str) -> dict:
@@ -6780,7 +6799,7 @@ class AccessController:
6780
6799
  if total > MAX_POLICY_ENTRIES:
6781
6800
  raise ValueError(f"El número total de entradas ({total}) supera el máximo permitido ({MAX_POLICY_ENTRIES}).")
6782
6801
 
6783
- def _validate_state_payload(self, state: dict, scope: str, context: SecurityContext) -> tuple[str | None, list[str] | None, dict | None, dict | None]:
6802
+ def _validate_state_payload(self, state: dict, scope: str) -> tuple[str | None, list[str] | None, dict | None, dict | None]:
6784
6803
  if not isinstance(state, dict):
6785
6804
  raise ValueError("El estado de políticas debe ser un diccionario.")
6786
6805
 
@@ -6791,7 +6810,7 @@ class AccessController:
6791
6810
  raise ValueError(f"Política global no válida: '{pol}'. Válidas: {GLOBAL_POLICIES}")
6792
6811
  clean_global = pol
6793
6812
 
6794
- clean_rules = self._validate_directory_rules(state["directoryRules"], context) if "directoryRules" in state else None
6813
+ clean_rules = self._validate_directory_rules(state["directoryRules"]) if "directoryRules" in state else None
6795
6814
  clean_tools = self._validate_policy_entries(state["tools"], "tools", scope) if "tools" in state else None
6796
6815
  clean_servers = self._validate_policy_entries(state["servers"], "servers", scope) if "servers" in state else None
6797
6816
  return clean_global, clean_rules, clean_tools, clean_servers
@@ -6802,33 +6821,33 @@ class AccessController:
6802
6821
  `addDirectoryRules` añade reglas a las guardadas dentro de la misma transacción y
6803
6822
  `commandPatterns` sustituye los patrones de comando guardados.
6804
6823
  """
6805
- clean_global, clean_rules, clean_tools, clean_servers = self._validate_state_payload(state, SCOPE_PERMANENT, context)
6806
- added_rules = self._validate_directory_rules(state["addDirectoryRules"], context) if "addDirectoryRules" in state else []
6824
+ clean_global, clean_rules, clean_tools, clean_servers = self._validate_state_payload(state, SCOPE_PERMANENT)
6825
+ added_rules = self._validate_directory_rules(state["addDirectoryRules"]) if "addDirectoryRules" in state else []
6807
6826
  clean_patterns = normalize_command_patterns(state["commandPatterns"]) if "commandPatterns" in state else None
6808
6827
 
6809
6828
  project = context.key
6829
+ default_rule = self.get_default_directory_rule(context)
6810
6830
 
6811
6831
  def mutator(current: dict) -> dict:
6812
- self._apply_state_patch(current, project, clean_global, clean_rules, added_rules, clean_tools, clean_servers, clean_patterns)
6832
+ self._apply_state_patch(current, project, default_rule, clean_global, clean_rules, added_rules, clean_tools, clean_servers, clean_patterns)
6813
6833
  self._check_entry_limit(current)
6814
6834
  return current
6815
6835
  self._update_permanent(mutator)
6816
6836
  self._forget_session_overrides(project, clean_global, clean_rules, added_rules, clean_tools, clean_servers)
6817
6837
  return self.export_state(context)
6818
6838
 
6819
- def _apply_state_patch(self, current: dict, project: str, clean_global, clean_rules, added_rules, clean_tools, clean_servers, clean_patterns):
6839
+ def _apply_state_patch(self, current: dict, project: str, default_rule: str, clean_global, clean_rules, added_rules, clean_tools, clean_servers, clean_patterns):
6820
6840
  """Aplica sobre el estado guardado los apartados del parche que vienen (None es «no cambiar»)."""
6821
6841
  if clean_global is not None:
6822
6842
  current["globalMcpPolicy"] = clean_global
6823
6843
  if clean_rules is not None:
6824
- if clean_rules:
6825
- current["directoryRules"][project] = clean_rules
6826
- else:
6844
+ if clean_rules == [default_rule]:
6827
6845
  current["directoryRules"].pop(project, None)
6846
+ else:
6847
+ current["directoryRules"][project] = clean_rules
6828
6848
  if added_rules:
6829
- merged = self._append_rules(current["directoryRules"].get(project) or [], added_rules)
6830
- if merged:
6831
- current["directoryRules"][project] = merged
6849
+ base_rules = current["directoryRules"][project] if project in current["directoryRules"] else [default_rule]
6850
+ current["directoryRules"][project] = self._append_rules(base_rules, added_rules)
6832
6851
  if clean_tools is not None:
6833
6852
  current["tools"] = self._apply_entry_patch(current.get("tools"), clean_tools)
6834
6853
  if clean_servers is not None:
@@ -6873,7 +6892,7 @@ class AccessController:
6873
6892
  Aplica una capa de políticas temporal en memoria para una ejecución en servidor, sin persistir.
6874
6893
  De los patrones de comando solo toma los de sesión: los guardados se leen de la misma base de datos.
6875
6894
  """
6876
- clean_global, clean_rules, clean_tools, clean_servers = self._validate_state_payload(state, SCOPE_SESSION, context)
6895
+ clean_global, clean_rules, clean_tools, clean_servers = self._validate_state_payload(state, SCOPE_SESSION)
6877
6896
  raw_patterns = state.get("commandPatterns")
6878
6897
  session_patterns = self._limit_patterns(clean_pattern_list(raw_patterns.get("session") or [], "commandPatterns.session")) \
6879
6898
  if isinstance(raw_patterns, dict) else None
@@ -6900,7 +6919,7 @@ class AccessController:
6900
6919
  @staticmethod
6901
6920
  def get_default_directory_rule(context: SecurityContext) -> str:
6902
6921
  base = normalize_directory_path(str(context.workspace_dir))
6903
- return f"RW:{base}" if base == "/" else f"RW:{base}/**"
6922
+ return f"RWX:{base}" if base == "/" else f"RWX:{base}/**"
6904
6923
 
6905
6924
  @staticmethod
6906
6925
  def _resolve_rule_pattern(pattern: str, workspace_dir: Path | None = None) -> str:
@@ -6926,32 +6945,18 @@ class AccessController:
6926
6945
  if not normalized_dest:
6927
6946
  return {"allowed": False, "rule": None, "path": ""}
6928
6947
 
6929
- full_rule = self._full_directory_access_rule(user_rules)
6930
- if full_rule and access in ("R", "W"):
6948
+ full_rule = self._full_directory_access_rule(user_rules, access)
6949
+ if full_rule:
6931
6950
  return {"allowed": True, "rule": full_rule, "path": normalized_dest}
6932
6951
 
6933
- matching_user_rules = []
6934
6952
  for raw_rule in user_rules:
6935
6953
  parsed = parse_directory_rule(raw_rule)
6936
6954
  if not parsed:
6937
6955
  continue
6938
6956
  rule_pattern = self._resolve_rule_pattern(parsed["path"], ctx.workspace_dir)
6939
- if matches_directory_pattern(normalized_dest, rule_pattern):
6940
- matching_user_rules.append(parsed)
6941
-
6942
- for parsed in matching_user_rules:
6943
- if parsed["access"] == access or parsed["access"] == "RW":
6957
+ if matches_directory_pattern(normalized_dest, rule_pattern) and all(ch in parsed["access"] for ch in access):
6944
6958
  return {"allowed": True, "rule": parsed["rule"], "path": normalized_dest}
6945
6959
 
6946
- if matching_user_rules:
6947
- return {"allowed": False, "rule": None, "path": normalized_dest}
6948
-
6949
- default_rule = self.get_default_directory_rule(ctx)
6950
- default_parsed = parse_directory_rule(default_rule)
6951
- if default_parsed and (default_parsed["access"] == access or default_parsed["access"] == "RW"):
6952
- rule_pattern = self._resolve_rule_pattern(default_parsed["path"], ctx.workspace_dir)
6953
- if matches_directory_pattern(normalized_dest, rule_pattern):
6954
- return {"allowed": True, "rule": default_parsed["rule"], "path": normalized_dest}
6955
6960
  return {"allowed": False, "rule": None, "path": normalized_dest}
6956
6961
 
6957
6962
  def clear_session(self):
@@ -6981,7 +6986,7 @@ class AccessController:
6981
6986
  if not isinstance(dec_type, str) or dec_type not in AUTHORIZE_DECISIONS or dec_type == "allow_once":
6982
6987
  return
6983
6988
  pattern = normalize_command_pattern(raw_pattern) if (raw_pattern and tool_name == COMMAND_TOOL) else None
6984
- rules = self._validate_directory_rules([raw_dir_rule], context) if raw_dir_rule else []
6989
+ rules = self._validate_directory_rules([raw_dir_rule]) if raw_dir_rule else []
6985
6990
  challenge = {
6986
6991
  "toolName": tool_name,
6987
6992
  "serverName": server_id or "mcp-proxy",
@@ -7036,7 +7041,7 @@ class AccessController:
7036
7041
  if decision == "allow_server_always" and not challenge.get("serverId"):
7037
7042
  return None
7038
7043
  pattern = self._validate_command_pattern(decision, command_pattern, challenge)
7039
- rules = self._validate_directory_rules([directory_rule], context) if directory_rule else []
7044
+ rules = self._validate_directory_rules([directory_rule]) if directory_rule else []
7040
7045
  challenges.pop(challenge_id)
7041
7046
  self._record_decision(challenge, decision, pattern, rules, context)
7042
7047
  return challenge
@@ -7080,9 +7085,12 @@ class AccessController:
7080
7085
  def mutator(state: dict) -> dict:
7081
7086
  self._store_decision(state, decision, pattern, project, tool, server_name, server_id)
7082
7087
  if rules:
7083
- merged = self._append_rules(state["directoryRules"].get(project) or [], rules)
7084
- if merged:
7085
- state["directoryRules"][project] = merged
7088
+ base_rules = (
7089
+ state["directoryRules"][project]
7090
+ if project in state["directoryRules"]
7091
+ else [self.get_default_directory_rule(context)]
7092
+ )
7093
+ state["directoryRules"][project] = self._append_rules(base_rules, rules)
7086
7094
  self._check_entry_limit(state)
7087
7095
  return state
7088
7096
  self._update_permanent(mutator)
@@ -7168,18 +7176,18 @@ class AccessController:
7168
7176
  return POLICY_ASK, "mcp_default_ask", "", None
7169
7177
 
7170
7178
  @staticmethod
7171
- def _full_directory_access_rule(rules: list[str]) -> str | None:
7172
- """Primera regla RW sobre la raíz (RW:/** o RW:/), o None."""
7179
+ def _full_directory_access_rule(rules: list[str], access: str = "RWX") -> str | None:
7180
+ """Primera regla sobre la raíz (/** o /) que cubre `access`, o None."""
7173
7181
  for raw in rules:
7174
7182
  parsed = parse_directory_rule(raw)
7175
- if parsed is not None and parsed["access"] == "RW" and parsed["path"] in ("/**", "/"):
7183
+ if parsed is not None and all(ch in parsed["access"] for ch in access) and parsed["path"] in ("/**", "/"):
7176
7184
  return parsed["rule"]
7177
7185
  return None
7178
7186
 
7179
7187
  @classmethod
7180
7188
  def _has_full_directory_access(cls, rules: list[str]) -> bool:
7181
- """Indica si el proyecto tiene acceso RW a todo el sistema de ficheros (RW:/** o RW:/)."""
7182
- return cls._full_directory_access_rule(rules) is not None
7189
+ """Indica si el proyecto tiene acceso RWX a todo el sistema de ficheros (RWX:/** o RWX:/)."""
7190
+ return cls._full_directory_access_rule(rules, "RWX") is not None
7183
7191
 
7184
7192
  @staticmethod
7185
7193
  def _command_target(cwd: Path, raw_path: str) -> str:
@@ -7197,14 +7205,18 @@ class AccessController:
7197
7205
 
7198
7206
  def _evaluate_command(self, raw_command: str, view: dict, ctx: SecurityContext) -> tuple[str, str, str, dict | None]:
7199
7207
  """
7200
- Valida cada subcomando por separado: un cd tiene que llevar a una carpeta cubierta por las reglas
7201
- de directorio, y los subcomandos siguientes se ejecutan en ella; el resto tiene que estar cubierto
7202
- por un patrón o, con Workspace Trust, quedarse en el proyecto o en reglas RW del proyecto (tras una
7203
- tubería, solo un filtro). Con RW:/** en Workspace Trust, el proyecto queda sin restricción de comandos.
7208
+ Valida cada subcomando por separado: la carpeta donde se ejecuta (inicial y tras cada cd) requiere
7209
+ permiso X en directoryRules; cada cd debe llevar a una carpeta cubierta por las reglas de directorio,
7210
+ y el resto tiene que estar cubierto por un patrón o, con Workspace Trust, quedarse en el proyecto o en
7211
+ reglas RW del proyecto (tras una tubería, solo un filtro). Con RWX:/** en Workspace Trust, el proyecto
7212
+ queda sin restricción de comandos.
7204
7213
  """
7205
7214
  trust = view["globalMcpPolicy"] == GLOBAL_POLICY_WORKSPACE_TRUST
7206
7215
  if trust and self._has_full_directory_access(view["directoryRules"]):
7207
7216
  return POLICY_ALLOW, "directory_rule_allow", "", None
7217
+ if not self.evaluate_directory_rule("X", str(ctx.workspace_dir), view["directoryRules"], ctx)["allowed"]:
7218
+ return (POLICY_ASK, "command_directory_without_execute",
7219
+ f"La carpeta no tiene permiso de ejecución (X): {ctx.workspace_dir}", None)
7208
7220
  segments = split_command(raw_command)
7209
7221
  if segments is None:
7210
7222
  return (POLICY_ASK, "command_chaining_requires_approval",
@@ -7215,10 +7227,13 @@ class AccessController:
7215
7227
  directory = cd_target(segment)
7216
7228
  if directory is not None:
7217
7229
  target = self._command_target(cwd, directory)
7218
- if not any(self.evaluate_directory_rule(a, target, view["directoryRules"], ctx)["allowed"] for a in ("R", "W")):
7230
+ if not any(self.evaluate_directory_rule(a, target, view["directoryRules"], ctx)["allowed"] for a in ("R", "W", "X")):
7219
7231
  return (POLICY_ASK, "command_directory_outside_rules",
7220
7232
  f"El comando se ejecuta fuera de las reglas de directorio: {directory}", None)
7221
7233
  cwd = ctx.resolve_path(target) or cwd
7234
+ if not self.evaluate_directory_rule("X", str(cwd), view["directoryRules"], ctx)["allowed"]:
7235
+ return (POLICY_ASK, "command_directory_without_execute",
7236
+ f"La carpeta no tiene permiso de ejecución (X): {cwd}", None)
7222
7237
  elif any(matches_command_pattern(segment, p) for p in patterns):
7223
7238
  continue
7224
7239
  elif trust and self._is_allowed_trust_segment(segment, cwd, view["directoryRules"], ctx) and (
@@ -7235,12 +7250,10 @@ class AccessController:
7235
7250
  return POLICY_ASK, reason, details, command_rule_offer(uncovered)
7236
7251
 
7237
7252
  def _evaluate_path(self, tool_name: str, access: str, path: str, view: dict, ctx: SecurityContext) -> tuple[str, str, str, dict | None]:
7238
- """Herramientas integradas de ficheros: reglas de directorio y, con Workspace Trust, el proyecto."""
7253
+ """Herramientas integradas de ficheros: reglas de directorio del proyecto."""
7239
7254
  dir_eval = self.evaluate_directory_rule(access, path, view["directoryRules"], ctx)
7240
7255
  if dir_eval["allowed"]:
7241
7256
  return POLICY_ALLOW, "directory_rule_allow", "", None
7242
- if view["globalMcpPolicy"] == GLOBAL_POLICY_WORKSPACE_TRUST and ctx.is_inside_workspace(path):
7243
- return POLICY_ALLOW, "workspace_trust_allow", "", None
7244
7257
  return (POLICY_ASK, "directory_rule_required", f"La ruta no coincide con una regla {access}: {path}",
7245
7258
  directory_rule_offer(tool_name, access, dir_eval["path"] or path))
7246
7259
 
@@ -7331,7 +7344,8 @@ def live_state(ctx: SecurityContext, focus_conversation_id: str | None = None) -
7331
7344
  "servers": GLOBAL_MCP_MANAGER.list_servers(),
7332
7345
  "externalTools": GLOBAL_MCP_MANAGER.tools(),
7333
7346
  "runs": runs,
7334
- "focus_run": focus_run
7347
+ "focus_run": focus_run,
7348
+ "conversations_rev": conversations_revision()
7335
7349
  }
7336
7350
 
7337
7351
 
File without changes
File without changes
File without changes