Added getCwdHash proto (#6773)
This commit is contained in:
1 parent
8c05a9923d
commit
5c7bb7c5db
3 files changed
+28
No files matched your search
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"claude-dev": patch
|
||||
---
|
||||
|
||||
Added getCwdHash proto
|
||||
@@ -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 })
|
||||
}
|
||||
Reference in new issue
Block a user