Added getCwdHash proto (#6773)

This commit is contained in:
canvrno authored and GitHub committed 2025-10-12 03:23:56 +00:00
1 parent 8c05a9923d
commit 5c7bb7c5db
3 files changed
+28

No files matched your search

+5
View File
@@ -0,0 +1,5 @@
---
"claude-dev": patch
---
Added getCwdHash proto
+5
View File
@@ -9,6 +9,7 @@ option java_multiple_files = true;
service CheckpointsService {
rpc checkpointDiff(Int64Request) returns (Empty);
rpc checkpointRestore(CheckpointRestoreRequest) returns (Empty);
rpc getCwdHash(StringArrayRequest) returns (PathHashMap);
}
message CheckpointRestoreRequest {
@@ -17,3 +18,7 @@ message CheckpointRestoreRequest {
string restore_type = 3;
optional int64 offset = 4;
}
message PathHashMap {
map<string, string> path_hash = 1;
}
@@ -0,0 +1,18 @@
import { PathHashMap } from "@shared/proto/cline/checkpoints"
import { StringArrayRequest } from "@shared/proto/cline/common"
import { hashWorkingDir } from "@/integrations/checkpoints/CheckpointUtils"
import { Controller } from ".."
export async function getCwdHash(_controller: Controller, request: StringArrayRequest): Promise<PathHashMap> {
const pathHash: Record<string, string> = {}
for (const path of request.value) {
try {
pathHash[path] = hashWorkingDir(path)
} catch {
pathHash[path] = ""
}
}
return PathHashMap.create({ pathHash })
}