Add permanence refs opens picker, labels inject into INHERITS

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Towsty
2026-08-28 09:20:44 -05:00
co-authored by Cursor
parent fb748e9b6e
commit adc583aad6
4 changed files with 112 additions and 45 deletions
+6 -2
View File
@@ -94,15 +94,19 @@ function extractState(locks: string) {
return String(match?.[1] || '').replace(/\s+/g, ' ').trim()
}
export function permanenceLabels(refs: PermanenceRef[] | null | undefined) {
return [...new Set(normalizePermanenceRefs(refs).map(item => item.label).filter(Boolean))]
}
function permanenceLine(refs: PermanenceRef[]) {
const labels = [...new Set(refs.map(item => item.label).filter(Boolean))]
const labels = permanenceLabels(refs)
if (!labels.length) return ''
return `Permanence: ${labels.join(', ')} stay the same.`
}
function inheritLine(locks: string, refs: PermanenceRef[]) {
const parts = ['[INHERITS] Global locks.']
const labels = [...new Set(refs.map(item => item.label).filter(Boolean))]
const labels = permanenceLabels(refs)
if (labels.length) parts.push(`Same ${labels.join(', ')} as locked.`)
const state = extractState(locks)
if (state) parts.push(`State: ${state}`)