Module app_api

Module app_api 

Source
Expand description

App API — high-level commands for programmatic control of AgentMux.

These commands orchestrate multiple low-level operations (CreateBlock, SetMeta, ControllerResync) behind stable, intent-based interfaces. Callers express what they want (“open an agent pane with AgentX”), not how to do it.

Functions§

allocate_agent_workdir
Atomically allocate an agent working directory.
build_pane_meta 🔒
Build the metadata map for a pane.open request, validating required args.
extract_digest_text 🔒
Extract meaningful text from raw stream-json lines for digest summarization. Skips system/result events and raw stream_event deltas; extracts assistant text and tool call summaries.
find_agent_block 🔒
Find an existing agent block in a tab by agent ID.
invoke_cli_for_digest 🔒
Invoke the Claude CLI with a prompt and extract the text response. Uses -p --output-format stream-json --verbose (non-interactive mode).
register_agent_kill_process 🔒
register_agent_kill_tree 🔒
register_agent_list 🔒
register_agent_open 🔒
register_agent_output 🔒
register_agent_process_list 🔒
register_agent_send 🔒
register_agent_status 🔒
register_agent_stop 🔒
register_agent_tracked_blocks 🔒
register_app_api_handlers
Register all App API handlers on the RPC engine.
register_blockfile_line_count 🔒
register_blockfile_read_range 🔒
register_blockfile_read_state 🔒
register_blockfile_write_state 🔒
register_pane_open 🔒
register_session_archive_handler 🔒
register_session_digest 🔒
register_session_export_handler 🔒
register_session_restore_handler 🔒
resolve_placement 🔒
Translate split_direction + split_reference_block_id into the backend layout action triple. Returns (actiontype, targetblockid, position). Falls back to a plain insert if direction/reference are missing.
resolve_tab_id 🔒
Resolve a tab ID: use the provided one, or fall back to the first workspace’s active tab.
write_agent_config_files 🔒
Write agent config files (CLAUDE.md, .mcp.json, etc.) to the working directory.