diff --git a/.claude/skills/skd-compile/scripts/skd-compile.ps1 b/.claude/skills/skd-compile/scripts/skd-compile.ps1 index 5545484a..a8efd93d 100644 --- a/.claude/skills/skd-compile/scripts/skd-compile.ps1 +++ b/.claude/skills/skd-compile/scripts/skd-compile.ps1 @@ -1,4 +1,4 @@ -# skd-compile v1.76 — Compile 1C DCS from JSON +# skd-compile v1.77 — Compile 1C DCS from JSON # Source: https://github.com/Nikolay-Shirokov/cc-1c-skills param( [string]$DefinitionFile, @@ -1314,12 +1314,20 @@ function Emit-SingleParam { if (Test-EmptyValue $av.value) { Emit-EmptyValue -type $parsed.type -indent "`t`t`t" -tagPrefix "" -valueListAllowed $false } else { - $avVal = "$($av.value)" - $avType = "xs:string" - if ($avVal -match '^(Перечисление|Справочник|ПланСчетов|Документ|ПланВидовХарактеристик|ПланВидовРасчета)\.') { - $avType = "dcscor:DesignTimeValue" + $av_v = $av.value + if ($av_v -is [bool]) { + $bv = "$av_v".ToLower() + X "`t`t`t$bv" + } elseif ($av_v -is [int] -or $av_v -is [long] -or $av_v -is [double]) { + X "`t`t`t$av_v" + } else { + $avVal = "$av_v" + $avType = "xs:string" + if ($avVal -match '^(Перечисление|Справочник|ПланСчетов|Документ|ПланВидовХарактеристик|ПланВидовРасчета)\.') { + $avType = "dcscor:DesignTimeValue" + } + X "`t`t`t$(Esc-Xml $avVal)" } - X "`t`t`t$(Esc-Xml $avVal)" } # `title` accepted as synonym of `presentation` — both map to the same UI label. $avPres = if ($av.presentation) { $av.presentation } elseif ($av.title) { $av.title } else { "" } diff --git a/.claude/skills/skd-compile/scripts/skd-compile.py b/.claude/skills/skd-compile/scripts/skd-compile.py index 06dc935a..d2c9386e 100644 --- a/.claude/skills/skd-compile/scripts/skd-compile.py +++ b/.claude/skills/skd-compile/scripts/skd-compile.py @@ -1,5 +1,5 @@ #!/usr/bin/env python3 -# skd-compile v1.76 — Compile 1C DCS from JSON +# skd-compile v1.77 — Compile 1C DCS from JSON # Source: https://github.com/Nikolay-Shirokov/cc-1c-skills import argparse import json @@ -1126,11 +1126,17 @@ def emit_single_param(lines, p, parsed): if is_empty_value(av.get('value')): emit_empty_value(lines, parsed.get('type', ''), '\t\t\t', '', False) else: - av_val = str(av.get('value', '')) - av_type = 'xs:string' - if re.match(r'^(Перечисление|Справочник|ПланСчетов|Документ|ПланВидовХарактеристик|ПланВидовРасчета)\.', av_val): - av_type = 'dcscor:DesignTimeValue' - lines.append(f'\t\t\t{esc_xml(av_val)}') + av_v = av['value'] + if isinstance(av_v, bool): + lines.append(f'\t\t\t{str(av_v).lower()}') + elif isinstance(av_v, (int, float)): + lines.append(f'\t\t\t{av_v}') + else: + av_val = str(av_v) + av_type = 'xs:string' + if re.match(r'^(Перечисление|Справочник|ПланСчетов|Документ|ПланВидовХарактеристик|ПланВидовРасчета)\.', av_val): + av_type = 'dcscor:DesignTimeValue' + lines.append(f'\t\t\t{esc_xml(av_val)}') # `title` accepted as synonym of `presentation` — both map to the same UI label. av_pres = av.get('presentation') or av.get('title') or '' if av_pres: diff --git a/.claude/skills/skd-decompile/scripts/skd-decompile.ps1 b/.claude/skills/skd-decompile/scripts/skd-decompile.ps1 index 8b4db335..12334afa 100644 --- a/.claude/skills/skd-decompile/scripts/skd-decompile.ps1 +++ b/.claude/skills/skd-decompile/scripts/skd-decompile.ps1 @@ -1,4 +1,4 @@ -# skd-decompile v0.59 — Decompile 1C DCS Template.xml to JSON DSL (draft) +# skd-decompile v0.61 — Decompile 1C DCS Template.xml to JSON DSL (draft) # Source: https://github.com/Nikolay-Shirokov/cc-1c-skills param( [Parameter(Mandatory)] @@ -764,7 +764,16 @@ function Build-Parameter { $avValNode = $av.SelectSingleNode("r:value", $ns) $avPresNode = $av.SelectSingleNode("r:presentation", $ns) $avEntry = [ordered]@{} - if ($avValNode) { $avEntry['value'] = $avValNode.InnerText } + if ($avValNode) { + $avType = Get-LocalXsiType $avValNode + $avText = $avValNode.InnerText + if ($avType -eq 'boolean') { $avEntry['value'] = ($avText -eq 'true') } + elseif ($avType -eq 'decimal') { + if ($avText -match '^-?\d+$') { $avEntry['value'] = [int]$avText } + else { $avEntry['value'] = [double]$avText } + } + else { $avEntry['value'] = $avText } + } if ($avPresNode) { $avEntry['presentation'] = Get-MLText $avPresNode } $availableValues += $avEntry } @@ -1350,6 +1359,12 @@ function Get-FilterValueWithType { } $txt = $valNode.InnerText if (-not $txt) { return @{ value = '_'; type = $rawType } } + # Конвертация по типу — compile различает [bool]/[int]/[double] для auto-detect xsi:type. + if ($vType -eq 'boolean') { return @{ value = ($txt -eq 'true'); type = $rawType } } + if ($vType -eq 'decimal') { + if ($txt -match '^-?\d+$') { return @{ value = [int]$txt; type = $rawType } } + return @{ value = [double]$txt; type = $rawType } + } return @{ value = $txt; type = $rawType } } @@ -1477,7 +1492,11 @@ function Build-FilterItem { if ($op -in $noValueOps) { $s += " $op" } else { - $vDisplay = if ($null -ne $value -and "$value" -ne '') { "$value" } else { '_' } + $vDisplay = '_' + if ($null -ne $value) { + if ($value -is [bool]) { $vDisplay = if ($value) { 'true' } else { 'false' } } + elseif ("$value" -ne '') { $vDisplay = "$value" } + } $s += " $op $vDisplay" } if ($flags) { $s += ' ' + ($flags -join ' ') }