Part of #183. path-cli only. No library changes. No user-visible changes.
Work
- Add a
Config struct. Extract it one time in run() with figment:
Serialized::defaults, then Env.
- It owns
TOOLPATH_CONFIG_DIR, HOME, the harness root variables (XDG_DATA_HOME, COPILOT_HOME, APPDATA), PATHBASE_URL, TOOLPATH_QUERY_EXPLAIN.
- The env layer emits values as verbatim strings (a small provider wrapping
Env). No per-field deserializers.
- Change
config.rs::config_dir() to read from Config, not from env.
- Change the ~30 provider construction sites to the injection functions that exist today:
Convo::new() becomes Convo::with_resolver(...).
derive_* wrappers become derive_*_with(...).
- Commands get a
&Config parameter. Command structure does not change.
- For opencode and copilot, inject the directory (
with_data_dir, with_copilot_dir), not the home.
- Their env reads still exist and win against
with_home.
- The provider issue deletes those reads.
- Test the env-to-
Config mapping with figment::Jail.
PR plan
- PR 1:
Config, figment load, config_dir().
- Then one PR per command module for its construction sites. The first one adds the
run() extraction and passes &Config down.
- Old and new construction can coexist until the provider issue lands.
Part of #183. path-cli only. No library changes. No user-visible changes.
Work
Configstruct. Extract it one time inrun()with figment:Serialized::defaults, thenEnv.TOOLPATH_CONFIG_DIR,HOME, the harness root variables (XDG_DATA_HOME,COPILOT_HOME,APPDATA),PATHBASE_URL,TOOLPATH_QUERY_EXPLAIN.Env). No per-field deserializers.config.rs::config_dir()to read fromConfig, not from env.Convo::new()becomesConvo::with_resolver(...).derive_*wrappers becomederive_*_with(...).&Configparameter. Command structure does not change.with_data_dir,with_copilot_dir), not the home.with_home.Configmapping withfigment::Jail.PR plan
Config, figment load,config_dir().run()extraction and passes&Configdown.