diff --git a/.claude/skills/skd-compile/scripts/skd-compile.ps1 b/.claude/skills/skd-compile/scripts/skd-compile.ps1 index 7f873e3a..5041e49c 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.59 — Compile 1C DCS from JSON +# skd-compile v1.60 — Compile 1C DCS from JSON # Source: https://github.com/Nikolay-Shirokov/cc-1c-skills param( [string]$DefinitionFile, @@ -2314,6 +2314,15 @@ function Emit-OutputParameters { foreach ($prop in $params.PSObject.Properties) { $key = $prop.Name $rawVal = $prop.Value + # Распознаём wrapper {use: false, value: ...} (отличаем от multilang dict) + $useWrapper = $false + if ($rawVal -is [PSCustomObject] -and $rawVal.PSObject.Properties['use'] -and $rawVal.use -eq $false -and $rawVal.PSObject.Properties['value']) { + $useWrapper = $true + $rawVal = $rawVal.value + } elseif (($rawVal -is [hashtable] -or $rawVal -is [System.Collections.IDictionary]) -and $rawVal.Contains('use') -and $rawVal['use'] -eq $false -and $rawVal.Contains('value')) { + $useWrapper = $true + $rawVal = $rawVal['value'] + } $ptype = $script:outputParamTypes[$key] if (-not $ptype) { $ptype = "xs:string" } # Auto-promote to mltext if value is a multilang dict ({ru, en, ...}) @@ -2322,6 +2331,7 @@ function Emit-OutputParameters { } X "$indent`t" + if ($useWrapper) { X "$indent`t`tfalse" } X "$indent`t`t$(Esc-Xml $key)" if ($ptype -eq "mltext") { Emit-MLText -tag "dcscor:value" -text $rawVal -indent "$indent`t`t" diff --git a/.claude/skills/skd-compile/scripts/skd-compile.py b/.claude/skills/skd-compile/scripts/skd-compile.py index e098adf4..86f55559 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.59 — Compile 1C DCS from JSON +# skd-compile v1.60 — Compile 1C DCS from JSON # Source: https://github.com/Nikolay-Shirokov/cc-1c-skills import argparse import json @@ -1931,12 +1931,19 @@ def emit_output_parameters(lines, params, indent): lines.append(f'{indent}') for key, val in params.items(): + # Распознаём wrapper {use: false, value: ...} — отличаем от multilang dict + use_wrapper = False + if isinstance(val, dict) and val.get('use') is False and 'value' in val: + use_wrapper = True + val = val['value'] ptype = OUTPUT_PARAM_TYPES.get(key, 'xs:string') # Auto-promote to mltext if value is a multilang dict ({ru, en, ...}) if isinstance(val, dict): ptype = 'mltext' lines.append(f'{indent}\t') + if use_wrapper: + lines.append(f'{indent}\t\tfalse') lines.append(f'{indent}\t\t{esc_xml(key)}') if ptype == 'mltext': emit_mltext(lines, f'{indent}\t\t', 'dcscor:value', val)