diff --git a/.claude/skills/cf-edit/scripts/cf-edit.ps1 b/.claude/skills/cf-edit/scripts/cf-edit.ps1 index 7b5c244b..45faa035 100644 --- a/.claude/skills/cf-edit/scripts/cf-edit.ps1 +++ b/.claude/skills/cf-edit/scripts/cf-edit.ps1 @@ -1,4 +1,4 @@ -# cf-edit v1.2 — Edit 1C configuration root (Configuration.xml) +# cf-edit v1.3 — Edit 1C configuration root (Configuration.xml) # Source: https://github.com/Nikolay-Shirokov/cc-1c-skills param( [Parameter(Mandatory)][Alias('Path')][string]$ConfigPath, @@ -445,6 +445,7 @@ function Do-RemoveDefaultRole([string]$batchVal) { } # --- Operation: set-panels --- +# Canonical English aliases — preferred form, used in docs and error messages. $script:panelUuids = @{ "sections" = "b553047f-c9aa-4157-978d-448ecad24248" "open" = "cbab57f2-a0f3-4f0a-89ea-4cb19570ab75" @@ -452,15 +453,26 @@ $script:panelUuids = @{ "history" = "c933ac92-92cd-459d-81cc-e0c8a83ced99" "functions" = "b2735bd3-d822-4430-ba59-c9e869693b24" } +# Russian synonyms — silently accepted (cf-info displays Russian names; users +# may copy them straight into cf-edit value). +$script:panelSynonyms = @{ + "разделов" = "sections"; "разделы" = "sections" + "открытых" = "open"; "открытые" = "open" + "избранного" = "favorites";"избранное" = "favorites" + "истории" = "history"; "история" = "history" + "функций" = "functions";"функции" = "functions" +} function Build-PanelEntryXml($entry, [string]$indent) { # String alias -> ... if ($entry -is [string]) { - if (-not $script:panelUuids.ContainsKey($entry)) { + $key = $entry.ToLowerInvariant() + if ($script:panelSynonyms.ContainsKey($key)) { $key = $script:panelSynonyms[$key] } + if (-not $script:panelUuids.ContainsKey($key)) { Write-Error "Unknown panel alias '$entry'. Allowed: $(($script:panelUuids.Keys | Sort-Object) -join ', ')" exit 1 } - $u = $script:panelUuids[$entry] + $u = $script:panelUuids[$key] $instId = [guid]::NewGuid().ToString() return "$indent`r`n$indent`t$u`r`n$indent" } diff --git a/.claude/skills/cf-edit/scripts/cf-edit.py b/.claude/skills/cf-edit/scripts/cf-edit.py index 6cdd2591..ca679bb8 100644 --- a/.claude/skills/cf-edit/scripts/cf-edit.py +++ b/.claude/skills/cf-edit/scripts/cf-edit.py @@ -1,5 +1,5 @@ #!/usr/bin/env python3 -# cf-edit v1.2 — Edit 1C configuration root (Configuration.xml) +# cf-edit v1.3 — Edit 1C configuration root (Configuration.xml) # Source: https://github.com/Nikolay-Shirokov/cc-1c-skills import argparse @@ -495,6 +495,7 @@ def main(): info(f"Set DefaultRoles: {len(items)} roles") # --- set-panels (writes Ext/ClientApplicationInterface.xml from scratch) --- + # Canonical English aliases — preferred form, used in docs and error messages. PANEL_UUIDS = { "sections": "b553047f-c9aa-4157-978d-448ecad24248", "open": "cbab57f2-a0f3-4f0a-89ea-4cb19570ab75", @@ -502,15 +503,26 @@ def main(): "history": "c933ac92-92cd-459d-81cc-e0c8a83ced99", "functions": "b2735bd3-d822-4430-ba59-c9e869693b24", } + # Russian synonyms — silently accepted (cf-info displays Russian names; + # users may copy them straight into cf-edit value). + PANEL_SYNONYMS = { + "разделов": "sections", "разделы": "sections", + "открытых": "open", "открытые": "open", + "избранного": "favorites","избранное": "favorites", + "истории": "history", "история": "history", + "функций": "functions", "функции": "functions", + } def build_panel_entry_xml(entry, indent): if isinstance(entry, str): - if entry not in PANEL_UUIDS: + key = entry.lower() + key = PANEL_SYNONYMS.get(key, key) + if key not in PANEL_UUIDS: allowed = ", ".join(sorted(PANEL_UUIDS.keys())) print(f"Unknown panel alias '{entry}'. Allowed: {allowed}", file=sys.stderr) sys.exit(1) inst = str(_uuid.uuid4()) - return f'{indent}\r\n{indent}\t{PANEL_UUIDS[entry]}\r\n{indent}' + return f'{indent}\r\n{indent}\t{PANEL_UUIDS[key]}\r\n{indent}' if isinstance(entry, dict) and "group" in entry: children = entry["group"] if not children: