AI Process Manager (AIPM)

v0.5.0
io.github.agorapassadoagora-debug/aipm Checked 3 days ago Published 4 months ago

Structured Windows state for AI agents: processes, windows, UI trees.

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

health_check

Ping the AI Process Manager backend. Returns version, API URL, and whether the local service is reachable. Call this first in a new session.

check_process

Check if a process is running on the user's Windows machine — no screenshot. Filter by executable name fragment (e.g. "python", "ffmpeg") and/or window title (e.g. "RENDER VIDEO 02"). Returns PID, CPU%, RAM, title, command line, start time. Command lines are truncated to 120 chars unless full_command_line=true. Results are capped at 10 matches, windowed processes first.

ParameterTypeDescription
full_command_linebooleantrue for full command line (default: truncated to 120 chars)
name_containsstringExecutable name fragment (case-insensitive)
title_containsstringWindow title fragment (case-insensitive)

list_processes

List running processes sorted by CPU. Use "top" to limit (default 25, max 200). Prefer check_process when searching for one process. Command lines truncated unless full_command_line=true.

ParameterTypeDescription
full_command_linebooleantrue for full command lines
topnumberHow many processes to return (default 25)

list_windows

List open desktop windows: title, process, minimized/maximized state, position, Z-order, and which has focus. Replaces screenshots for "what is open".

get_system_status

Machine snapshot: CPU%, RAM used/total, GPU name and usage, disk free space per drive, network, uptime, active displays.

get_taskbar

Human view of the taskbar: pinned apps and running apps grouped with window titles.

read_window

Read TEXT from inside a window via UI Automation — no screenshot. Works with consoles (cmd, PowerShell, Windows Terminal), editors, and most native apps. Typical use: read render progress from a console ("frame 4812/5000"). Identify the window by title_contains or hwnd from list_windows.

ParameterTypeDescription
hwndnumberExact window handle from list_windows
max_charsnumberMax characters (default 20000)
title_containsstringWindow title fragment (case-insensitive)

get_ui_tree

UI Automation tree of a window (roles, names, states) — the accessibility snapshot of a native Windows app. depth: default 4, max 30. max_nodes: default 200, max 1000 — max_nodes is the cost brake, NOT depth. Win32 apps expose content within 4-6 levels. Chromium/Electron apps (VS Code, Slack, Discord, Claude Desktop, Teams) bury real content under ~10 levels of Pane/Group wrappers: at low depth you get only empty Panes and conclude, wrongly, that the window is empty. Measured on Claude Desktop: depth=8 -> 15 useless nodes; depth=17 -> 115 nodes, 87 of them named (~8 KB) — the tree satura…

ParameterTypeDescription
depthnumberMax tree depth (default 4, max 30). 4-6 for native Win32; 15-20 for Chromium/Electron apps, whose content sits under ~10 wrapper levels.
hwndnumberExact window handle
max_nodesnumberMax nodes returned (default 200, max 1000). This is the token-cost brake — raise depth freely and cap cost here.
title_containsstringWindow title fragment

wait_for

Long-poll until a condition is met (or timeout). Replaces polling loops. Conditions: process_ended, process_started, file_stable (render/download done), file_exists, window_title_contains. Max 50s per call; if satisfied=false, call again to keep waiting.

ParameterTypeDescription
file_existsstringFile path that must appear
file_stablestringFile path that must stop growing
process_endedstringProcess name fragment that must exit
process_startedstringProcess name fragment that must start
stable_fornumberFor file_stable: seconds unchanged (default 10)
timeoutnumberMax wait seconds (default 50, max 50)
window_title_containsstringWindow title fragment that must appear

get_recent_events

Last 24h of PC events: process_started, process_ended (with duration), window_focused, file_changed. Useful for "what happened while I was away" (e.g. when did the render finish?).

ParameterTypeDescription
limitnumberMax events (default 50, max 1000)
typestringFilter by type (process_ended, file_changed, ...)

check_file

File or folder status: exists, size, last modified, locked?, locking process. Ideal for checking if a render/export finished without opening Explorer.

