refactor: add domain-grouped re-exports for preferences module (#996)
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
4cb5f8dbca
commit
8877e01083
4 changed files with 57 additions and 0 deletions
10
src/resources/extensions/gsd/preferences-hooks.ts
Normal file
10
src/resources/extensions/gsd/preferences-hooks.ts
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
/**
|
||||
* Focused re-export: hook-related preferences.
|
||||
*
|
||||
* Consumers that only need hook resolution can import from this module
|
||||
* instead of the monolithic preferences.ts, reducing coupling surface.
|
||||
*/
|
||||
export {
|
||||
resolvePostUnitHooks,
|
||||
resolvePreDispatchHooks,
|
||||
} from "./preferences.js";
|
||||
22
src/resources/extensions/gsd/preferences-models.ts
Normal file
22
src/resources/extensions/gsd/preferences-models.ts
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
/**
|
||||
* Focused re-export: model-related preferences.
|
||||
*
|
||||
* Consumers that only need model resolution can import from this module
|
||||
* instead of the monolithic preferences.ts, reducing coupling surface.
|
||||
*/
|
||||
export {
|
||||
// Types
|
||||
type GSDPhaseModelConfig,
|
||||
type GSDModelConfig,
|
||||
type GSDModelConfigV2,
|
||||
type ResolvedModelConfig,
|
||||
|
||||
// Functions
|
||||
resolveModelForUnit,
|
||||
resolveModelWithFallbacksForUnit,
|
||||
resolveDynamicRoutingConfig,
|
||||
getNextFallbackModel,
|
||||
isTransientNetworkError,
|
||||
validateModelId,
|
||||
updatePreferencesModels,
|
||||
} from "./preferences.js";
|
||||
18
src/resources/extensions/gsd/preferences-skills.ts
Normal file
18
src/resources/extensions/gsd/preferences-skills.ts
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
/**
|
||||
* Focused re-export: skill-related preferences.
|
||||
*
|
||||
* Consumers that only need skill resolution can import from this module
|
||||
* instead of the monolithic preferences.ts, reducing coupling surface.
|
||||
*/
|
||||
export {
|
||||
// Types
|
||||
type GSDSkillRule,
|
||||
type SkillDiscoveryMode,
|
||||
type SkillResolution,
|
||||
type SkillResolutionReport,
|
||||
|
||||
// Functions
|
||||
resolveAllSkillReferences,
|
||||
resolveSkillDiscoveryMode,
|
||||
resolveSkillStalenessDays,
|
||||
} from "./preferences.js";
|
||||
|
|
@ -261,6 +261,7 @@ export function loadEffectiveGSDPreferences(): LoadedGSDPreferences | null {
|
|||
}
|
||||
|
||||
// ─── Skill Reference Resolution ───────────────────────────────────────────────
|
||||
// Focused re-exports available via ./preferences-skills.js
|
||||
|
||||
export interface SkillResolution {
|
||||
/** The original reference from preferences (bare name or path). */
|
||||
|
|
@ -547,6 +548,9 @@ export function getIsolationMode(): "none" | "worktree" | "branch" {
|
|||
return "worktree"; // default
|
||||
}
|
||||
|
||||
// ─── Model Resolution ─────────────────────────────────────────────────────────
|
||||
// Focused re-exports available via ./preferences-models.js
|
||||
|
||||
/**
|
||||
* Resolve which model ID to use for a given auto-mode unit type.
|
||||
* Returns undefined if no model preference is set for this unit type.
|
||||
|
|
@ -1389,6 +1393,9 @@ function mergePostUnitHooks(
|
|||
return merged.length > 0 ? merged : undefined;
|
||||
}
|
||||
|
||||
// ─── Hook Resolution ──────────────────────────────────────────────────────────
|
||||
// Focused re-exports available via ./preferences-hooks.js
|
||||
|
||||
/**
|
||||
* Resolve enabled post-unit hooks from effective preferences.
|
||||
* Returns an empty array when no hooks are configured.
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue