All Tauri commands, TypeScript bridge types, and SSE events.
This page covers the public API consumed by the edytlab frontend. For the full Rust implementation, see commands.rs and tauri-bridge.ts. The complete reference is in docs/api-reference.md.
Commands
All commands are invoked via tauri-bridge.ts. They return Promise<T> and throw a string on Rust Err(_).
Project
| Function | Returns | Description |
|---|
openProject(path) | ProjectInfo | Open or create a project directory. Returns the current head node ID (null if empty). |
API Keys
| Function | Returns | Description |
|---|
setApiKey(key) | void | Store the API key for the active provider in the OS keychain. |
setApiKeyFor(provider, key) | void | Store the API key for a specific provider. |
hasApiKey() | boolean | Check whether the active provider has a key configured. |
hasApiKeyFor(provider) | boolean | Check whether a specific provider has a key. |
clearApiKeyFor(provider) | void | Remove a specific provider's key from the keychain. |
clearApiKey() | void | Remove the API key for the active provider from the keychain. |
testApiKeyFor(provider, key) | void | Validate a key against a specific provider with a 1-token probe. |
testApiKey(key) | void | Validate a key with a 1-token probe request. Throws on failure. |
Provider and Model
| Function | Returns | Description |
|---|
listProviders() | ProviderId[] | Returns ["anthropic", "openrouter", "openai"]. |
getActiveProvider() | ProviderId | Returns the currently active provider ID. |
setActiveProvider(provider) | void | Switch the active provider. Rebuilds the agent. |
listModelsFor(provider, apiKey?) | ModelInfo[] | Fetch available models. Results cached 10 minutes. |
getActiveModel(provider) | string | Returns the model ID selected for the provider. |
setActiveModel(provider, model) | void | Set the active model for a provider. |
Session Graph
| Function | Returns | Description |
|---|
getSessionHead() | NodeId | Returns the current head node ID. |
getNode(id) | SessionNode | Fetch a full node (including SessionState) by ID. |
getGraph() | GraphSummary | Fetch all nodes (without full state) and the current head. |
setHeadTo(nodeId) | NodeId | Move the head pointer to any existing node (non-destructive revert). |
renameNode(nodeId, label) | void | Set a human-readable label on a node. |
Rendering and A/B
| Function | Returns | Description |
|---|
renderPreview(node) | string (path) | Render session to a temp WAV for playback. Returns file path. |
renderRange(node, startSec, endSec, outPath) | void | Render a time range to a specific output file. |
prepareCompare(a, b) | { a_path, b_path } | Pre-render two nodes for A/B comparison. |
acceptB(b) | NodeId | Accept node B as the new session head. |
Agent
| Function | Returns | Description |
|---|
sendMessage(text) | void | Send a user message. Agent runs async; emits events during processing. |
approvePlan() | void | In mashup mode: approve the agent's proposed plan to proceed. |
Selection and Markers
| Function | Returns | Description |
|---|
setSelectionContext(range?) | void | Set or clear the selection range. Injected as agent context on next turn. |
addMarker(timeSec, name) | string (annotation_id) | Add a named point marker. |
removeMarker(id) | NodeId | Remove a marker by annotation ID. |
listMarkers() | Marker[] | List all markers and regions for the current session. |
Tracks
| Function | Returns | Description |
|---|
batchLoad(paths) | LoadReport | Load several audio files in one call, each as its own track. |
listTracks() | TrackSummary[] | List all tracks in the current session head. |
Skills
| Function | Returns | Description |
|---|
listSkills() | SkillSummary[] | List every skill in the library, re-reading the skills directory first so files added or removed since startup are picked up. |
readSkill(name) | SkillContent | Read one skill's front matter and markdown body. |
upsertSkill(name, content) | void | Create or overwrite a skill. The name is validated before it becomes a filename. |
deleteSkill(name) | void | Delete a skill from the library. |
installBundledSkills() | number | Copy the skills that ship with the app into the user's library. Returns how many were written. |
Agent Profiles
| Function | Returns | Description |
|---|
listAgentProfiles() | AgentProfileSummary[] | List saved agent profiles, re-reading them from disk first. |
readAgentProfile(name) | AgentProfileContent | Read one profile's model override, tool whitelist and system-prompt addition. |
upsertAgentProfile(name, content) | void | Create or overwrite an agent profile. |
deleteAgentProfile(name) | void | Delete an agent profile. |
getActiveAgentProfile() | string | null | The profile currently in effect, or null when none is selected. |
setActiveAgentProfile(name) | void | Switch the active profile. Pass null to clear it. |
MCP Servers
| Function | Returns | Description |
|---|
listMcpServers() | McpServerListEntry[] | Every registered MCP server with its transport, enabled flag and current connection state. |
readMcpServer(id) | McpServerEntry | Full configuration for one server — command, args, env, headers. |
upsertMcpServer(id, entry) | void | Register or update a server. A server installed by a plugin always arrives disabled. |
deleteMcpServer(id) | void | Stop the server and remove it from the configuration. |
restartMcpServer(id) | void | Stop and re-launch one server, picking up an edited configuration. |
Plugins and Capabilities
| Function | Returns | Description |
|---|
installPlugin(source) | PluginInstallReport | Install skills and agent profiles from github:org/repo or a local path. Existing files are never overwritten, and any MCP servers the plugin declares are registered disabled. |
listCapabilities() | Capabilities | A snapshot of everything the agent can currently reach: tools, skills, MCP servers and profiles, with their enabled state. |
Templates
| Function | Returns | Description |
|---|
listTemplates() | TemplateInfo[] | Session templates that ship with the app. |
applyTemplate(name) | nodeId | Apply a template to the current session. |
Recording
| Function | Returns | Description |
|---|
startRecording() | string | Begin capturing from the default input device. |
stopRecording(outputPath) | { path, duration_sec } | Stop capture and write the take to a WAV file. |
Memory
| Function | Returns | Description |
|---|
readMemory("global" | "project") | string | Read the memory markdown for the given scope. Returns empty string if none. |
writeMemory("global" | "project", contents) | void | Overwrite the memory file atomically. |
Events
Subscribe with the unlisten pattern. Each handler returns an UnlistenFn — call it in useEffect cleanup.
const unlisten = await bridge.onTextDelta((chunk) => {
appendText(chunk);
});
// cleanup:
return () => { unlisten(); };
| Event | Payload | Description |
|---|
onTextDelta(cb) | string (text chunk) | Each streamed text chunk from the LLM. Append to the current assistant message. |
onToolCall(cb) | { name, id } | Tool execution started. Use to show a tool badge in the chat UI. |
onToolCallEnd(cb) | { id, ok: boolean } | Tool execution completed. ok = false if the tool returned an error. |
onNodeCreated(cb) | nodeId: string | New DAG node appended. Refresh the graph view and track list. |
onAgentDone(cb) | none | Agent turn fully complete — no more text or tool calls. |
onPlan(cb) | steps: object[] | Mashup mode: agent proposed a multi-step plan before execution. |
onMarkerChanged(cb) | none | Marker or region annotation added or removed. Refresh the marker list. |
Key types
type NodeId = string;
type ProviderId = "anthropic" | "openrouter" | "openai";
interface ProjectInfo { path: string; head: NodeId | null }
interface SessionNode { id: NodeId; parent: NodeId | null; label: string | null; state: SessionState }
interface GraphSummary { nodes: GraphNode[]; head: NodeId | null }
interface GraphNode { id: NodeId; parent: NodeId | null; label: string | null; tool: string | null }
interface TrackSummary { id: string; name: string; muted: boolean; gain_db: number; audio_path: string | null }
interface ModelInfo { id: string; display_name: string; context_length: number | null }
interface Marker { id: string; name: string; kind: "marker" | "region"; time_sec?: number; start_sec?: number; end_sec?: number }