mirror of
https://github.com/cline/cline.git
synced 2026-09-21 13:21:23 +08:00
fix: implement exportTaskWithId and fix openDiskConversationHistory
- Replace exportTaskWithId stub in SdkController with real implementation that opens the task directory in the file manager (matching classic behavior) - Fix openDiskConversationHistory to await openFileIntegration and move path construction inside the null check Closes ENG-1828
This commit is contained in:
@@ -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<Empty> {
|
||||
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()
|
||||
}
|
||||
|
||||
@@ -617,8 +617,11 @@ export class Controller {
|
||||
return this.taskHistory.getTaskWithId(id)
|
||||
}
|
||||
|
||||
async exportTaskWithId(_id: string): Promise<void> {
|
||||
stubWarn("exportTaskWithId")
|
||||
async exportTaskWithId(id: string): Promise<void> {
|
||||
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<HistoryItem[]> {
|
||||
|
||||
Reference in New Issue
Block a user