claude-code: undo a home removal through the mesh
A removal kept its copy but nothing could put it back without a shell on the machine. claude_code_home_restore puts a kept copy back when nothing is at its path and the copy matches the digests recorded at removal; claude_code_home_removed lists what is kept.
This commit is contained in:
@@ -329,6 +329,13 @@ func configTools(p Paths, state ConfigState, view *ConfigView) []stdio.Tool {
|
||||
}
|
||||
return answer, nil
|
||||
}},
|
||||
stdio.Tool{Name: "claude_code_home_removed",
|
||||
Description: "Every item removed from this node's home through claude_code_home_remove whose copy the module keeps, newest first: what it was, where it was, why it went, its keptAt, and whether it was put back.",
|
||||
Run: func(map[string]any) (any, error) { return KeptRemovals(p) }},
|
||||
stdio.Tool{Name: "claude_code_home_restore",
|
||||
Description: "Undo a removal made with claude_code_home_remove: put the kept copy back at the path it was removed from. Refused when something is at that path now, or when the copy is not exactly what was removed (checked file by file against the digests its removal.json recorded). Logged as the removal was; the copy stays.",
|
||||
Input: map[string]any{"kept": str("the keptAt the removal answered, as claude_code_home_removed lists it")},
|
||||
Run: func(a map[string]any) (any, error) { return RestoreHome(p, strArg(a, "kept"), time.Now()) }},
|
||||
)
|
||||
return out
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user