This document defines the IPC API between Frontend and Core, as well as internal APIs.
Tauri Commands that Frontend uses to call Rust Core.
Creates a new project.
// Request
interface CreateProjectRequest {
name: string;
path: string; // Project folder path
format?: SequenceFormat; // Default sequence format
}
// Response
interface CreateProjectResponse {
projectId: string;
projectPath: string;
}Opens an existing project.
interface OpenProjectRequest {
path: string;
}
interface OpenProjectResponse {
projectId: string;
state: ProjectState;
}Saves the current project.
Closes the project.
Retrieves the current project state.
Executes an edit command.
interface ExecuteCommandRequest {
command: Command;
}
interface ExecuteCommandResponse {
opId: OpId;
changes: StateChange[];
createdIds: string[];
deletedIds: string[];
}Executes multiple commands atomically.
Undoes the last command.
Redoes the undone command.
Imports an asset to the project.
interface ImportAssetRequest {
uri: string; // Source file path
kind?: AssetKind; // Auto-detect if omitted
copyToProject?: boolean; // Copy or link
}
interface ImportAssetResponse {
asset: Asset;
jobIds: JobId[]; // Proxy/thumbnail generation jobs
}Retrieves asset information.
Lists all project assets.
Deletes an asset (fails if in use).
Retrieves sequence information with tracks and clips.
Retrieves clip information.
Gets clips within a specific time range.
Requests a preview frame.
interface RequestPreviewRequest {
sequenceId: SequenceId;
timeSec: TimeSec;
quality: 'low' | 'medium' | 'high';
}
interface RequestPreviewResponse {
frameUri: string; // Rendered frame path
cached: boolean;
}Starts preview streaming.
Stops preview streaming.
Starts final rendering.
interface StartRenderRequest {
sequenceId: SequenceId;
outputPath: string;
settings: RenderSettings;
}
interface RenderSettings {
format: 'mp4' | 'mov' | 'webm';
videoCodec: 'h264' | 'hevc' | 'vp9';
videoBitrate?: number;
audioCodec: 'aac' | 'opus' | 'mp3';
audioBitrate?: number;
resolution?: { width: number; height: number };
fps?: Ratio;
}Cancels rendering.
Sends an editing request to AI.
interface AIRequestRequest {
prompt: string;
context?: {
selectedClipIds?: ClipId[];
timeRange?: TimeRange;
};
}
interface AIRequestResponse {
proposalId: string;
status: 'processing' | 'ready';
}Retrieves AI proposal.
Applies AI proposal.
Rejects AI proposal.
Requests AI proposal revision.
Searches assets.
Retrieves job status.
interface GetJobStatusResponse {
jobId: JobId;
type: JobType;
status: JobStatus;
progress?: number; // 0.0 ~ 1.0
message?: string;
result?: any;
error?: string;
}Lists current jobs.
Cancels a job.
Events sent from Core to Frontend.
Emitted when project state changes.
interface StateChangedEvent {
changes: StateChange[];
opId: OpId;
}
// Subscribe
listen('state_changed', (event) => {
const { changes, opId } = event.payload;
// Update Store
});Emitted when sequence is updated.
Job progress update.
interface JobProgressEvent {
jobId: JobId;
progress: number; // 0.0 ~ 1.0
message?: string;
etaSec?: number;
}Job completed.
Job failed.
AI proposal is ready.
AI is processing.
Preview frame is ready.
Internal communication API between Core and Worker.
// Job request
pub struct JobMessage {
pub id: JobId,
pub job_type: JobType,
pub priority: Priority,
pub payload: serde_json::Value,
pub cancel_token: CancellationToken,
}
// Job result
pub struct JobResult {
pub id: JobId,
pub status: JobResultStatus,
pub result: Option<serde_json::Value>,
pub error: Option<String>,
pub duration_ms: u64,
}- ProxyGeneration
- ThumbnailGeneration
- Indexing (ShotDetection, Transcription, FaceDetection, ObjectDetection, Embedding)
- FinalRender
API for WASM plugins to communicate with the host.
fn host_log(level: LogLevel, message: &str);
fn host_get_asset(asset_id: &str) -> Option<AssetInfo>;
fn host_read_file(path: &str) -> Result<Vec<u8>, Error>;
fn host_write_file(path: &str, data: &[u8]) -> Result<(), Error>;
fn host_http_request(request: HttpRequest) -> Result<HttpResponse, Error>;
fn host_ai_complete(request: AIRequest) -> Result<AIResponse, Error>;// AssetProvider interface
fn plugin_search(query_json: &str) -> String;
fn plugin_fetch(asset_ref: &str) -> Vec<u8>;
fn plugin_get_license(asset_ref: &str) -> String;
// EditAssistant interface
fn plugin_propose(context_json: &str) -> String;
// EffectPresetProvider interface
fn plugin_list_presets() -> String;
fn plugin_apply_preset(preset_id: &str, params_json: &str) -> String;interface APIError {
code: ErrorCode;
message: string;
details?: Record<string, any>;
}| Code | Description |
|---|---|
PROJECT_NOT_FOUND |
Project not found |
PROJECT_ALREADY_OPEN |
Project already open |
PROJECT_CORRUPTED |
Project file corrupted |
ASSET_NOT_FOUND |
Asset not found |
ASSET_IN_USE |
Asset in use |
ASSET_IMPORT_FAILED |
Asset import failed |
CLIP_NOT_FOUND |
Clip not found |
TRACK_NOT_FOUND |
Track not found |
SEQUENCE_NOT_FOUND |
Sequence not found |
INVALID_COMMAND |
Invalid command |
COMMAND_FAILED |
Command execution failed |
INVALID_RANGE |
Invalid time range |
RENDER_FAILED |
Render failed |
JOB_NOT_FOUND |
Job not found |
JOB_CANCELLED |
Job cancelled |
AI_REQUEST_FAILED |
AI request failed |
PROPOSAL_NOT_FOUND |
Proposal not found |
PERMISSION_DENIED |
Permission denied |
PLUGIN_ERROR |
Plugin error |
IO_ERROR |
File IO error |
INTERNAL_ERROR |
Internal error |