diff --git a/.claude/skills/skd-compile/scripts/skd-compile.ps1 b/.claude/skills/skd-compile/scripts/skd-compile.ps1 index 6acd0e77..a250d357 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.36 — Compile 1C DCS from JSON +# skd-compile v1.37 — Compile 1C DCS from JSON # Source: https://github.com/Nikolay-Shirokov/cc-1c-skills param( [string]$DefinitionFile, @@ -2135,16 +2135,20 @@ function Emit-OutputParameters { X "$indent" foreach ($prop in $params.PSObject.Properties) { $key = $prop.Name - $val = "$($prop.Value)" + $rawVal = $prop.Value $ptype = $script:outputParamTypes[$key] if (-not $ptype) { $ptype = "xs:string" } + # Auto-promote to mltext if value is a multilang dict ({ru, en, ...}) + if ($rawVal -is [System.Management.Automation.PSCustomObject] -or $rawVal -is [hashtable] -or $rawVal -is [System.Collections.IDictionary]) { + $ptype = "mltext" + } X "$indent`t" X "$indent`t`t$(Esc-Xml $key)" if ($ptype -eq "mltext") { - Emit-MLText -tag "dcscor:value" -text $val -indent "$indent`t`t" + Emit-MLText -tag "dcscor:value" -text $rawVal -indent "$indent`t`t" } else { - X "$indent`t`t$(Esc-Xml $val)" + X "$indent`t`t$(Esc-Xml "$rawVal")" } X "$indent`t" } diff --git a/.claude/skills/skd-compile/scripts/skd-compile.py b/.claude/skills/skd-compile/scripts/skd-compile.py index ffcbd385..4a36feda 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.36 — Compile 1C DCS from JSON +# skd-compile v1.37 — Compile 1C DCS from JSON # Source: https://github.com/Nikolay-Shirokov/cc-1c-skills import argparse import json @@ -1776,15 +1776,17 @@ def emit_output_parameters(lines, params, indent): lines.append(f'{indent}') for key, val in params.items(): - val_str = str(val) 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') lines.append(f'{indent}\t\t{esc_xml(key)}') if ptype == 'mltext': - emit_mltext(lines, f'{indent}\t\t', 'dcscor:value', val_str) + emit_mltext(lines, f'{indent}\t\t', 'dcscor:value', val) else: - lines.append(f'{indent}\t\t{esc_xml(val_str)}') + lines.append(f'{indent}\t\t{esc_xml(str(val))}') lines.append(f'{indent}\t') lines.append(f'{indent}')