feat: choose project or session for text commands

This commit is contained in:
muena
2026-10-19 06:34:07 +02:00
parent 65134735f1
commit ebf78128c4
28 changed files with 386 additions and 641 deletions

View File

@@ -8,9 +8,12 @@ export function mappingRoot(key: string, mapping: PlaceholderMapping): string {
while (mapping[current].merged_into) {
if (seen.has(current)) throw new Error(`Zyklische Zuordnung: ${key}`);
seen.add(current);
const target = mapping[current].merged_into!;
const reference = mapping[current].merged_into!;
const target = mapping[reference] ? reference
: mapping[`<${reference.replace(/^<|>$/g, "")}>`] ? `<${reference.replace(/^<|>$/g, "")}>`
: reference.replace(/^<|>$/g, "");
if (!mapping[target] || mapping[target].type !== initial.type) {
throw new Error(`Ungültiger Hauptbegriff für ${key}: ${target}`);
throw new Error(`Ungültiger Hauptbegriff für ${key}: ${reference}`);
}
current = target;
}