diff --git a/src/core/controller/file/openDiskConversationHistory.ts b/src/core/controller/file/openDiskConversationHistory.ts index 157a090958..8db4231e70 100644 --- a/src/core/controller/file/openDiskConversationHistory.ts +++ b/src/core/controller/file/openDiskConversationHistory.ts @@ -4,16 +4,16 @@ import path from "path" import { HostProvider } from "@/hosts/host-provider" import { Controller } from ".." /** - * Opens a file in the editor + * Opens the api_conversation_history.json file for a task in the editor * @param controller The controller instance - * @param request The request message containing the file path in the 'value' field + * @param request The request message containing the task ID in the 'value' field * @returns Empty response */ export async function openDiskConversationHistory(_controller: Controller, request: StringRequest): Promise { - const globalStoragePath = HostProvider.get().globalStorageFsPath - const taskConversationHistoryPath = path.join(globalStoragePath, "tasks", request.value, "api_conversation_history.json") if (request.value) { - openFileIntegration(taskConversationHistoryPath) + const globalStoragePath = HostProvider.get().globalStorageFsPath + const taskConversationHistoryPath = path.join(globalStoragePath, "tasks", request.value, "api_conversation_history.json") + await openFileIntegration(taskConversationHistoryPath) } return Empty.create() } diff --git a/src/sdk/SdkController.ts b/src/sdk/SdkController.ts index b3a89fa22e..09762b7fa5 100644 --- a/src/sdk/SdkController.ts +++ b/src/sdk/SdkController.ts @@ -617,8 +617,11 @@ export class Controller { return this.taskHistory.getTaskWithId(id) } - async exportTaskWithId(_id: string): Promise { - stubWarn("exportTaskWithId") + async exportTaskWithId(id: string): Promise { + const taskDirPath = path.join(HostProvider.get().globalStorageFsPath, "tasks", id) + Logger.log(`[EXPORT] Opening task directory: ${taskDirPath}`) + const open = (await import("open")).default + await open(taskDirPath) } async deleteTaskFromState(id: string): Promise {