ParameterTypeDescription
path *stringAbsolute path, e.g. D:/videos/output.mp4

get_app_knowledge

Query what AIPM learned locally about an app: successful (role, name) -> action recipes, plus common_failures (targets that keep failing — do not retry them). Call BEFORE acting in an app. Even with known=false you may get ui_shape: the shape of the app's UI tree (counts, roles, depth) learned passively from earlier reads — useful cold-start map. Pass the process name as shown in task manager (e.g. "notepad.exe", "chrome.exe").

ParameterTypeDescription
name *stringApp/process name (e.g. notepad.exe)

get_economy_stats

Local economy metrics: tokens and time saved by structured state vs screenshots, queries served, task/action success rates, top apps, 24h/7d trends. Two independent views of savings — economy_measured_by_api (measured here) and economy_reported_by_agents (self-reported): never add them together. The store block states which local database the totals came from.

get_audit_log

Recent API audit log: which agents called which endpoints and when. Works even when the API is paused. For compliance and debugging agent behavior. Secrets and typed text (api_key=, value=) are masked before being recorded.

ParameterTypeDescription
limitnumberMax entries (default 50, max 1000)

ui_find

List interactive UI elements in a window (buttons, fields, menus first; grid cells last). Each item has a stable global element_index plus can_invoke/can_set_value flags. Paginated (total/offset/limit/has_more). Read-only — no action tier required. Pass element_index to ui_invoke/ui_set_value.

ParameterTypeDescription
hwndnumberExact window handle
limitnumberPage size (default 30, max 200)
name_containsstringFilter elements by name
offsetnumberPagination offset (default 0)
rolestringFilter by role (Button, Edit, MenuItem, ...)
title_containsstringWindow title fragment

ui_invoke

Semantically CLICK a UI element via UI Automation (button, menu item, checkbox). Target by name_contains or element_index from ui_find. REQUIRES user-enabled action tier + app allowlist; otherwise returns action_denied. Confirm with the user before acting.

ParameterTypeDescription
element_indexnumberStable index from ui_find
hwndnumberExact window handle
name_containsstringElement name to click (e.g. "Save")
title_containsstringWindow title fragment

ui_set_value

Set text in an editable field via UI Automation (no key simulation). REQUIRES action tier + allowlist. Check can_set_value in ui_find; modern apps (e.g. Win11 Notepad) may not expose fields. Confirm with the user first.

ParameterTypeDescription
value *stringText to set
element_indexnumberStable index from ui_find
hwndnumberExact window handle
name_containsstringField name
title_containsstringWindow title fragment

focus_window

Bring a window to the foreground. REQUIRES action tier + app allowlist.

ParameterTypeDescription
hwndnumberExact window handle
title_containsstringWindow title fragment

report_task_outcome

Report task outcome to local telemetry (metadata only — never screen content). Call at END of a computer-use task. Feeds get_app_knowledge and get_economy_stats.

ParameterTypeDescription
app *stringPrimary app (e.g. chrome.exe)
duration_snumberDuration in seconds
notesstringShort notes (metadata)
screenshots_avoidednumberScreenshots avoided via structured state
stepsnumberNumber of steps/actions
successbooleanTask succeeded?
taskstringShort task description (metadata)
tokens_estimatednumberEstimated tokens consumed

report_action_outcome

Report one UI action outcome (invoke/set_value/focus). Feeds per-app recipes in get_app_knowledge. Metadata only — never screen content or typed text. Report FAILURES too (ok=false plus reason): they become common_failures and stop the next agent from repeating the same dead end.

ParameterTypeDescription
action *stringAction performed (invoke, set_value, focus)
app *stringApp where action occurred
element_namestringElement name (e.g. "Save")
element_rolestringElement role (Button, Edit, ...)
msnumberAction duration in ms
okbooleanAction succeeded?
reasonstringOnly when ok=false. Closed vocabulary: elemento_nao_encontrado, elemento_nao_suporta_invoke, elemento_nao_suporta_set_value, campo_somente_leitura, janela_nao_encontrada, ui_timeout, acao_bloqueada, e…