API Reference
Projects and Templates
Open, save and rename projects, keep the view and the history path, and apply templates.
On this page12 commands
Called through tauri-bridge.ts. Each returns Promise<T> and throws 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), stamps last-opened into project.json, and moves the project to the top of the recents list. Refused while a batch_apply run is writing its per-file project to the folder, and while the folder has been replaced at the same path (restored from a backup, or trashed and made again) and the assistant is still working in the old one; wait for it to finish and open the project again. |
saveProjectAs(dest) | CopyReport | Copy the open project to dest and carry on in the copy. The copy is the project at the moment of the click, history and audio together, whatever the assistant commits while it is made, and the audio is copied without holding up other commands. Cached previews and auditions are left behind, since they rebuild. Refuses a dest that exists and is not empty; a copy that fails part way, or is missing what its head needs, is an error and leaves dest for inspection. Resolves with { files, bytes, skipped_cache_files }. |
getProjectMeta() | ProjectMeta | The open project's name, when it was created, and its notes. A missing or corrupt project.json returns a folder-named default rather than failing — the audio and its history are not in that file. |
setProjectMeta(name, notes?) | ProjectMeta | Rename the open project. An empty name is refused, and the recents row is updated in step. |
getViewState() | ViewState | Where you were: head, zoom, selection, playhead. Every field is independently optional — absent means 'was not recorded', not 'reset this'. |
saveViewState(view) | void | Remember where you are. Disposable by design: losing it costs a scroll, not work. |
getHeadTrail() | SavedTrail | The path you took through the history, saved with the project so undo retraces it after a restart. A missing or corrupt file answers an empty path rather than failing. Entries for nodes the project no longer has are dropped. |
saveHeadTrail(trail) | void | Keep the path with the project, replacing the last. Written atomically and bounded to the last 500 steps each way. A path that does not end at a node of the open project is ignored. |
listRecentProjects() | RecentProject[] | Projects this machine has opened, most recent first, one row each, capped at 10. Folders that have gone are pruned on read and the pruning is written back. |
forgetRecentProject(path) | RecentProject[] | Remove the row. Does not touch the project. |
Templates
| Function | Returns | Description |
|---|---|---|
listTemplates() | TemplateInfo[] | Session templates that ship with the app. |
applyTemplate(name) | NodeId | Apply a template to the current session. |