Dodaios is an open-source agent OS for your desktop: it runs your coding agents, browser and apps by voice or chat, on your own machine. Formerly Personal Jarvis.
Python agent-orchestrationai-agentai-coding-assistantclaude-codecoding-agentcomputer-usedesktop-applocal-firstmcppersonal-jarvisvoice-assistantvoice-coding
feat(app-actions): let Jarvis run any app action under a per-action policy
rubenluetke10-beep90cbbaa51360
diff --git a/docs/adr/0011-router-pure-dispatcher.md b/docs/adr/0011-router-pure-dispatcher.mdindex eb478f134a..0f621537d4 100644--- a/docs/adr/0011-router-pure-dispatcher.md+++ b/docs/adr/0011-router-pure-dispatcher.md@@ -1377,3 +1377,35 @@ Guards: `tests/contract/test_internal_messages.py`, the router membership test,`InternalMessageBubble` tests. Voice confirmation retries share one result;a real microphone response captured after playback is not discarded solelybecause its transcript resembles the confirmation question.++## Amendment 2026-09-29 — Every app action++`find-app-action` and `run-app-action` join `ROUTER_TOOLS`. The Command+Registry keeps its curated, hand-described commands; these two open the rest+of the app's own REST surface (about 765 operations) without declaring a+schema per operation on every turn. `find-app-action` (risk `safe`) ranks the+catalog built in-process from the live app's OpenAPI document+(`jarvis/app_actions/catalog.py`) and returns a few matches with their+parameters. `run-app-action` sends ONE operation through the same in-process+ASGI transport as `app-command`.++### Pure-Dispatcher spirit is preserved++- Each call's tier comes from `risk_tier_for_args`: the person's per-action+ mode from Settings > Jarvis actions (`allow` → monitor, `ask`, `block`),+ else the action default (read → safe, change → monitor, dangerous route →+ ask). `ToolExecutor.execute()` still evaluates and confirms (AP-3); a+ blocked action is refused by the evaluator. The same policy applies to the+ registry commands that share an endpoint.+- The catalog never contains credentials, sign-ins, OAuth callbacks,+ webhooks, the raw control plane, self-modification or the policy routes —+ voice never carries a secret (AP-2) and Jarvis never edits its own+ permissions.+- Never a spawn and never in a worker set (AP-5/AP-14): both names are in the+ worker broker's forbidden list and in the society `NEVER_GRANTED` set.++### Regression guards++`tests/unit/brain/test_routing.py` (exact router set) and+`tests/unit/app_actions/` (catalog exclusions, policy tiers, blocked calls,+parameter mapping).diff --git a/jarvis/app_actions/__init__.py b/jarvis/app_actions/__init__.pynew file mode 100644index 0000000000..85f6ae542c--- /dev/null+++ b/jarvis/app_actions/__init__.py@@ -0,0 +1,8 @@+"""Every action of the Jarvis app, reachable by the brain under the user's policy.++The app's own REST surface is the action catalog (``catalog``): one entry per+OpenAPI operation, built in-process from the live FastAPI app, minus the+operations Jarvis must never touch (secrets, sign-ins, its own policy). The+person decides per action whether Jarvis may run it freely, must ask first,+or may never run it (``policy``); ``history`` keeps what Jarvis ran recently.+"""diff --git a/jarvis/app_actions/catalog.py b/jarvis/app_actions/catalog.pynew file mode 100644index 0000000000..bca3e55f8c--- /dev/null+++ b/jarvis/app_actions/catalog.py@@ -0,0 +1,191 @@+"""The app-action catalog: one entry per operation of the app's REST surface."""++from __future__ import annotations++import re+from dataclasses import dataclass, field+from typing import Any, Final++__all__ = [+ "ActionEntry",+ "build_catalog",+ "default_tier",+ "is_excluded",+ "live_catalog",+]++_METHODS: Final[tuple[str, ...]] = ("get", "post", "put", "patch", "delete")++#: Never offered to the brain: credentials and sign-ins (voice must never carry+#: a secret, AP-2), the raw control plane, webhooks, self-modification, and the+#: action policy itself — Jarvis never edits its own permissions.+_EXCLUDED: Final[re.Pattern[str]] = re.compile(+ r"(secret|api-?keys?|/keys?(/|$)|install-key|host-key|use-key|token|password|"+ r"credential|oauth|/auth(/|$)|login|pairing|/callback|/hooks/|openapi|/ws$|"+ r"^/api/control/|^/api/self-mod|^/api/app-actions)",+ re.IGNORECASE,+)++_SCHEMA_KEYS: Final[tuple[str, ...]] = ("type", "enum", "items", "properties", "required")+++@dataclass(frozen=True, slots=True)+class ActionEntry:+ """One app action. ``id`` is the stable OpenAPI operation id."""++ id: str+ method: str+ path: str+ area: str+ title: str+ description: str+ dangerous: bool+ path_params: tuple[str, ...] = ()+ query_params: tuple[str, ...] = ()+ has_body: bool = False+ parameters: dict[str, Any] = field(default_factory=dict)++ @property+ def mutating(self) -> bool:+ return self.method != "GET"++ def summary(self) -> dict[str, Any]:+ return {+ "id": self.id,+ "method": self.method,+ "path": self.path,+ "area": self.area,+ "title": self.title,+ "description": self.description,+ "dangerous": self.dangerous,+ "default_tier": default_tier(self),+ }+++def default_tier(entry: ActionEntry) -> str:+ """Reading is safe, changing is logged, a dangerous change asks first."""+ if entry.dangerous:+ return "ask"+ return "monitor" if entry.mutating else "safe"+++def is_excluded(path: str) -> bool:+ return bool(_EXCLUDED.search(path))+++def _dangerous(method: str, path: str, operation: dict[str, Any]) -> bool:+ if operation.get("x-jarvis-dangerous"):+ return True+ try:+ from jarvis.cli_ctl.safety import is_dangerous+ except Exception: # noqa: BLE001 — without the CLI extras, DELETE alone is dangerous+ return method == "DELETE"+ return is_dangerous(method, path)+++def _resolve(schema: Any, components: dict[str, Any], depth: int = 0) -> Any:+ """Inline ``$ref``s and keep only what a model needs to fill arguments."""+ if not isinstance(schema, dict) or depth > 4:+ return {}+ ref = schema.get("$ref")+ if isinstance(ref, str):+ schema = components.get(ref.rsplit("/", 1)[-1], {})+ for key in ("anyOf", "oneOf", "allOf"):+ options = [o for o in schema.get(key) or () if o.get("type") != "null"]+ if options:+ merged = _resolve(options[0], components, depth + 1)+ return {**merged, **_short_description(schema)}+ out: dict[str, Any] = {k: schema[k] for k in _SCHEMA_KEYS if k in schema and k != "properties"}+ out.update(_short_description(schema))+ if "items" in out:+ out["items"] = _resolve(out["items"], components, depth + 1)+ props = schema.get("properties")+ if isinstance(props, dict):+ out["properties"] = {+ name: _resolve(value, components, depth + 1) for name, value in props.items()+ }+ return out+++def _short_description(schema: dict[str, Any]) -> dict[str, str]:+ # Pydantic's auto title ("Agent Id") repeats the name; only a written+ # description tells the model something.+ text = str(schema.get("description") or "").strip()+ return {"description": text[:160]} if text else {}+++def _entry(+ method: str, path: str, operation: dict[str, Any], components: dict[str, Any]+) -> ActionEntry | None:+ op_id = str(operation.get("operationId") or "")+ if not op_id or is_excluded(path):+ return None+ properties: dict[str, Any] = {}+ required: list[str] = []+ path_params: list[str] = []+ query_params: list[str] = []+ for param in operation.get("parameters") or ():+ where = param.get("in")+ name = str(param.get("name") or "")+ if not name or where not in ("path", "query"):+ continue+ (path_params if where == "path" else query_params).append(name)+ properties[name] = _resolve(param.get("schema") or {}, components)+ if param.get("required"):+ required.append(name)+ body = (+ (operation.get("requestBody") or {}).get("content", {}).get("application/json", {})+ ).get("schema")+ if body:+ properties["body"] = _resolve(body, components)+ if (operation.get("requestBody") or {}).get("required"):+ required.append("body")+ parameters: dict[str, Any] = {"type": "object", "properties": properties}+ if required:+ parameters["required"] = required+ description = str(operation.get("description") or "").strip().split("\n\n", 1)[0]+ return ActionEntry(+ id=op_id,+ method=method.upper(),+ path=path,+ area=str((operation.get("tags") or ["app"])[0]),+ title=str(operation.get("summary") or op_id),+ description=" ".join(description.split())[:300],+ dangerous=_dangerous(method.upper(), path, operation),+ path_params=tuple(path_params),+ query_params=tuple(query_params),+ has_body=bool(body),+ parameters=parameters,+ )+++def build_catalog(spec: dict[str, Any]) -> dict[str, ActionEntry]:+ """Every allowed operation of an OpenAPI spec, keyed by operation id."""+ components = (spec.get("components") or {}).get("schemas") or {}+ out: dict[str, ActionEntry] = {}+ for path, item in (spec.get("paths") or {}).items():+ for method in _METHODS:+ operation = (item or {}).get(method)+ if isinstance(operation, dict):+ entry = _entry(method, path, operation, components)+ if entry is not None:+ out[entry.id] = entry+ return out+++_cache: dict[int, dict[str, ActionEntry]] = {}+++def live_catalog() -> dict[str, ActionEntry]:+ """The running app's catalog; empty before the web app exists (headless tools)."""+ from jarvis.core import runtime_refs++ app = runtime_refs.get_web_app()+ if app is None:+ return {}+ spec = app.openapi()+ key = id(spec)+ if key not in _cache:+ _cache.clear()+ _cache[key] = build_catalog(spec)+ return _cache[key]diff --git a/jarvis/app_actions/history.py b/jarvis/app_actions/history.pynew file mode 100644index 0000000000..f5a58b2c86--- /dev/null+++ b/jarvis/app_actions/history.py@@ -0,0 +1,94 @@+"""What Jarvis recently did with app actions: ran, failed, or was blocked.++A bounded list (newest first) kept in memory and mirrored to+``DATA_DIR/state/app_action_history.json`` so the Jarvis-actions page still+shows it after a restart. Only action ids, outcomes and short app messages are+kept — never arguments, which may carry personal text.+"""++from __future__ import annotations++import json+import logging+import os+import threading+import time+import uuid+from collections import deque+from pathlib import Path+from typing import Any, Final++log = logging.getLogger(__name__)++__all__ = ["history_path", "recent", "record"]++_MAX: Final[int] = 200+_DEDUPE_S: Final[float] = 3.0+_FILE_NAME: Final[str] = "app_action_history.json"+_lock = threading.Lock()+_entries: deque[dict[str, Any]] | None = None+++def history_path() -> Path:+ from jarvis.core import config as cfg_mod # lazy: tests monkeypatch DATA_DIR++ return Path(cfg_mod.DATA_DIR) / "state" / _FILE_NAME+++def _load() -> deque[dict[str, Any]]:+ global _entries+ if _entries is None:+ rows: list[dict[str, Any]] = []+ try:+ raw = json.loads(history_path().read_text(encoding="utf-8"))+ rows = [r for r in raw if isinstance(r, dict)] if isinstance(raw, list) else []+ except FileNotFoundError:+ pass+ except (OSError, ValueError):+ log.warning("app-actions: unreadable history — starting empty", exc_info=True)+ _entries = deque(rows[:_MAX], maxlen=_MAX)+ return _entries+++def record(action_id: str, outcome: str, detail: str = "", *, via: str = "") -> None:+ """Add one entry. ``outcome`` is ``ran``, ``failed`` or ``blocked``.++ The same blocked action reported again within a few seconds is one event:+ the tier hook runs once per guard that inspects the call.+ """+ now = time.time()+ with _lock:+ entries = _load()+ if entries and outcome == "blocked":+ last = entries[0]+ if (+ last.get("action") == action_id+ and last.get("outcome") == outcome+ and now - float(last.get("at", 0)) < _DEDUPE_S+ ):+ return+ entries.appendleft(+ {"action": action_id, "outcome": outcome, "detail": detail[:300], "via": via, "at": now}+ )+ snapshot = list(entries)+ path = history_path()+ temporary = path.with_name(f".{path.name}.{os.getpid()}.{uuid.uuid4().hex}.tmp")+ try:+ path.parent.mkdir(parents=True, exist_ok=True)+ temporary.write_text(json.dumps(snapshot), encoding="utf-8")+ os.replace(temporary, path)+ except OSError:+ log.warning("app-actions: history not persisted", exc_info=True)+ finally:+ temporary.unlink(missing_ok=True)+++def recent(limit: int = 50) -> list[dict[str, Any]]:+ with _lock:+ return list(_load())[: max(0, limit)]+++def reset_for_tests() -> None:+ global _entries+ with _lock:+ _entries = Nonediff --git a/jarvis/app_actions/policy.py b/jarvis/app_actions/policy.pynew file mode 100644index 0000000000..31782018bf--- /dev/null+++ b/jarvis/app_actions/policy.py@@ -0,0 +1,84 @@+"""The person's per-action policy: allow, ask, block — or the action's default.++Stored as ``DATA_DIR/state/app_action_policy.json`` (``{action_id: mode}``),+written atomically; not ``jarvis.toml``, because it is per-user runtime state+edited from the Jarvis-actions page, and a missing or broken file simply means+"every action uses its default".+"""++from __future__ import annotations++import json+import logging+import os+import threading+import uuid+from pathlib import Path+from typing import Final, Literal, get_args++from .catalog import ActionEntry, default_tier++log = logging.getLogger(__name__)++__all__ = ["Mode", "effective_tier", "load_policy", "policy_path", "set_mode"]++Mode = Literal["allow", "ask", "block"]+MODES: Final[tuple[str, ...]] = get_args(Mode)+_FILE_NAME: Final[str] = "app_action_policy.json"+_lock = threading.Lock()+++def policy_path() -> Path:+ from jarvis.core import config as cfg_mod # lazy: tests monkeypatch DATA_DIR++ return Path(cfg_mod.DATA_DIR) / "state" / _FILE_NAME+++def load_policy() -> dict[str, str]:+ path = policy_path()+ try:+ raw = json.loads(path.read_text(encoding="utf-8"))+ except FileNotFoundError:+ return {}+ except (OSError, ValueError):+ log.warning("app-actions: unreadable policy %s — using defaults", path, exc_info=True)+ return {}+ if not isinstance(raw, dict):+ return {}+ return {str(k): str(v) for k, v in raw.items() if v in MODES}+++def set_mode(action_id: str, mode: str | None) -> dict[str, str]:+ """Set (or with ``None`` clear) one action's mode; returns the whole policy."""+ if mode is not None and mode not in MODES:+ raise ValueError(f"mode must be one of {MODES} or null")+ with _lock:+ policy = load_policy()+ if mode is None:+ policy.pop(action_id, None)+ else:+ policy[action_id] = mode+ path = policy_path()+ temporary = path.with_name(f".{path.name}.{os.getpid()}.{uuid.uuid4().hex}.tmp")+ path.parent.mkdir(parents=True, exist_ok=True)+ try:+ temporary.write_text(json.dumps(policy, indent=2, sort_keys=True), encoding="utf-8")+ os.replace(temporary, path)+ finally:+ temporary.unlink(missing_ok=True)+ return policy+++def effective_tier(entry: ActionEntry, policy: dict[str, str] | None = None) -> str:+ """The risk tier the executor applies: the person's mode wins over the default.++ ``allow`` runs without a question but is still logged (``monitor``).+ """+ mode = (load_policy() if policy is None else policy).get(entry.id)+ if mode == "allow":+ return "monitor"+ if mode == "ask":+ return "ask"+ if mode == "block":+ return "block"+ return default_tier(entry)diff --git a/jarvis/brain/factory.py b/jarvis/brain/factory.pyindex 6b9b750d5b..da1f899b35 100644--- a/jarvis/brain/factory.py+++ b/jarvis/brain/factory.py@@ -101,6 +101,14 @@ ROUTER_TOOLS = frozenset({# (two-turn voice confirm). Direct gated action, never a spawn — never in# a worker set (AP-5/AP-14). See ADR-0011 amendment "app-command tool"."app-command",+ # Every app action (2026-09-29): search the app's own REST surface and+ # run ONE operation in-process, each call tiered by the person's+ # Jarvis-actions policy (allow / ask / block, else the action default).+ # Secrets, sign-ins and the policy itself are never in the catalog.+ # Direct gated action, never a spawn — never in a worker set+ # (AP-5/AP-14). See ADR-0011 amendment "Every app action".+ "find-app-action",+ "run-app-action",# Phase A1: synchronous state read on the AwarenessManager (Plan §5).# NO brain call, NO IO — property read only."awareness-snapshot",diff --git a/jarvis/missions/workers/worker_tool_broker.py b/jarvis/missions/workers/worker_tool_broker.pyindex 5fba68ad17..c7474c6942 100644--- a/jarvis/missions/workers/worker_tool_broker.py+++ b/jarvis/missions/workers/worker_tool_broker.py@@ -46,6 +46,10 @@ _FORBIDDEN_EXACT = frozenset({"app-command","app_command",+ "find-app-action",+ "find_app_action",+ "run-app-action",+ "run_app_action","cli-jarvis","cli-jarvisctl","cli-jctl",diff --git a/jarvis/plugins/tool/app_action.py b/jarvis/plugins/tool/app_action.pynew file mode 100644index 0000000000..78bce4b65b--- /dev/null+++ b/jarvis/plugins/tool/app_action.py@@ -0,0 +1,237 @@+"""``find-app-action`` / ``run-app-action`` — any action of the Jarvis app.++The Command Registry gives the brain ~50 curated, hand-described commands.+Everything else the app can do (765 REST operations) used to be reachable+only by clicking. These two router tools open the whole surface without+declaring hundreds of schemas every turn: the brain searches the catalog+(``jarvis.app_actions.catalog``) and runs one operation in-process, exactly+like the UI would. Each call's risk tier comes from the person's policy on+the Jarvis-actions page (allow / ask / block, else the action's default), so+ToolExecutor still decides and confirms (AP-3). Secrets, sign-ins and the+policy itself are never in the catalog.+"""++from __future__ import annotations++import json+import logging+from typing import Any+from urllib.parse import quote++from jarvis.core.protocols import ToolResult++log = logging.getLogger(__name__)++_MAX_RESULTS = 6+_MAX_RESPONSE_CHARS = 12_000+++def _catalog() -> dict[str, Any]:+ from jarvis.app_actions.catalog import live_catalog++ return live_catalog()+++class FindAppActionTool:+ """Search every action of the Jarvis app by keywords."""++ name: str = "find-app-action"+ risk_tier: str = "safe"+ description: str = (+ "Search ALL actions of the Jarvis desktop app (settings, IDE panes and "+ "workspaces, skills, local models, computers, marketplace, MCP servers, "+ "dictation, chats, agents, automations …) when no other tool does what the "+ "user asked. Pass English keywords; returns action ids, what each does, its "+ "parameters and whether it runs freely, asks first or is blocked. Then call "+ "run-app-action."+ )+ schema: dict[str, Any] = {+ "type": "object",+ "properties": {+ "query": {"type": "string", "description": "English keywords, e.g. 'pane rename'."},+ "area": {"type": "string", "description": "Optional area filter, e.g. 'skills'."},+ },+ "required": ["query"],+ }++ async def execute(self, args: dict[str, Any], ctx: Any) -> ToolResult:+ from jarvis.app_actions.policy import effective_tier, load_policy+ from jarvis.core.protocols import SupervisorToolDescriptor+ from jarvis.live.discovery import discover++ catalog = _catalog()+ if not catalog:+ return ToolResult(+ success=False, output=None, error="The app's actions are not available here."+ )+ area = str(args.get("area") or "").strip().lower()+ entries = [e for e in catalog.values() if not area or e.area.lower() == area]+ policy = load_policy()+ descriptors = [+ SupervisorToolDescriptor(+ name=e.id,+ description=f"{e.title}. {e.description} {e.area} {e.path}",+ input_schema=e.parameters,+ risk_tier=effective_tier(e, policy), # type: ignore[arg-type]+ )+ for e in entries+ ]+ found = discover(descriptors, str(args.get("query") or ""))+ actions = []+ for item in found["tools"][:_MAX_RESULTS]:+ entry = catalog[item["name"]]+ tier = effective_tier(entry, policy)+ actions.append(+ {+ "action_id": entry.id,+ "title": entry.title,+ "does": entry.description,+ "area": entry.area,+ "runs": {"safe": "freely", "monitor": "freely", "ask": "asks first"}.get(+ tier, "blocked by the user"+ ),+ "parameters": entry.parameters,+ }+ )+ return ToolResult(+ success=True,+ output={"actions": actions, "total_matches": found["total"]},+ )+++class RunAppActionTool:+ """Run one app action by id, under the person's per-action policy."""++ name: str = "run-app-action"+ risk_tier: str = "monitor"+ is_action_tool: bool = True+ description: str = (+ "Run one Jarvis app action found with find-app-action. Pass its action_id and "+ "params: path and query parameters by name, the request body under 'body'. "+ "Report the result the tool returns, never your assumption; a blocked action "+ "stays blocked — tell the user it is off in Settings > Jarvis actions."+ )+ schema: dict[str, Any] = {+ "type": "object",+ "properties": {+ "action_id": {"type": "string", "description": "Id from find-app-action."},+ "params": {"type": "object", "description": "Parameters as listed by the search."},+ },+ "required": ["action_id"],+ }++ def __init__(self, runtime: Any = None) -> None:+ if runtime is None:+ from jarvis.plugins.tool.app_command import _Runtime++ runtime = _Runtime()+ self._runtime = runtime++ def risk_tier_for_args(self, args: dict[str, Any]) -> str:+ from jarvis.app_actions import history+ from jarvis.app_actions.policy import effective_tier++ entry = _catalog().get(str((args or {}).get("action_id") or ""))+ if entry is None:+ return "safe" # execute refuses an unknown id without side effects+ tier = effective_tier(entry)+ if tier == "block":+ history.record(entry.id, "blocked", "Blocked in Jarvis actions", via=self.name)+ return tier++ async def execute(self, args: dict[str, Any], ctx: Any) -> ToolResult:+ from jarvis.app_actions import history+ from jarvis.app_actions.policy import effective_tier++ action_id = str((args or {}).get("action_id") or "")+ entry = _catalog().get(action_id)+ if entry is None:+ return ToolResult(+ success=False,+ output=None,+ error=f"Unknown action {action_id!r}. Search with find-app-action first.",+ )+ if effective_tier(entry) == "block":+ # The executor already refuses a blocked tier; this keeps a direct+ # call honest too.+ history.record(entry.id, "blocked", "Blocked in Jarvis actions", via=self.name)+ return ToolResult(+ success=False, output=None, error="The user blocked this action for Jarvis."+ )+ params = dict((args or {}).get("params") or {})+ path = entry.path+ for name in entry.path_params:+ if name not in params:+ return ToolResult(+ success=False, output=None, error=f"Missing path parameter {name!r}."+ )+ path = path.replace("{" + name + "}", quote(str(params.pop(name)), safe=""))+ query = {k: params.pop(k) for k in list(params) if k in entry.query_params}+ body = params.pop("body", None)+ if body is None and entry.has_body and params:+ body = params # a model that flattened the body still gets it through+ status, data = await self._request(entry.method, path, query, body)+ if status is None:+ history.record(entry.id, "failed", str(data), via=self.name)+ return ToolResult(success=False, output=None, error=str(data))+ if status >= 400:+ detail = data.get("detail", data) if isinstance(data, dict) else data+ history.record(entry.id, "failed", f"HTTP {status}: {detail}", via=self.name)+ log.info("app action %s refused: HTTP %s %s", entry.id, status, str(detail)[:500])+ return ToolResult(+ success=False,+ output={"action_id": entry.id, "status": status},+ error=f"{entry.title} failed: HTTP {status}: {detail}",+ )+ history.record(entry.id, "ran", entry.title, via=self.name)+ return ToolResult(success=True, output={"action_id": entry.id, "response": _trim(data)})++ async def _request(+ self, method: str, path: str, query: dict[str, Any], body: Any+ ) -> tuple[int | None, Any]:+ import httpx++ from jarvis.agent_chat.jarvis_harness import HEADER_NAME+ from jarvis.society.inherit import caller_session_id+ from jarvis.tasks.context import CLIENT_TIMEZONE_HEADER, turn_timezone++ transport = self._runtime.resolve_transport()+ if transport is None:+ return None, "The app server is not available in this runtime."+ headers: dict[str, str] = {}+ key = self._runtime.control_key()+ if key:+ headers["Authorization"] = f"Bearer {key}"+ zone = turn_timezone()+ if zone:+ headers[CLIENT_TIMEZONE_HEADER] = zone+ session_id = caller_session_id()+ if session_id:+ headers[HEADER_NAME] = session_id+ try:+ async with httpx.AsyncClient(+ transport=transport, base_url="http://127.0.0.1", headers=headers, timeout=60.0+ ) as client:+ resp = await client.request(+ method,+ path,+ params=query or None,+ json=body if method != "GET" and body is not None else None,+ )+ except httpx.HTTPError as exc:+ return None, f"transport error: {exc}"+ try:+ data = resp.json() if resp.content else None+ except ValueError:+ data = resp.text+ return resp.status_code, data+++def _trim(data: Any) -> Any:+ from jarvis.plugins.tool.app_command import _without_snapshots++ data = _without_snapshots(data)+ text = json.dumps(data, ensure_ascii=False, default=str)+ if len(text) <= _MAX_RESPONSE_CHARS:+ return data+ return {"truncated": True, "preview": text[:_MAX_RESPONSE_CHARS]}diff --git a/jarvis/plugins/tool/app_command.py b/jarvis/plugins/tool/app_command.pyindex ef01479abc..21d0905a7c 100644--- a/jarvis/plugins/tool/app_command.py+++ b/jarvis/plugins/tool/app_command.py@@ -260,6 +260,16 @@ class _Runtime:return None+def _remember(command_id: str, outcome: str, detail: str) -> None:+ """Show the command on the Jarvis-actions page's recent list."""+ try:+ from jarvis.app_actions import history++ history.record(command_id, outcome, detail, via="app-command")+ except Exception: # noqa: BLE001 — the log is advisory; the command's result stands+ log.warning("app-actions history unavailable", exc_info=True)++class RegistryCommandTool:"""One registry command as a flat, schema-validated brain tool."""@@ -281,6 +291,28 @@ class RegistryCommandTool:"type": "object", "properties": {},}+ def risk_tier_for_args(self, args: dict[str, Any]) -> str:+ """The person's Jarvis-actions choice for this command's endpoint wins+ over the registry's own tier; without one the registry tier stands."""+ from jarvis.app_actions.catalog import live_catalog+ from jarvis.app_actions.policy import effective_tier, load_policy++ policy = load_policy()+ if not policy:+ return self.risk_tier+ method = self._cmd.method.upper()+ for entry in live_catalog().values():+ if entry.method == method and entry.path == self._cmd.path:+ if entry.id not in policy:+ return self.risk_tier+ tier = effective_tier(entry, policy)+ if tier == "block":+ from jarvis.app_actions import history++ history.record(entry.id, "blocked", "Blocked in Jarvis actions", via=self.name)+ return tier+ return self.risk_tier+async def execute(self, args: dict[str, Any], ctx: Any) -> ToolResult:cmd = self._cmdcmd_args = _with_defaults(cmd.params, args or {})@@ -363,12 +395,14 @@ class RegistryCommandTool:"app command %s refused: HTTP %s %s",cmd.id, resp.status_code, str(detail)[:500],)+ _remember(cmd.id, "failed", f"HTTP {resp.status_code}: {detail}")return ToolResult(success=False,output={"command_id": cmd.id, "status": resp.status_code},error=f"{cmd.title} failed: HTTP {resp.status_code}: {detail}",)+ _remember(cmd.id, "ran", cmd.title)return ToolResult(success=True,output={diff --git a/jarvis/plugins/tool/navigate.py b/jarvis/plugins/tool/navigate.pyindex d8494a8995..dd479b3abb 100644--- a/jarvis/plugins/tool/navigate.py+++ b/jarvis/plugins/tool/navigate.py@@ -56,6 +56,8 @@ KNOWN: frozenset[str] = frozenset("wallpaper",# Appshots: the shortcut and destination for showing the front window."appshots",+ # Jarvis actions: which app actions Jarvis may run, ask for or never run.+ "jarvis-actions","dictionary","dictation","voice-shortcuts",@@ -202,6 +204,8 @@ _ALIASES: dict[str, str] = {"hintergrundbild": "wallpaper", # i18n-allow: input vocab"fondo de pantalla": "wallpaper", # i18n-allow: input vocab"appshot": "appshots",+ "jarvis actions": "jarvis-actions",+ "jarvis aktionen": "jarvis-actions", # i18n-allow: speech-input vocabulary"app shots": "appshots","app shot": "appshots","task bar": "taskbar",diff --git a/jarvis/society/capabilities.py b/jarvis/society/capabilities.pyindex c973b12cce..12073ff9b2 100644--- a/jarvis/society/capabilities.py+++ b/jarvis/society/capabilities.py@@ -68,6 +68,8 @@ NEVER_GRANTED: Final[frozenset[str]] = frozenset("switch-provider","manage-mcp-server","app-command",+ "find-app-action",+ "run-app-action","create-skill","reveal-key-preview","profile-update",diff --git a/jarvis/ui/web/app_actions_routes.py b/jarvis/ui/web/app_actions_routes.pynew file mode 100644index 0000000000..e8a7a7738d--- /dev/null+++ b/jarvis/ui/web/app_actions_routes.py@@ -0,0 +1,60 @@+"""Settings > Jarvis actions: every app action, the person's mode for each, and+what Jarvis recently ran. The brain never reaches these routes — they are+excluded from its action catalog, so Jarvis cannot change its own permissions."""++from __future__ import annotations++from typing import Any, Literal++from fastapi import APIRouter, HTTPException+from pydantic import BaseModel, ConfigDict++router = APIRouter(prefix="/api/app-actions", tags=["app-actions"])+++class ModeBody(BaseModel):+ model_config = ConfigDict(extra="forbid")+ #: ``None`` returns the action to its default.+ mode: Literal["allow", "ask", "block"] | None = None+++async def list_app_actions() -> dict[str, Any]:+ from jarvis.app_actions.catalog import live_catalog+ from jarvis.app_actions.policy import effective_tier, load_policy++ policy = load_policy()+ actions = [+ {**entry.summary(), "mode": policy.get(entry.id), "tier": effective_tier(entry, policy)}+ for entry in sorted(live_catalog().values(), key=lambda e: (e.area, e.title))+ ]+ return {+ "actions": actions,+ "areas": sorted({a["area"] for a in actions}),+ "count": len(actions),+ }++[email protected]("/{action_id}/mode")+async def set_app_action_mode(action_id: str, body: ModeBody) -> dict[str, Any]:+ from jarvis.app_actions.catalog import live_catalog+ from jarvis.app_actions.policy import effective_tier, set_mode++ entry = live_catalog().get(action_id)+ if entry is None:+ raise HTTPException(404, "Unknown action")+ policy = set_mode(action_id, body.mode)+ return {"id": action_id, "mode": policy.get(action_id), "tier": effective_tier(entry, policy)}++[email protected]("/history")+async def app_action_history(limit: int = 50) -> dict[str, Any]:+ from jarvis.app_actions import history+ from jarvis.app_actions.catalog import live_catalog++ catalog = live_catalog()+ rows = []+ for row in history.recent(min(max(limit, 1), 200)):+ entry = catalog.get(str(row.get("action")))+ rows.append({**row, "title": entry.title if entry else row.get("action")})+ return {"history": rows}diff --git a/jarvis/ui/web/frontend/src/components/layout/navGroups.ts b/jarvis/ui/web/frontend/src/components/layout/navGroups.tsindex bd90915309..4c4aa40e9c 100644--- a/jarvis/ui/web/frontend/src/components/layout/navGroups.ts+++ b/jarvis/ui/web/frontend/src/components/layout/navGroups.ts@@ -34,6 +34,7 @@ import {Workflow,Image as ImageIcon,ScanLine,+ ShieldCheck,type LucideIcon,} from "lucide-react";import { OllamaIcon } from "@/components/icons/OllamaIcon";@@ -273,6 +274,12 @@ export const NAV_FOOTER_ITEMS: NavItem[] = [*/export const SETTINGS_HUB_ONLY_ITEMS: NavItem[] = [{ id: "appshots", labelKey: "nav.appshots", icon: ScanLine, fallbackLabel: "Appshots" },+ {+ id: "jarvis-actions",+ labelKey: "nav.jarvis_actions",+ icon: ShieldCheck,+ fallbackLabel: "Jarvis actions",+ },];/**@@ -300,6 +307,7 @@ export const SETTINGS_HUB_IDS: readonly SectionId[] = ["computers","wallpaper","appshots",+ "jarvis-actions","costs","feedback",];diff --git a/jarvis/ui/web/frontend/src/i18n/locales/de.json b/jarvis/ui/web/frontend/src/i18n/locales/de.jsonindex 7a6a80f747..186184083a 100644--- a/jarvis/ui/web/frontend/src/i18n/locales/de.json+++ b/jarvis/ui/web/frontend/src/i18n/locales/de.json@@ -162,6 +162,7 @@"agent_instructions": "{name}.md","wallpaper": "Hintergrund","appshots": "Appshots",+ "jarvis_actions": "Jarvis-Aktionen","marketplace": "Marketplace","agentic_ide": "Agentic IDE","agentic_ide_beta": "Beta",@@ -5927,6 +5928,30 @@}}},+ "jarvis_actions": {+ "title": "Jarvis-Aktionen",+ "subtitle": "Alles, was Jarvis in dieser App tun kann. Wähle pro Aktion, ob sie frei läuft, vorher nachfragt oder nie ausgeführt wird.",+ "search_placeholder": "Aktionen suchen",+ "area_all": "Alle Bereiche",+ "changed_only": "Nur geänderte",+ "mode_default": "Standard",+ "mode_allow": "Erlaubt",+ "mode_ask": "Nachfragen",+ "mode_block": "Gesperrt",+ "tier_safe": "Standard: läuft frei (nur lesen)",+ "tier_monitor": "Standard: läuft frei",+ "tier_ask": "Standard: fragt vorher",+ "count": "{shown} von {total} Aktionen",+ "show_more": "Mehr anzeigen",+ "dangerous": "Ändert oder löscht etwas",+ "history_title": "Letzte Aktionen",+ "history_empty": "Jarvis hat noch keine App-Aktion ausgeführt.",+ "outcome_ran": "Ausgeführt",+ "outcome_failed": "Fehlgeschlagen",+ "outcome_blocked": "Gesperrt",+ "load_error": "Die Aktionen konnten nicht geladen werden.",+ "save_error": "Die Änderung konnte nicht gespeichert werden."+ },"appshots": {"title": "Appshots","subtitle": "Zeig {name} das Fenster, in dem du gerade arbeitest.",diff --git a/jarvis/ui/web/frontend/src/i18n/locales/en.json b/jarvis/ui/web/frontend/src/i18n/locales/en.jsonindex e988af59f7..06af3bba94 100644--- a/jarvis/ui/web/frontend/src/i18n/locales/en.json+++ b/jarvis/ui/web/frontend/src/i18n/locales/en.json@@ -162,6 +162,7 @@"agent_instructions": "{name}.md","wallpaper": "Wallpaper","appshots": "Appshots",+ "jarvis_actions": "Jarvis actions","marketplace": "Marketplace","agentic_ide": "Agentic IDE","agentic_ide_beta": "Beta",@@ -5960,6 +5961,30 @@}}},+ "jarvis_actions": {+ "title": "Jarvis actions",+ "subtitle": "Everything Jarvis can do in this app. Choose per action whether it runs freely, asks you first, or never runs.",+ "search_placeholder": "Search actions",+ "area_all": "All areas",+ "changed_only": "Only changed",+ "mode_default": "Default",+ "mode_allow": "Allowed",+ "mode_ask": "Ask",+ "mode_block": "Blocked",+ "tier_safe": "Default: runs freely (reads only)",+ "tier_monitor": "Default: runs freely",+ "tier_ask": "Default: asks first",+ "count": "{shown} of {total} actions",+ "show_more": "Show more",+ "dangerous": "Changes or deletes something",+ "history_title": "Recent actions",+ "history_empty": "Jarvis has not run any app action yet.",+ "outcome_ran": "Ran",+ "outcome_failed": "Failed",+ "outcome_blocked": "Blocked",+ "load_error": "Could not load the actions.",+ "save_error": "Could not save the change."+ },"appshots": {"title": "Appshots","subtitle": "Show {name} the window you are working in.",diff --git a/jarvis/ui/web/frontend/src/i18n/locales/es.json b/jarvis/ui/web/frontend/src/i18n/locales/es.jsonindex 657947bcbb..f45e761582 100644--- a/jarvis/ui/web/frontend/src/i18n/locales/es.json+++ b/jarvis/ui/web/frontend/src/i18n/locales/es.json@@ -162,6 +162,7 @@"agent_instructions": "{name}.md","wallpaper": "Fondo de pantalla","appshots": "Appshots",+ "jarvis_actions": "Acciones de Jarvis","marketplace": "Marketplace","agentic_ide": "IDE agéntico","agentic_ide_beta": "Beta",@@ -5927,6 +5928,30 @@}}},+ "jarvis_actions": {+ "title": "Acciones de Jarvis",+ "subtitle": "Todo lo que Jarvis puede hacer en esta app. Elige por acción si se ejecuta libremente, pregunta antes o nunca se ejecuta.",+ "search_placeholder": "Buscar acciones",+ "area_all": "Todas las áreas",+ "changed_only": "Solo cambiadas",+ "mode_default": "Predeterminado",+ "mode_allow": "Permitida",+ "mode_ask": "Preguntar",+ "mode_block": "Bloqueada",+ "tier_safe": "Predeterminado: se ejecuta libremente (solo lectura)",+ "tier_monitor": "Predeterminado: se ejecuta libremente",+ "tier_ask": "Predeterminado: pregunta antes",+ "count": "{shown} de {total} acciones",+ "show_more": "Mostrar más",+ "dangerous": "Cambia o elimina algo",+ "history_title": "Acciones recientes",+ "history_empty": "Jarvis aún no ha ejecutado ninguna acción de la app.",+ "outcome_ran": "Ejecutada",+ "outcome_failed": "Falló",+ "outcome_blocked": "Bloqueada",+ "load_error": "No se pudieron cargar las acciones.",+ "save_error": "No se pudo guardar el cambio."+ },"appshots": {"title": "Appshots","subtitle": "Muestra a {name} la ventana en la que trabajas.",diff --git a/jarvis/ui/web/frontend/src/lib/appActionsApi.ts b/jarvis/ui/web/frontend/src/lib/appActionsApi.tsnew file mode 100644index 0000000000..32ad558a59--- /dev/null+++ b/jarvis/ui/web/frontend/src/lib/appActionsApi.ts@@ -0,0 +1,57 @@+/**+ * Typed client for Settings > Jarvis actions (jarvis/ui/web/app_actions_routes.py).+ * The shapes mirror the route's dicts; the backend stays the authority.+ */++export type ActionMode = "allow" | "ask" | "block";+export type ActionTier = "safe" | "monitor" | "ask" | "block";++export interface AppAction {+ id: string;+ method: string;+ path: string;+ area: string;+ title: string;+ description: string;+ dangerous: boolean;+ default_tier: ActionTier;+ mode: ActionMode | null;+ tier: ActionTier;+}++export interface AppActionCatalog {+ actions: AppAction[];+ areas: string[];+ count: number;+}++export interface AppActionHistoryRow {+ action: string;+ title: string;+ outcome: "ran" | "failed" | "blocked";+ detail: string;+ via: string;+ at: number;+}++async function json<T>(res: Response): Promise<T> {+ if (!res.ok) throw new Error(`HTTP ${res.status}`);+ return (await res.json()) as T;+}++export const appActionsApi = {+ list: async (): Promise<AppActionCatalog> => json(await fetch("/api/app-actions")),+ setMode: async (+ id: string,+ mode: ActionMode | null,+ ): Promise<{ id: string; mode: ActionMode | null; tier: ActionTier }> =>+ json(+ await fetch(`/api/app-actions/${encodeURIComponent(id)}/mode`, {+ method: "PUT",+ headers: { "Content-Type": "application/json" },+ body: JSON.stringify({ mode }),+ }),+ ),+ history: async (limit = 50): Promise<{ history: AppActionHistoryRow[] }> =>+ json(await fetch(`/api/app-actions/history?limit=${limit}`)),+};diff --git a/jarvis/ui/web/frontend/src/store/events.ts b/jarvis/ui/web/frontend/src/store/events.tsindex 811a0dabce..3de5f78cd4 100644--- a/jarvis/ui/web/frontend/src/store/events.ts+++ b/jarvis/ui/web/frontend/src/store/events.ts@@ -88,6 +88,9 @@ export type SectionId =// Appshots: the shortcut, destination, sound and flash for showing the// assistant the front window. A Settings-hub page.| "appshots"+ // Jarvis actions: every app action Jarvis can run and the person's+ // allow / ask / block choice for each. A Settings-hub page.+ | "jarvis-actions"| "dictionary"| "dictation"// The three tabs added by the merged voice section. "dictation" (default@@ -143,6 +146,7 @@ export const SECTION_IDS = ["agent-instructions","wallpaper","appshots",+ "jarvis-actions","dictionary","dictation",// `satisfies` only catches array entries that are missing from the union,@@ -234,6 +238,7 @@ export const SECTION_LABELS: Record<SectionId, string> = {"agent-instructions": "Agent Instructions",wallpaper: "Wallpaper",appshots: "Appshots",+ "jarvis-actions": "Jarvis actions",dictionary: "Dictionary",dictation: "Dictation",// Plain English, deliberately NOT the "{name} Voice" brand: these labels arediff --git a/jarvis/ui/web/frontend/src/views/JarvisActionsView.tsx b/jarvis/ui/web/frontend/src/views/JarvisActionsView.tsxnew file mode 100644index 0000000000..d3d3f5baa6--- /dev/null+++ b/jarvis/ui/web/frontend/src/views/JarvisActionsView.tsx@@ -0,0 +1,265 @@+import { useMemo, useState } from "react";+import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query";+import { ShieldCheck } from "lucide-react";++import { PageHeader } from "@/components/layout/PageHeader";+import { Button } from "@/components/ui/button";+import { Input } from "@/components/ui/input";+import { BrandedSelect, type BrandedSelectOption } from "@/components/ui/select";+import { Switch } from "@/components/ui/switch";+import { useT } from "@/i18n";+import {+ appActionsApi,+ type ActionMode,+ type AppAction,+ type AppActionCatalog,+} from "@/lib/appActionsApi";+import { cn } from "@/lib/utils";++/**+ * Settings > Jarvis actions. Every action of the app Jarvis can run (its+ * find-app-action / run-app-action tools and the curated voice commands), and+ * the person's choice per action: Default, Allowed, Ask, Blocked. The backend+ * applies the choice as the call's risk tier, so Blocked is enforced there,+ * not here.+ */++const KEYS = {+ catalog: ["app-actions", "catalog"] as const,+ history: ["app-actions", "history"] as const,+};+const PAGE = 120;+const ALL = "__all__";++type Choice = "default" | ActionMode;+const CHOICES: readonly { value: Choice; labelKey: string }[] = [+ { value: "default", labelKey: "jarvis_actions.mode_default" },+ { value: "allow", labelKey: "jarvis_actions.mode_allow" },+ { value: "ask", labelKey: "jarvis_actions.mode_ask" },+ { value: "block", labelKey: "jarvis_actions.mode_block" },+];++function ModeControl({+ action,+ onChange,+}: {+ action: AppAction;+ onChange: (mode: ActionMode | null) => void;+}) {+ const t = useT();+ const current: Choice = action.mode ?? "default";+ return (+ <div+ role="radiogroup"+ aria-label={action.title}+ className="inline-flex shrink-0 rounded-lg border border-border bg-background p-0.5"+ >+ {CHOICES.map(({ value, labelKey }) => {+ const active = current === value;+ return (+ <button+ key={value}+ type="button"+ role="radio"+ aria-checked={active}+ onClick={() => onChange(value === "default" ? null : value)}+ className={cn(+ "rounded-md px-2.5 py-1 text-xs font-medium transition-colors",+ active+ ? value === "block"+ ? "bg-destructive text-destructive-foreground"+ : "bg-primary text-primary-foreground"+ : "text-muted-foreground hover:bg-secondary hover:text-foreground",+ )}+ >+ {t(labelKey)}+ </button>+ );+ })}+ </div>+ );+}++function RecentActions() {+ const t = useT();+ const { data } = useQuery({+ queryKey: KEYS.history,+ queryFn: () => appActionsApi.history(30),+ });+ const rows = data?.history ?? [];+ return (+ <section className="rounded-xl border border-border bg-card p-5">+ <h3 className="font-medium text-foreground">{t("jarvis_actions.history_title")}</h3>+ {rows.length === 0 ? (+ <p className="mt-2 text-sm text-muted-foreground">{t("jarvis_actions.history_empty")}</p>+ ) : (+ <ul className="mt-3 divide-y divide-border">+ {rows.map((row) => (+ <li key={`${row.at}-${row.action}`} className="flex items-baseline gap-3 py-2 text-sm">+ <span+ className={cn(+ "w-24 shrink-0 text-xs font-medium",+ row.outcome === "ran" && "text-success",+ row.outcome === "failed" && "text-warning",+ row.outcome === "blocked" && "text-destructive",+ )}+ >+ {t(`jarvis_actions.outcome_${row.outcome}`)}+ </span>+ <span className="min-w-0 flex-1 truncate text-foreground" title={row.detail}>+ {row.title}+ </span>+ <span className="shrink-0 text-xs text-foreground-faint">+ {new Date(row.at * 1000).toLocaleString()}+ </span>+ </li>+ ))}+ </ul>+ )}+ </section>+ );+}++export function JarvisActionsView() {+ const t = useT();+ const queryClient = useQueryClient();+ const [query, setQuery] = useState("");+ const [area, setArea] = useState(ALL);+ const [changedOnly, setChangedOnly] = useState(false);+ const [limit, setLimit] = useState(PAGE);+ const catalog = useQuery({ queryKey: KEYS.catalog, queryFn: appActionsApi.list });++ const setMode = useMutation({+ mutationFn: ({ id, mode }: { id: string; mode: ActionMode | null }) =>+ appActionsApi.setMode(id, mode),+ onSuccess: (saved) => {+ queryClient.setQueryData<AppActionCatalog>(KEYS.catalog, (old) =>+ old+ ? {+ ...old,+ actions: old.actions.map((a) =>+ a.id === saved.id ? { ...a, mode: saved.mode, tier: saved.tier } : a,+ ),+ }+ : old,+ );+ },+ });++ const areaOptions = useMemo<BrandedSelectOption[]>(+ () => [+ { value: ALL, label: t("jarvis_actions.area_all") },+ ...(catalog.data?.areas ?? []).map((a) => ({ value: a, label: a })),+ ],+ [catalog.data?.areas, t],+ );++ const filtered = useMemo(() => {+ const words = query.toLowerCase().split(/\s+/).filter(Boolean);+ return (catalog.data?.actions ?? []).filter((a) => {+ if (area !== ALL && a.area !== area) return false;+ if (changedOnly && !a.mode) return false;+ const text = `${a.title} ${a.description} ${a.area} ${a.path}`.toLowerCase();+ return words.every((w) => text.includes(w));+ });+ }, [catalog.data?.actions, query, area, changedOnly]);++ const shown = filtered.slice(0, limit);+ const count = t("jarvis_actions.count")+ .replace("{shown}", String(shown.length))+ .replace("{total}", String(filtered.length));++ return (+ <div+ data-testid="jarvis-actions-view"+ className="flex h-full flex-col overflow-y-auto bg-background px-8 pb-10 scrollbar-jarvis"+ >+ <div className="w-full max-w-[1400px] space-y-5">+ <PageHeader+ icon={<ShieldCheck className="h-5 w-5" />}+ title={t("jarvis_actions.title")}+ description={t("jarvis_actions.subtitle")}+ />++ <RecentActions />++ <section className="rounded-xl border border-border bg-card p-5">+ <div className="flex flex-wrap items-center gap-3">+ <Input+ value={query}+ onChange={(e) => {+ setQuery(e.target.value);+ setLimit(PAGE);+ }}+ placeholder={t("jarvis_actions.search_placeholder")}+ aria-label={t("jarvis_actions.search_placeholder")}+ className="max-w-sm"+ />+ <BrandedSelect+ value={area}+ options={areaOptions}+ onValueChange={(value) => {+ setArea(value);+ setLimit(PAGE);+ }}+ ariaLabel={t("jarvis_actions.area_all")}+ className="w-56"+ />+ <label className="flex items-center gap-2 text-sm text-muted-foreground">+ <Switch+ checked={changedOnly}+ onCheckedChange={setChangedOnly}+ aria-label={t("jarvis_actions.changed_only")}+ />+ {t("jarvis_actions.changed_only")}+ </label>+ <span className="ml-auto text-xs text-foreground-faint">{count}</span>+ </div>++ {catalog.isError && (+ <p className="mt-4 text-sm text-destructive">{t("jarvis_actions.load_error")}</p>+ )}+ {setMode.isError && (+ <p className="mt-4 text-sm text-destructive">{t("jarvis_actions.save_error")}</p>+ )}++ <ul className="mt-4 divide-y divide-border">+ {shown.map((action) => (+ <li key={action.id} className="flex flex-wrap items-center gap-4 py-3">+ <div className="min-w-0 flex-1">+ <div className="flex flex-wrap items-baseline gap-2">+ <span className="font-medium text-foreground">{action.title}</span>+ <span className="text-xs text-foreground-faint">{action.area}</span>+ {action.dangerous && (+ <span className="text-xs text-warning">{t("jarvis_actions.dangerous")}</span>+ )}+ </div>+ {action.description && (+ <p className="mt-0.5 line-clamp-2 text-xs text-muted-foreground">+ {action.description}+ </p>+ )}+ <p className="mt-0.5 text-xs text-foreground-faint">+ {t(`jarvis_actions.tier_${action.default_tier}`)}+ </p>+ </div>+ <ModeControl+ action={action}+ onChange={(mode) => setMode.mutate({ id: action.id, mode })}+ />+ </li>+ ))}+ </ul>++ {filtered.length > shown.length && (+ <div className="mt-4 flex justify-center">+ <Button variant="outline" size="sm" onClick={() => setLimit((n) => n + PAGE)}>+ {t("jarvis_actions.show_more")}+ </Button>+ </div>+ )}+ </section>+ </div>+ </div>+ );+}diff --git a/jarvis/ui/web/frontend/src/views/SettingsHubView.tsx b/jarvis/ui/web/frontend/src/views/SettingsHubView.tsxindex 6c20bfda71..84ca739131 100644--- a/jarvis/ui/web/frontend/src/views/SettingsHubView.tsx+++ b/jarvis/ui/web/frontend/src/views/SettingsHubView.tsx@@ -79,6 +79,9 @@ const ComputersTab = lazy(() =>const WallpaperTab = lazy(() =>import("@/views/WallpaperView").then((m) => ({ default: m.WallpaperView })),);+const JarvisActionsTab = lazy(() =>+ import("@/views/JarvisActionsView").then((m) => ({ default: m.JarvisActionsView })),+);const AppshotsTab = lazy(() =>import("@/views/AppshotsView").then((m) => ({ default: m.AppshotsView })),);@@ -102,6 +105,7 @@ type HubNavId =| "apikeys"| "local-models"| "computers"+ | "jarvis-actions"| "wallpaper"| "costs"| "feedback";@@ -113,7 +117,7 @@ const HUB_NAV_GROUPS: readonly { labelKey: string; ids: readonly HubNavId[] }[]},{labelKey: "settings_hub.group_system",- ids: ["computers", "apikeys", "local-models", "wallpaper"],+ ids: ["computers", "apikeys", "local-models", "jarvis-actions", "wallpaper"],},{labelKey: "settings_hub.group_activity",@@ -133,6 +137,7 @@ const TAB_CONTENT: Record<HubNavId | "telephony-setup", LazyExoticComponent<Compcomputers: ComputersTab,wallpaper: WallpaperTab,appshots: AppshotsTab,+ "jarvis-actions": JarvisActionsTab,costs: CostsTab,feedback: FeedbackTab,};@@ -165,6 +170,8 @@ function resolveHubTab(active: string): { content: HubNavId | "telephony-setup";return { content: "wallpaper", highlight: "wallpaper" };case "appshots":return { content: "appshots", highlight: "appshots" };+ case "jarvis-actions":+ return { content: "jarvis-actions", highlight: "jarvis-actions" };case "costs":return { content: "costs", highlight: "costs" };case "feedback":diff --git a/jarvis/ui/web/frontend/src/views/settings/settingsSearch.ts b/jarvis/ui/web/frontend/src/views/settings/settingsSearch.tsindex 8de537f254..9b9ab983f1 100644--- a/jarvis/ui/web/frontend/src/views/settings/settingsSearch.ts+++ b/jarvis/ui/web/frontend/src/views/settings/settingsSearch.ts@@ -32,6 +32,7 @@ const SEARCH_PAGES = [{ id: "apikeys", keys: ["apikeys_view", "apikeys_voice", "apikeys_model", "apikeys_cu_model"] },{ id: "wallpaper", keys: ["home.background_label", "home.background_hint"] },{ id: "appshots", keys: ["appshots"] },+ { id: "jarvis-actions", keys: ["jarvis_actions"] },{ id: "costs", keys: ["costs_view"] },{ id: "feedback", keys: ["feedback"] },] as const;diff --git a/jarvis/ui/web/server.py b/jarvis/ui/web/server.pyindex b0ecc5f44a..ad1bb4f3f7 100644--- a/jarvis/ui/web/server.py+++ b/jarvis/ui/web/server.py@@ -391,6 +391,7 @@ class WebServer:from .provider_routes import router as provider_routerfrom .review_routes import router as review_routerfrom .routine_hooks_routes import router as routine_hooks_router+ from .app_actions_routes import router as app_actions_routerfrom .appshot_routes import router as appshot_routerfrom .screen_context_routes import router as screen_context_routerfrom .self_mod_routes import router as self_mod_router@@ -568,6 +569,7 @@ class WebServer:app.include_router(screen_context_router)# Appshots: the front window as conversation context, on a shortcut,# a button or a spoken request. Captures through Screen Context.+ app.include_router(app_actions_router)app.include_router(appshot_router)# The mission deck's pictures: the last Screen-Context capture (one# frame, in memory, TTL) and Computer-Use frames by content hash.diff --git a/pyproject.toml b/pyproject.tomlindex 6207099ef6..c94490cc88 100644--- a/pyproject.toml+++ b/pyproject.toml@@ -751,6 +751,10 @@ create-artifact = "jarvis.plugins.tool.create_artifact:CreateArtifactTool"# constrained + schema-validated; dangerous commands confirm (risk "ask").# Never a spawn (AP-5/AP-14). See ADR-0011 amendment "app-command tool".app-command = "jarvis.plugins.tool.app_command:AppCommandTool"+# Every app action (2026-09-29): search + run any REST operation of the app+# under the person's per-action policy. See ADR-0011 amendment "Every app action".+find-app-action = "jarvis.plugins.tool.app_action:FindAppActionTool"+run-app-action = "jarvis.plugins.tool.app_action:RunAppActionTool"# Phase A1 — Awareness layer L1 (synchronous state read for the router).awareness-snapshot = "jarvis.plugins.tool.awareness_snapshot:AwarenessSnapshotTool"# Phase A3 — Awareness-Layer L3 (BM25 search across recent episodes).diff --git a/tests/conftest.py b/tests/conftest.pyindex 03197623b3..3bcf5331c4 100644--- a/tests/conftest.py+++ b/tests/conftest.py@@ -200,6 +200,21 @@ def _report_readback_canned_only():report_readback.set_composer(None)[email protected](autouse=True)+def _app_action_state_in_tmp(tmp_path_factory, monkeypatch): # noqa: ANN001+ """Every registry-command or app-action call records its outcome for the+ Jarvis-actions page; keep that, and the per-action policy, off the+ developer's real ``data/state``."""+ from jarvis.app_actions import history, policy++ root = tmp_path_factory.mktemp("app-actions")+ monkeypatch.setattr(policy, "policy_path", lambda: root / "policy.json")+ monkeypatch.setattr(history, "history_path", lambda: root / "history.json")+ history.reset_for_tests()+ yield+ history.reset_for_tests()++@pytest.fixture(autouse=True)def _reset_bus():"""Reset the global default bus before and after each test."""diff --git a/tests/unit/app_actions/__init__.py b/tests/unit/app_actions/__init__.pynew file mode 100644index 0000000000..e69de29bb2diff --git a/tests/unit/app_actions/test_app_actions.py b/tests/unit/app_actions/test_app_actions.pynew file mode 100644index 0000000000..5eaad91131--- /dev/null+++ b/tests/unit/app_actions/test_app_actions.py@@ -0,0 +1,148 @@+"""Every app action for Jarvis, under the person's per-action policy."""++from __future__ import annotations++from typing import Any++import httpx+import pytest+from fastapi import FastAPI++from jarvis.app_actions import catalog as catalog_mod+from jarvis.app_actions import history+from jarvis.app_actions.catalog import build_catalog, default_tier+from jarvis.app_actions.policy import effective_tier, load_policy, set_mode+from jarvis.plugins.tool.app_action import FindAppActionTool, RunAppActionTool+from jarvis.ui.web.app_actions_routes import router as app_actions_router+++def _app() -> FastAPI:+ app = FastAPI()+ app.include_router(app_actions_router)+ seen: dict[str, Any] = {}++ @app.post("/api/workspace/panes/{pane_id}/rename", tags=["agentic-ide"])+ async def rename_pane(pane_id: str, body: dict[str, Any]) -> dict[str, Any]:+ """Give a terminal pane a new title."""+ seen["rename"] = (pane_id, body)+ return {"ok": True, "title": body.get("title")}++ @app.get("/api/skills", tags=["skills"])+ async def list_skills(limit: int = 10) -> dict[str, Any]:+ """List installed skills."""+ return {"skills": [], "limit": limit}++ @app.delete("/api/skills/{name}", tags=["skills"])+ async def delete_skill(name: str) -> dict[str, Any]:+ """Delete one skill."""+ return {"deleted": name}++ @app.post("/api/secrets/{key}", tags=["settings"])+ async def store_secret(key: str) -> dict[str, Any]:+ return {"ok": True}++ app.state.seen = seen+ return app+++class _Runtime:+ def __init__(self, app: FastAPI) -> None:+ self._app = app++ def resolve_transport(self) -> httpx.ASGITransport:+ return httpx.ASGITransport(app=self._app)++ def control_key(self) -> None:+ return None+++def app(monkeypatch: pytest.MonkeyPatch) -> FastAPI:+ application = _app()+ monkeypatch.setattr(catalog_mod, "_cache", {})+ monkeypatch.setattr("jarvis.core.runtime_refs.get_web_app", lambda: application, raising=False)+ return application+++def _id(app: FastAPI, path: str, method: str) -> str:+ for entry in build_catalog(app.openapi()).values():+ if entry.path == path and entry.method == method:+ return entry.id+ raise AssertionError(f"{method} {path} not in catalog")+++def test_catalog_offers_actions_but_never_secrets_or_its_own_policy(app: FastAPI) -> None:+ catalog = build_catalog(app.openapi())+ paths = {e.path for e in catalog.values()}+ assert "/api/workspace/panes/{pane_id}/rename" in paths+ assert "/api/secrets/{key}" not in paths+ assert not any(p.startswith("/api/app-actions") for p in paths)+++def test_default_tiers_read_safe_change_monitor_delete_ask(app: FastAPI) -> None:+ catalog = build_catalog(app.openapi())+ tiers = {(e.method, e.path): default_tier(e) for e in catalog.values()}+ assert tiers[("GET", "/api/skills")] == "safe"+ assert tiers[("POST", "/api/workspace/panes/{pane_id}/rename")] == "monitor"+ assert tiers[("DELETE", "/api/skills/{name}")] == "ask"+++def test_the_persons_mode_wins_and_can_be_cleared(app: FastAPI) -> None:+ entry = build_catalog(app.openapi())[_id(app, "/api/skills/{name}", "DELETE")]+ set_mode(entry.id, "allow")+ assert effective_tier(entry) == "monitor"+ set_mode(entry.id, "block")+ assert effective_tier(entry) == "block"+ set_mode(entry.id, None)+ assert entry.id not in load_policy() and effective_tier(entry) == "ask"+++async def test_find_then_run_an_action_in_process(app: FastAPI) -> None:+ found = await FindAppActionTool().execute({"query": "rename pane"}, None)+ assert found.success+ first = found.output["actions"][0]+ assert first["title"] == "Rename Pane" and first["runs"] == "freely"++ tool = RunAppActionTool(runtime=_Runtime(app))+ result = await tool.execute(+ {"action_id": first["action_id"], "params": {"pane_id": "p1", "body": {"title": "API"}}},+ None,+ )+ assert result.success, result.error+ assert app.state.seen["rename"] == ("p1", {"title": "API"})+ assert history.recent(1)[0]["outcome"] == "ran"+++async def test_a_blocked_action_never_runs(app: FastAPI) -> None:+ action_id = _id(app, "/api/workspace/panes/{pane_id}/rename", "POST")+ set_mode(action_id, "block")+ tool = RunAppActionTool(runtime=_Runtime(app))+ assert tool.risk_tier_for_args({"action_id": action_id}) == "block"+ result = await tool.execute({"action_id": action_id, "params": {"pane_id": "p1"}}, None)+ assert not result.success and "blocked" in (result.error or "")+ assert "rename" not in app.state.seen+ assert history.recent(1)[0]["outcome"] == "blocked"+++async def test_query_parameters_and_unknown_ids(app: FastAPI) -> None:+ tool = RunAppActionTool(runtime=_Runtime(app))+ listed = await tool.execute(+ {"action_id": _id(app, "/api/skills", "GET"), "params": {"limit": 3}}, None+ )+ assert listed.output["response"]["limit"] == 3+ unknown = await tool.execute({"action_id": "nope"}, None)+ assert not unknown.success and "find-app-action" in (unknown.error or "")+++async def test_settings_routes_list_set_and_show_history(app: FastAPI) -> None:+ transport = httpx.ASGITransport(app=app)+ async with httpx.AsyncClient(transport=transport, base_url="http://t") as client:+ listed = (await client.get("/api/app-actions")).json()+ assert listed["count"] == len(build_catalog(app.openapi()))+ action_id = listed["actions"][0]["id"]+ changed = await client.put(f"/api/app-actions/{action_id}/mode", json={"mode": "ask"})+ assert changed.json()["tier"] == "ask"+ assert (await client.put("/api/app-actions/nope/mode", json={})).status_code == 404+ history.record(action_id, "ran", "x")+ rows = (await client.get("/api/app-actions/history")).json()["history"]+ assert rows[0]["action"] == action_iddiff --git a/tests/unit/brain/test_routing.py b/tests/unit/brain/test_routing.pyindex 4eb787d63f..656e04e9e1 100644--- a/tests/unit/brain/test_routing.py+++ b/tests/unit/brain/test_routing.py@@ -2002,6 +2002,11 @@ def test_router_tools_is_pure_dispatcher_set() -> None:"delegate-to-agent","society-status","message-agent",+ # Every app action (2026-09-29): catalog search + one gated REST+ # operation under the person's policy - never a spawn, never in a+ # worker set. See ADR-0011 amendment "Every app action".+ "find-app-action",+ "run-app-action",})assert ROUTER_TOOLS == expected, (