Merge branch 'dev'

This commit is contained in:
Nick Shirokov
2026-02-21 20:03:06 +03:00
9 changed files with 108 additions and 4 deletions
+9
View File
@@ -118,6 +118,15 @@ if ($UserName) { $argString += " /N`"$UserName`"" }
if ($Password) { $argString += " /P`"$Password`"" }
# --- Optional params ---
if ($Execute) {
$ext = [System.IO.Path]::GetExtension($Execute).ToLower()
if ($ext -eq ".erf") {
Write-Host "[WARN] /Execute не поддерживает ERF-файлы (внешние отчёты)." -ForegroundColor Yellow
Write-Host " Откройте отчёт через «Файл -> Открыть»: $Execute" -ForegroundColor Yellow
Write-Host " Запускаю базу без /Execute." -ForegroundColor Yellow
$Execute = ""
}
}
if ($Execute) {
$argString += " /Execute `"$Execute`""
}
@@ -22,8 +22,11 @@ if (-not [System.IO.Path]::IsPathRooted($ObjectPath)) {
if (Test-Path $ObjectPath -PathType Container) {
$dirName = Split-Path $ObjectPath -Leaf
$candidate = Join-Path $ObjectPath "$dirName.xml"
$sibling = Join-Path (Split-Path $ObjectPath) "$dirName.xml"
if (Test-Path $candidate) {
$ObjectPath = $candidate
} elseif (Test-Path $sibling) {
$ObjectPath = $sibling
} else {
$xmlFiles = @(Get-ChildItem $ObjectPath -Filter "*.xml" -File | Select-Object -First 1)
if ($xmlFiles.Count -gt 0) {
@@ -35,6 +38,16 @@ if (Test-Path $ObjectPath -PathType Container) {
}
}
# File not found — check Dir/Name/Name.xml → Dir/Name.xml
if (-not (Test-Path $ObjectPath)) {
$fileName = [System.IO.Path]::GetFileNameWithoutExtension($ObjectPath)
$parentDir = Split-Path $ObjectPath
$parentDirName = Split-Path $parentDir -Leaf
if ($fileName -eq $parentDirName) {
$candidate = Join-Path (Split-Path $parentDir) "$fileName.xml"
if (Test-Path $candidate) { $ObjectPath = $candidate }
}
}
if (-not (Test-Path $ObjectPath)) {
Write-Host "[ERROR] File not found: $ObjectPath"
exit 1
+14 -1
View File
@@ -58,13 +58,26 @@ if ($DefinitionFile) {
if (Test-Path $ObjectPath -PathType Container) {
$dirName = Split-Path $ObjectPath -Leaf
$candidate = Join-Path $ObjectPath "$dirName.xml"
$sibling = Join-Path (Split-Path $ObjectPath) "$dirName.xml"
if (Test-Path $candidate) {
$ObjectPath = $candidate
} elseif (Test-Path $sibling) {
$ObjectPath = $sibling
} else {
Write-Error "Directory given but no $dirName.xml found inside"
Write-Error "Directory given but no $dirName.xml found inside or as sibling"
exit 1
}
}
# File not found — check Dir/Name/Name.xml → Dir/Name.xml
if (-not (Test-Path $ObjectPath)) {
$fileName = [System.IO.Path]::GetFileNameWithoutExtension($ObjectPath)
$parentDir = Split-Path $ObjectPath
$parentDirName = Split-Path $parentDir -Leaf
if ($fileName -eq $parentDirName) {
$candidate = Join-Path (Split-Path $parentDir) "$fileName.xml"
if (Test-Path $candidate) { $ObjectPath = $candidate }
}
}
if (-not (Test-Path $ObjectPath)) {
Write-Error "Object file not found: $ObjectPath"
exit 1
+1 -1
View File
@@ -1,6 +1,6 @@
---
name: meta-info
description: Анализ структуры объекта метаданных 1С из XML-выгрузки — реквизиты, табличные части, формы, движения, типы. Используй для изучения структуры объектов и как подготовительный шаг при написании запросов и кода, работающего с объектами
description: Анализ структуры объекта метаданных 1С из XML-выгрузки — реквизиты, табличные части, формы, движения, типы. Используй для изучения структуры объектов (вместо чтения XML-файлов напрямую) и как подготовительный шаг при написании запросов и кода, работающего с объектами
argument-hint: <ObjectPath> [-Mode overview|brief|full] [-Name <элемент>]
allowed-tools:
- Bash
+14 -1
View File
@@ -22,12 +22,15 @@ if (-not [System.IO.Path]::IsPathRooted($ObjectPath)) {
$ObjectPath = Join-Path (Get-Location).Path $ObjectPath
}
# Directory -> find XML inside
# Directory -> find XML inside or as sibling
if (Test-Path $ObjectPath -PathType Container) {
$dirName = Split-Path $ObjectPath -Leaf
$candidate = Join-Path $ObjectPath "$dirName.xml"
$sibling = Join-Path (Split-Path $ObjectPath) "$dirName.xml"
if (Test-Path $candidate) {
$ObjectPath = $candidate
} elseif (Test-Path $sibling) {
$ObjectPath = $sibling
} else {
$xmlFiles = @(Get-ChildItem $ObjectPath -Filter "*.xml" -File | Select-Object -First 1)
if ($xmlFiles.Count -gt 0) {
@@ -39,6 +42,16 @@ if (Test-Path $ObjectPath -PathType Container) {
}
}
# File not found — check Dir/Name/Name.xml → Dir/Name.xml (common LLM mistake)
if (-not (Test-Path $ObjectPath)) {
$fileName = [System.IO.Path]::GetFileNameWithoutExtension($ObjectPath)
$parentDir = Split-Path $ObjectPath
$parentDirName = Split-Path $parentDir -Leaf
if ($fileName -eq $parentDirName) {
$candidate = Join-Path (Split-Path $parentDir) "$fileName.xml"
if (Test-Path $candidate) { $ObjectPath = $candidate }
}
}
if (-not (Test-Path $ObjectPath)) {
Write-Host "[ERROR] File not found: $ObjectPath"
exit 1
@@ -21,8 +21,11 @@ if (-not [System.IO.Path]::IsPathRooted($ObjectPath)) {
if (Test-Path $ObjectPath -PathType Container) {
$dirName = Split-Path $ObjectPath -Leaf
$candidate = Join-Path $ObjectPath "$dirName.xml"
$sibling = Join-Path (Split-Path $ObjectPath) "$dirName.xml"
if (Test-Path $candidate) {
$ObjectPath = $candidate
} elseif (Test-Path $sibling) {
$ObjectPath = $sibling
} else {
$xmlFiles = @(Get-ChildItem $ObjectPath -Filter "*.xml" -File | Select-Object -First 1)
if ($xmlFiles.Count -gt 0) {
@@ -34,6 +37,16 @@ if (Test-Path $ObjectPath -PathType Container) {
}
}
# File not found — check Dir/Name/Name.xml → Dir/Name.xml
if (-not (Test-Path $ObjectPath)) {
$fileName = [System.IO.Path]::GetFileNameWithoutExtension($ObjectPath)
$parentDir = Split-Path $ObjectPath
$parentDirName = Split-Path $parentDir -Leaf
if ($fileName -eq $parentDirName) {
$candidate = Join-Path (Split-Path $parentDir) "$fileName.xml"
if (Test-Path $candidate) { $ObjectPath = $candidate }
}
}
if (-not (Test-Path $ObjectPath)) {
Write-Host "[ERROR] File not found: $ObjectPath"
exit 1
@@ -23,8 +23,19 @@ if (-not [System.IO.Path]::IsPathRooted($SubsystemPath)) {
if (Test-Path $SubsystemPath -PathType Container) {
$dirName = Split-Path $SubsystemPath -Leaf
$candidate = Join-Path $SubsystemPath "$dirName.xml"
$sibling = Join-Path (Split-Path $SubsystemPath) "$dirName.xml"
if (Test-Path $candidate) { $SubsystemPath = $candidate }
else { Write-Error "No $dirName.xml found in directory"; exit 1 }
elseif (Test-Path $sibling) { $SubsystemPath = $sibling }
else { Write-Error "No $dirName.xml found in directory or as sibling"; exit 1 }
}
# File not found — check Dir/Name/Name.xml → Dir/Name.xml
if (-not (Test-Path $SubsystemPath)) {
$fn = [System.IO.Path]::GetFileNameWithoutExtension($SubsystemPath)
$pd = Split-Path $SubsystemPath
if ($fn -eq (Split-Path $pd -Leaf)) {
$c = Join-Path (Split-Path $pd) "$fn.xml"
if (Test-Path $c) { $SubsystemPath = $c }
}
}
if (-not (Test-Path $SubsystemPath)) { Write-Error "File not found: $SubsystemPath"; exit 1 }
$resolvedPath = (Resolve-Path $SubsystemPath).Path
@@ -383,6 +383,15 @@ if ($Mode -eq "tree") {
Write-Host "[ERROR] ci mode requires a subsystem .xml file, not a directory"
exit 1
}
# File not found — check Dir/Name/Name.xml → Dir/Name.xml
if (-not (Test-Path $SubsystemPath)) {
$fn = [System.IO.Path]::GetFileNameWithoutExtension($SubsystemPath)
$pd = Split-Path $SubsystemPath
if ($fn -eq (Split-Path $pd -Leaf)) {
$c = Join-Path (Split-Path $pd) "$fn.xml"
if (Test-Path $c) { $SubsystemPath = $c }
}
}
if (-not (Test-Path $SubsystemPath)) {
Write-Host "[ERROR] File not found: $SubsystemPath"
exit 1
@@ -402,14 +411,26 @@ if ($Mode -eq "tree") {
if (Test-Path $SubsystemPath -PathType Container) {
$dirName = Split-Path $SubsystemPath -Leaf
$candidate = Join-Path $SubsystemPath "$dirName.xml"
$sibling = Join-Path (Split-Path $SubsystemPath) "$dirName.xml"
if (Test-Path $candidate) {
$SubsystemPath = $candidate
} elseif (Test-Path $sibling) {
$SubsystemPath = $sibling
} else {
Write-Host "[ERROR] No $dirName.xml found in directory. Use -Mode tree for directory listing."
exit 1
}
}
# File not found — check Dir/Name/Name.xml → Dir/Name.xml
if (-not (Test-Path $SubsystemPath)) {
$fn = [System.IO.Path]::GetFileNameWithoutExtension($SubsystemPath)
$pd = Split-Path $SubsystemPath
if ($fn -eq (Split-Path $pd -Leaf)) {
$c = Join-Path (Split-Path $pd) "$fn.xml"
if (Test-Path $c) { $SubsystemPath = $c }
}
}
if (-not (Test-Path $SubsystemPath)) {
Write-Host "[ERROR] File not found: $SubsystemPath"
exit 1
@@ -16,12 +16,23 @@ if (-not [System.IO.Path]::IsPathRooted($SubsystemPath)) {
if (Test-Path $SubsystemPath -PathType Container) {
$dirName = Split-Path $SubsystemPath -Leaf
$candidate = Join-Path $SubsystemPath "$dirName.xml"
$sibling = Join-Path (Split-Path $SubsystemPath) "$dirName.xml"
if (Test-Path $candidate) { $SubsystemPath = $candidate }
elseif (Test-Path $sibling) { $SubsystemPath = $sibling }
else {
Write-Host "[ERROR] No $dirName.xml found in directory: $SubsystemPath"
exit 1
}
}
# File not found — check Dir/Name/Name.xml → Dir/Name.xml
if (-not (Test-Path $SubsystemPath)) {
$fn = [System.IO.Path]::GetFileNameWithoutExtension($SubsystemPath)
$pd = Split-Path $SubsystemPath
if ($fn -eq (Split-Path $pd -Leaf)) {
$c = Join-Path (Split-Path $pd) "$fn.xml"
if (Test-Path $c) { $SubsystemPath = $c }
}
}
if (-not (Test-Path $SubsystemPath)) {
Write-Host "[ERROR] File not found: $SubsystemPath"
exit 1