The agent that grows with you
Python aiai-agentai-agentsanthropicchatgptclaudeclaude-codecodexhermeshermes-agentllmnous-researchopenai
Merge branch 'simp/r2-webserver' into simp/integration2
Tekniumd6f56549c079
diff --cc hermes_cli/web_server.pyindex fdc86e3e4c8,645f314067d..e010a6a9cec--- a/hermes_cli/web_server.py+++ b/hermes_cli/web_server.py@@@ -3096,485 -1448,325 +1448,326 @@@ from hermes_cli.web_routers.sessions im)- def _normalize_config_for_web(config: Dict[str, Any]) -> Dict[str, Any]:- """Normalize config for the web UI.-- Hermes supports ``model`` as either a bare string (``"anthropic/claude-sonnet-4"``)- or a dict (``{default: ..., provider: ..., base_url: ...}``). The schema is built- from DEFAULT_CONFIG where ``model`` is a string, but user configs often have the- dict form. Normalize to the string form so the frontend schema matches.-- Also surfaces ``model_context_length`` as a top-level field so the web UI can- display and edit it. A value of 0 means "auto-detect".- """- config = dict(config) # shallow copy- model_val = config.get("model")- if isinstance(model_val, dict):- # Extract context_length before flattening the dict- ctx_len = model_val.get("context_length", 0)- config["model"] = model_val.get("default", model_val.get("name", ""))- config["model_context_length"] = ctx_len if isinstance(ctx_len, int) else 0- else:- config["model_context_length"] = 0- return config--- def _normalize_memory_provider_name(name: Any) -> str:- provider = str(name or "").strip()- if provider.lower() in {"built-in", "builtin", "none"}:- return ""- return provider--- def _load_memory_provider(name: str):- try:- from plugins.memory import load_memory_provider-- return load_memory_provider(name)- except Exception:- _log.debug("Failed to load memory provider %s", name, exc_info=True)- return None--- def _memory_provider_manifest(name: str) -> Dict[str, Any]:- try:- from plugins.memory import find_provider_dir-- provider_dir = find_provider_dir(name)- if provider_dir is None:- return {}- manifest_path = provider_dir / "plugin.yaml"- if not manifest_path.exists():- return {}- with manifest_path.open(encoding="utf-8-sig") as handle:- manifest = yaml.safe_load(handle) or {}- return manifest if isinstance(manifest, dict) else {}- except Exception:- _log.debug("Failed to read memory provider manifest for %s", name, exc_info=True)- return {}+ from hermes_cli.web_server_memory import ( # noqa: E402,F401 — re-exported; routers/tests reach these via web_server.<name>+ _coerce_bool,+ _dependency_importable,+ _discover_memory_provider_statuses,+ _env_lookup,+ _field_default,+ _field_is_set,+ _field_value,+ _field_visible,+ _load_memory_provider,+ _memory_provider_manifest,+ _memory_provider_setup_info,+ _memory_provider_setup_manifest,+ _normalize_memory_provider_name,+ _normalize_memory_provider_schema,+ _read_json_file,+ _read_memory_provider_existing_values,+ _require_memory_provider_ready,+ _run_setup_command,+ )- def _string_list(value: Any) -> List[str]:- if not isinstance(value, list):- return []- return [str(item).strip() for item in value if str(item).strip()]+ from hermes_cli.web_routers import memory_providers as _memory_providers_routes # noqa: E402+ app.include_router(_memory_providers_routes.router)- def _memory_provider_setup_manifest(name: str) -> Dict[str, Any]:- manifest = _memory_provider_manifest(name)- external_dependencies: List[Dict[str, str]] = []- for raw in manifest.get("external_dependencies") or []:- if not isinstance(raw, dict):- continue- dep = {- "name": str(raw.get("name") or "").strip(),- "install": str(raw.get("install") or "").strip(),- "check": str(raw.get("check") or "").strip(),- }- if dep["name"] or dep["install"] or dep["check"]:- external_dependencies.append(dep)- return {- "pip_dependencies": _string_list(manifest.get("pip_dependencies")),- "external_dependencies": external_dependencies,- "required_env": _string_list(manifest.get("requires_env")),- }+ from hermes_cli.web_routers import config_env as _config_env_routes # noqa: E402+ app.include_router(_config_env_routes.config_router)+ from hermes_cli.web_routers.config_env import ( # noqa: E402,F401 — legacy re-exports; tests call these via web_server.<name>+ get_config,+ get_schema,+ )- def _memory_provider_setup_info(name: str) -> Dict[str, Any]:- setup = _memory_provider_setup_manifest(name)- setup["dependencies_installed"] = _memory_provider_dependencies_installed(setup)- return setup+ from hermes_cli.web_routers import models as _models_routes # noqa: E402- _MEMORY_PROVIDER_IMPORT_NAMES = {- "honcho-ai": "honcho",- "mem0ai": "mem0",- "hindsight-client": "hindsight_client",- "hindsight-all": "hindsight",- }+ app.include_router(_models_routes.router)+ from hermes_cli.web_routers.models import ( # noqa: E402,F401 — legacy re-exports; tests call these via web_server.<name>+ get_model_info,+ get_model_options,+ get_recommended_default_model,+ set_moa_models,+ )- def _memory_provider_dependency_package(dep: str) -> str:- return re.split(r"[\[<>=!~;]", dep, maxsplit=1)[0].strip()+ app.include_router(_config_env_routes.router)- def _memory_provider_import_name(dep: str) -> str:- package = _memory_provider_dependency_package(dep)- return _MEMORY_PROVIDER_IMPORT_NAMES.get(package, package.replace("-", "_"))+ from hermes_cli.web_server_profiles import ( # noqa: E402,F401 — re-exported; routers/tests reach these via web_server.<name>+ _profile_cli_args,+ _hub_action_name,+ _installed_hub_identifiers,+ _SKILLS_PROFILE_LOCK,+ _TERMINAL_BACKENDS,+ _approval_mode_of,+ _aux_task_summary,+ _aux_usage_rows,+ _broadcast_gateway_session_info,+ _config_profile_scope,+ _fallback_profile_dicts,+ _is_other_profile,+ _merge_aux_into_by_model,+ _parse_model_ids,+ _plugin_terminal_backend_rows,+ _profile_scope,+ _resolve_profile_dir,+ _write_profile_mcp_servers,+ )- def _dependency_importable(dep: str) -> bool:- import_name = _memory_provider_import_name(dep)- if not import_name:- return False- try:- __import__(import_name)- return True- except ImportError:- return False+ from hermes_cli.web_server_messaging import ( # noqa: E402,F401 — re-exported; routers/tests reach these via web_server.<name>+ _MESSAGING_KEYS_PAGE_KEYS,+ _TelegramOnboardingPairing,+ _WhatsAppOnboardingSession,+ _build_catalog_entry,+ _channel_managed_env_keys,+ _messaging_platform_catalog,+ _restart_gateway_after_whatsapp_onboarding,+ _telegram_onboarding_error_message,+ _telegram_onboarding_lock,+ _telegram_onboarding_pairings,+ _telegram_onboarding_request_sync,+ _whatsapp_onboarding_payload,+ _whatsapp_onboarding_sessions,+ _whatsapp_session_path,+ _write_platform_enabled,+ )- def _memory_provider_setup_env() -> Dict[str, str]:- # External package-manager child (npm/uv/pip): exact env preservation —- # scrubbing or HOME rewriting could break user tool auth/config.- from tools.environments.local import build_subprocess_env- env = build_subprocess_env(scrub_secrets=False, inherit_profile_home=False)- home = Path.home()- extra_bins = [- home / ".brv-cli" / "bin",- home / ".local" / "bin",- home / ".npm-global" / "bin",- Path("/usr/local/bin"),- ]- existing_path = env.get("PATH", "")- prefix = os.pathsep.join(str(path) for path in extra_bins if path.exists())- if prefix:- env["PATH"] = prefix + os.pathsep + existing_path- return env--- def _run_setup_command(- command: Any,- *,- display: str,- shell: bool = False,- timeout: int = 180,- ) -> subprocess.CompletedProcess:- return subprocess.run(- command,- shell=shell,- executable="/bin/bash" if shell else None,- env=_memory_provider_setup_env(),- capture_output=True,- text=True,- # Lossy UTF-8 decode — setup tools emit UTF-8; never let a- # locale-mismatched byte raise in the reader thread (#52649).- encoding="utf-8",- errors="replace",- timeout=timeout,- check=False,- )+ # Which per-platform knobs the setup UI hides, and why: see+ # hermes_cli/setup_hidden_env.py. Shared with the `hermes setup gateway`+ # wizard so the surfaces ask for the same things.- def _memory_provider_dependencies_installed(setup: Dict[str, Any]) -> bool:- pip_dependencies = _string_list(setup.get("pip_dependencies"))- external_dependencies = setup.get("external_dependencies") or []+ from hermes_cli.web_routers import messaging as _messaging_routes # noqa: E402- pip_ok = all(_dependency_importable(dep) for dep in pip_dependencies)- external_ok = True- for dep in external_dependencies:- if not isinstance(dep, dict):- continue- check_cmd = str(dep.get("check") or "").strip()- install_cmd = str(dep.get("install") or "").strip()- if not check_cmd:- if install_cmd:- external_ok = False- continue- try:- completed = _run_setup_command(- shlex.split(check_cmd),- display=check_cmd,- timeout=20,- )- except Exception:- external_ok = False- continue- if completed.returncode != 0:- external_ok = False+ app.include_router(_messaging_routes.router)+ from hermes_cli.web_routers.messaging import ( # noqa: E402,F401 — legacy re-exports; tests call these via web_server.<name>+ apply_whatsapp_onboarding,+ start_whatsapp_onboarding,+ )- return pip_ok and external_ok+ from hermes_cli.web_server_oauth import ( # noqa: E402,F401 — re-exported; routers/tests reach these via web_server.<name>+ _OAUTH_PROVIDER_CATALOG,+ _external_process_cli_command,+ _minimax_poller,+ _nous_poller,+ _oauth_profile_name,+ _oauth_session_profile,+ _oauth_sessions,+ _oauth_sessions_lock,+ _truncate_token,+ _xai_device_poller,+ )- from hermes_cli.web_routers import memory_providers as _memory_providers_routes # noqa: E402- app.include_router(_memory_providers_routes.router)+ from hermes_cli.web_routers import oauth as _oauth_routes # noqa: E402+ app.include_router(_oauth_routes.router)+ from hermes_cli.web_routers.oauth import ( # noqa: E402,F401 — legacy re-exports; tests call these via web_server.<name>+ _codex_full_login_worker,+ _new_oauth_session,+ _resolve_provider_status,+ start_oauth_login,+ )- def _normalize_memory_provider_schema(name: str, provider: Any) -> List[Dict[str, Any]]:- raw_schema: List[Dict[str, Any]] = []- if provider is not None and hasattr(provider, "get_config_schema"):- try:- raw = provider.get_config_schema()- if isinstance(raw, list):- raw_schema = [field for field in raw if isinstance(field, dict)]- except Exception:- _log.warning("Failed to read memory provider schema for %s", name, exc_info=True)- fields: List[Dict[str, Any]] = []- for raw in raw_schema:- key = str(raw.get("key") or "").strip()- if not key:- continue+ from hermes_cli.web_server_sessions import ( # noqa: E402,F401 — re-exported; routers/tests reach these via web_server.<name>+ _auto_archive_ticker_loop,+ _last_auto_archive_check,+ _maybe_auto_archive_for_profile,+ _open_session_db_at_path,+ _open_session_db_for_profile,+ _session_db_heal_exhausted,+ _session_db_heal_warned,+ _session_db_read_probe_statements,+ _session_latest_descendant,+ )- choices = raw.get("choices") or raw.get("options") or []- if not isinstance(choices, list):- choices = []-- explicit_kind = str(raw.get("kind") or raw.get("type") or "").strip().lower()- if raw.get("secret"):- kind = "secret"- elif choices:- kind = "select"- elif explicit_kind in {"bool", "boolean"} or isinstance(raw.get("default"), bool):- kind = "boolean"- elif explicit_kind in {"int", "integer"} or (- isinstance(raw.get("default"), int) and not isinstance(raw.get("default"), bool)- ):- kind = "integer"- elif explicit_kind in {"float", "number"} or isinstance(raw.get("default"), float):- kind = "number"- else:- kind = "text"-- options = []- for choice in choices:- value = str(choice)- options.append({"value": value, "label": value, "description": ""})-- description = str(raw.get("description") or "")- fields.append({- "key": key,- "label": str(raw.get("label") or key.replace("_", " ").title()),- "kind": kind,- "description": description,- "placeholder": str(raw.get("placeholder") or ""),- "required": bool(raw.get("required", False)),- "default": raw.get("default", ""),- "options": options,- "url": str(raw.get("url") or ""),- "when": raw.get("when") if isinstance(raw.get("when"), dict) else None,- "minimum": raw.get("minimum"),- "maximum": raw.get("maximum"),- "step": raw.get("step"),- "_env_key": str(raw.get("env_var") or "") or None,- })-- return fields--- def _read_json_file(path: Path) -> Dict[str, Any]:- if not path.exists():- return {}- try:- data = json.loads(path.read_text(encoding="utf-8"))- except Exception:- _log.debug("Failed to read JSON config from %s", path, exc_info=True)- return {}- return data if isinstance(data, dict) else {}+ app.include_router(_sessions_routes.manage_router)+ from hermes_cli.web_routers.sessions import ( # noqa: E402,F401 — legacy re-exports; tests call these via web_server.<name>+ bulk_delete_sessions_endpoint,+ import_sessions_endpoint,+ count_empty_sessions_endpoint,+ delete_empty_sessions_endpoint,+ get_session_stats,+ get_session_detail,+ get_session_latest_descendant,+ get_session_messages,+ delete_session_endpoint,+ rename_session_endpoint,+ export_session_endpoint,+ prune_sessions_endpoint,+ )- def _read_memory_provider_existing_values(name: str) -> Dict[str, Any]:- """Best-effort read of existing provider config across legacy/native stores."""- hermes_home = get_hermes_home()- values: Dict[str, Any] = {}+ app.include_router(_status_routes.logs_router)- # Common native provider stores.- for path in (- hermes_home / f"{name}.json",- hermes_home / name / "config.json",- ):- values.update(_read_json_file(path))- try:- cfg = load_config()- except Exception:- cfg = {}+ from hermes_cli.web_server_cron import ( # noqa: E402,F401 — re-exported; routers/tests reach these via web_server.<name>+ _call_cron_for_profile,+ _create_cron_job_sync,+ _cron_default_profile,+ _cron_optional_text,+ _cron_profile_dicts,+ _cron_profile_home,+ _cron_string_list,+ _find_cron_job_profile,+ _fire_cron_job_for_profile,+ _forward_cron_fire_to_gateway,+ _gateway_fire_endpoint,+ _gateway_intentionally_stopped,+ _mutate_cron_for_profile,+ _normalize_dashboard_cron_script,+ _notify_cron_provider_for_profile,+ _raise_if_cron_registration_error,+ _run_cron_dashboard_io,+ _validate_dashboard_cron_context_from,+ _validate_dashboard_cron_effective_job,+ )- memory_cfg = cfg.get("memory") if isinstance(cfg, dict) else {}- if isinstance(memory_cfg, dict):- provider_cfg = memory_cfg.get(name)- if isinstance(provider_cfg, dict):- values.update(provider_cfg)- legacy_cfg = memory_cfg.get("provider_config")- if isinstance(legacy_cfg, dict):- values = {**legacy_cfg, **values}- # Holographic stores under plugins.hermes-memory-store.- plugins_cfg = cfg.get("plugins") if isinstance(cfg, dict) else {}- if name == "holographic" and isinstance(plugins_cfg, dict):- holographic_cfg = plugins_cfg.get("hermes-memory-store")- if isinstance(holographic_cfg, dict):- values.update(holographic_cfg)+ from hermes_cli.web_routers import cron as _cron_routes # noqa: E402- return values+ app.include_router(_cron_routes.router)+ from hermes_cli.web_routers.cron import ( # noqa: E402,F401 — legacy re-exports; tests call these via web_server.<name>+ list_cron_jobs,+ get_cron_job,+ list_cron_job_runs,+ create_cron_job,+ get_cron_delivery_targets,+ update_cron_job,+ pause_cron_job,+ resume_cron_job,+ trigger_cron_job,+ delete_cron_job,+ cron_fire_webhook,+ list_cron_blueprints,+ instantiate_blueprint,++ _normalize_dashboard_cron_updates,+ )- def _env_lookup(env_key: Optional[str]) -> str:- if not env_key:- return ""- env_on_disk = load_env()- return str(env_on_disk.get(env_key) or os.environ.get(env_key) or "")--- def _coerce_bool(value: Any, *, default: bool = False) -> bool:- if isinstance(value, bool):- return value- if value is None or value == "":- return default- if isinstance(value, (int, float)):- return bool(value)- text = str(value).strip().lower()- if text in {"1", "true", "yes", "on"}:- return True- if text in {"0", "false", "no", "off"}:- return False- raise ValueError(f"Invalid boolean value: {value}")+ from hermes_cli.web_server_mcp import ( # noqa: E402,F401 — re-exported; routers/tests reach these via web_server.<name>+ _mcp_oauth_flows,+ _mcp_server_summary,+ _normalize_mcp_server_create,+ _run_dashboard_mcp_oauth,+ )- def _field_default(field: Dict[str, Any]) -> Any:- default = field.get("default", "")- if field["kind"] == "boolean":- return _coerce_bool(default, default=False)- return default+ from hermes_cli.web_routers import mcp as _mcp_routes # noqa: E402+ app.include_router(_mcp_routes.router)+ from hermes_cli.web_routers.mcp import ( # noqa: E402,F401 — legacy re-exports; tests call these via web_server.<name>+ list_mcp_servers,+ add_mcp_server,+ replace_mcp_servers,+ remove_mcp_server,+ test_mcp_server,+ auth_mcp_server,+ mcp_oauth_flow_status,+ mcp_oauth_callback,+ set_mcp_server_enabled,+ list_mcp_catalog,+ install_mcp_catalog_entry,+ )- def _field_value(field: Dict[str, Any], data: Dict[str, Any]) -> Any:- if field["kind"] == "secret":- return ""- value = data.get(field["key"])- if value in (None, ""):- value = _env_lookup(field.get("_env_key"))- if value in (None, ""):- value = _field_default(field)+ _ACTION_LOG_FILES.setdefault("computer-use-grant", "action-computer-use-grant.log")- if field["kind"] == "select":- allowed = {opt["value"] for opt in field.get("options", [])}- value = str(value)- return value if value in allowed else str(_field_default(field))- if field["kind"] == "boolean":- return _coerce_bool(value, default=_coerce_bool(_field_default(field), default=False))- return str(value)+ from hermes_cli.web_routers import ops as _ops_routes # noqa: E402- def _field_is_set(field: Dict[str, Any], data: Dict[str, Any]) -> bool:- if field["kind"] == "secret":- return bool(_env_lookup(field.get("_env_key")) or data.get(field["key"]))- value = _field_value(field, data)- return value not in (None, "")+ app.include_router(_ops_routes.router)+ from hermes_cli.web_routers.ops import ( # noqa: E402,F401 — legacy re-exports; tests call these via web_server.<name>+ delete_webhook,+ list_checkpoints,+ list_credential_pool,+ prune_checkpoints,+ run_backup,+ run_doctor,+ run_import,+ run_security_audit,+ start_gateway,+ )- def _field_visible(- field: Dict[str, Any],- data: Dict[str, Any],- fields_by_key: Optional[Dict[str, Dict[str, Any]]] = None,- ) -> bool:- when = field.get("when")- if not isinstance(when, dict) or not when:- return True- for dep_key, expected in when.items():- dep_field = (fields_by_key or {}).get(str(dep_key)) or {- "key": str(dep_key),- "kind": "text",- "default": "",- "_env_key": None,- }- actual = _field_value(dep_field, data)- if str(actual) != str(expected):- return False- return True+ # ---------------------------------------------------------------------------+ # Skills hub endpoints — search / install / uninstall / update.+ #+ # Search and install touch the network (GitHub, hub sources) and run the same+ # complex source-router pipeline the CLI uses, so they're spawned as background+ # actions whose logs the dashboard tails. The already-installed skill list ++ # enable/disable toggle live in the existing /api/skills endpoints.+ # ---------------------------------------------------------------------------- def _memory_provider_is_configured(name: str, provider: Any) -> bool:- data = _read_memory_provider_existing_values(name)- fields = _normalize_memory_provider_schema(name, provider)- fields_by_key = {field["key"]: field for field in fields}- visible_fields = [- field for field in fields if _field_visible(field, data, fields_by_key)- ]- required_fields = [field for field in visible_fields if field.get("required")]- if not required_fields:- return True- return all(_field_is_set(field, data) for field in required_fields)+ from hermes_cli.web_routers import skills as _skills_routes # noqa: E402+ app.include_router(_skills_routes.hub_router)+ from hermes_cli.web_routers.skills import ( # noqa: E402,F401 — legacy re-exports; tests call these via web_server.<name>+ install_skill_hub,+ uninstall_skill_hub,+ update_skills_hub,+ list_skills_hub_sources,+ search_skills_hub,+ preview_skill_hub,+ scan_skill_hub,+ )- def _discover_memory_provider_statuses() -> List[Dict[str, Any]]:- discovered: Dict[str, Dict[str, Any]] = {}- try:- from plugins.memory import discover_memory_providers-- for name, description, available in discover_memory_providers():- discovered[str(name)] = {- "name": str(name),- "description": str(description or ""),- "available": bool(available),- "missing": False,- }- except Exception:- _log.exception("discover_memory_providers failed")-- cfg = load_config()- active = ""- mem = cfg.get("memory")- if isinstance(mem, dict):- active = _normalize_memory_provider_name(mem.get("provider"))- if active and active not in discovered:- discovered[active] = {- "name": active,- "description": "Configured provider was not found.",- "available": False,- "missing": True,- }- providers: List[Dict[str, Any]] = []- for name in sorted(discovered):- row = discovered[name]- provider = None if row["missing"] else _load_memory_provider(name)- setup = _memory_provider_setup_info(name)- configured = False if row["missing"] else _memory_provider_is_configured(name, provider)- schema_fields = [] if row["missing"] else _normalize_memory_provider_schema(name, provider)- if row["missing"]:- status = "missing"- elif not row["available"] and not setup.get("dependencies_installed", True):- status = "unavailable"- elif not configured:- status = "needs_config"- elif not row["available"] and schema_fields:- status = "needs_config"- elif not row["available"]:- status = "unavailable"- else:- status = "ready"- providers.append({- "name": name,- "description": row["description"],- "available": row["available"],- "configured": configured,- "status": status,- "setup": setup,- })- return providers+ app.include_router(_profiles_routes.router)+ from hermes_cli.web_routers.profiles import ( # noqa: E402,F401 — legacy re-exports; tests call these via web_server.<name>+ list_profiles_endpoint,+ create_profile_endpoint,+ get_active_profile_endpoint,+ set_active_profile_endpoint,+ get_profile_setup_command,+ open_profile_terminal_endpoint,+ rename_profile_endpoint,+ delete_profile_endpoint,+ get_profile_soul,+ update_profile_soul,+ update_profile_description_endpoint,+ update_profile_model_endpoint,+ describe_profile_auto_endpoint,+ )- def _require_memory_provider_ready(name: str) -> None:- if not name:- return- statuses = {row["name"]: row for row in _discover_memory_provider_statuses()}- row = statuses.get(name)- if row is None:- raise HTTPException(- status_code=400,- detail=f"Unknown memory provider '{name}'.",- )- if row["status"] != "ready":- raise HTTPException(- status_code=400,- detail=(- f"Memory provider '{name}' is not ready "- f"({row['status'].replace('_', ' ')}). Configure it in the dashboard first."- ),- )+ app.include_router(_skills_routes.router)+ from hermes_cli.web_routers.skills import ( # noqa: E402,F401 — legacy re-exports; tests call these via web_server.<name>+ get_skills,+ toggle_skill,+ get_skill_content,+ create_skill,+ update_skill_content,+ )- from hermes_cli.web_routers import config_env as _config_env_routes # noqa: E402+ from hermes_cli.web_routers import tools as _tools_routes # noqa: E402- app.include_router(_config_env_routes.config_router)- from hermes_cli.web_routers.config_env import ( # noqa: E402,F401 — legacy re-exports; tests call these via web_server.<name>- get_config,- get_schema,+ app.include_router(_tools_routes.router)+ from hermes_cli.web_routers.tools import ( # noqa: E402,F401 — legacy re-exports; tests call these via web_server.<name>+ get_toolsets,+ toggle_toolset,+ get_toolset_config,+ get_toolset_models,+ select_toolset_model,+ select_toolset_provider,+ save_toolset_env,+ run_toolset_post_setup,+ get_terminal_backends,+ select_terminal_backend,+ get_computer_use_status,+ grant_computer_use_permissions,)