mirror of
https://github.com/stablyai/orca.git
synced 2026-10-08 16:02:37 +00:00
12 lines
440 B
TypeScript
12 lines
440 B
TypeScript
import type { HookCommandSourcePolicy } from './types'
|
|
|
|
export function normalizeHookCommandSourcePolicy(policy: unknown): HookCommandSourcePolicy {
|
|
if (policy === 'local-only' || policy === 'run-both' || policy === 'shared-only') {
|
|
return policy
|
|
}
|
|
|
|
// Why: old persisted settings may still contain the removed shared-first mode.
|
|
// Treat any unknown value as the authoritative committed config policy.
|
|
return 'shared-only'
|
|
}
|