edytlab
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

FunctionReturnsDescription
openProject(path)ProjectInfoOpen 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)CopyReportCopy 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()ProjectMetaThe 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?)ProjectMetaRename the open project. An empty name is refused, and the recents row is updated in step.
getViewState()ViewStateWhere you were: head, zoom, selection, playhead. Every field is independently optional — absent means 'was not recorded', not 'reset this'.
saveViewState(view)voidRemember where you are. Disposable by design: losing it costs a scroll, not work.
getHeadTrail()SavedTrailThe 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)voidKeep 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

FunctionReturnsDescription
listTemplates()TemplateInfo[]Session templates that ship with the app.
applyTemplate(name)NodeIdApply a template to the current session.