@uipath/skills 1.206.0 → 1.206.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude-plugin/marketplace.json +1 -1
- package/.claude-plugin/plugin.json +1 -1
- package/.cursor-plugin/plugin.json +1 -1
- package/CODEOWNERS +34 -7
- package/README.md +2 -2
- package/package.json +2 -2
- package/skills/uipath-genome/SKILL.md +35 -88
- package/skills/uipath-genome/references/build-guide.md +61 -0
- package/skills/uipath-genome/references/completion-report-guide.md +93 -0
- package/skills/uipath-genome/references/composite-interactions-guide.md +39 -0
- package/skills/uipath-genome/references/configuration-questions-guide.md +68 -0
- package/skills/uipath-genome/references/execution-guide.md +45 -166
- package/skills/uipath-genome/references/execution-parts-guide.md +84 -17
- package/skills/uipath-genome/references/genome-reading-guide.md +153 -0
- package/skills/uipath-genome/references/live-application-guide.md +23 -9
- package/skills/uipath-genome/references/offline-definition-workarounds-guide.md +4 -4
- package/skills/uipath-genome/references/open-items-guide.md +3 -3
- package/skills/uipath-genome/references/package-doc-errata-guide.md +8 -0
- package/skills/uipath-genome/references/refactor-guide.md +38 -39
- package/skills/uipath-genome/references/selector-matching-guide.md +59 -0
- package/skills/uipath-genome/references/selector-translation-guide.md +13 -66
- package/skills/uipath-genome/references/selector-translation-sap-guide.md +7 -5
- package/skills/uipath-genome/references/selector-translation-web-guide.md +2 -2
- package/skills/uipath-genome/references/source-frameworks-guide.md +21 -0
- package/skills/uipath-genome/references/source-migration-guide.md +48 -19
- package/skills/uipath-genome/references/test-execution-guide.md +8 -7
- package/skills/uipath-genome/references/transactional-execution-guide.md +41 -13
- package/skills/uipath-genome/references/ui-target-migration-guide.md +12 -49
- package/skills/uipath-genome/references/ui-verification-guide.md +9 -1
- package/skills/uipath-maestro-case/SKILL.md +7 -7
- package/skills/uipath-maestro-case/references/evals/evals.json +5 -5
- package/skills/uipath-maestro-case/references/planning.md +5 -5
- package/skills/uipath-maestro-case/references/plugins/conditions/task-entry-conditions/planning.md +2 -2
- package/skills/uipath-maestro-case/references/plugins/sla/planning.md +1 -1
- package/skills/uipath-maestro-case/references/registry-discovery.md +3 -3
- package/skills/uipath-planner/SKILL.md +80 -199
- package/skills/uipath-planner/assets/templates/agent-sdd-template.md +17 -17
- package/skills/uipath-planner/assets/templates/api-workflow-sdd-template.md +15 -13
- package/skills/uipath-planner/assets/templates/bpmn-sdd-template.md +19 -19
- package/skills/uipath-planner/assets/templates/case-sdd-task-details-template.md +173 -0
- package/skills/uipath-planner/assets/templates/{case/case-sdd-template.md → case-sdd-template.md} +51 -229
- package/skills/uipath-planner/assets/templates/coded-app-sdd-template.md +16 -14
- package/skills/{uipath-genome → uipath-planner}/assets/templates/component-genome-template.md +9 -5
- package/skills/uipath-planner/assets/templates/flow-sdd-template.md +17 -15
- package/skills/{uipath-genome → uipath-planner}/assets/templates/process-genome-template.md +11 -7
- package/skills/uipath-planner/assets/templates/rpa-sdd-template.md +50 -73
- package/skills/uipath-planner/references/author/author-guide.md +119 -0
- package/skills/uipath-planner/references/author/genome-from-sdd-guide.md +36 -0
- package/skills/uipath-planner/references/author/scenario-proposal-guide.md +30 -0
- package/skills/uipath-planner/references/decompose/decompose-guide.md +223 -0
- package/skills/uipath-planner/references/{asdd-crosswalk-guide.md → design/asdd-crosswalk-guide.md} +6 -4
- package/skills/uipath-planner/references/{business-rules-guide.md → design/business-rules-guide.md} +3 -3
- package/skills/uipath-planner/references/design/caller-request-guide.md +92 -0
- package/skills/uipath-planner/references/design/case-data-and-time-guide.md +292 -0
- package/skills/uipath-planner/references/design/case-product-guide.md +243 -0
- package/skills/uipath-planner/references/design/case-review-and-conformance-guide.md +166 -0
- package/skills/uipath-planner/references/design/design-guide.md +296 -0
- package/skills/uipath-planner/references/{package-selection-guide.md → design/package-selection-guide.md} +16 -13
- package/skills/uipath-planner/references/{rpa-product-guide.md → design/rpa-product-guide.md} +23 -53
- package/skills/uipath-planner/references/design/scope-recommendation-guide.md +134 -0
- package/skills/uipath-planner/references/design/sdd-writing-guide.md +235 -0
- package/skills/uipath-planner/references/design/solution-composition-guide.md +153 -0
- package/skills/uipath-planner/references/edit/edit-guide.md +66 -0
- package/skills/uipath-planner/references/extract/extract-guide.md +230 -0
- package/skills/uipath-planner/references/extract/source-frameworks-guide.md +22 -0
- package/skills/uipath-planner/references/extract/uipath-non-rpa-signals-guide.md +121 -0
- package/skills/uipath-planner/references/extract/uipath-rpa-signals-guide.md +88 -0
- package/skills/uipath-planner/references/extract/uipath-source-guide.md +193 -0
- package/skills/uipath-planner/references/shared/component-placement-guide.md +99 -0
- package/skills/{uipath-genome/references → uipath-planner/references/shared}/defect-verification-guide.md +4 -4
- package/skills/{uipath-genome/references → uipath-planner/references/shared}/extracted-genome-guide.md +15 -14
- package/skills/uipath-planner/references/shared/extraction-parts-guide.md +66 -0
- package/skills/{uipath-genome/references → uipath-planner/references/shared}/genome-format-guide.md +63 -34
- package/skills/uipath-planner/references/{multi-skill-patterns-guide.md → shared/multi-skill-patterns-guide.md} +28 -27
- package/skills/uipath-planner/references/{pdd-analysis-guide.md → shared/pdd-analysis-guide.md} +27 -72
- package/skills/uipath-planner/references/{plan-and-tasks-format.md → shared/plan-and-tasks-format.md} +43 -67
- package/skills/uipath-planner/references/{platform-availability-guide.md → shared/platform-availability-guide.md} +56 -1
- package/skills/uipath-planner/references/shared/product-selection-guide.md +202 -0
- package/skills/{uipath-genome/references → uipath-planner/references/shared}/skill-mapping-guide.md +24 -4
- package/skills/uipath-planner/references/{tenant-library-search-guide.md → shared/tenant-library-search-guide.md} +10 -8
- package/skills/{uipath-genome/references → uipath-planner/references/shared}/transactional-shape-guide.md +39 -8
- package/skills/uipath-planner/scripts/check-genome.mjs +801 -0
- package/skills/uipath-planner/scripts/sdd-fingerprint.mjs +71 -0
- package/skills/uipath-planner/scripts/sdd-to-docx.mjs +87 -0
- package/skills/uipath-test/SKILL.md +3 -3
- package/version-manifest.json +1 -1
- package/skills/uipath-genome/CLAUDE.md +0 -85
- package/skills/uipath-genome/assets/examples/artemis-2-mission-monitor-genome.md +0 -126
- package/skills/uipath-genome/assets/examples/classify-document-and-create-validation-genome.md +0 -117
- package/skills/uipath-genome/assets/examples/invoice-processing-genome/exception-triage-agent-genome.md +0 -96
- package/skills/uipath-genome/assets/examples/invoice-processing-genome/invoice-extraction-genome.md +0 -128
- package/skills/uipath-genome/assets/examples/invoice-processing-genome/invoice-orchestration-genome.md +0 -115
- package/skills/uipath-genome/assets/examples/invoice-processing-genome.md +0 -136
- package/skills/uipath-genome/assets/examples/purchase-requisition-entry-genome.md +0 -224
- package/skills/uipath-genome/assets/examples/salesforce-accounts-and-contacts-genome.md +0 -151
- package/skills/uipath-genome/references/authoring-guide.md +0 -98
- package/skills/uipath-genome/references/editing-guide.md +0 -57
- package/skills/uipath-genome/references/extraction-guide.md +0 -166
- package/skills/uipath-genome/references/extraction-parts-guide.md +0 -45
- package/skills/uipath-genome/references/parts-guide.md +0 -22
- package/skills/uipath-genome/references/uipath-source-guide.md +0 -404
- package/skills/uipath-genome/scripts/check-genome.py +0 -670
- package/skills/uipath-planner/assets/templates/case/sdd-viewer.html +0 -1530
- package/skills/uipath-planner/references/case/case-design-lane-guide.md +0 -327
- package/skills/uipath-planner/references/case/case-design-layers-guide.md +0 -503
- package/skills/uipath-planner/references/case/case-sdd-conformance-checklist.md +0 -123
- package/skills/uipath-planner/references/non-pdd-lane-guide.md +0 -196
- package/skills/uipath-planner/references/pdd-driven-lane-guide.md +0 -210
- package/skills/uipath-planner/references/product-selection-guide.md +0 -673
- package/skills/uipath-planner/references/sdd-generation-guide.md +0 -613
- package/skills/uipath-planner/scripts/docx-extract.ps1 +0 -59
- package/skills/uipath-planner/scripts/docx-extract.sh +0 -54
- package/skills/uipath-planner/scripts/sdd-to-docx.ps1 +0 -74
- package/skills/uipath-planner/scripts/sdd-to-docx.sh +0 -76
- /package/skills/uipath-planner/references/{attended-reauth-pattern-guide.md → design/attended-reauth-pattern-guide.md} +0 -0
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env pwsh
|
|
2
|
-
# Extract a .docx (typically a PDD) to GitHub-flavored Markdown.
|
|
3
|
-
# PowerShell twin of docx-extract.sh — keep behavior IDENTICAL (change both together).
|
|
4
|
-
# Works on Windows PowerShell 5.1 and PowerShell 7+. Requires pandoc on PATH.
|
|
5
|
-
#
|
|
6
|
-
# Usage: docx-extract.ps1 <input.docx> [output.md]
|
|
7
|
-
# output.md defaults to <input-basename>.md in the current directory
|
|
8
|
-
# embedded media lands in <output-basename>-media/
|
|
9
|
-
#
|
|
10
|
-
# Exit codes: 0 success | 1 usage error | 2 pandoc missing | 3 conversion failed
|
|
11
|
-
|
|
12
|
-
function Write-Err($msg) { [Console]::Error.WriteLine($msg) }
|
|
13
|
-
|
|
14
|
-
if ($args.Count -lt 1 -or $args[0] -eq '--help' -or $args[0] -eq '-h') {
|
|
15
|
-
Write-Output "Usage: docx-extract.ps1 <input.docx> [output.md]"
|
|
16
|
-
Write-Output "Converts a .docx to GitHub-flavored Markdown via pandoc."
|
|
17
|
-
Write-Output "Embedded images are extracted to <output-basename>-media/."
|
|
18
|
-
if ($args.Count -lt 1) { exit 1 } else { exit 0 }
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
if (-not (Get-Command pandoc -ErrorAction SilentlyContinue)) {
|
|
22
|
-
Write-Err "ERROR: pandoc is not installed."
|
|
23
|
-
Write-Err "Install it, then re-run:"
|
|
24
|
-
Write-Err " Windows: winget install JohnMacFarlane.Pandoc"
|
|
25
|
-
Write-Err " macOS: brew install pandoc"
|
|
26
|
-
Write-Err " Linux: sudo apt-get install pandoc"
|
|
27
|
-
exit 2
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
$inputPath = $args[0]
|
|
31
|
-
if (-not (Test-Path -LiteralPath $inputPath -PathType Leaf)) {
|
|
32
|
-
Write-Err "ERROR: input file not found: $inputPath"
|
|
33
|
-
exit 1
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
$base = Split-Path -Path $inputPath -Leaf
|
|
37
|
-
$stem = [System.IO.Path]::GetFileNameWithoutExtension($base)
|
|
38
|
-
if ($args.Count -ge 2) { $output = $args[1] } else { $output = "$stem.md" }
|
|
39
|
-
if ($output -match '\.md$') { $mediaDir = ($output -replace '\.md$', '-media') } else { $mediaDir = "$output-media" }
|
|
40
|
-
|
|
41
|
-
$pandocArgs = @($inputPath, '-f', 'docx', '-t', 'gfm', '--wrap=none', "--extract-media=$mediaDir", '-o', $output)
|
|
42
|
-
& pandoc @pandocArgs
|
|
43
|
-
if ($LASTEXITCODE -ne 0) {
|
|
44
|
-
Write-Err "ERROR: pandoc conversion failed for $inputPath"
|
|
45
|
-
exit 3
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
Write-Output "Markdown: $output"
|
|
49
|
-
if (Test-Path -LiteralPath $mediaDir -PathType Container) {
|
|
50
|
-
$files = @(Get-ChildItem -LiteralPath $mediaDir -Recurse -File)
|
|
51
|
-
Write-Output ("Media: {0}/ ({1} file(s))" -f $mediaDir, $files.Count)
|
|
52
|
-
$unreadable = @($files | Where-Object { $_.Extension -match '(?i)\.(emf|wmf)$' } | ForEach-Object { $_.FullName })
|
|
53
|
-
if ($unreadable.Count -gt 0) {
|
|
54
|
-
Write-Err ("WARNING: EMF/WMF media cannot be rendered by the Read tool: " + ($unreadable -join ' '))
|
|
55
|
-
Write-Err "Ask the user for PNG exports of those figures, or mark dependent extractions [SME REVIEW]."
|
|
56
|
-
}
|
|
57
|
-
} else {
|
|
58
|
-
Write-Output "Media: none embedded"
|
|
59
|
-
}
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env bash
|
|
2
|
-
# Extract a .docx document (typically a PDD) to GitHub-flavored Markdown.
|
|
3
|
-
# UTF-8 safe, preserves tables as pipe tables, extracts embedded images
|
|
4
|
-
# (screenshots) to a media folder so the agent can Read them.
|
|
5
|
-
#
|
|
6
|
-
# Usage: docx-extract.sh <input.docx> [output.md]
|
|
7
|
-
# output.md defaults to <input-basename>.md in the current directory
|
|
8
|
-
# embedded media lands in <output-basename>-media/
|
|
9
|
-
#
|
|
10
|
-
# Exit codes: 0 success · 1 usage error · 2 pandoc missing · 3 conversion failed
|
|
11
|
-
set -euo pipefail
|
|
12
|
-
|
|
13
|
-
if [ $# -lt 1 ] || [ "$1" = "--help" ] || [ "$1" = "-h" ]; then
|
|
14
|
-
echo "Usage: docx-extract.sh <input.docx> [output.md]"
|
|
15
|
-
echo "Converts a .docx to GitHub-flavored Markdown via pandoc."
|
|
16
|
-
echo "Embedded images are extracted to <output-basename>-media/."
|
|
17
|
-
[ $# -lt 1 ] && exit 1 || exit 0
|
|
18
|
-
fi
|
|
19
|
-
|
|
20
|
-
if ! command -v pandoc >/dev/null 2>&1; then
|
|
21
|
-
echo "ERROR: pandoc is not installed." >&2
|
|
22
|
-
echo "Install it, then re-run:" >&2
|
|
23
|
-
echo " Windows: winget install JohnMacFarlane.Pandoc" >&2
|
|
24
|
-
echo " macOS: brew install pandoc" >&2
|
|
25
|
-
echo " Linux: sudo apt-get install pandoc" >&2
|
|
26
|
-
exit 2
|
|
27
|
-
fi
|
|
28
|
-
|
|
29
|
-
input="$1"
|
|
30
|
-
if [ ! -f "$input" ]; then
|
|
31
|
-
echo "ERROR: input file not found: $input" >&2
|
|
32
|
-
exit 1
|
|
33
|
-
fi
|
|
34
|
-
|
|
35
|
-
base="$(basename "$input")"
|
|
36
|
-
output="${2:-${base%.*}.md}"
|
|
37
|
-
media_dir="${output%.md}-media"
|
|
38
|
-
|
|
39
|
-
if ! pandoc "$input" -f docx -t gfm --wrap=none --extract-media="$media_dir" -o "$output"; then
|
|
40
|
-
echo "ERROR: pandoc conversion failed for $input" >&2
|
|
41
|
-
exit 3
|
|
42
|
-
fi
|
|
43
|
-
|
|
44
|
-
echo "Markdown: $output"
|
|
45
|
-
if [ -d "$media_dir" ]; then
|
|
46
|
-
echo "Media: $media_dir/ ($(find "$media_dir" -type f | wc -l | tr -d ' ') file(s))"
|
|
47
|
-
unreadable="$(find "$media_dir" -type f \( -iname '*.emf' -o -iname '*.wmf' \) | tr '\n' ' ')"
|
|
48
|
-
if [ -n "${unreadable% }" ]; then
|
|
49
|
-
echo "WARNING: EMF/WMF media cannot be rendered by the Read tool: $unreadable" >&2
|
|
50
|
-
echo "Ask the user for PNG exports of those figures, or mark dependent extractions [SME REVIEW]." >&2
|
|
51
|
-
fi
|
|
52
|
-
else
|
|
53
|
-
echo "Media: none embedded"
|
|
54
|
-
fi
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env pwsh
|
|
2
|
-
# Convert a generated SDD markdown file to a styled Word document.
|
|
3
|
-
# PowerShell twin of sdd-to-docx.sh — keep behavior IDENTICAL (change both together).
|
|
4
|
-
# Works on Windows PowerShell 5.1 and PowerShell 7+. Requires pandoc on PATH.
|
|
5
|
-
# Optional --reference-doc <template.docx> applies a corporate style.
|
|
6
|
-
#
|
|
7
|
-
# Usage: sdd-to-docx.ps1 <sdd.md> [output.docx] [--reference-doc <template.docx>]
|
|
8
|
-
# output.docx defaults to <input-basename>.docx in the current directory
|
|
9
|
-
#
|
|
10
|
-
# Known limitation: mermaid code blocks are NOT rendered — they appear as code.
|
|
11
|
-
#
|
|
12
|
-
# Exit codes: 0 success | 1 usage error | 2 pandoc missing | 3 conversion failed
|
|
13
|
-
|
|
14
|
-
function Write-Err($msg) { [Console]::Error.WriteLine($msg) }
|
|
15
|
-
|
|
16
|
-
if ($args.Count -lt 1 -or $args[0] -eq '--help' -or $args[0] -eq '-h') {
|
|
17
|
-
Write-Output "Usage: sdd-to-docx.ps1 <sdd.md> [output.docx] [--reference-doc <template.docx>]"
|
|
18
|
-
Write-Output "Converts an SDD markdown file to .docx via pandoc, with table of contents."
|
|
19
|
-
Write-Output "--reference-doc applies the styles of an existing Word document."
|
|
20
|
-
if ($args.Count -lt 1) { exit 1 } else { exit 0 }
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
if (-not (Get-Command pandoc -ErrorAction SilentlyContinue)) {
|
|
24
|
-
Write-Err "ERROR: pandoc is not installed."
|
|
25
|
-
Write-Err "Install it, then re-run:"
|
|
26
|
-
Write-Err " Windows: winget install JohnMacFarlane.Pandoc"
|
|
27
|
-
Write-Err " macOS: brew install pandoc"
|
|
28
|
-
Write-Err " Linux: sudo apt-get install pandoc"
|
|
29
|
-
exit 2
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
$inputPath = $args[0]
|
|
33
|
-
if (-not (Test-Path -LiteralPath $inputPath -PathType Leaf)) {
|
|
34
|
-
Write-Err "ERROR: input file not found: $inputPath"
|
|
35
|
-
exit 1
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
$base = Split-Path -Path $inputPath -Leaf
|
|
39
|
-
$stem = [System.IO.Path]::GetFileNameWithoutExtension($base)
|
|
40
|
-
$output = "$stem.docx"
|
|
41
|
-
$reference = ""
|
|
42
|
-
|
|
43
|
-
$i = 1
|
|
44
|
-
while ($i -lt $args.Count) {
|
|
45
|
-
if ($args[$i] -eq '--reference-doc') {
|
|
46
|
-
if (($i + 1) -ge $args.Count) { Write-Err "ERROR: --reference-doc needs a path"; exit 1 }
|
|
47
|
-
$reference = $args[$i + 1]
|
|
48
|
-
$i = $i + 2
|
|
49
|
-
} else {
|
|
50
|
-
$output = $args[$i]
|
|
51
|
-
$i = $i + 1
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
$pandocArgs = @($inputPath, '-f', 'gfm', '-t', 'docx', '--toc', '--toc-depth=2', '-o', $output)
|
|
56
|
-
if ($reference -ne "") {
|
|
57
|
-
if (-not (Test-Path -LiteralPath $reference -PathType Leaf)) {
|
|
58
|
-
Write-Err "ERROR: reference doc not found: $reference"
|
|
59
|
-
exit 1
|
|
60
|
-
}
|
|
61
|
-
$pandocArgs += "--reference-doc=$reference"
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
& pandoc @pandocArgs
|
|
65
|
-
if ($LASTEXITCODE -ne 0) {
|
|
66
|
-
Write-Err "ERROR: pandoc conversion failed for $inputPath"
|
|
67
|
-
exit 3
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
Write-Output "Word document: $output"
|
|
71
|
-
if (Select-String -LiteralPath $inputPath -Pattern '```mermaid' -SimpleMatch -Quiet) {
|
|
72
|
-
Write-Err "NOTE: mermaid diagrams are kept as code blocks, not rendered images."
|
|
73
|
-
Write-Err "Render and place images separately if the deliverable needs visuals."
|
|
74
|
-
}
|
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env bash
|
|
2
|
-
# Convert a generated SDD markdown file to a styled Word document.
|
|
3
|
-
# Optionally takes a corporate .docx as a style reference (--reference-doc)
|
|
4
|
-
# so the output picks up the customer's fonts, heading styles, and margins
|
|
5
|
-
# without committing any template binary to this repo.
|
|
6
|
-
#
|
|
7
|
-
# Usage: sdd-to-docx.sh <sdd.md> [output.docx] [--reference-doc <template.docx>]
|
|
8
|
-
# output.docx defaults to <input-basename>.docx in the current directory
|
|
9
|
-
#
|
|
10
|
-
# Known limitation: mermaid code blocks are NOT rendered — they appear as
|
|
11
|
-
# code in the document. Render them separately (e.g. mermaid-cli) and replace
|
|
12
|
-
# manually if the deliverable needs diagram images.
|
|
13
|
-
#
|
|
14
|
-
# Exit codes: 0 success · 1 usage error · 2 pandoc missing · 3 conversion failed
|
|
15
|
-
set -euo pipefail
|
|
16
|
-
|
|
17
|
-
if [ $# -lt 1 ] || [ "$1" = "--help" ] || [ "$1" = "-h" ]; then
|
|
18
|
-
echo "Usage: sdd-to-docx.sh <sdd.md> [output.docx] [--reference-doc <template.docx>]"
|
|
19
|
-
echo "Converts an SDD markdown file to .docx via pandoc, with table of contents."
|
|
20
|
-
echo "--reference-doc applies the styles of an existing Word document."
|
|
21
|
-
[ $# -lt 1 ] && exit 1 || exit 0
|
|
22
|
-
fi
|
|
23
|
-
|
|
24
|
-
if ! command -v pandoc >/dev/null 2>&1; then
|
|
25
|
-
echo "ERROR: pandoc is not installed." >&2
|
|
26
|
-
echo "Install it, then re-run:" >&2
|
|
27
|
-
echo " Windows: winget install JohnMacFarlane.Pandoc" >&2
|
|
28
|
-
echo " macOS: brew install pandoc" >&2
|
|
29
|
-
echo " Linux: sudo apt-get install pandoc" >&2
|
|
30
|
-
exit 2
|
|
31
|
-
fi
|
|
32
|
-
|
|
33
|
-
input="$1"
|
|
34
|
-
shift
|
|
35
|
-
if [ ! -f "$input" ]; then
|
|
36
|
-
echo "ERROR: input file not found: $input" >&2
|
|
37
|
-
exit 1
|
|
38
|
-
fi
|
|
39
|
-
|
|
40
|
-
base="$(basename "$input")"
|
|
41
|
-
output="${base%.*}.docx"
|
|
42
|
-
reference=""
|
|
43
|
-
|
|
44
|
-
while [ $# -gt 0 ]; do
|
|
45
|
-
case "$1" in
|
|
46
|
-
--reference-doc)
|
|
47
|
-
[ $# -ge 2 ] || { echo "ERROR: --reference-doc needs a path" >&2; exit 1; }
|
|
48
|
-
reference="$2"
|
|
49
|
-
shift 2
|
|
50
|
-
;;
|
|
51
|
-
*)
|
|
52
|
-
output="$1"
|
|
53
|
-
shift
|
|
54
|
-
;;
|
|
55
|
-
esac
|
|
56
|
-
done
|
|
57
|
-
|
|
58
|
-
args=("$input" -f gfm -t docx --toc --toc-depth=2 -o "$output")
|
|
59
|
-
if [ -n "$reference" ]; then
|
|
60
|
-
if [ ! -f "$reference" ]; then
|
|
61
|
-
echo "ERROR: reference doc not found: $reference" >&2
|
|
62
|
-
exit 1
|
|
63
|
-
fi
|
|
64
|
-
args+=("--reference-doc=$reference")
|
|
65
|
-
fi
|
|
66
|
-
|
|
67
|
-
if ! pandoc "${args[@]}"; then
|
|
68
|
-
echo "ERROR: pandoc conversion failed for $input" >&2
|
|
69
|
-
exit 3
|
|
70
|
-
fi
|
|
71
|
-
|
|
72
|
-
echo "Word document: $output"
|
|
73
|
-
if grep -q '```mermaid' "$input"; then
|
|
74
|
-
echo "NOTE: mermaid diagrams are kept as code blocks, not rendered images." >&2
|
|
75
|
-
echo "Render and place images separately if the deliverable needs visuals." >&2
|
|
76
|
-
fi
|