refactor(agent-presets): keep the user-root segment out of the package API

`USER_PRESET_DIR` was exported with no production consumer — only the new test
read it, and a test that imports the implementation constant cannot catch that
constant being wrong. It stays module-internal, and the test spells the segment
it expects.
This commit is contained in:
Yichen Jiang
2026-08-12 11:36:24 +08:00
parent dfa2d91dcb
commit 2646da8d56
3 changed files with 13 additions and 7 deletions

View File

@@ -33,6 +33,10 @@ export const COMPOSITION_FILE = 'agent.cordis.yml'
* the installed app can resolve; where a person's own presets go is the same
* place in every deployment that does not say otherwise, so a launcher that
* forgets to configure one still finds them.
*
* Package-internal on purpose: no consumer outside this package addresses the
* directory by name, and a test that imported it could not catch this value
* being wrong — the expected segment is spelled out where it is asserted.
*/
export const USER_PRESET_DIR = '.agent-presets'

View File

@@ -50,7 +50,7 @@ export const AgentPresetSettingsSchema: z<AgentPresetSettings> = z.object({
default: z.string(),
})
export { COMPOSITION_FILE, discoverPresets, scanRoot, USER_PRESET_DIR } from './discovery.ts'
export { COMPOSITION_FILE, discoverPresets, scanRoot } from './discovery.ts'
export {
METADATA_FILE, readPresetMetadata, renderPresetMetadata, type PresetMetadata,
} from './metadata.ts'