List all sessions with display_name_is_custom, is_remote, and the same optional lifecycle state (shell_state, agent_state, background_work, queued_commands) returned by GET /sessions
list_worktrees
–
Vec<JSON>
List managed worktrees
update_session_cwd
session_id, cwd
()
Update session working directory (from OSC 7)
get_session_foreground_process
session_id
JSON
Get foreground process info
get_kitty_flags
session_id
u32
Get Kitty keyboard protocol flags for session
get_last_prompt
session_id
Option<String>
Get last user-typed prompt from input line buffer
get_shell_state
session_id
Option<String>
Get current shell state (“busy”, “idle”, or null); agent-specific semantic Working markers can repair a transient false-idle state
has_foreground_process
session_id: String
bool
Checks if a non-shell foreground process is running
debug_agent_detection
session_id: String
AgentDiagnostics
Returns diagnostic breakdown of agent detection pipeline
set_session_name
session_id, name, is_custom?
()
Set a session display name and whether it represents an explicit user rename
get_input_buffer_content
session_id
String
Get the current content of the input line buffer (what the user is typing). Used by plugins with pty:read capability.
get_process_stats
–
Vec<ProcessStat>
CPU% and RSS memory for TUIC and all child process trees
Fetch configured base ref and rebase or merge the branch onto it. Conflict cleanup reports (aborted) only after abort succeeds; abort failure includes manual recovery guidance.
Discard working tree changes (git restore). Destructive. Path-traversal validated
git_commit
path, message, amend?
String (commit hash)
Commit staged changes; optional --amend. Returns new HEAD hash
get_commit_log
path, count?, after?
Vec<CommitLogEntry>
Paginated commit log (default 50, max 500). after is a commit hash for cursor-based pagination
get_stash_list
path
Vec<StashEntry>
List stash entries (index, ref_name, message, hash)
git_stash_apply
path, index
()
Apply stash entry by index
git_stash_pop
path, index
()
Pop stash entry by index
git_stash_drop
path, index
()
Drop stash entry by index
git_stash_show
path, index
String
Show diff of stash entry
git_apply_reverse_patch
path, patch, scope?
()
Apply a unified diff patch in reverse (git apply --reverse). Used for hunk/line restore. scope="staged" adds --cached. Patch passed via stdin (no temp files). Path-traversal validated
get_file_history
path, file, count?, after?
Vec<CommitLogEntry>
Per-file commit log following renames (default 50, max 500)
Batch PR status for all branches (includes merged)
get_pr_diff
repo_path, pr_number
String
Get PR diff content
run_pr_review
repo_path, pr_number
PrReviewResult
AI review of a PR diff (multi-turn engine, Main slot) → line-level findings
get_merged_prs
repo_path, since_tag?
Vec<MergedPr>
Merged PRs via GraphQL, optionally since a tag’s date (AI changelog source)
generate_changelog
repo_path, since_tag?
{markdown, json}
AI changelog from merged PRs (headless slot, one-shot)
start_conflict_assist
repo_path, pr_number
ConflictAssistResult
Worktree on PR head + rebase onto base; reports verified/unverified clean or conflicts, base provenance/warning, and agent prompt (push gated, never auto-merge)
run_improvement_scan
repo_path, focus
ImprovementScanResult
One-shot Headless-slot scan of local repo context for improvement proposals (focus: refactor, testing, perf); emits proposals-ready
create_issue_from_proposal
repo_path, proposal
CreatedIssue
Human-gated issue creation from an improvement proposal
fetch_ci_failure_logs
repo_path, branch
String
Fetch failed-job logs for the branch’s latest GitHub Actions head, including partially completed workflow runs
Remove worktree; delete_branch (default true) controls whether the local branch is also deleted. If safe branch deletion fails after the worktree is removed, returns branch_delete_warning so the UI can report that the branch was kept. Archive script resolved from config (not IPC).
delete_local_branch
repo_path, branch_name
()
Delete a local branch (and its worktree if linked). Refuses to delete the default branch. Uses safe git branch -d
check_worktree_dirty
repo_path, branch_name
bool
Check if a branch’s worktree has uncommitted changes. Returns false if no worktree exists. When git cannot answer (the worktree list or status call fails) it returns an error, never false — callers that gate a destructive action must see the failure
get_worktree_paths
repo_path
HashMap<String,String>
Worktree paths for repo
get_worktrees_dir
–
String
Worktrees base directory
generate_worktree_name_cmd
existing_names
String
Generate unique name
list_local_branches
path
Vec<String>
List local branches
checkout_remote_branch
repo_path, branch_name
()
Check out a remote-only branch as a new local tracking branch
detect_orphan_worktrees
repo_path
Vec<String>
Detect worktrees in detached HEAD state (branch deleted)
remove_orphan_worktree
repo_path, worktree_path
()
Remove an orphan worktree by filesystem path (validated against repo)
switch_branch
repo_path, branch_name
()
Switch main worktree to a different branch (with dirty-state and process checks)
Merge worktree branch into base and archive. A pre-flight counts the commits the target is missing and checks whether the worktree is dirty; both are returned so the caller can say what the merge actually carried. When after_merge is archive or delete and the worktree is not known to be clean, it returns action: "needs_confirmation" without touching anything — re-call with force: true to proceed. The commit count does not enter that decision: both cleanups end in git worktree remove --force, which destroys uncommitted work whether or not the branch carries commits. A dirty check that fails also blocks (worktree_dirty stays false because git never said “dirty”). If conflict cleanup abort fails, the error reports the repo may still be conflicted and includes the manual abort command.
finalize_merged_worktree
repo_path, branch_name, action, force?
MergeArchiveResult
Clean up a merged worktree. Passes the same dirty-worktree gate as merge_and_archive_worktree: without force a worktree that is not known to be clean comes back as action: "needs_confirmation" instead of being wiped (merged: true — only the cleanup stopped, the merge already landed). Delete action may include branch_delete_warning if the worktree was removed but safe branch deletion kept the branch.
Decode base64 image, validate ≤10 MB, write to config_dir()/note-images/<note_id>/<timestamp>.<ext>
delete_note_assets
note_id
()
Remove note-images/<note_id>/ directory recursively (no-op if missing)
get_note_images_dir
–
String
Return config_dir()/note-images/ absolute path
load_keybindings
–
JSON
Load keybinding overrides
save_keybindings
config
()
Save keybinding overrides
load_agents_config
–
AgentsConfig
Load per-agent run configs
save_agents_config
config
()
Save per-agent run configs
load_activity
–
ActivityConfig
Load activity dashboard state
save_activity
config
()
Save activity dashboard state
load_repo_local_config
repo_path
RepoLocalConfig?
Read .tuic.json from repo root; returns null if absent or malformed
save_repo_local_config
repo_path
()
Write the repo’s effective resolved worktree/branch settings (global defaults + per-repo overrides) to .tuic.json at its root (committable, team-shareable). Preserves fields already in the file (e.g. mcp_upstreams); never writes script fields
Cross-window state synchronization for the AI Chat panel. The registry is the Rust-side source of truth; frontends subscribe via Channel<ChatEvent> for real-time projection.
Command
Args
Returns
Description
chat_subscribe
chat_id, on_event: Channel<ChatEvent>
{ subscriptionId, snapshot }
Subscribe to a chat’s state changes. Returns current snapshot + subscription ID. Events: snapshot, chunk { delta }, error { message }, cleared
chat_unsubscribe
chat_id, subscription_id
()
Remove a subscriber (normal cleanup path)
chat_get_state
chat_id
ConversationStateSnapshot
Read-only snapshot of a chat’s current state
chat_push_message
chat_id, role, content
()
Push a message to the registry and fan-out to subscribers
chat_clear
chat_id
()
Clear conversation state and notify subscribers
chat_set_pinned
chat_id, pinned
()
Set the pinned flag on a chat
chat_attach_terminal
chat_id, terminal_id
()
Attach a terminal session to a chat
chat_detach_terminal
chat_id
()
Detach the terminal from a chat
open_panel_window
panel_id, title?, params?, width?, height?
()
Open (or focus) a detached panel window. panel_id becomes the window label prefix (panel-{id}). URL: /?mode=panel&panel={id}&{params}. Emits panel-window-closed { panelId } on destroy
close_panel_window
panel_id
()
Close a detached panel window by ID
focus_main_window
—
()
Bring the main window to foreground (used by detached panels after cross-window actions)
ReAct-style agent loop driving a terminal session with ai_terminal_* tools,
plus a Tauri-side query for the per-session knowledge store.
Command
Args
Returns
Description
start_agent_loop
session_id, goal, unrestricted?: bool
String (status message)
Start a ReAct loop on the given terminal session with the given goal. When unrestricted=true, sets TrustLevel::Unrestricted — bypasses sandbox and approval prompts. Errors if an agent is already active for the session.
cancel_agent_loop
session_id
String
Cancel the active agent loop. Errors if no loop is active.
pause_agent_loop
session_id
String
Pause the active agent loop between iterations.
resume_agent_loop
session_id
String
Resume a paused agent loop.
agent_loop_status
session_id
{ active: bool, state: AgentState?, session_id }
Query whether an agent is active and its current state (running/paused/pending_approval).
approve_agent_action
session_id, approved
String
Approve or reject the pending destructive command the agent wants to run. Errors if no agent is active.
get_session_knowledge
session_id
SessionKnowledgeSummary
Lightweight summary for the SessionKnowledgeBar UI: commands count, last 5 outcomes with kind badges, recent errors with error_type, TUI mode indicator, TUI apps seen. Returns an empty summary when the session has no recorded knowledge yet.
list_knowledge_sessions
filter?: { text?, hasErrors?, since? }, limit?
SessionListEntry[]
Scan persisted ai-sessions/ and list sessions sorted by most recent activity. Filter by text (matches command/output/intent/error_type), errors-only, or UNIX-seconds since lower bound. limit clamps at 500 (default 100).
get_knowledge_session_detail
session_id
SessionDetail?
Full command history for one session — reads the in-memory store when active, falls back to disk otherwise. HistoryCommand rows include pre-extracted kind/error_type and the opt-in semantic_intent.
load_scheduler_config
–
SchedulerConfig
Load cron scheduler config from ai-cron.json. Returns { jobs: ScheduledJob[] } where each job has id, cron_expr, goal.
save_scheduler_config
config: SchedulerConfig
()
Validate cron expressions and persist scheduler config. Errors if any expression is invalid.
OAuth 2.1 authorization for upstream MCP servers. Full RFC 9728 (Protected Resource Metadata) + RFC 8414 (Authorization Server Discovery) flow with PKCE S256. Completion via the tuic://oauth-callback deep link.
Command
Args
Returns
Description
start_mcp_upstream_oauth
name: String
StartOAuthResponse
Begin an OAuth flow for the named upstream. Transitions status to authenticating, returns the authorization URL + AS origin for the consent dialog. PKCE challenge is generated and stored per pending flow
mcp_oauth_callback
code: String, oauth_state: String
()
Consume the tuic://oauth-callback?code=…&state=… deep link. Exchanges the code for tokens, persists OAuthTokenSet to the OS keyring, transitions upstream to connecting
cancel_mcp_upstream_oauth
name: String
()
Abort an in-flight OAuth flow. Drops the pending entry and resets upstream status
Apply the caller’s ID-keyed base-to-config delta to the latest locked mcp-upstreams.json, validate it, and hot-reload the exact persisted change. Removing a server or its optional auth field is an explicit deletion; unrelated concurrent changes are preserved
reconnect_mcp_upstream
name: String
()
Disconnect and reconnect a single upstream by name. Useful after credential changes or transient failures
get_mcp_upstream_status
–
Vec<UpstreamStatus>
Get live status of all upstream MCP servers. Status values: connecting, ready, circuit_open, disabled, failed, authenticating, needs_auth
save_mcp_upstream_credential
name: String, token: String
()
Store a Bearer token for an upstream in the OS keyring
delete_mcp_upstream_credential
name: String
()
Remove a Bearer token from the OS keyring (idempotent)
Spawn a one-shot agent process in argv form (no shell — metacharacters in args are literal). Prompt content piped via stdin. Timeout capped at 5 minutes
Aggregated token/session stats from JSONL transcripts
get_claude_project_list
–
Vec<ProjectEntry>
List project slugs with session counts
scope values: "all" (all projects) or a specific project slug. days defaults to 7.
Uses incremental parsing with a file-size-based cache (claude-usage-cache.json) so only newly appended JSONL data is processed on each call. The cache is persisted across app restarts.
Move/copy OS paths into a destination directory. Skips silently on name conflicts; returns needs_confirm=true (no-op) when a source is a directory and allowRecursive=false. Used by the drag-drop handler when dropping files onto a folder in the file browser.
Full-text content search; streams results progressively via content-search-batch events. Binary files and files >1 MB are skipped. Supports cancellation.
search_content_all
query, caseSensitive?, limit?
()
Cross-repo BM25 content search over every ready index; streams via the same content-search-batch events with each match tagged repo_path. Only repos whose index is built participate (depends on Content Indexing strategy). Shares the cancellation slot with search_content.