Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions crates/hk-core/src/adapter/claude.rs
Original file line number Diff line number Diff line change
Expand Up @@ -573,9 +573,9 @@ mod tests {
let home = tmp.path();

// Project A: has a transcript → owner cwd is known.
let a = home.join(".claude/projects/-Users-zoe-Demo-Proj");
let a = home.join(".claude/projects/-Users-me-Demo-Proj");
fs::create_dir_all(a.join("memory")).unwrap();
fs::write(a.join("s.jsonl"), "{\"cwd\":\"/Users/zoe/Demo/Proj\"}\n").unwrap();
fs::write(a.join("s.jsonl"), "{\"cwd\":\"/Users/me/Demo/Proj\"}\n").unwrap();
fs::write(a.join("memory/note.md"), "x").unwrap();

// Project B: memory but NO transcript → owner unknown (None).
Expand All @@ -595,7 +595,7 @@ mod tests {
.unwrap();
assert_eq!(
known.0.as_deref(),
Some(std::path::Path::new("/Users/zoe/Demo/Proj"))
Some(std::path::Path::new("/Users/me/Demo/Proj"))
);

let orphan = groups
Expand Down
6 changes: 3 additions & 3 deletions crates/hk-core/src/deployer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ pub fn sanitize_mcp_name(name: &str) -> String {
///
/// GUI-based agents (e.g. Antigravity) do not inherit the user's shell `$PATH`,
/// so bare command names like `npx` or `uvx` fail with ENOENT. This resolves the
/// command to an absolute path (e.g. `/Users/zoe/.local/bin/uvx`) at deploy time.
/// command to an absolute path (e.g. `/Users/me/.local/bin/uvx`) at deploy time.
/// Returns the original command unchanged if resolution fails.
pub fn resolve_command_path(command: &str) -> String {
// Already absolute — nothing to do.
Expand Down Expand Up @@ -4298,10 +4298,10 @@ mod tests {
#[cfg(not(target_os = "windows"))]
#[test]
fn test_build_path_for_command_includes_parent_dir() {
let path = build_path_for_command("/Users/zoe/.nvm/versions/node/v24.13.0/bin/npx");
let path = build_path_for_command("/Users/me/.nvm/versions/node/v24.13.0/bin/npx");
assert_eq!(
path.unwrap(),
"/Users/zoe/.nvm/versions/node/v24.13.0/bin:/usr/local/bin:/usr/bin:/bin"
"/Users/me/.nvm/versions/node/v24.13.0/bin:/usr/local/bin:/usr/bin:/bin"
);
}

Expand Down
2 changes: 1 addition & 1 deletion crates/hk-core/src/sanitize.rs
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ pub fn resolve_and_validate_config_path(path: &str) -> Result<String, HkError> {
));
}
// Compare canonical paths so trailing slashes, symlinks, and other
// surface variants (e.g. `/Users/zoe/` vs `/Users/zoe`, or a symlink
// surface variants (e.g. `/Users/me/` vs `/Users/me`, or a symlink
// pointing to home) all reject as "home itself".
let home = crate::home_dir();
if let (Ok(rp), Ok(hp)) = (
Expand Down
16 changes: 8 additions & 8 deletions crates/hk-core/src/scanner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,7 @@ fn mcp_stdio_profile(server: &crate::adapter::McpServerEntry) -> (Vec<Permission
}
}

// Extract filesystem paths from args (e.g. /Users/zoe/projects or ~/workspace)
// Extract filesystem paths from args (e.g. /Users/me/projects or ~/workspace)
let fs_paths: Vec<String> = server
.args
.iter()
Expand Down Expand Up @@ -2497,7 +2497,7 @@ mod tests {
// server-filesystem takes an absolute path as a positional arg
std::fs::write(
dir.path().join(".claude.json"),
r#"{"mcpServers":{"fs":{"command":"node","args":["/Users/zoe/projects"],"env":{}}}}"#,
r#"{"mcpServers":{"fs":{"command":"node","args":["/Users/me/projects"],"env":{}}}}"#,
)
.unwrap();
let adapter = crate::adapter::claude::ClaudeAdapter::with_home(dir.path().to_path_buf());
Expand All @@ -2509,7 +2509,7 @@ mod tests {
.find(|p| matches!(p, Permission::FileSystem { .. }));
assert!(fs_perm.is_some(), "expected FileSystem permission");
if let Some(Permission::FileSystem { paths }) = fs_perm {
assert_eq!(paths, &vec!["/Users/zoe/projects".to_string()]);
assert_eq!(paths, &vec!["/Users/me/projects".to_string()]);
}
}

Expand Down Expand Up @@ -3425,19 +3425,19 @@ mod config_tests {
let home = tmp.path();

// Registered project → Project scope.
let reg = home.join(".claude/projects/-Users-zoe-Demo-Proj");
let reg = home.join(".claude/projects/-Users-me-Demo-Proj");
fs::create_dir_all(reg.join("memory")).unwrap();
fs::write(reg.join("s.jsonl"), "{\"cwd\":\"/Users/zoe/Demo/Proj\"}\n").unwrap();
fs::write(reg.join("s.jsonl"), "{\"cwd\":\"/Users/me/Demo/Proj\"}\n").unwrap();
fs::write(reg.join("memory/note.md"), "x").unwrap();

// Unregistered project → Global scope (behavior preserved).
let unreg = home.join(".claude/projects/-Users-zoe-Other");
let unreg = home.join(".claude/projects/-Users-me-Other");
fs::create_dir_all(unreg.join("memory")).unwrap();
fs::write(unreg.join("s.jsonl"), "{\"cwd\":\"/Users/zoe/Other\"}\n").unwrap();
fs::write(unreg.join("s.jsonl"), "{\"cwd\":\"/Users/me/Other\"}\n").unwrap();
fs::write(unreg.join("memory/misc.md"), "y").unwrap();

let adapter = ClaudeAdapter::with_home(home.to_path_buf());
let projects = vec![("Demo".to_string(), "/Users/zoe/Demo/Proj".to_string())];
let projects = vec![("Demo".to_string(), "/Users/me/Demo/Proj".to_string())];
let configs = scan_agent_configs(&adapter, &projects);

let note = configs.iter().find(|c| c.file_name == "note.md").unwrap();
Expand Down
Loading