Skip to content

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.

refactor(settings): retire the Jarvis actions page

rubenluetke10-beep017ea1269167
diff --git a/docs/adr/0011-router-pure-dispatcher.md b/docs/adr/0011-router-pure-dispatcher.md
index 960b600610..ea84d08f45 100644
--- a/docs/adr/0011-router-pure-dispatcher.md
+++ b/docs/adr/0011-router-pure-dispatcher.md
@@ -1392,7 +1392,8 @@ 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`),
+ mode from the stored action policy (`allow` → monitor, `ask`, `block`;
+ set through `/api/app-actions` since the settings page was retired),
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
diff --git a/jarvis/plugins/tool/app_action.py b/jarvis/plugins/tool/app_action.py
index bea49ab5c2..795c6c0cb5 100644
--- a/jarvis/plugins/tool/app_action.py
+++ b/jarvis/plugins/tool/app_action.py
@@ -129,7 +129,7 @@ class RunAppActionTool:
"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."
+ "stays blocked — tell the user it is switched off for Jarvis."
)
schema: dict[str, Any] = {
"type": "object",
@@ -156,7 +156,7 @@ class RunAppActionTool:
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)
+ history.record(entry.id, "blocked", "Blocked by the action policy", via=self.name)
return tier
async def execute(self, args: dict[str, Any], ctx: Any) -> ToolResult:
@@ -174,7 +174,7 @@ class RunAppActionTool:
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)
+ history.record(entry.id, "blocked", "Blocked by the action policy", via=self.name)
return ToolResult(
success=False, output=None, error="The user blocked this action for Jarvis."
)
diff --git a/jarvis/plugins/tool/app_command.py b/jarvis/plugins/tool/app_command.py
index fa1f18a153..97b7ae33a0 100644
--- a/jarvis/plugins/tool/app_command.py
+++ b/jarvis/plugins/tool/app_command.py
@@ -325,7 +325,7 @@ class RegistryCommandTool:
if tier == "block":
from jarvis.app_actions import history
- history.record(entry.id, "blocked", "Blocked in Jarvis actions", via=self.name)
+ history.record(entry.id, "blocked", "Blocked by the action policy", via=self.name)
return tier
return base
diff --git a/jarvis/plugins/tool/navigate.py b/jarvis/plugins/tool/navigate.py
index 0b43db5f1e..a5d0df3400 100644
--- a/jarvis/plugins/tool/navigate.py
+++ b/jarvis/plugins/tool/navigate.py
@@ -50,8 +50,6 @@ KNOWN: frozenset[str] = frozenset(
"agent-instructions",
# 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",
@@ -198,8 +196,6 @@ _ALIASES: dict[str, str] = {
"ergebnisse": "visualization", # i18n-allow: input vocab
"resultados": "visualization", # 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/ui/web/app_actions_routes.py b/jarvis/ui/web/app_actions_routes.py
index f18fb3c5fd..0d5675696b 100644
--- a/jarvis/ui/web/app_actions_routes.py
+++ b/jarvis/ui/web/app_actions_routes.py
@@ -1,6 +1,8 @@
-"""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."""
+"""Every app action, the person's mode for each, and what Jarvis recently ran.
+
+The settings page that showed these was retired; the routes stay for the CLI.
+The brain never reaches them — they are excluded from its action catalog, so
+Jarvis cannot change its own permissions."""
from __future__ import annotations
diff --git a/jarvis/ui/web/frontend/src/components/layout/navGroups.ts b/jarvis/ui/web/frontend/src/components/layout/navGroups.ts
index e972d330c5..b99f805be9 100644
--- a/jarvis/ui/web/frontend/src/components/layout/navGroups.ts
+++ b/jarvis/ui/web/frontend/src/components/layout/navGroups.ts
@@ -24,7 +24,6 @@ import {
AssistantIcon,
MarketplaceIcon,
MicrophoneIcon,
- PermissionsIcon,
PetsIcon,
ProfileIcon,
SettingsIcon,
@@ -257,12 +256,6 @@ export const SETTINGS_HUB_ONLY_ITEMS: NavItem[] = [
},
{ id: "appshots", labelKey: "nav.appshots", icon: CaptureIcon, fallbackLabel: "Appshots" },
{ id: "pets", labelKey: "nav.pets", icon: PetsIcon, fallbackLabel: "My Pets" },
- {
- id: "jarvis-actions",
- labelKey: "nav.jarvis_actions",
- icon: PermissionsIcon,
- fallbackLabel: "Jarvis actions",
- },
];
/**
@@ -289,7 +282,6 @@ export const SETTINGS_HUB_IDS: readonly SectionId[] = [
"appshots",
"shortcuts",
"pets",
- "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.json
index 5e3bb4c476..887d19edfc 100644
--- a/jarvis/ui/web/frontend/src/i18n/locales/de.json
+++ b/jarvis/ui/web/frontend/src/i18n/locales/de.json
@@ -215,7 +215,6 @@
"agent_instructions": "{name}",
"appshots": "Appshots",
"jarvisx": "Jarvis X",
- "jarvis_actions": "Jarvis-Aktionen",
"marketplace": "Marketplace",
"agentic_ide": "Agentic IDE",
"agentic_ide_beta": "Beta",
@@ -6785,59 +6784,6 @@
}
}
},
- "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": "Von dir geändert",
- "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.",
- "overview_headline": "{name} kann {count} Aktionen in dieser App nutzen",
- "overview_hint": "Die meisten schauen nur etwas nach. Alles, was etwas ändert oder löscht, folgt den Regeln, die du hier festlegst.",
- "group_safe": "Liest selbstständig",
- "group_safe_hint": "Schaut nach, ändert nichts",
- "group_monitor": "Handelt selbstständig",
- "group_monitor_hint": "Läuft sofort und erscheint im Verlauf",
- "group_ask": "Fragt dich vorher",
- "group_ask_hint": "Wartet auf dein Ja",
- "group_block": "Läuft nie",
- "group_block_hint": "Gesperrt, auch auf Nachfrage",
- "activity_days": "Letzte 14 Tage",
- "activity_day_tooltip": "{ran} ausgeführt, {failed} fehlgeschlagen, {blocked} gesperrt",
- "activity_unknown": "Ältere Einträge werden nicht aufbewahrt",
- "history_hint": "Was {name} in der App getan hat, neueste zuerst. Klicke einen Eintrag an, um seine Berechtigung zu ändern.",
- "did_read": "hat etwas nachgeschaut",
- "did_change": "hat etwas geändert",
- "did_delete": "hat etwas gelöscht",
- "open_permission": "Berechtigung dieser Aktion anzeigen",
- "show_older": "Ältere anzeigen",
- "mode_allow_hint": "Läuft, ohne dich zu fragen",
- "mode_ask_hint": "Fragt dich jedes Mal, bevor sie läuft",
- "mode_block_hint": "Läuft nie, auch wenn du darum bittest",
- "set_by_you": "Deine Wahl",
- "permissions_title": "Berechtigungen",
- "permissions_hint": "Jede Aktion, nach Bereich sortiert. Wähle, wie {name} sie nutzen darf.",
- "focus_label": "Angezeigt: {title}",
- "focus_clear": "Alle anzeigen",
- "no_results": "Keine Aktion passt zu diesen Filtern.",
- "area_other": "Sonstiges"
- },
"appshots": {
"recording_title": "Bildschirmaufnahme",
"recording_hint": "Wähle einen Bereich oder den gesamten Bildschirm. Das Video wird ohne Ton lokal gespeichert und nicht an den Assistenten gesendet. Dasselbe Tastenkürzel stoppt die Aufnahme.",
diff --git a/jarvis/ui/web/frontend/src/i18n/locales/en.json b/jarvis/ui/web/frontend/src/i18n/locales/en.json
index 9823eb7dc9..1186ec86c2 100644
--- a/jarvis/ui/web/frontend/src/i18n/locales/en.json
+++ b/jarvis/ui/web/frontend/src/i18n/locales/en.json
@@ -215,7 +215,6 @@
"agent_instructions": "{name}",
"appshots": "Appshots",
"jarvisx": "Jarvis X",
- "jarvis_actions": "Jarvis actions",
"marketplace": "Marketplace",
"agentic_ide": "Agentic IDE",
"agentic_ide_beta": "Beta",
@@ -6785,59 +6784,6 @@
}
}
},
- "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": "Changed by you",
- "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.",
- "overview_headline": "{name} can use {count} actions in this app",
- "overview_hint": "Most of them only look things up. Anything that changes or deletes something follows the rules you set here.",
- "group_safe": "Reads on its own",
- "group_safe_hint": "Looks things up, changes nothing",
- "group_monitor": "Acts on its own",
- "group_monitor_hint": "Runs right away and shows in the activity",
- "group_ask": "Asks you first",
- "group_ask_hint": "Waits for your yes",
- "group_block": "Never runs",
- "group_block_hint": "Blocked, even when asked",
- "activity_days": "Last 14 days",
- "activity_day_tooltip": "{ran} ran, {failed} failed, {blocked} blocked",
- "activity_unknown": "Older entries are not kept",
- "history_hint": "What {name} did in the app, newest first. Click an entry to change its permission.",
- "did_read": "looked something up",
- "did_change": "changed something",
- "did_delete": "deleted something",
- "open_permission": "Show this action's permission",
- "show_older": "Show older",
- "mode_allow_hint": "Runs without asking you",
- "mode_ask_hint": "Asks you every time before it runs",
- "mode_block_hint": "Never runs, even when you ask for it",
- "set_by_you": "Your choice",
- "permissions_title": "Permissions",
- "permissions_hint": "Every action, grouped by area. Pick how {name} may use each one.",
- "focus_label": "Showing: {title}",
- "focus_clear": "Show all",
- "no_results": "No action matches these filters.",
- "area_other": "Other"
- },
"appshots": {
"recording_title": "Screen recording",
"recording_hint": "Select an area or the entire screen. Records video without audio and saves it locally; nothing is sent to the assistant. Use the same shortcut to stop.",
diff --git a/jarvis/ui/web/frontend/src/i18n/locales/es.json b/jarvis/ui/web/frontend/src/i18n/locales/es.json
index d758e4653a..85fb7f2206 100644
--- a/jarvis/ui/web/frontend/src/i18n/locales/es.json
+++ b/jarvis/ui/web/frontend/src/i18n/locales/es.json
@@ -215,7 +215,6 @@
"agent_instructions": "{name}",
"appshots": "Appshots",
"jarvisx": "Jarvis X",
- "jarvis_actions": "Acciones de Jarvis",
"marketplace": "Marketplace",
"agentic_ide": "IDE agéntico",
"agentic_ide_beta": "Beta",
@@ -6785,59 +6784,6 @@
}
}
},
- "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": "Cambiadas por ti",
- "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.",
- "overview_headline": "{name} puede usar {count} acciones en esta app",
- "overview_hint": "La mayoría solo consultan algo. Todo lo que cambia o elimina algo sigue las reglas que fijes aquí.",
- "group_safe": "Lee por su cuenta",
- "group_safe_hint": "Consulta, no cambia nada",
- "group_monitor": "Actúa por su cuenta",
- "group_monitor_hint": "Se ejecuta enseguida y aparece en la actividad",
- "group_ask": "Te pregunta antes",
- "group_ask_hint": "Espera tu sí",
- "group_block": "Nunca se ejecuta",
- "group_block_hint": "Bloqueada, aunque se pida",
- "activity_days": "Últimos 14 días",
- "activity_day_tooltip": "{ran} ejecutadas, {failed} fallidas, {blocked} bloqueadas",
- "activity_unknown": "No se guardan entradas más antiguas",
- "history_hint": "Lo que {name} hizo en la app, lo más reciente primero. Haz clic en una entrada para cambiar su permiso.",
- "did_read": "consultó algo",
- "did_change": "cambió algo",
- "did_delete": "eliminó algo",
- "open_permission": "Mostrar el permiso de esta acción",
- "show_older": "Mostrar anteriores",
- "mode_allow_hint": "Se ejecuta sin preguntarte",
- "mode_ask_hint": "Te pregunta cada vez antes de ejecutarse",
- "mode_block_hint": "Nunca se ejecuta, aunque lo pidas",
- "set_by_you": "Tu elección",
- "permissions_title": "Permisos",
- "permissions_hint": "Cada acción, agrupada por área. Elige cómo puede usarla {name}.",
- "focus_label": "Mostrando: {title}",
- "focus_clear": "Mostrar todas",
- "no_results": "Ninguna acción coincide con estos filtros.",
- "area_other": "Otras"
- },
"appshots": {
"recording_title": "Grabación de pantalla",
"recording_hint": "Selecciona un área o la pantalla completa. El vídeo se guarda localmente sin audio y no se envía al asistente. El mismo atajo detiene la grabación.",
diff --git a/jarvis/ui/web/frontend/src/i18n/locales/zh.json b/jarvis/ui/web/frontend/src/i18n/locales/zh.json
index a69167ac81..1b267964df 100644
--- a/jarvis/ui/web/frontend/src/i18n/locales/zh.json
+++ b/jarvis/ui/web/frontend/src/i18n/locales/zh.json
@@ -215,7 +215,6 @@
"agent_instructions": "{name}",
"appshots": "截图",
"jarvisx": "Jarvis X",
- "jarvis_actions": "Jarvis 操作",
"marketplace": "市场",
"agentic_ide": "智能体 IDE",
"agentic_ide_beta": "Beta",
@@ -6770,59 +6769,6 @@
}
}
},
- "jarvis_actions": {
- "title": "Jarvis 操作",
- "subtitle": "Jarvis 在这个应用中能做的所有事。可为每个操作选择:直接运行、先询问你,或永不运行。",
- "search_placeholder": "搜索操作",
- "area_all": "所有区域",
- "changed_only": "你更改过的",
- "mode_default": "默认",
- "mode_allow": "允许",
- "mode_ask": "询问",
- "mode_block": "禁止",
- "tier_safe": "默认:直接运行(只读)",
- "tier_monitor": "默认:直接运行",
- "tier_ask": "默认:先询问",
- "count": "{total} 个操作中的 {shown} 个",
- "show_more": "显示更多",
- "dangerous": "会更改或删除内容",
- "history_title": "最近的操作",
- "history_empty": "Jarvis 还没有运行过任何应用操作。",
- "outcome_ran": "已运行",
- "outcome_failed": "失败",
- "outcome_blocked": "已拦截",
- "load_error": "无法加载操作。",
- "save_error": "无法保存更改。",
- "overview_headline": "{name} 可以在这个应用中使用 {count} 个操作",
- "overview_hint": "大多数操作只是查询信息。任何会更改或删除内容的操作,都遵循你在这里设定的规则。",
- "group_safe": "自行读取",
- "group_safe_hint": "只查询,不做更改",
- "group_monitor": "自行执行",
- "group_monitor_hint": "立即运行,并显示在活动中",
- "group_ask": "先询问你",
- "group_ask_hint": "等待你的同意",
- "group_block": "永不运行",
- "group_block_hint": "已禁止,即使被要求也不运行",
- "activity_days": "最近 14 天",
- "activity_day_tooltip": "已运行 {ran} 个,失败 {failed} 个,已拦截 {blocked} 个",
- "activity_unknown": "不保留更早的记录",
- "history_hint": "{name} 在应用中做过的事,最新的在前。点击一条记录可更改其权限。",
- "did_read": "查询了信息",
- "did_change": "做了更改",
- "did_delete": "删除了内容",
- "open_permission": "显示此操作的权限",
- "show_older": "显示更早的",
- "mode_allow_hint": "不询问你直接运行",
- "mode_ask_hint": "每次运行前都先询问你",
- "mode_block_hint": "永不运行,即使你要求",
- "set_by_you": "你的选择",
- "permissions_title": "权限",
- "permissions_hint": "所有操作按区域分组。为每个操作选择 {name} 的使用方式。",
- "focus_label": "当前显示:{title}",
- "focus_clear": "显示全部",
- "no_results": "没有符合这些筛选条件的操作。",
- "area_other": "其他"
- },
"appshots": {
"recording_title": "屏幕录制",
"recording_hint": "选择一个区域或整个屏幕。视频保存在本地,可选择包含系统音频。使用同一个快捷键停止。",
diff --git a/jarvis/ui/web/frontend/src/lib/appActionsApi.ts b/jarvis/ui/web/frontend/src/lib/appActionsApi.ts
deleted file mode 100644
index 843f002457..0000000000
--- a/jarvis/ui/web/frontend/src/lib/appActionsApi.ts
+++ /dev/null
@@ -1,66 +0,0 @@
-/**
- * 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 type ActionKind = "read" | "change" | "delete";
-
-export interface AppActionHistoryRow {
- action: string;
- /** A readable name: the catalog's or the voice command's title, else the raw id. */
- title: string;
- description: string;
- area: string;
- /** Empty when the action is no longer known to the app. */
- kind: ActionKind | "";
- /** The catalog entry whose permission governs this action, if any. */
- catalog_id: string | null;
- 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/lib/quickSwitch.ts b/jarvis/ui/web/frontend/src/lib/quickSwitch.ts
index e007971fde..ebec0cfe1e 100644
--- a/jarvis/ui/web/frontend/src/lib/quickSwitch.ts
+++ b/jarvis/ui/web/frontend/src/lib/quickSwitch.ts
@@ -86,7 +86,6 @@ const ALIASES: Partial<Record<string, readonly string[]>> = {
docs: ["documentation", "help", "manual"],
feedback: ["bug", "report", "issue"],
appshots: ["screenshot", "capture"],
- "jarvis-actions": ["permissions", "allow", "block", "actions"],
dictation: ["voice", "speech", "microphone", "mic", "whisper"],
shortcuts: ["hotkeys", "keybinds", "keyboard", "quick switcher"],
"voice-shortcuts": ["dictation hotkeys", "dictation keys"],
diff --git a/jarvis/ui/web/frontend/src/store/events.ts b/jarvis/ui/web/frontend/src/store/events.ts
index e87f8a4001..59d403c8aa 100644
--- a/jarvis/ui/web/frontend/src/store/events.ts
+++ b/jarvis/ui/web/frontend/src/store/events.ts
@@ -89,9 +89,6 @@ export type SectionId =
// My Pets: the desktop pet — which one, its size, its bubble, and custom
// pets from a sprite sheet (docs/pets.md). A Settings-hub page.
| "pets"
- // 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
@@ -144,7 +141,6 @@ export const SECTION_IDS = [
"appshots",
"shortcuts",
"pets",
- "jarvis-actions",
"dictionary",
"dictation",
// `satisfies` only catches array entries that are missing from the union,
@@ -241,7 +237,6 @@ export const SECTION_LABELS: Record<SectionId, string> = {
appshots: "Appshots",
shortcuts: "Keyboard shortcuts",
pets: "My Pets",
- "jarvis-actions": "Jarvis actions",
dictionary: "Dictionary",
dictation: "Dictation",
// Plain English, deliberately NOT the "{name} Voice" brand: these labels are
diff --git a/jarvis/ui/web/frontend/src/views/JarvisActionsView.test.tsx b/jarvis/ui/web/frontend/src/views/JarvisActionsView.test.tsx
deleted file mode 100644
index 3d50001eec..0000000000
--- a/jarvis/ui/web/frontend/src/views/JarvisActionsView.test.tsx
+++ /dev/null
@@ -1,91 +0,0 @@
-import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
-import { cleanup, fireEvent, render, screen, within } from "@testing-library/react";
-import { afterEach, beforeEach, expect, it, vi } from "vitest";
-
-import { JarvisActionsView } from "./JarvisActionsView";
-
-vi.mock("@/i18n", () => ({
- useT: () => (key: string) => key,
- useUiLanguage: () => "en",
- fill: (template: string, vars: Record<string, string | number>) =>
- template.replace(/\{(\w+)\}/g, (m, k: string) => (k in vars ? String(vars[k]) : m)),
-}));
-
-const now = Date.now() / 1000;
-const action = (id: string, area: string, title: string, method = "GET") => ({
- id,
- method,
- path: `/api/${id}`,
- area,
- title,
- description: "",
- dangerous: false,
- default_tier: method === "GET" ? "safe" : "monitor",
- mode: null,
- tier: method === "GET" ? "safe" : "monitor",
-});
-const catalog = {
- actions: [
- action("list_tasks", "tasks", "List tasks"),
- action("rename_pane", "agentic-ide", "Rename a pane", "POST"),
- ],
- areas: ["agentic-ide", "tasks"],
- count: 2,
-};
-const row = (at: number, outcome = "ran") => ({
- action: "tasks-list",
- title: "List tasks",
- description: "",
- area: "tasks",
- kind: "read",
- catalog_id: "list_tasks",
- outcome,
- detail: "",
- via: "app-command",
- at,
-});
-
-beforeEach(() => {
- vi.stubGlobal(
- "fetch",
- vi.fn(async (url: string) =>
- new Response(
- JSON.stringify(
- url.includes("/history")
- ? { history: [row(now), row(now - 5), row(now - 10, "failed")] }
- : catalog,
- ),
- ),
- ),
- );
- render(
- <QueryClientProvider client={new QueryClient()}>
- <JarvisActionsView />
- </QueryClientProvider>,
- );
-});
-afterEach(() => {
- cleanup();
- vi.unstubAllGlobals();
-});
-
-it("names history rows, folds repeats and opens the action's permission", async () => {
- const timeline = await screen.findByTestId("jarvis-actions-history");
- expect(await within(timeline).findByText("×2")).toBeTruthy();
- expect(within(timeline).getAllByText("List tasks")).toHaveLength(2);
- expect(within(timeline).queryByText("tasks-list")).toBeNull();
-
- fireEvent.click(within(timeline).getAllByTitle("jarvis_actions.open_permission")[0]);
- expect(screen.getAllByTestId("jarvis-action-row")).toHaveLength(1);
- fireEvent.click(screen.getByText("jarvis_actions.focus_clear"));
- expect(screen.getAllByTestId("jarvis-action-row")).toHaveLength(2);
-});
-
-it("groups permissions by a readable area and filters by tier", async () => {
- expect(await screen.findByText("Agentic IDE")).toBeTruthy();
- const overview = screen.getByTestId("jarvis-actions-overview");
- fireEvent.click(within(overview).getByText("jarvis_actions.group_monitor").closest("button")!);
- const rows = screen.getAllByTestId("jarvis-action-row");
- expect(rows).toHaveLength(1);
- expect(within(rows[0]).getByText("Rename a pane")).toBeTruthy();
-});
diff --git a/jarvis/ui/web/frontend/src/views/JarvisActionsView.tsx b/jarvis/ui/web/frontend/src/views/JarvisActionsView.tsx
deleted file mode 100644
index f7ed4440a5..0000000000
--- a/jarvis/ui/web/frontend/src/views/JarvisActionsView.tsx
+++ /dev/null
@@ -1,893 +0,0 @@
-import { useMemo, useState, type ReactNode } from "react";
-import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query";
-import {
- AlertTriangle,
- Ban,
- Check,
- Eye,
- PenLine,
- Search,
- ShieldCheck,
- Trash2,
- X,
- type LucideIcon,
-} 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 { fill, useT, useUiLanguage } from "@/i18n";
-import {
- appActionsApi,
- type ActionKind,
- type ActionMode,
- type ActionTier,
- type AppAction,
- type AppActionCatalog,
- type AppActionHistoryRow,
-} 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.
- *
- * The page reads top to bottom as three answers: how much Jarvis may do on
- * its own (the overview, whose groups double as filters), what it actually
- * did (the activity timeline), and where to change it (the permission list).
- */
-
-const KEYS = {
- catalog: ["app-actions", "catalog"] as const,
- history: ["app-actions", "history"] as const,
-};
-const PAGE = 120;
-const HISTORY_LIMIT = 200;
-const HISTORY_PAGE = 14;
-const STRIP_DAYS = 14;
-const ALL = "__all__";
-const DAY_MS = 86_400_000;
-
-type Choice = "default" | ActionMode;
-const CHOICES: readonly Choice[] = ["default", "allow", "ask", "block"];
-const TIERS: readonly ActionTier[] = ["safe", "monitor", "ask", "block"];
-
-/** One status hue per effective tier; reading is neutral, not a signal. */
-const TIER_DOT: Record<ActionTier, string> = {
- safe: "bg-foreground/35",
- monitor: "bg-accent",
- ask: "bg-warning",
- block: "bg-destructive",
-};
-const CHOICE_DOT: Record<Choice, string> = {
- default: "bg-foreground/35",
- allow: "bg-success",
- ask: "bg-warning",
- block: "bg-destructive",
-};
-
-const KIND_ICON: Record<ActionKind, LucideIcon> = { read: Eye, change: PenLine, delete: Trash2 };
-
-function kindOf(method: string): ActionKind {
- const m = method.toUpperCase();
- if (m === "GET") return "read";
- return m === "DELETE" ? "delete" : "change";
-}
-
-const ACRONYMS: Record<string, string> = {
- ide: "IDE",
- mcp: "MCP",
- mcps: "MCPs",
- cli: "CLI",
- clis: "CLIs",
- ws: "WS",
- pty: "PTY",
- api: "API",
- ui: "UI",
-};
-
-/** `agentic-ide-git` → "Agentic IDE git": OpenAPI tags, read as words. */
-function humanArea(area: string): string {
- const words = area
- .split(/[-_\s]+/)
- .filter(Boolean)
- .map((w) => ACRONYMS[w.toLowerCase()] ?? w.toLowerCase());
- const text = words.join(" ");
- return text.charAt(0).toUpperCase() + text.slice(1);
-}
-
-function startOfDay(ms: number): number {
- const d = new Date(ms);
- d.setHours(0, 0, 0, 0);
- return d.getTime();
-}
-
-function Skeleton({ className }: { className?: string }) {
- return <div aria-hidden className={cn("animate-pulse rounded-md bg-foreground/10", className)} />;
-}
-
-// ---------------------------------------------------------------- overview
-
-function Overview({
- catalog,
- history,
- tierFilter,
- onTierFilter,
-}: {
- catalog: AppActionCatalog | undefined;
- history: AppActionHistoryRow[] | undefined;
- tierFilter: ActionTier | null;
- onTierFilter: (tier: ActionTier | null) => void;
-}) {
- const t = useT();
- const counts = useMemo(() => {
- const out: Record<ActionTier, number> = { safe: 0, monitor: 0, ask: 0, block: 0 };
- for (const a of catalog?.actions ?? []) out[a.tier] += 1;
- return out;
- }, [catalog?.actions]);
- const total = catalog?.count ?? 0;
-
- return (
- <section
- data-testid="jarvis-actions-overview"
- className="grid gap-px overflow-hidden rounded-lg border border-border bg-border lg:grid-cols-[minmax(0,1fr)_340px]"
- >
- <div className="bg-card p-5">
- {catalog ? (
- <>
- <p className="font-display text-xl font-semibold text-foreground-strong">
- {fill(t("jarvis_actions.overview_headline"), { count: total.toLocaleString() })}
- </p>
- <p className="mt-1 text-sm text-muted-foreground">{t("jarvis_actions.overview_hint")}</p>
- <div className="mt-5 flex h-2 w-full gap-0.5 overflow-hidden rounded-full" aria-hidden>
- {TIERS.filter((tier) => counts[tier] > 0).map((tier) => (
- <span
- key={tier}
- className={cn(
- "h-full transition-opacity",
- TIER_DOT[tier],
- tierFilter && tierFilter !== tier && "opacity-25",
- )}
- style={{ width: `${(counts[tier] / Math.max(total, 1)) * 100}%`, minWidth: 6 }}
- />
- ))}
- </div>
- </>
- ) : (
- <>
- <Skeleton className="h-7 w-80 max-w-full" />
- <Skeleton className="mt-2 h-4 w-96 max-w-full" />
- <Skeleton className="mt-5 h-2 w-full rounded-full" />
- </>
- )}
- <div className="mt-4 grid grid-cols-2 gap-2 sm:grid-cols-4">
- {TIERS.map((tier) => {
- const active = tierFilter === tier;
- return (
- <button
- key={tier}
- type="button"
- aria-pressed={active}
- disabled={!catalog}
- onClick={() => onTierFilter(active ? null : tier)}
- className={cn(
- "rounded-md border px-3 py-2.5 text-left transition-colors",
- "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
- active
- ? "border-accent bg-accent-soft"
- : "border-border hover:border-border-strong hover:bg-secondary",
- )}
- >
- <span className="flex items-center gap-2 text-xs font-medium text-muted-foreground">
- <span className={cn("h-2 w-2 shrink-0 rounded-full", TIER_DOT[tier])} />
- <span className="truncate">{t(`jarvis_actions.group_${tier}`)}</span>
- </span>
- {catalog ? (
- <span className="mt-1 block text-xl font-semibold tabular-nums text-foreground-strong">
- {counts[tier].toLocaleString()}
- </span>
- ) : (
- <Skeleton className="mt-1.5 h-6 w-12" />
- )}
- <span className="mt-0.5 block text-xs text-foreground-faint">
- {t(`jarvis_actions.group_${tier}_hint`)}
- </span>
- </button>
- );
- })}
- </div>
- </div>
- <ActivityStrip history={history} />
- </section>
- );
-}
-
-/**
- * Fourteen day columns, each stacked ran / failed / blocked. The history keeps
- * a bounded number of entries, so days older than the oldest kept entry are
- * drawn as "unknown", never as an invented quiet day.
- */
-function ActivityStrip({ history }: { history: AppActionHistoryRow[] | undefined }) {
- const t = useT();
- const lang = useUiLanguage();
- const days = useMemo(() => {
- const today = startOfDay(Date.now());
- const rows = history ?? [];
- const capped = rows.length >= HISTORY_LIMIT;
- const knownFrom = capped ? startOfDay(rows[rows.length - 1].at * 1000) : -Infinity;
- return Array.from({ length: STRIP_DAYS }, (_, i) => {
- const start = today - (STRIP_DAYS - 1 - i) * DAY_MS;
- const tally = { ran: 0, failed: 0, blocked: 0 };
- for (const r of rows) {
- const at = r.at * 1000;
- if (at >= start && at < start + DAY_MS) tally[r.outcome] += 1;
- }
- return { start, known: start >= knownFrom, ...tally };
- });
- }, [history]);
- const totals = days.reduce(
- (acc, d) => ({ ran: acc.ran + d.ran, failed: acc.failed + d.failed, blocked: acc.blocked + d.blocked }),
- { ran: 0, failed: 0, blocked: 0 },
- );
- const peak = Math.max(1, ...days.map((d) => d.ran + d.failed + d.blocked));
- const dateLabel = (ms: number) =>
- new Date(ms).toLocaleDateString(lang, { day: "numeric", month: "short" });
-
- return (
- <div className="flex flex-col bg-card p-5">
- <div className="flex items-baseline justify-between gap-3">
- <span className="text-sm font-medium text-foreground">{t("jarvis_actions.activity_days")}</span>
- {history ? (
- <span className="text-xl font-semibold tabular-nums text-foreground-strong">
- {(totals.ran + totals.failed + totals.blocked).toLocaleString()}
- </span>
- ) : (
- <Skeleton className="h-6 w-10" />
- )}
- </div>
- <div className="mt-4 flex h-24 items-end gap-1" role="img" aria-label={t("jarvis_actions.activity_days")}>
- {days.map((d) => {
- const sum = d.ran + d.failed + d.blocked;
- const label = `${dateLabel(d.start)} · ${
- d.known
- ? fill(t("jarvis_actions.activity_day_tooltip"), {
- ran: d.ran,
- failed: d.failed,
- blocked: d.blocked,
- })
- : t("jarvis_actions.activity_unknown")
- }`;
- return (
- <div key={d.start} title={label} className="flex h-full flex-1 flex-col justify-end">
- {!history ? (
- <Skeleton className="h-1/3 w-full rounded-sm" />
- ) : !d.known ? (
- <div className="h-1 w-full rounded-full border border-dashed border-border-strong" />
- ) : sum === 0 ? (
- <div className="h-1 w-full rounded-full bg-foreground/10" />
- ) : (
- <div
- className="flex w-full flex-col-reverse overflow-hidden rounded-sm"
- style={{ height: `${Math.max(8, (sum / peak) * 100)}%` }}
- >
- <span className="bg-success/80" style={{ flexGrow: d.ran }} />
- <span className="bg-warning" style={{ flexGrow: d.failed }} />
- <span className="bg-destructive" style={{ flexGrow: d.blocked }} />
- </div>
- )}
- </div>
- );
- })}
- </div>
- <div className="mt-1.5 flex justify-between text-xs text-foreground-faint">
- <span>{dateLabel(days[0].start)}</span>
- <span>{dateLabel(days[days.length - 1].start)}</span>
- </div>
- <div className="mt-auto flex flex-wrap gap-x-4 gap-y-1 pt-4 text-xs text-muted-foreground">
- {(["ran", "failed", "blocked"] as const).map((o) => (
- <span key={o} className="inline-flex items-center gap-1.5">
- <span
- className={cn(
- "h-2 w-2 rounded-full",
- o === "ran" && "bg-success/80",
- o === "failed" && "bg-warning",
- o === "blocked" && "bg-destructive",
- )}
- />
- <span className="tabular-nums text-foreground">{totals[o]}</span>
- {t(`jarvis_actions.outcome_${o}`)}
- </span>
- ))}
- </div>
- </div>
- );
-}
-
-// ---------------------------------------------------------------- activity
-
-const OUTCOME_STYLE: Record<
- AppActionHistoryRow["outcome"],
- { icon: LucideIcon; badge: string; text: string }
-> = {
- ran: { icon: Check, badge: "bg-success/15 text-success", text: "text-success" },
- failed: { icon: AlertTriangle, badge: "bg-warning/15 text-warning", text: "text-warning" },
- blocked: { icon: Ban, badge: "bg-destructive/15 text-destructive", text: "text-destructive" },
-};
-
-interface ActivityItem extends AppActionHistoryRow {
- repeat: number;
-}
-
-/** Consecutive identical runs on one day read as one line with a count. */
-function collapse(rows: AppActionHistoryRow[]): ActivityItem[] {
- const out: ActivityItem[] = [];
- for (const row of rows) {
- const last = out[out.length - 1];
- if (
- last &&
- last.action === row.action &&
- last.outcome === row.outcome &&
- startOfDay(last.at * 1000) === startOfDay(row.at * 1000)
- ) {
- last.repeat += 1;
- continue;
- }
- out.push({ ...row, repeat: 1 });
- }
- return out;
-}
-
-function ActivityTimeline({
- history,
- isLoading,
- onOpen,
-}: {
- history: AppActionHistoryRow[] | undefined;
- isLoading: boolean;
- onOpen: (catalogId: string) => void;
-}) {
- const t = useT();
- const lang = useUiLanguage();
- const [limit, setLimit] = useState(HISTORY_PAGE);
- const items = useMemo(() => collapse(history ?? []), [history]);
- const shown = items.slice(0, limit);
-
- const days = useMemo(() => {
- const groups: { day: number; items: ActivityItem[] }[] = [];
- for (const item of shown) {
- const day = startOfDay(item.at * 1000);
- const group = groups[groups.length - 1];
- if (group && group.day === day) group.items.push(item);
- else groups.push({ day, items: [item] });
- }
- return groups;
- }, [shown]);
-
- const dayLabel = (day: number) => {
- const diff = Math.round((startOfDay(Date.now()) - day) / DAY_MS);
- if (diff <= 1) {
- const text = new Intl.RelativeTimeFormat(lang, { numeric: "auto" }).format(-diff, "day");
- return text.charAt(0).toUpperCase() + text.slice(1);
- }
- return new Date(day).toLocaleDateString(lang, { weekday: "long", day: "numeric", month: "long" });
- };
- const time = (at: number) =>
- new Date(at * 1000).toLocaleTimeString(lang, { hour: "2-digit", minute: "2-digit" });
-
- return (
- <section
- data-testid="jarvis-actions-history"
- className="flex min-h-0 flex-col rounded-lg border border-border bg-card"
- >
- <header className="border-b border-border px-5 py-4">
- <h2 className="text-base font-semibold text-foreground-strong">
- {t("jarvis_actions.history_title")}
- </h2>
- <p className="mt-0.5 text-sm text-muted-foreground">{t("jarvis_actions.history_hint")}</p>
- </header>
- <div className="min-h-0 flex-1 overflow-y-auto px-5 py-4 scrollbar-jarvis">
- {isLoading ? (
- <div className="space-y-4">
- {Array.from({ length: 6 }, (_, i) => (
- <div key={i} className="flex gap-3">
- <Skeleton className="h-7 w-7 rounded-full" />
- <div className="flex-1 space-y-1.5">
- <Skeleton className="h-4 w-2/3" />
- <Skeleton className="h-3 w-1/3" />
- </div>
- </div>
- ))}
- </div>
- ) : items.length === 0 ? (
- <div className="flex flex-col items-center py-10 text-center">
- <span className="flex h-10 w-10 items-center justify-center rounded-full bg-secondary text-muted-foreground">
- <ShieldCheck className="h-5 w-5" />
- </span>
- <p className="mt-3 max-w-xs text-sm text-muted-foreground">
- {t("jarvis_actions.history_empty")}
- </p>
- </div>
- ) : (
- <div className="space-y-5">
- {days.map((group) => (
- <div key={group.day}>
- <h3 className="mb-2 text-xs font-medium uppercase tracking-wide text-foreground-faint">
- {dayLabel(group.day)}
- </h3>
- <ol className="relative">
- {group.items.map((item, index) => {
- const style = OUTCOME_STYLE[item.outcome];
- const Icon = style.icon;
- const last = index === group.items.length - 1;
- const clickable = Boolean(item.catalog_id);
- const meta = [
- item.area ? humanArea(item.area) : null,
- item.kind ? t(`jarvis_actions.did_${item.kind}`) : null,
- ].filter(Boolean);
- const body = (
- <>
- <span className="relative flex w-7 shrink-0 justify-center">
- {!last && (
- <span
- aria-hidden
- className="absolute left-1/2 top-7 h-[calc(100%-4px)] w-px -translate-x-1/2 bg-border"
- />
- )}
- <span
- className={cn(
- "relative flex h-7 w-7 items-center justify-center rounded-full",
- style.badge,
- )}
- >
- <Icon className="h-3.5 w-3.5" strokeWidth={2.25} />
- </span>
- </span>
- <span className="min-w-0 flex-1 pb-4">
- <span className="flex items-baseline gap-2">
- <span className="min-w-0 flex-1 truncate text-sm font-medium text-foreground">
- {item.title}
- </span>
- {item.repeat > 1 && (
- <span className="shrink-0 rounded-sm bg-secondary px-1.5 text-xs tabular-nums text-muted-foreground">
- ×{item.repeat}
- </span>
- )}
- <span className="shrink-0 text-xs tabular-nums text-foreground-faint">
- {time(item.at)}
- </span>
- </span>
- <span className="mt-0.5 block truncate text-xs text-muted-foreground">
- <span className={style.text}>{t(`jarvis_actions.outcome_${item.outcome}`)}</span>
- {meta.map((m) => (
- <span key={m}> · {m}</span>
- ))}
- </span>
- {item.outcome !== "ran" && item.detail && (
- <span
- className="mt-1.5 block line-clamp-2 rounded-md bg-secondary px-2 py-1 text-xs text-foreground-secondary"
- title={item.detail}
- >
- {item.detail}
- </span>
- )}
- </span>
- </>
- );
- return (
- <li key={`${item.at}-${item.action}`}>
- {clickable ? (
- <button
- type="button"
- title={t("jarvis_actions.open_permission")}
- onClick={() => onOpen(item.catalog_id as string)}
- className="-mx-2 flex w-[calc(100%+1rem)] gap-3 rounded-md px-2 pt-1 text-left transition-colors hover:bg-secondary focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring"
- >
- {body}
- </button>
- ) : (
- <div className="flex gap-3 pt-1">{body}</div>
- )}
- </li>
- );
- })}
- </ol>
- </div>
- ))}
- {items.length > shown.length && (
- <Button
- variant="outline"
- size="sm"
- className="w-full"
- onClick={() => setLimit((n) => n + HISTORY_PAGE * 2)}
- >
- {t("jarvis_actions.show_older")}
- </Button>
- )}
- </div>
- )}
- </div>
- </section>
- );
-}
-
-// ---------------------------------------------------------------- permissions
-
-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-md bg-secondary p-0.5"
- >
- {CHOICES.map((value) => {
- const active = current === value;
- const hint =
- value === "default"
- ? t(`jarvis_actions.tier_${action.default_tier}`)
- : t(`jarvis_actions.mode_${value}_hint`);
- return (
- <button
- key={value}
- type="button"
- role="radio"
- aria-checked={active}
- title={hint}
- onClick={() => onChange(value === "default" ? null : value)}
- className={cn(
- "inline-flex items-center gap-1.5 rounded-sm px-2.5 py-1 text-xs font-medium transition-colors",
- "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
- active
- ? "bg-card text-foreground-strong ring-1 ring-border-strong"
- : "text-muted-foreground hover:text-foreground",
- )}
- >
- <span
- aria-hidden
- className={cn(
- "h-1.5 w-1.5 rounded-full transition-opacity",
- CHOICE_DOT[value],
- !active && "opacity-40",
- )}
- />
- {t(`jarvis_actions.mode_${value}`)}
- </button>
- );
- })}
- </div>
- );
-}
-
-function ActionRow({
- action,
- onChange,
-}: {
- action: AppAction;
- onChange: (mode: ActionMode | null) => void;
-}) {
- const t = useT();
- const kind = kindOf(action.method);
- const Icon = KIND_ICON[kind];
- return (
- <li
- data-testid="jarvis-action-row"
- className="relative flex flex-wrap items-center gap-x-4 gap-y-3 px-5 py-3.5"
- >
- {action.mode && (
- <span aria-hidden className="absolute inset-y-3 left-0 w-0.5 rounded-full bg-accent" />
- )}
- <span
- aria-hidden
- className={cn(
- "flex h-8 w-8 shrink-0 items-center justify-center rounded-md",
- action.dangerous ? "bg-warning/15 text-warning" : "bg-secondary text-muted-foreground",
- )}
- >
- <Icon className="h-4 w-4" />
- </span>
- <div className="min-w-0 flex-1 basis-64">
- <div className="text-sm font-medium text-foreground">{action.title}</div>
- {action.description && action.description !== action.title && (
- <p className="mt-0.5 line-clamp-2 text-xs text-muted-foreground">{action.description}</p>
- )}
- <div className="mt-1 flex flex-wrap items-center gap-x-3 gap-y-1 text-xs text-foreground-faint">
- <span className="inline-flex items-center gap-1.5">
- <span className={cn("h-1.5 w-1.5 rounded-full", TIER_DOT[action.default_tier])} />
- {t(`jarvis_actions.tier_${action.default_tier}`)}
- </span>
- {action.dangerous && (
- <span className="inline-flex items-center gap-1 text-warning">
- <AlertTriangle className="h-3 w-3" />
- {t("jarvis_actions.dangerous")}
- </span>
- )}
- {action.mode && (
- <span className="font-medium text-accent">{t("jarvis_actions.set_by_you")}</span>
- )}
- </div>
- </div>
- <ModeControl action={action} onChange={onChange} />
- </li>
- );
-}
-
-function FilterChip({
- active,
- onClick,
- children,
-}: {
- active: boolean;
- onClick: () => void;
- children: ReactNode;
-}) {
- return (
- <button
- type="button"
- aria-pressed={active}
- onClick={onClick}
- className={cn(
- "inline-flex h-9 items-center gap-2 rounded-md border px-3 text-sm transition-colors",
- "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
- active
- ? "border-accent bg-accent-soft text-foreground-strong"
- : "border-border text-muted-foreground hover:bg-secondary hover:text-foreground",
- )}
- >
- {children}
- </button>
- );
-}
-
-export function JarvisActionsView() {
- const t = useT();
- const queryClient = useQueryClient();
- const [query, setQuery] = useState("");
- const [area, setArea] = useState(ALL);
- const [changedOnly, setChangedOnly] = useState(false);
- const [tierFilter, setTierFilter] = useState<ActionTier | null>(null);
- const [focusId, setFocusId] = useState<string | null>(null);
- const [limit, setLimit] = useState(PAGE);
- const catalog = useQuery({ queryKey: KEYS.catalog, queryFn: appActionsApi.list });
- const history = useQuery({
- queryKey: KEYS.history,
- queryFn: () => appActionsApi.history(HISTORY_LIMIT),
- });
-
- 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: humanArea(a) })),
- ],
- [catalog.data?.areas, t],
- );
-
- const changedCount = useMemo(
- () => (catalog.data?.actions ?? []).filter((a) => a.mode).length,
- [catalog.data?.actions],
- );
-
- const filtered = useMemo(() => {
- const actions = catalog.data?.actions ?? [];
- if (focusId) return actions.filter((a) => a.id === focusId);
- const words = query.toLowerCase().split(/\s+/).filter(Boolean);
- return actions.filter((a) => {
- if (area !== ALL && a.area !== area) return false;
- if (changedOnly && !a.mode) return false;
- if (tierFilter && a.tier !== tierFilter) return false;
- const text =
- `${a.title} ${a.description} ${a.area} ${humanArea(a.area)} ${a.path}`.toLowerCase();
- return words.every((w) => text.includes(w));
- });
- }, [catalog.data?.actions, query, area, changedOnly, tierFilter, focusId]);
-
- const shown = filtered.slice(0, limit);
- const groups = useMemo(() => {
- const out: { area: string; actions: AppAction[] }[] = [];
- for (const action of shown) {
- const group = out[out.length - 1];
- if (group && group.area === action.area) group.actions.push(action);
- else out.push({ area: action.area, actions: [action] });
- }
- return out;
- }, [shown]);
- const focused = focusId ? catalog.data?.actions.find((a) => a.id === focusId) : undefined;
- const resetPaging = () => setLimit(PAGE);
-
- 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")}
- />
-
- <Overview
- catalog={catalog.data}
- history={history.data?.history}
- tierFilter={tierFilter}
- onTierFilter={(tier) => {
- setTierFilter(tier);
- setFocusId(null);
- resetPaging();
- }}
- />
-
- <div className="grid items-start gap-5 xl:grid-cols-[minmax(0,1fr)_400px]">
- <section className="min-w-0 rounded-lg border border-border bg-card">
- <header className="space-y-3 border-b border-border px-5 py-4">
- <div className="flex flex-wrap items-baseline justify-between gap-2">
- <div>
- <h2 className="text-base font-semibold text-foreground-strong">
- {t("jarvis_actions.permissions_title")}
- </h2>
- <p className="mt-0.5 text-sm text-muted-foreground">
- {t("jarvis_actions.permissions_hint")}
- </p>
- </div>
- {catalog.data && (
- <span className="text-xs tabular-nums text-foreground-faint">
- {fill(t("jarvis_actions.count"), {
- shown: shown.length,
- total: filtered.length,
- })}
- </span>
- )}
- </div>
- {focused ? (
- <div className="flex items-center gap-2 rounded-md bg-accent-soft px-3 py-2 text-sm text-foreground">
- <span className="min-w-0 flex-1 truncate">
- {fill(t("jarvis_actions.focus_label"), { title: focused.title })}
- </span>
- <Button variant="ghost" size="sm" onClick={() => setFocusId(null)}>
- <X className="h-3.5 w-3.5" />
- {t("jarvis_actions.focus_clear")}
- </Button>
- </div>
- ) : (
- <div className="flex flex-wrap items-center gap-2">
- <div className="relative min-w-[200px] flex-1 basis-64">
- <Search
- aria-hidden
- className="pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-foreground-faint"
- />
- <Input
- value={query}
- onChange={(e) => {
- setQuery(e.target.value);
- resetPaging();
- }}
- placeholder={t("jarvis_actions.search_placeholder")}
- aria-label={t("jarvis_actions.search_placeholder")}
- className="pl-9"
- />
- </div>
- <BrandedSelect
- value={area}
- options={areaOptions}
- onValueChange={(value) => {
- setArea(value);
- resetPaging();
- }}
- ariaLabel={t("jarvis_actions.area_all")}
- className="w-52"
- />
- <FilterChip
- active={changedOnly}
- onClick={() => {
- setChangedOnly((v) => !v);
- resetPaging();
- }}
- >
- {t("jarvis_actions.changed_only")}
- <span className="tabular-nums text-foreground-faint">{changedCount}</span>
- </FilterChip>
- {tierFilter && (
- <FilterChip active onClick={() => setTierFilter(null)}>
- <span className={cn("h-2 w-2 rounded-full", TIER_DOT[tierFilter])} />
- {t(`jarvis_actions.group_${tierFilter}`)}
- <X className="h-3.5 w-3.5" />
- </FilterChip>
- )}
- </div>
- )}
- {catalog.isError && (
- <p className="text-sm text-destructive">{t("jarvis_actions.load_error")}</p>
- )}
- {setMode.isError && (
- <p className="text-sm text-destructive">{t("jarvis_actions.save_error")}</p>
- )}
- </header>
-
- {catalog.isLoading ? (
- <div className="divide-y divide-border">
- {Array.from({ length: 6 }, (_, i) => (
- <div key={i} className="flex items-center gap-4 px-5 py-4">
- <Skeleton className="h-8 w-8" />
- <div className="flex-1 space-y-1.5">
- <Skeleton className="h-4 w-1/3" />
- <Skeleton className="h-3 w-2/3" />
- </div>
- <Skeleton className="h-7 w-64" />
- </div>
- ))}
- </div>
- ) : catalog.data && filtered.length === 0 ? (
- <p className="px-5 py-12 text-center text-sm text-muted-foreground">
- {t("jarvis_actions.no_results")}
- </p>
- ) : (
- groups.map((group) => (
- <div key={group.area}>
- <h3 className="sticky top-0 z-10 flex items-center justify-between border-b border-border bg-card/95 px-5 py-2 text-xs font-medium uppercase tracking-wide text-foreground-faint backdrop-blur">
- <span>{group.area ? humanArea(group.area) : t("jarvis_actions.area_other")}</span>
- <span className="tabular-nums">{group.actions.length}</span>
- </h3>
- <ul className="divide-y divide-border">
- {group.actions.map((action) => (
- <ActionRow
- key={action.id}
- action={action}
- onChange={(mode) => setMode.mutate({ id: action.id, mode })}
- />
- ))}
- </ul>
- </div>
- ))
- )}
-
- {filtered.length > shown.length && (
- <div className="flex justify-center border-t border-border p-4">
- <Button variant="outline" size="sm" onClick={() => setLimit((n) => n + PAGE)}>
- {t("jarvis_actions.show_more")}
- </Button>
- </div>
- )}
- </section>
-
- <div className="xl:sticky xl:top-6 xl:flex xl:max-h-[calc(100vh-3rem)] xl:flex-col">
- <ActivityTimeline
- history={history.data?.history}
- isLoading={history.isLoading}
- onOpen={(id) => {
- setFocusId(id);
- setTierFilter(null);
- }}
- />
- </div>
- </div>
- </div>
- </div>
- );
-}
diff --git a/jarvis/ui/web/frontend/src/views/SettingsHubView.tsx b/jarvis/ui/web/frontend/src/views/SettingsHubView.tsx
index b95937ab0a..22af4eec90 100644
--- a/jarvis/ui/web/frontend/src/views/SettingsHubView.tsx
+++ b/jarvis/ui/web/frontend/src/views/SettingsHubView.tsx
@@ -25,7 +25,7 @@ import { cn } from "@/lib/utils";
*
* General: General, Keyboard shortcuts, Appshots, My Pets, Profile,
* {name} (the assistant), Socials
- * System: Computers, API Keys, Jarvis actions
+ * System: Computers, API Keys
* Activity: Spend, Feedback
*
* Same merged-section pattern as VoiceHubView / ClisHubView: the active
@@ -69,9 +69,6 @@ const TelephonySetupTab = lazy(() =>
const ComputersTab = lazy(() =>
import("@/views/ComputersView").then((m) => ({ default: m.ComputersView })),
);
-const JarvisActionsTab = lazy(() =>
- import("@/views/JarvisActionsView").then((m) => ({ default: m.JarvisActionsView })),
-);
const AppshotsTab = lazy(() =>
import("@/views/AppshotsView").then((m) => ({ default: m.AppshotsView })),
);
@@ -101,7 +98,6 @@ type HubNavId =
| "socials"
| "apikeys"
| "computers"
- | "jarvis-actions"
| "costs"
| "feedback";
@@ -120,7 +116,7 @@ const HUB_NAV_GROUPS: readonly { labelKey: string; ids: readonly HubNavId[] }[]
},
{
labelKey: "settings_hub.group_system",
- ids: ["computers", "apikeys", "jarvis-actions"],
+ ids: ["computers", "apikeys"],
},
{
labelKey: "settings_hub.group_activity",
@@ -139,7 +135,6 @@ const TAB_CONTENT: Record<HubNavId | "telephony-setup", LazyExoticComponent<Comp
appshots: AppshotsTab,
shortcuts: ShortcutsTab,
pets: PetsTab,
- "jarvis-actions": JarvisActionsTab,
costs: CostsTab,
feedback: FeedbackTab,
};
@@ -170,8 +165,6 @@ function resolveHubTab(active: string): { content: HubNavId | "telephony-setup";
return { content: "shortcuts", highlight: "shortcuts" };
case "pets":
return { content: "pets", highlight: "pets" };
- 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.ts
index e91e6811f0..2d7b2c8dc2 100644
--- a/jarvis/ui/web/frontend/src/views/settings/settingsSearch.ts
+++ b/jarvis/ui/web/frontend/src/views/settings/settingsSearch.ts
@@ -32,7 +32,6 @@ const SEARCH_PAGES = [
{ id: "appshots", keys: ["appshots"] },
{ id: "shortcuts", keys: ["shortcuts_view", "settings_view.keybinds", "settings_view.quick_switch"] },
{ id: "pets", keys: ["pets"] },
- { id: "jarvis-actions", keys: ["jarvis_actions"] },
{ id: "costs", keys: ["costs_view"] },
{ id: "feedback", keys: ["feedback"] },
] as const;