import { invoke } from "@tauri-apps/api/core"; import type { AppId } from "./types"; export interface Prompt { id: string; name: string; content: string; description?: string; enabled: boolean; createdAt?: number; updatedAt?: number; } export const promptsApi = { async getPrompts(app: AppId): Promise> { return await invoke("get_prompts", { app }); }, async upsertPrompt(app: AppId, id: string, prompt: Prompt): Promise { return await invoke("upsert_prompt", { app, id, prompt }); }, async deletePrompt(app: AppId, id: string): Promise { return await invoke("delete_prompt", { app, id }); }, async enablePrompt(app: AppId, id: string): Promise { return await invoke("enable_prompt", { app, id }); }, async importFromFile(app: AppId): Promise { return await invoke("import_prompt_from_file", { app }); }, async getCurrentFileContent(app: AppId): Promise { return await invoke("get_current_prompt_file_content", { app }); }, };