Skip to content

smart_intents

diapason.desktop.smart_intents

Diapason-style smart browser/app intents (pattern matching, FR + EN).

Ports the fast heuristics from jarvis-ai-assistant SmartBrowserService / AICommandParser.tryFastParse — no cloud AI required for obvious commands.

SmartIntent dataclass

Resolved open/search/play intent.

execute_smart_intent(intent, *, browser='')

Execute a SmartIntent via desktop helpers. Returns None if KIND_NONE.

parse_smart_intent(command)

Parse a spoken/typed command into a SmartIntent (best-effort).

resolve_youtube_watch_url(query, *, timeout=4.0, fetch=None, mix=False)

Top YouTube search hit as a watch URL, or "" when resolution fails.

No API key: one GET on the public results page. Failure is a normal state (offline, layout change, consent wall) — the caller falls back to opening the results page, which is what happened before this existed.

try_execute_smart_command(command, *, browser='')

Parse + execute in one shot. None if no rich intent matched.