MCPcopy Create free account
hub / github.com/cursor/cookbook / getSelectionPreference

Function getSelectionPreference

sdk/coding-agent-cli/src/tui/App.tsx:1086–1099  ·  view source on GitHub ↗
(
  selection: ModelSelection,
  preference: keyof ModelPreference
)

Source from the content-addressed store, hash-verified

1084}
1085
1086function getSelectionPreference(
1087 selection: ModelSelection,
1088 preference: keyof ModelPreference
1089) {
1090 for (const param of selection.params ?? []) {
1091 const key = normalizeToken(`${param.id} ${param.value}`)
1092 if (key.includes(preference)) {
1093 return !isFalseValue(key)
1094 }
1095 }
1096
1097 const idKey = normalizeToken(selection.id)
1098 return idKey.includes(preference) ? !isFalseValue(idKey) : undefined
1099}
1100
1101function selectionOverlapScore(left: ModelSelection, right: ModelSelection) {
1102 const rightParams = new Set(

Callers 4

openModelPickerFunction · 0.85
filterModelItemsFunction · 0.85
findPreferredSelectionFunction · 0.85
modelSupportsPreferenceFunction · 0.85

Calls 2

normalizeTokenFunction · 0.85
isFalseValueFunction · 0.70

Tested by

no test coverage detected