refactor(claude): PathResolver::new takes a required home argument - #208
Draft
ecalifornica wants to merge 1 commit into
Draft
refactor(claude): PathResolver::new takes a required home argument#208ecalifornica wants to merge 1 commit into
ecalifornica wants to merge 1 commit into
Conversation
) toolpath-claude reads no environment variable. The caller supplies the home directory; the crate keeps the layout below it (`<home>/.claude`). Library (breaking, 0.13.0): - `PathResolver::new(home)` takes the home directory as a required argument. `ClaudeConvo::new(home)` and `ConvoIO::new(home)` take the same argument. - Delete the `Default` impls on the three types, `with_home`, the private `dirs::home_dir` helper, and the `NoHomeDirectory` error variant. - Keep `with_claude_dir` as the full override. - The home directory is always present, so `home_dir()`, `claude_dir()`, `projects_dir()`, `history_file()`, `project_dir()`, `conversation_file()`, `ConvoIO::claude_dir_path()`, and `ConvoIO::conversation_exists()` return a value, not a `Result`. Callers inside the crate drop the dead error arms. - Verbose parse warnings are a `bool` parameter. `ConversationReader::read_conversation_with(path, verbose_warnings)` takes it directly. `ConvoIO::with_verbose_warnings` and `ClaudeConvo::with_verbose_warnings` store it and pass it down. `ConversationReader::read_conversation(path)` warns about the first 5 unparseable lines only. path-cli: - `providers::claude_resolver` returns `Option<PathResolver>`. `None` means `Config` carries no home directory, so Claude is out of reach. - `harness_bundle` omits the Claude manager in that case. - `providers::require_claude_resolver` reports "cannot determine the home directory" for the 6 commands that target Claude. - `Config` reads `$CLAUDE_CLI_DEBUG`. `providers::claude_verbose_warnings` turns its presence into the flag every `ClaudeConvo` receives, so the variable keeps its behavior for CLI users. Version bump per the release checklist: crate manifest, workspace dependency, site/_data/crates.json, CHANGELOG.md.
|
🔍 Preview deployed: https://cde2e660.toolpath.pages.dev |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of #185.
toolpath-claudereads no environment variable. The caller supplies the home directory. The crate keeps the layout below it: Claude data is in<home>/.claude.toolpath-claude, breaking, 0.13.0
PathResolver::new(home)takes the home directory as a required argument.ClaudeConvo::new(home)andConvoIO::new(home)take the same argument.Defaultimpls onPathResolver,ConvoIO, andClaudeConvo;PathResolver::with_home; the privatedirs::home_dirhelper; theNoHomeDirectoryerror variant.with_claude_dirstays as the full override.Result. The CHANGELOG lists them.list_project_dirs,list_conversations, and every read path keep theirResult. Their error is a failed directory or file read, not a missing home.Verbose parse warnings are a parameter:
~/.claude/projects/**/*.jsonl). The reader tolerates unparseable lines; by default it warns about the first 5, and verbose warnings cover every one. The flag is in this PR because$CLAUDE_CLI_DEBUGselects it, and this refactor moves every environment read out of the crate.ConversationReader::read_conversation_with(path, verbose_warnings)takes the flag directly.ConversationReader::read_conversation(path)stays on the first-5 default.ConvoIO::with_verbose_warnings(bool)andClaudeConvo::with_verbose_warnings(bool)store the flag, default false, and pass it down.path-cli
providers::claude_resolverreturnsOption<PathResolver>.NonemeansConfigcarries no home directory, so the Claude harness is out of reach.harness_bundleomits the Claude manager when the resolver isNone.providers::require_claude_resolverturnsNoneinto an error. The 6 commands that target Claude use it:p list claude,p import claude,p export claude --project, the plugin-facing session lookup inp export,show claude, and the single-session derive.Configreads$CLAUDE_CLI_DEBUG.providers::claude_verbose_warningsturns its presence into the flag everyClaudeConvoreceives, so the variable keeps its behavior for CLI users.Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.