Loading page...Загружаем страницу...正在加载页面...
AtlasRepo

How I built an app launcher for my desktop AI companion: an index, not a shell command

Описание и применение

Создан безопасный лаунчер приложений для настольного AI‑ассистента, использующий индекс приложений вместо shell‑команд, чтобы избежать блокировки голосового интерфейса и уязвимостей.

Задача

A shell command to launch apps can leave a child process that holds the voice queue open, causing the assistant to freeze, and can be unsafe if the model injects malicious code.

Результат

The launcher safely opens applications without freezing the assistant, using an index to prevent shell injection and detaching processes to avoid voice queue blockage.

Рабочий процесс

  • 1. Scan installed apps and cache results in apps-index.json (max 600 entries, 7‑day age).
  • 2. Build a strict matching ladder: exact name → unique prefix → substring → multi‑token matching.
  • 3. If multiple matches, return ambiguous with up to 5 candidates and ask user to choose.
  • 4. For Windows AppIDs, launch via cmd /c start after shape validation; for file paths, spawn directly with shell:false after absolute path and existence checks.
  • 5. Detach child process, ignore stdio, call unref() and do not register in job state.
  • 6. Log app name and source, not absolute path.
  • 7. Prompt user only for unknown apps not in index.

Доказательства

"Open Notepad" sounds like the simplest request a desktop companion can get. It nearly became the most dangerous one.

Источник

The obvious implementation is a shell command: take the app name, run it, done. But a shell command has a child process, and a child that outlives its turn can hold the voice queue open — the exact bug that used to freeze voice entirely.

Источник

So I built open_app around one decision: the model picks a name from an index, never a path.

Источник

Ankita scans the machine's installed apps and caches them in apps-index.json (mode 0o600, capped at 600 entries).

Источник

The launch itself is detached, with stdio ignored and unref() called — and deliberately not registered in the assistant's job state.

Источник

  • Дата записи: 2026-11-01T19:59:06.879Z