edytlab
API Reference

Agent and Profiles

Send messages, approve or reject plans, cancel a long-running tool, and manage agent profiles.

On this page12 commands

Called through tauri-bridge.ts. Each returns Promise<T> and throws a string on Rust Err(_).

Agent

FunctionReturnsDescription
sendMessage(text)voidSend a user message. Agent runs async; emits events during processing. A failure on the ChatGPT plan rejects with text that starts [plan-usage code=usage_limit] (or not_eligible, plan_disabled, session_ended, unavailable, unsupported_request, refused), then the sentence to show; when the session ended the message is kept for chatgptTakePendingMessage.
approvePlan(steps?)voidApprove what onPlan showed (the agent's plan, or its first edit when Plan first is on and it wrote no plan). Pass the edited steps, each with its tool, to change it instead: a plan follows the revision, a held edit is not run and the agent proposes again.
rejectPlan()voidDecline what onPlan showed. The turn ends and nothing is applied; for a held edit, the agent is told you declined.
setPlanFirst(enabled)voidWith Plan first on, no edit runs without your approval: the plan is shown, or, with no plan, the first step that would change the session. Calls that only read the session, audition an effect or render a preview are never held. The setting is kept through the agent rebuilds a key, model or base-URL change causes, and across a restart: it is saved to ~/.edytlab/settings.json and read back when the app starts. If it cannot be saved the call rejects with "could not save the Plan first setting", the choice still applies until the app quits, and the next launch starts from what was saved before.
getPlanFirst()booleanWhether Plan first is on: what was saved when the app last quit, then whatever setPlanFirst has set since. Off on a fresh install, or when the settings file is missing or corrupt. The chat box reads it when it opens, so its toggle shows the right state.
cancelLongRunningTool()voidAsk the running tool to stop. Cooperative: batch_apply checks between files and timer_record between polls, so it lands at the next boundary, and a tool that does not check is unaffected. Resolves when the request is recorded, not when the tool stops; watch the tool-progress event for that.

Agent Profiles

FunctionReturnsDescription
listAgentProfiles()AgentProfileSummary[]List saved agent profiles, re-reading them from disk first.
readAgentProfile(name)AgentProfileContentRead one profile's model override, tool whitelist and system-prompt addition.
upsertAgentProfile(name, content)voidCreate or overwrite an agent profile.
deleteAgentProfile(name)voidDelete an agent profile.
getActiveAgentProfile()string | nullThe profile currently in effect, or null when none is selected.
setActiveAgentProfile(name)voidSwitch the active profile. Pass null to clear it.