alran 0.0.0-stage → 0.9.0
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/ALRAN_TOOLS_NOTICES.md +64 -0
- package/LICENSE +27 -0
- package/LICENSE-STATUS.md +21 -0
- package/NOTICE +6 -0
- package/README.md +289 -2
- package/THIRD_PARTY_NOTICES.md +113 -0
- package/alran-tools.js +3 -0
- package/assets/agents/_default/prompt-auto_classifier.md +185 -0
- package/assets/agents/_default/prompt-auto_classifier_extras.md +17 -0
- package/assets/agents/_default/prompt-base-all.md +133 -0
- package/assets/agents/_default/prompt-base-all.md.hbs +228 -0
- package/assets/agents/_default/prompt-base-windows.md +5 -0
- package/assets/agents/_default/prompt-base-windows.md.hbs +5 -0
- package/assets/agents/_default/prompt-base-worker.md +10 -0
- package/assets/agents/_default/prompt-base-worker.md.hbs +27 -0
- package/assets/agents/_default/prompt-compact.md +76 -0
- package/assets/agents/_default/prompt-compact_continue.md +9 -0
- package/assets/agents/_default/prompt-git.md +8 -0
- package/assets/agents/_default/prompt-goal.md +13 -0
- package/assets/agents/_default/prompt-session-branch.md +3 -0
- package/assets/agents/_default/prompt-session-branch.md.hbs +30 -0
- package/assets/agents/_default/prompt-session-root.md +3 -0
- package/assets/agents/_default/prompt-session-root.md.hbs +32 -0
- package/assets/agents/_default/prompt-title.md +11 -0
- package/assets/agents/_default/prompt-tool_agent.md +22 -0
- package/assets/agents/_migration/README.md +20 -0
- package/assets/agents/_migration/coder/PERSONA.md +11 -0
- package/assets/agents/_migration/coder/system-prompt.md.hbs +42 -0
- package/assets/agents/_migration/general/PERSONA.md +11 -0
- package/assets/agents/_migration/general/system-prompt.md.hbs +49 -0
- package/assets/agents/_v2/AGENT_CONTEXT.md.hbs +245 -0
- package/assets/agents/_v2/PTC_TOOL_CALLS.md.hbs +35 -0
- package/assets/agents/_v2/coding/SYSTEM.md.hbs +173 -0
- package/assets/agents/_v2/explore.md.hbs +38 -0
- package/assets/agents/_v2/tui/SYSTEM.md.hbs +211 -0
- package/assets/agents/_v2/verifier.md.hbs +32 -0
- package/assets/agents/_v2/work/SYSTEM.md.hbs +186 -0
- package/assets/agents/_v2/worker.md.hbs +27 -0
- package/assets/agents/alran/PERSONA.md +7 -0
- package/assets/agents/alran/features/cron.md.hbs +0 -0
- package/assets/agents/alran/features/delegation.md.hbs +56 -0
- package/assets/agents/alran/features/memory.md.hbs +61 -0
- package/assets/agents/alran/features/recoverable-deletion.md.hbs +10 -0
- package/assets/agents/alran/features/task-management.md.hbs +11 -0
- package/assets/agents/alran/features/web-search.md.hbs +11 -0
- package/assets/agents/alran/modes/coding/online/PERSONA.md.hbs +20 -0
- package/assets/agents/alran/modes/coding/online/SYSTEM.md.hbs +158 -0
- package/assets/agents/alran/modes/work/online/PERSONA.md.hbs +20 -0
- package/assets/agents/alran/modes/work/online/SYSTEM.md.hbs +160 -0
- package/assets/agents/alran/prompt-session-root.md +4 -0
- package/assets/agents/alran/prompt-session-root.md.hbs +4 -0
- package/assets/agents/alran/skills/alran-code-product/SKILL.md +72 -0
- package/assets/agents/alran/skills/alran-code-product/references/account-models.md +61 -0
- package/assets/agents/alran/skills/alran-code-product/references/agents.md +34 -0
- package/assets/agents/alran/skills/alran-code-product/references/extensions.md +46 -0
- package/assets/agents/alran/skills/alran-code-product/references/workflows.md +56 -0
- package/assets/agents/alran/skills/control-in-app-browser/SKILL.md +590 -0
- package/assets/agents/alran/system-prompt.md.hbs +97 -0
- package/assets/agents/builtin-agents.json +1 -0
- package/assets/agents/desktop-task/archive-title/system-en.md +1 -0
- package/assets/agents/desktop-task/checkpoint/system.md +19 -0
- package/assets/agents/desktop-task/output-revision/system.md +1 -0
- package/assets/agents/desktop-task/retry/continuation.md +4 -0
- package/assets/agents/desktop-task/session-title/system.md +41 -0
- package/assets/agents/explore/PERSONA.md +8 -0
- package/assets/agents/explore/agent.md +14 -0
- package/assets/agents/explore/system-prompt.md.hbs +35 -0
- package/assets/agents/greeting.md +61 -0
- package/assets/agents/managed-prompts.json +47 -0
- package/assets/agents/prompt-exemptions.json +36 -0
- package/assets/agents/verifier/PERSONA.md +8 -0
- package/assets/agents/verifier/agent.md +17 -0
- package/assets/agents/verifier/system-prompt.md.hbs +28 -0
- package/assets/agents/worker/PERSONA.md +8 -0
- package/assets/agents/worker/agent.md +18 -0
- package/assets/agents/worker/system-prompt.md.hbs +22 -0
- package/assets/agents/workflow/code-review/review-candidates.md +120 -0
- package/assets/agents/workflow/code-review/reviewer-system.md +75 -0
- package/assets/agents/workflow/goal/budget-limit.md +16 -0
- package/assets/agents/workflow/goal/continuation.md +62 -0
- package/assets/agents/workflow/goal/objective-updated.md +16 -0
- package/assets/agents/workflow/goal/recovery-terminal-audit.md +13 -0
- package/assets/agents/workflow/goal/recovery.md +11 -0
- package/assets/agents/workflow/goal/terminal-audit.md +10 -0
- package/assets/agents/workflow/plan-mode/agent-entry.md +72 -0
- package/assets/agents/workflow/prompt-hook/system.md +0 -0
- package/assets/models-dev-catalog.json.gz +0 -0
- package/assets/prompts/code-review/review-candidates.md +120 -0
- package/assets/prompts/code-review/reviewer-system.md +75 -0
- package/assets/skills/alran-tools-master/SKILL.md +127 -0
- package/assets/skills/code-review/SKILL.md +51 -0
- package/assets/skills/cu-desktop/SKILL.md +255 -0
- package/assets/skills/deep-research/SKILL.md +30 -0
- package/assets/skills/deploy-website/SKILL.md +52 -0
- package/assets/skills/docx/LICENSE +21 -0
- package/assets/skills/docx/SKILL.md +259 -0
- package/assets/skills/docx/assets/styles/academic_styles.xml +250 -0
- package/assets/skills/docx/assets/styles/corporate_styles.xml +284 -0
- package/assets/skills/docx/assets/styles/default_styles.xml +449 -0
- package/assets/skills/docx/assets/xsd/aesthetic-rules.xsd +470 -0
- package/assets/skills/docx/assets/xsd/business-rules.xsd +130 -0
- package/assets/skills/docx/assets/xsd/common-types.xsd +159 -0
- package/assets/skills/docx/assets/xsd/wml-subset.xsd +589 -0
- package/assets/skills/docx/docs/acceptance-checklists/create.md +7 -0
- package/assets/skills/docx/docs/acceptance-checklists/edit.md +6 -0
- package/assets/skills/docx/docs/acceptance-checklists/layout-repair.md +7 -0
- package/assets/skills/docx/docs/acceptance-checklists/template.md +6 -0
- package/assets/skills/docx/docs/acceptance.md +139 -0
- package/assets/skills/docx/docs/anti-patterns.md +14 -0
- package/assets/skills/docx/docs/backends.md +116 -0
- package/assets/skills/docx/docs/evidence.md +73 -0
- package/assets/skills/docx/docs/failure-taxonomy.md +71 -0
- package/assets/skills/docx/docs/index.md +50 -0
- package/assets/skills/docx/docs/rendered-delivery.md +125 -0
- package/assets/skills/docx/docs/router.md +122 -0
- package/assets/skills/docx/docs/tables-and-numbering.md +27 -0
- package/assets/skills/docx/docs/task-apply-template.md +141 -0
- package/assets/skills/docx/docs/task-compare-two-docx.md +48 -0
- package/assets/skills/docx/docs/task-create.md +124 -0
- package/assets/skills/docx/docs/task-edit-fill.md +69 -0
- package/assets/skills/docx/docs/task-read-content.md +148 -0
- package/assets/skills/docx/docs/task-read-rendered.md +78 -0
- package/assets/skills/docx/docs/task-read-structure.md +93 -0
- package/assets/skills/docx/docs/task-repair-layout.md +70 -0
- package/assets/skills/docx/docs/template-dsl.md +32 -0
- package/assets/skills/docx/docs/track-changes.md +15 -0
- package/assets/skills/docx/docs/xml-patch-dsl.md +33 -0
- package/assets/skills/docx/references/cjk_typography.md +357 -0
- package/assets/skills/docx/references/cjk_university_template_guide.md +184 -0
- package/assets/skills/docx/references/comments_guide.md +191 -0
- package/assets/skills/docx/references/design_good_bad_examples.md +829 -0
- package/assets/skills/docx/references/design_principles.md +819 -0
- package/assets/skills/docx/references/openxml_element_order.md +308 -0
- package/assets/skills/docx/references/openxml_encyclopedia_part1.md +4061 -0
- package/assets/skills/docx/references/openxml_encyclopedia_part2.md +2820 -0
- package/assets/skills/docx/references/openxml_encyclopedia_part3.md +3381 -0
- package/assets/skills/docx/references/openxml_namespaces.md +82 -0
- package/assets/skills/docx/references/openxml_units.md +72 -0
- package/assets/skills/docx/references/sample-patch-plans.json +22 -0
- package/assets/skills/docx/references/sample-task-intents.json +5 -0
- package/assets/skills/docx/references/sample-template-manifests.json +21 -0
- package/assets/skills/docx/references/scenario_a_create.md +284 -0
- package/assets/skills/docx/references/scenario_b_edit_content.md +295 -0
- package/assets/skills/docx/references/scenario_c_apply_template.md +456 -0
- package/assets/skills/docx/references/track_changes_guide.md +200 -0
- package/assets/skills/docx/references/troubleshooting.md +506 -0
- package/assets/skills/docx/references/typography_guide.md +294 -0
- package/assets/skills/docx/references/xsd_validation_guide.md +158 -0
- package/assets/skills/docx/scripts/build_patch_plan.py +29 -0
- package/assets/skills/docx/scripts/diff_docx_structure.py +61 -0
- package/assets/skills/docx/scripts/doc_to_docx.ps1 +85 -0
- package/assets/skills/docx/scripts/doc_to_docx.sh +40 -0
- package/assets/skills/docx/scripts/docx_preview.ps1 +76 -0
- package/assets/skills/docx/scripts/docx_preview.sh +37 -0
- package/assets/skills/docx/scripts/docx_to_pdf.py +87 -0
- package/assets/skills/docx/scripts/dotnet/AlranAIDocx.Cli/AlranAIDocx.Cli.csproj +19 -0
- package/assets/skills/docx/scripts/dotnet/AlranAIDocx.Cli/Program.cs +18 -0
- package/assets/skills/docx/scripts/dotnet/AlranAIDocx.Core/AlranAIDocx.Core.csproj +15 -0
- package/assets/skills/docx/scripts/dotnet/AlranAIDocx.Core/Commands/AnalyzeCommand.cs +147 -0
- package/assets/skills/docx/scripts/dotnet/AlranAIDocx.Core/Commands/ApplyTemplateCommand.cs +322 -0
- package/assets/skills/docx/scripts/dotnet/AlranAIDocx.Core/Commands/CreateCommand.cs +324 -0
- package/assets/skills/docx/scripts/dotnet/AlranAIDocx.Core/Commands/DiffCommand.cs +155 -0
- package/assets/skills/docx/scripts/dotnet/AlranAIDocx.Core/Commands/EditContentCommand.cs +487 -0
- package/assets/skills/docx/scripts/dotnet/AlranAIDocx.Core/Commands/FixOrderCommand.cs +108 -0
- package/assets/skills/docx/scripts/dotnet/AlranAIDocx.Core/Commands/MergeRunsCommand.cs +122 -0
- package/assets/skills/docx/scripts/dotnet/AlranAIDocx.Core/Commands/ValidateCommand.cs +107 -0
- package/assets/skills/docx/scripts/dotnet/AlranAIDocx.Core/OpenXml/CommentSynchronizer.cs +169 -0
- package/assets/skills/docx/scripts/dotnet/AlranAIDocx.Core/OpenXml/ElementOrder.cs +80 -0
- package/assets/skills/docx/scripts/dotnet/AlranAIDocx.Core/OpenXml/NamespaceConstants.cs +42 -0
- package/assets/skills/docx/scripts/dotnet/AlranAIDocx.Core/OpenXml/RunMerger.cs +81 -0
- package/assets/skills/docx/scripts/dotnet/AlranAIDocx.Core/OpenXml/StyleAnalyzer.cs +81 -0
- package/assets/skills/docx/scripts/dotnet/AlranAIDocx.Core/OpenXml/TrackChangesHelper.cs +99 -0
- package/assets/skills/docx/scripts/dotnet/AlranAIDocx.Core/OpenXml/UnitConverter.cs +23 -0
- package/assets/skills/docx/scripts/dotnet/AlranAIDocx.Core/Samples/AestheticRecipeSamples.cs +1832 -0
- package/assets/skills/docx/scripts/dotnet/AlranAIDocx.Core/Samples/AestheticRecipeSamples_Batch1.cs +910 -0
- package/assets/skills/docx/scripts/dotnet/AlranAIDocx.Core/Samples/AestheticRecipeSamples_Batch2.cs +999 -0
- package/assets/skills/docx/scripts/dotnet/AlranAIDocx.Core/Samples/AestheticRecipeSamples_Batch3.cs +1048 -0
- package/assets/skills/docx/scripts/dotnet/AlranAIDocx.Core/Samples/AestheticRecipeSamples_Batch4.cs +1038 -0
- package/assets/skills/docx/scripts/dotnet/AlranAIDocx.Core/Samples/CharacterFormattingSamples.cs +1020 -0
- package/assets/skills/docx/scripts/dotnet/AlranAIDocx.Core/Samples/DocumentCreationSamples.cs +1121 -0
- package/assets/skills/docx/scripts/dotnet/AlranAIDocx.Core/Samples/FieldAndTocSamples.cs +624 -0
- package/assets/skills/docx/scripts/dotnet/AlranAIDocx.Core/Samples/FootnoteAndCommentSamples.cs +675 -0
- package/assets/skills/docx/scripts/dotnet/AlranAIDocx.Core/Samples/HeaderFooterSamples.cs +838 -0
- package/assets/skills/docx/scripts/dotnet/AlranAIDocx.Core/Samples/ImageSamples.cs +917 -0
- package/assets/skills/docx/scripts/dotnet/AlranAIDocx.Core/Samples/ListAndNumberingSamples.cs +826 -0
- package/assets/skills/docx/scripts/dotnet/AlranAIDocx.Core/Samples/ParagraphFormattingSamples.cs +1199 -0
- package/assets/skills/docx/scripts/dotnet/AlranAIDocx.Core/Samples/StyleSystemSamples.cs +1487 -0
- package/assets/skills/docx/scripts/dotnet/AlranAIDocx.Core/Samples/TableSamples.cs +1163 -0
- package/assets/skills/docx/scripts/dotnet/AlranAIDocx.Core/Samples/TrackChangesSamples.cs +595 -0
- package/assets/skills/docx/scripts/dotnet/AlranAIDocx.Core/Typography/CjkHelper.cs +39 -0
- package/assets/skills/docx/scripts/dotnet/AlranAIDocx.Core/Typography/FontDefaults.cs +24 -0
- package/assets/skills/docx/scripts/dotnet/AlranAIDocx.Core/Typography/PageSizes.cs +20 -0
- package/assets/skills/docx/scripts/dotnet/AlranAIDocx.Core/Validation/BusinessRuleValidator.cs +224 -0
- package/assets/skills/docx/scripts/dotnet/AlranAIDocx.Core/Validation/GateCheckValidator.cs +148 -0
- package/assets/skills/docx/scripts/dotnet/AlranAIDocx.Core/Validation/ValidationResult.cs +23 -0
- package/assets/skills/docx/scripts/dotnet/AlranAIDocx.Core/Validation/XsdValidator.cs +69 -0
- package/assets/skills/docx/scripts/dotnet/AlranAIDocx.slnx +4 -0
- package/assets/skills/docx/scripts/env_check.ps1 +327 -0
- package/assets/skills/docx/scripts/env_check.sh +340 -0
- package/assets/skills/docx/scripts/extract_docx_text.py +1075 -0
- package/assets/skills/docx/scripts/pack_docx.py +31 -0
- package/assets/skills/docx/scripts/read_docx_structure.py +1032 -0
- package/assets/skills/docx/scripts/render_docx_pages.py +147 -0
- package/assets/skills/docx/scripts/rendered_report.py +609 -0
- package/assets/skills/docx/scripts/setup.ps1 +542 -0
- package/assets/skills/docx/scripts/setup.sh +537 -0
- package/assets/skills/docx/scripts/unpack_docx.py +29 -0
- package/assets/skills/docx/scripts/validate_template_manifest.py +60 -0
- package/assets/skills/docx/scripts/verify_anchor_atomicity.py +87 -0
- package/assets/skills/edit-deployed-website/SKILL.md +27 -0
- package/assets/skills/init/SKILL.md +135 -0
- package/assets/skills/llm-call/SKILL.md +48 -0
- package/assets/skills/llm-call/scripts/llm_call.py +458 -0
- package/assets/skills/pdf/SKILL.md +280 -0
- package/assets/skills/pdf/docs/advanced-reference.md +711 -0
- package/assets/skills/pdf/docs/create-guide.md +437 -0
- package/assets/skills/pdf/docs/design-guide.md +204 -0
- package/assets/skills/pdf/docs/forms-guide.md +462 -0
- package/assets/skills/pdf/docs/html-pdf-spec.md +500 -0
- package/assets/skills/pdf/docs/latex-academic-thesis-guide.md +233 -0
- package/assets/skills/pdf/docs/latex-technical-book-guide.md +112 -0
- package/assets/skills/pdf/docs/pitfalls-index.md +792 -0
- package/assets/skills/pdf/docs/read-guide.md +358 -0
- package/assets/skills/pdf/docs/reformat-guide.md +238 -0
- package/assets/skills/pdf/docs/skill-readme-archive.md +151 -0
- package/assets/skills/pdf/docs/troubleshooting.md +86 -0
- package/assets/skills/pdf/docs/vision-guide.md +188 -0
- package/assets/skills/pdf/scripts/__init__.py +0 -0
- package/assets/skills/pdf/scripts/_pdf_read_lib.py +284 -0
- package/assets/skills/pdf/scripts/fill/__init__.py +0 -0
- package/assets/skills/pdf/scripts/fill/acroform_apply.py +153 -0
- package/assets/skills/pdf/scripts/fill/overlay_apply.py +109 -0
- package/assets/skills/pdf/scripts/lib/__init__.py +0 -0
- package/assets/skills/pdf/scripts/lib/acroform_io.py +170 -0
- package/assets/skills/pdf/scripts/lib/cli_utils.py +41 -0
- package/assets/skills/pdf/scripts/lib/geometry.py +79 -0
- package/assets/skills/pdf/scripts/make.sh +388 -0
- package/assets/skills/pdf/scripts/merge.py +112 -0
- package/assets/skills/pdf/scripts/pdf_inspect/__init__.py +0 -0
- package/assets/skills/pdf/scripts/pdf_inspect/acroform_inspect.py +52 -0
- package/assets/skills/pdf/scripts/pdf_inspect/acroform_probe.py +57 -0
- package/assets/skills/pdf/scripts/pdf_inspect/layout_scan.py +164 -0
- package/assets/skills/pdf/scripts/read_pdf_vision.py +473 -0
- package/assets/skills/pdf/scripts/reformat_parse.py +181 -0
- package/assets/skills/pdf/scripts/render/__init__.py +0 -0
- package/assets/skills/pdf/scripts/render/overlay_preview.py +86 -0
- package/assets/skills/pdf/scripts/render/page_rasterize.py +85 -0
- package/assets/skills/pdf/scripts/render_html.cjs +205 -0
- package/assets/skills/pdf/scripts/validate/__init__.py +0 -0
- package/assets/skills/pdf/scripts/validate/geometry_lint.py +124 -0
- package/assets/skills/pdf/templates/INDEX.md +90 -0
- package/assets/skills/pdf/templates/bilingual-menu-premium/README.md +175 -0
- package/assets/skills/pdf/templates/bilingual-menu-premium/skeleton.html +343 -0
- package/assets/skills/pdf/templates/brand-guide-2page/README.md +140 -0
- package/assets/skills/pdf/templates/brand-guide-2page/skeleton.html +264 -0
- package/assets/skills/pdf/templates/data-viz-report/README.md +234 -0
- package/assets/skills/pdf/templates/data-viz-report/skeleton.html +835 -0
- package/assets/skills/pdf/templates/form-fill-acroform/README.md +195 -0
- package/assets/skills/pdf/templates/form-fill-acroform/field_values.template.json +118 -0
- package/assets/skills/pdf/templates/latex-academic-thesis/README.md +146 -0
- package/assets/skills/pdf/templates/latex-academic-thesis/source.tex +334 -0
- package/assets/skills/pdf/templates/latex-technical-book/README.md +130 -0
- package/assets/skills/pdf/templates/latex-technical-book/README.template-source.md +62 -0
- package/assets/skills/pdf/templates/latex-technical-book/source.tex +439 -0
- package/assets/skills/pdf/templates/multi-article-aggregator/README.md +148 -0
- package/assets/skills/pdf/templates/multi-article-aggregator/pipeline.md +223 -0
- package/assets/skills/pdf/templates/multilang-research-report/README.md +136 -0
- package/assets/skills/pdf/templates/multilang-research-report/skeleton.html +242 -0
- package/assets/skills/pdf/templates/reformat-default/README.md +136 -0
- package/assets/skills/pdf/templates/reformat-default/skeleton.html +204 -0
- package/assets/skills/pdf/templates/translate-preserve-layout/README.md +136 -0
- package/assets/skills/pdf/templates/translate-preserve-layout/skeleton.html +96 -0
- package/assets/skills/pdf/templates/translate-preserve-layout/terminology.template.json +66 -0
- package/assets/skills/pptx/SKILL.md +283 -0
- package/assets/skills/pptx/references/design-system.md +424 -0
- package/assets/skills/pptx/references/editing.md +162 -0
- package/assets/skills/pptx/references/element-map.md +229 -0
- package/assets/skills/pptx/references/pitfalls.md +205 -0
- package/assets/skills/pptx/references/pptxgenjs.md +420 -0
- package/assets/skills/pptx/references/preview-selection-writeback.md +65 -0
- package/assets/skills/pptx/references/python-pptx-recipes.md +63 -0
- package/assets/skills/pptx/references/slide-types.md +413 -0
- package/assets/skills/pptx/scripts/alran-ppt-map.cjs +280 -0
- package/assets/skills/pptx/scripts/audit_pptx.py +708 -0
- package/assets/skills/pptx/scripts/extract_comments.py +468 -0
- package/assets/skills/pptx/scripts/extract_images.py +226 -0
- package/assets/skills/pptx/scripts/extract_pptx.py +285 -0
- package/assets/skills/pptx/scripts/pdf2png.swift +203 -0
- package/assets/skills/pptx/scripts/pptx-screenshot.sh +105 -0
- package/assets/skills/resume-codex/SKILL.md +53 -0
- package/assets/skills/resume-codex/scripts/session-reader.mjs +445 -0
- package/assets/skills/skill-creator/SKILL.md +188 -0
- package/assets/skills/skill-creator/references/anti-patterns.md +149 -0
- package/assets/skills/skill-creator/references/commands-macos-linux.md +38 -0
- package/assets/skills/skill-creator/references/commands-windows-powershell.md +48 -0
- package/assets/skills/skill-creator/references/description-rubric.md +83 -0
- package/assets/skills/skill-creator/references/skill-template.md +101 -0
- package/assets/skills/skill-creator/references/when-to-bundle-scripts.md +139 -0
- package/assets/skills/skill-creator/scripts/lint-skill.js +226 -0
- package/assets/skills/skill-refiner/SKILL.md +137 -0
- package/assets/skills/visual-page/SKILL.md +194 -0
- package/assets/skills/x-link-reader/SKILL.md +108 -0
- package/assets/skills/xlsx/SKILL.md +498 -0
- package/assets/skills/xlsx/docs/advanced-reference.md +410 -0
- package/assets/skills/xlsx/docs/conventions-guide.md +217 -0
- package/assets/skills/xlsx/docs/create-edit-guide.md +410 -0
- package/assets/skills/xlsx/docs/pitfalls-index.md +759 -0
- package/assets/skills/xlsx/docs/raw-xml-escape-hatch.md +201 -0
- package/assets/skills/xlsx/docs/recalc-guide.md +295 -0
- package/assets/skills/xlsx/scripts/office/helpers/__init__.py +0 -0
- package/assets/skills/xlsx/scripts/office/helpers/merge_runs.py +199 -0
- package/assets/skills/xlsx/scripts/office/helpers/simplify_redlines.py +197 -0
- package/assets/skills/xlsx/scripts/office/pack.py +159 -0
- package/assets/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-chart.xsd +1499 -0
- package/assets/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-chartDrawing.xsd +146 -0
- package/assets/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-diagram.xsd +1085 -0
- package/assets/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-lockedCanvas.xsd +11 -0
- package/assets/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-main.xsd +3081 -0
- package/assets/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-picture.xsd +23 -0
- package/assets/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-spreadsheetDrawing.xsd +185 -0
- package/assets/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-wordprocessingDrawing.xsd +287 -0
- package/assets/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/pml.xsd +1676 -0
- package/assets/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-additionalCharacteristics.xsd +28 -0
- package/assets/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-bibliography.xsd +144 -0
- package/assets/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-commonSimpleTypes.xsd +174 -0
- package/assets/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-customXmlDataProperties.xsd +25 -0
- package/assets/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-customXmlSchemaProperties.xsd +18 -0
- package/assets/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesCustom.xsd +59 -0
- package/assets/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesExtended.xsd +56 -0
- package/assets/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesVariantTypes.xsd +195 -0
- package/assets/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-math.xsd +582 -0
- package/assets/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-relationshipReference.xsd +25 -0
- package/assets/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/sml.xsd +4439 -0
- package/assets/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-main.xsd +570 -0
- package/assets/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-officeDrawing.xsd +509 -0
- package/assets/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-presentationDrawing.xsd +12 -0
- package/assets/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-spreadsheetDrawing.xsd +108 -0
- package/assets/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-wordprocessingDrawing.xsd +96 -0
- package/assets/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/wml.xsd +3646 -0
- package/assets/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/xml.xsd +116 -0
- package/assets/skills/xlsx/scripts/office/schemas/ecma/fouth-edition/opc-contentTypes.xsd +42 -0
- package/assets/skills/xlsx/scripts/office/schemas/ecma/fouth-edition/opc-coreProperties.xsd +50 -0
- package/assets/skills/xlsx/scripts/office/schemas/ecma/fouth-edition/opc-digSig.xsd +49 -0
- package/assets/skills/xlsx/scripts/office/schemas/ecma/fouth-edition/opc-relationships.xsd +33 -0
- package/assets/skills/xlsx/scripts/office/schemas/mce/mc.xsd +75 -0
- package/assets/skills/xlsx/scripts/office/schemas/microsoft/wml-2010.xsd +560 -0
- package/assets/skills/xlsx/scripts/office/schemas/microsoft/wml-2012.xsd +67 -0
- package/assets/skills/xlsx/scripts/office/schemas/microsoft/wml-2018.xsd +14 -0
- package/assets/skills/xlsx/scripts/office/schemas/microsoft/wml-cex-2018.xsd +20 -0
- package/assets/skills/xlsx/scripts/office/schemas/microsoft/wml-cid-2016.xsd +13 -0
- package/assets/skills/xlsx/scripts/office/schemas/microsoft/wml-sdtdatahash-2020.xsd +4 -0
- package/assets/skills/xlsx/scripts/office/schemas/microsoft/wml-symex-2015.xsd +8 -0
- package/assets/skills/xlsx/scripts/office/soffice.py +191 -0
- package/assets/skills/xlsx/scripts/office/unpack.py +132 -0
- package/assets/skills/xlsx/scripts/office/validate.py +117 -0
- package/assets/skills/xlsx/scripts/office/validators/__init__.py +15 -0
- package/assets/skills/xlsx/scripts/office/validators/base.py +851 -0
- package/assets/skills/xlsx/scripts/office/validators/docx.py +446 -0
- package/assets/skills/xlsx/scripts/office/validators/pptx.py +275 -0
- package/assets/skills/xlsx/scripts/office/validators/redlining.py +247 -0
- package/assets/skills/xlsx/scripts/recalc.py +450 -0
- package/chunks/account-commands-JZ6NXTTK.js +2 -0
- package/chunks/anthropic-MN33DP4E.js +2 -0
- package/chunks/application-ITGAJ4HC.js +2 -0
- package/chunks/auth-command-V3RVPLZO.js +2 -0
- package/chunks/azure-openai-responses-OWHMUNKC.js +2 -0
- package/chunks/chunk-2TF6JAQM.js +2 -0
- package/chunks/chunk-33CNY6GP.js +2 -0
- package/chunks/chunk-3AODGLMF.js +2 -0
- package/chunks/chunk-44VPC5LA.js +38 -0
- package/chunks/chunk-4CN3IJFH.js +2 -0
- package/chunks/chunk-4PDIO3M6.js +2 -0
- package/chunks/chunk-4X22UJQH.js +164 -0
- package/chunks/chunk-6255CZPL.js +2 -0
- package/chunks/chunk-6P4UKHGR.js +2 -0
- package/chunks/chunk-7QLAXRD2.js +1085 -0
- package/chunks/chunk-7XYOYZX2.js +2 -0
- package/chunks/chunk-A7GMJNA2.js +29 -0
- package/chunks/chunk-AGUSPIUP.js +2 -0
- package/chunks/chunk-BQ3CF3KE.js +2 -0
- package/chunks/chunk-C3CMJAAV.js +3 -0
- package/chunks/chunk-CJM7ZJ6W.js +7 -0
- package/chunks/chunk-CSOUJVKM.js +2 -0
- package/chunks/chunk-D66ZSHXR.js +2 -0
- package/chunks/chunk-D7MGU75P.js +2 -0
- package/chunks/chunk-E3GLGDGC.js +5 -0
- package/chunks/chunk-ENHOPPS7.js +16 -0
- package/chunks/chunk-EOR6EDNR.js +2 -0
- package/chunks/chunk-EYK25HWR.js +2 -0
- package/chunks/chunk-F46IELF5.js +2 -0
- package/chunks/chunk-FC4M2B7E.js +2 -0
- package/chunks/chunk-FSNYOJPJ.js +2 -0
- package/chunks/chunk-FUERW2DW.js +3 -0
- package/chunks/chunk-FXOH6TEQ.js +21 -0
- package/chunks/chunk-GP52JZMY.js +2 -0
- package/chunks/chunk-GRXX6I72.js +2 -0
- package/chunks/chunk-GSYHBK5Q.js +6 -0
- package/chunks/chunk-HNWBFJNO.js +2 -0
- package/chunks/chunk-IIE366LR.js +6706 -0
- package/chunks/chunk-IWK7PZP7.js +207 -0
- package/chunks/chunk-J3KCPYZT.js +2 -0
- package/chunks/chunk-KCLRJQ53.js +59 -0
- package/chunks/chunk-LU4RPLJ3.js +2 -0
- package/chunks/chunk-LZJYNT32.js +2 -0
- package/chunks/chunk-M7GW4VMR.js +27 -0
- package/chunks/chunk-MACBL5HF.js +2 -0
- package/chunks/chunk-N5NTXCJI.js +2 -0
- package/chunks/chunk-N5SVBCUB.js +7 -0
- package/chunks/chunk-N6W7ZL26.js +2 -0
- package/chunks/chunk-NWB7LFOK.js +131 -0
- package/chunks/chunk-OIQ336YE.js +16 -0
- package/chunks/chunk-OQNU3VPS.js +30 -0
- package/chunks/chunk-OTDNOWXG.js +16 -0
- package/chunks/chunk-PNXZWSWT.js +3 -0
- package/chunks/chunk-QFUV5PX6.js +2 -0
- package/chunks/chunk-QIN5ZBE2.js +2 -0
- package/chunks/chunk-QKBN5CGI.js +2 -0
- package/chunks/chunk-QPGTKSIQ.js +2 -0
- package/chunks/chunk-SIOLUFGG.js +2 -0
- package/chunks/chunk-TW23QKAD.js +3 -0
- package/chunks/chunk-U3RMPDXU.js +2 -0
- package/chunks/chunk-U7U3DJHF.js +2 -0
- package/chunks/chunk-VLXX22YO.js +2 -0
- package/chunks/chunk-WHD2XVT2.js +2 -0
- package/chunks/chunk-WTAJMYF2.js +249 -0
- package/chunks/chunk-WWNUAU4P.js +29 -0
- package/chunks/chunk-WYANV3IX.js +4 -0
- package/chunks/chunk-XAGZ6ZEU.js +9 -0
- package/chunks/chunk-XFCC2CI2.js +24 -0
- package/chunks/chunk-XQK7JM66.js +2 -0
- package/chunks/chunk-YLQXZBEL.js +2 -0
- package/chunks/chunk-YPV2X2RG.js +2 -0
- package/chunks/chunk-Z6BHCXKT.js +25 -0
- package/chunks/chunk-Z6HBNJCA.js +8 -0
- package/chunks/chunk-ZQKVUPKA.js +2 -0
- package/chunks/chunk-ZQOALVGL.js +2 -0
- package/chunks/clipboard-image-PQPC4EHR.js +2 -0
- package/chunks/data-dir-LDVKDCJ2.js +2 -0
- package/chunks/dist-2BRD4JFU.js +11 -0
- package/chunks/dist-EXKHRFQO.js +5 -0
- package/chunks/emscripten-module-RD6P2XH5.js +2 -0
- package/chunks/emscripten-module-WYNDFH3N.js +2 -0
- package/chunks/emscripten-module-XPTEOIWW.js +2 -0
- package/chunks/emscripten-module-ZS3PMSDF.js +2 -0
- package/chunks/ffi-IO7WZQNG.js +2 -0
- package/chunks/ffi-M5UP5J6C.js +2 -0
- package/chunks/ffi-ORLOPBB3.js +2 -0
- package/chunks/ffi-OUPK6AY6.js +2 -0
- package/chunks/google-UJAPMFAB.js +2 -0
- package/chunks/google-vertex-VLSF55PW.js +2 -0
- package/chunks/install-source-JTIUC4G4.js +2 -0
- package/chunks/launcher-FCZ3EDBF.js +61 -0
- package/chunks/lifecycle-GY435YMF.js +2 -0
- package/chunks/main-TQGGRHTS.js +13 -0
- package/chunks/mistral-ZJZUEF2X.js +3 -0
- package/chunks/module-6F3E5H7Y-BN7QWGYB.js +2 -0
- package/chunks/module-asyncify-R6PWJ6ZV-P4FWSBAY.js +2 -0
- package/chunks/multipart-parser-L6M455MS.js +2 -0
- package/chunks/network-proxy-U72JCK2I.js +2 -0
- package/chunks/openai-codex-responses-FPCDNRL5.js +2 -0
- package/chunks/openai-completions-D32YW6KL.js +2 -0
- package/chunks/openai-responses-ZCGSENM4.js +2 -0
- package/chunks/openrouter-G2EHY5BD.js +2 -0
- package/chunks/otel-OHXIZ666.js +2 -0
- package/chunks/package-contract-GVXTMJ3N.js +2 -0
- package/chunks/pdfjs-SHZAF7PF.js +107 -0
- package/chunks/photon_rs-C52RL4CI.js +3 -0
- package/chunks/plugin-command-OSAFHS7C.js +2 -0
- package/chunks/provider-command-SKTCHD4E.js +2 -0
- package/chunks/questionnaire-bridge-ISQOCYWY.js +2 -0
- package/chunks/run-acp-command-SG2BDMFJ.js +2 -0
- package/chunks/run-exec-command-5ADSQR2Z.js +15 -0
- package/chunks/skills-command-XXXEZAG6.js +2 -0
- package/chunks/src-DNIDEMVV.js +2 -0
- package/chunks/src-IBHIRTD7.js +2 -0
- package/chunks/telemetry-J7ZLGF5X.js +2 -0
- package/chunks/telemetry-command-COQG2AKK.js +5 -0
- package/chunks/tools-WDBB2JKV.js +2 -0
- package/chunks/undici-TUGHZJSA.js +2 -0
- package/chunks/update-NB6OD572.js +14 -0
- package/chunks/update-hint-ED7O67WU.js +3 -0
- package/chunks/wechat-onboard-UWXQW2HT.js +2 -0
- package/cli.js +5 -0
- package/configs/data-minimal.yaml +50 -0
- package/embedded/alran-tools/cli.mjs +4961 -0
- package/embedded/alran-tools/manifest.json +25 -0
- package/emscripten-module.wasm +0 -0
- package/image-preview-worker.js +2 -0
- package/internal-bin/alran-tools +9 -0
- package/internal-bin/alran-tools.cmd +8 -0
- package/matrix-mcp-stdio.js +4 -0
- package/native/darwin/prebuilds/darwin-arm64/darwin-modifiers.node +0 -0
- package/native/darwin/prebuilds/darwin-x64/darwin-modifiers.node +0 -0
- package/native/win32/prebuilds/win32-arm64/win32-console-mode.node +0 -0
- package/native/win32/prebuilds/win32-x64/win32-console-mode.node +0 -0
- package/package.json +38 -4
- package/photon_rs_bg.wasm +0 -0
- package/quickjs-worker.js +152 -0
- package/vendor/java-proxy-agent/build.ts +97 -0
- package/vendor/java-proxy-agent/srt-proxy-agent.jar +0 -0
- package/vendor/seccomp/arm64/apply-seccomp +0 -0
- package/vendor/seccomp/build.ts +74 -0
- package/vendor/seccomp/x64/apply-seccomp +0 -0
- package/vendor/srt-win/arm64/srt-win.exe +0 -0
- package/vendor/srt-win/build.ts +40 -0
- package/vendor/srt-win/x64/srt-win.exe +0 -0
|
@@ -0,0 +1,327 @@
|
|
|
1
|
+
# docx strict environment check (Windows PowerShell mirror of env_check.sh)
|
|
2
|
+
# Authoritative for whether the skill may run on Windows.
|
|
3
|
+
# Supports -Level Read|Render|Full (default Full). Output format and exit codes
|
|
4
|
+
# match env_check.sh so the daemon's gate hook can compare them line-by-line.
|
|
5
|
+
#Requires -Version 5.1
|
|
6
|
+
|
|
7
|
+
[CmdletBinding()]
|
|
8
|
+
param(
|
|
9
|
+
# NOTE: intentionally NOT using [ValidateSet]. ValidateSet rejects with PowerShell exit 1
|
|
10
|
+
# which would conflate "NOT READY" with "bad CLI args". env_check.sh exits 2 for bad args
|
|
11
|
+
# and 1 for NOT READY; we mirror that with manual validation below.
|
|
12
|
+
[string]$Level = 'Full'
|
|
13
|
+
)
|
|
14
|
+
|
|
15
|
+
$ErrorActionPreference = 'Stop'
|
|
16
|
+
# Same UTF-8 enforcement as setup.ps1: chcp first (so child processes inherit UTF-8 code page),
|
|
17
|
+
# then [Console]::OutputEncoding (so PowerShell's view of stdout/stderr matches).
|
|
18
|
+
try { & chcp.com 65001 *> $null } catch { }
|
|
19
|
+
[Console]::OutputEncoding = [System.Text.Encoding]::UTF8
|
|
20
|
+
[Console]::InputEncoding = [System.Text.Encoding]::UTF8
|
|
21
|
+
$OutputEncoding = [System.Text.UTF8Encoding]::new()
|
|
22
|
+
$env:DOTNET_CLI_UI_LANGUAGE = 'en'
|
|
23
|
+
|
|
24
|
+
# Manual validation (mirror env_check.sh exit codes).
|
|
25
|
+
$ValidLevels = @('Read', 'Render', 'Full')
|
|
26
|
+
if ($ValidLevels -notcontains $Level) {
|
|
27
|
+
[Console]::Error.WriteLine("Invalid -Level value: '$Level'. Must be one of: Read, Render, Full")
|
|
28
|
+
exit 2
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
$ScriptDir = Split-Path -Parent $MyInvocation.MyCommand.Path
|
|
32
|
+
$ProjectDir = Split-Path -Parent $ScriptDir
|
|
33
|
+
$DotnetDir = Join-Path $ScriptDir 'dotnet'
|
|
34
|
+
$DotnetRequiredMajor = 9
|
|
35
|
+
|
|
36
|
+
function Test-Command($Name) { [bool](Get-Command $Name -ErrorAction SilentlyContinue) }
|
|
37
|
+
|
|
38
|
+
function Resolve-SofficePath {
|
|
39
|
+
foreach ($n in @('soffice.exe', 'soffice')) {
|
|
40
|
+
$cmd = Get-Command $n -ErrorAction SilentlyContinue
|
|
41
|
+
if ($cmd) { return $cmd.Source }
|
|
42
|
+
}
|
|
43
|
+
$candidates = @(
|
|
44
|
+
(Join-Path $env:ProgramFiles 'LibreOffice\program\soffice.exe'),
|
|
45
|
+
(Join-Path ${env:ProgramFiles(x86)} 'LibreOffice\program\soffice.exe'),
|
|
46
|
+
(Join-Path $env:LOCALAPPDATA 'Programs\LibreOffice\program\soffice.exe'),
|
|
47
|
+
(Join-Path $env:LOCALAPPDATA 'Microsoft\WinGet\Links\soffice.exe'),
|
|
48
|
+
(Join-Path $env:USERPROFILE 'scoop\apps\libreoffice\current\program\soffice.exe')
|
|
49
|
+
) | Where-Object { $_ }
|
|
50
|
+
foreach ($p in $candidates) { if (Test-Path $p) { return (Resolve-Path $p).Path } }
|
|
51
|
+
return $null
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
function Resolve-PdftoppmPath {
|
|
55
|
+
foreach ($n in @('pdftoppm.exe', 'pdftoppm', 'pdftocairo.exe', 'pdftocairo')) {
|
|
56
|
+
$cmd = Get-Command $n -ErrorAction SilentlyContinue
|
|
57
|
+
if ($cmd) { return $cmd.Source }
|
|
58
|
+
}
|
|
59
|
+
$candidates = @(
|
|
60
|
+
(Join-Path $env:USERPROFILE 'scoop\apps\poppler\current\bin\pdftoppm.exe'),
|
|
61
|
+
(Join-Path $env:ProgramData 'chocolatey\bin\pdftoppm.exe')
|
|
62
|
+
) | Where-Object { $_ }
|
|
63
|
+
foreach ($p in $candidates) { if (Test-Path $p) { return (Resolve-Path $p).Path } }
|
|
64
|
+
return $null
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
function Resolve-PythonCommand {
|
|
68
|
+
foreach ($name in @('python', 'python3', 'py')) {
|
|
69
|
+
$cmd = Get-Command $name -ErrorAction SilentlyContinue
|
|
70
|
+
if (-not $cmd) { continue }
|
|
71
|
+
if ($name -eq 'py') {
|
|
72
|
+
try {
|
|
73
|
+
& $cmd.Source -3 --version *> $null
|
|
74
|
+
if ($LASTEXITCODE -eq 0) { return @{ Cmd = $cmd.Source; Args = @('-3') } }
|
|
75
|
+
} catch { continue }
|
|
76
|
+
} else {
|
|
77
|
+
return @{ Cmd = $cmd.Source; Args = @() }
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
return $null
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
Write-Host "=== docx Environment Check (level: $Level) ==="
|
|
84
|
+
Write-Host ""
|
|
85
|
+
|
|
86
|
+
$Status = 'READY'
|
|
87
|
+
# Failure buckets — populated by CheckFail-style helpers, rendered at the end
|
|
88
|
+
# so the remediation section can speak in categories instead of one line per tool.
|
|
89
|
+
$script:MissingTools = New-Object System.Collections.Generic.List[string]
|
|
90
|
+
$script:LocaleBroken = $false
|
|
91
|
+
$script:LocaleHealed = $false # set when console was forced to UTF-8 for this
|
|
92
|
+
# session; READY path still emits an Advisory so
|
|
93
|
+
# the "forced for this session" message points
|
|
94
|
+
# the user at a persistent fix.
|
|
95
|
+
$script:LocaleHealedFrom = ''
|
|
96
|
+
$script:PermsBroken = $false
|
|
97
|
+
$script:ProjectBroken = $false
|
|
98
|
+
# Match env_check.sh's `printf '[OK] %-14s %s\n'` — 14-char left-justified column,
|
|
99
|
+
# ONE space separator, then the value. Without the explicit space, the format string
|
|
100
|
+
# `{0,-14}{1}` collapses when the name is exactly 14 chars wide.
|
|
101
|
+
function CheckOk { param([string]$Name, [string]$Detail) Write-Host ("[OK] {0,-14} {1}" -f $Name, $Detail) }
|
|
102
|
+
function CheckFail { param([string]$Name, [string]$Detail) Write-Host ("[FAIL] {0,-14} {1}" -f $Name, $Detail); $script:Status = 'NOT READY' }
|
|
103
|
+
function MarkMissingTool { param([string]$Name) $script:MissingTools.Add($Name) | Out-Null }
|
|
104
|
+
|
|
105
|
+
# --- read-level checks (always run) ---
|
|
106
|
+
|
|
107
|
+
$py = Resolve-PythonCommand
|
|
108
|
+
if (-not $py) {
|
|
109
|
+
CheckFail 'python3' 'not found'
|
|
110
|
+
MarkMissingTool 'python (3.x)'
|
|
111
|
+
} else {
|
|
112
|
+
$verLine = & $py.Cmd @($py.Args + '--version') 2>&1
|
|
113
|
+
$verNum = ($verLine -join ' ') -replace '.*?(\d+\.\d+(?:\.\d+)?).*', '$1'
|
|
114
|
+
CheckOk 'python3' $verNum
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
# unzip OR tar.exe (Windows 10 1803+) OR built-in Expand-Archive — any of them counts
|
|
118
|
+
if (Test-Command unzip) {
|
|
119
|
+
CheckOk 'unzip' 'available'
|
|
120
|
+
} elseif (Test-Command tar) {
|
|
121
|
+
CheckOk 'unzip' 'tar.exe (Windows 10+ native, handles .zip)'
|
|
122
|
+
} elseif (Get-Command Expand-Archive -ErrorAction SilentlyContinue) {
|
|
123
|
+
CheckOk 'unzip' 'Expand-Archive (PowerShell built-in)'
|
|
124
|
+
} else {
|
|
125
|
+
CheckFail 'unzip' 'no zip extractor found (unzip / tar.exe / Expand-Archive)'
|
|
126
|
+
MarkMissingTool 'unzip'
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
# Locale / encoding — UTF-8 console required for CJK
|
|
130
|
+
$enc = [Console]::OutputEncoding.WebName
|
|
131
|
+
if ($enc -match '^utf-?8$') {
|
|
132
|
+
CheckOk 'locale' "console=$enc"
|
|
133
|
+
} else {
|
|
134
|
+
# Try to force UTF-8 for this session and re-check
|
|
135
|
+
[Console]::OutputEncoding = [System.Text.Encoding]::UTF8
|
|
136
|
+
$enc2 = [Console]::OutputEncoding.WebName
|
|
137
|
+
if ($enc2 -match '^utf-?8$') {
|
|
138
|
+
CheckOk 'locale' "console=$enc2 (forced for this session — see advisory below to persist)"
|
|
139
|
+
$script:LocaleHealed = $true
|
|
140
|
+
$script:LocaleHealedFrom = $enc
|
|
141
|
+
} else {
|
|
142
|
+
CheckFail 'locale' "console=$enc — UTF-8 required, cannot force"
|
|
143
|
+
$script:LocaleBroken = $true
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
# Permission analogue on Windows: scripts unblocked (no Mark-of-the-Web).
|
|
148
|
+
# A blocked script will throw on Get-Item with -Stream Zone.Identifier.
|
|
149
|
+
$blocked = 0
|
|
150
|
+
foreach ($s in (Get-ChildItem -Path $ScriptDir -File -Filter '*.ps1' -ErrorAction SilentlyContinue)) {
|
|
151
|
+
try {
|
|
152
|
+
$null = Get-Item -LiteralPath $s.FullName -Stream 'Zone.Identifier' -ErrorAction Stop
|
|
153
|
+
$blocked++
|
|
154
|
+
} catch {
|
|
155
|
+
# No Zone.Identifier stream means NOT blocked — that's the desired state.
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
if ($blocked -eq 0) {
|
|
159
|
+
CheckOk 'permissions' 'all .ps1 scripts unblocked'
|
|
160
|
+
} else {
|
|
161
|
+
CheckFail 'permissions' "$blocked .ps1 script(s) carry Mark-of-the-Web (run setup.ps1 to unblock)"
|
|
162
|
+
$script:PermsBroken = $true
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
# --- render-level checks (render + full) ---
|
|
166
|
+
|
|
167
|
+
if ($Level -in @('Render', 'Full')) {
|
|
168
|
+
$sof = Resolve-SofficePath
|
|
169
|
+
if ($sof) { CheckOk 'soffice' $sof } else { CheckFail 'soffice' 'not found'; MarkMissingTool 'soffice.exe' }
|
|
170
|
+
|
|
171
|
+
$pp = Resolve-PdftoppmPath
|
|
172
|
+
if ($pp) { CheckOk 'pdftoppm' $pp } else { CheckFail 'pdftoppm' 'not found'; MarkMissingTool 'pdftoppm.exe' }
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
# --- full-level checks (full only) ---
|
|
176
|
+
|
|
177
|
+
if ($Level -eq 'Full') {
|
|
178
|
+
if (-not (Test-Command dotnet)) {
|
|
179
|
+
CheckFail 'dotnet' 'not found'
|
|
180
|
+
MarkMissingTool 'dotnet'
|
|
181
|
+
} else {
|
|
182
|
+
$ver = (& dotnet --version 2>$null)
|
|
183
|
+
if (-not $ver) { $ver = '0.0.0' }
|
|
184
|
+
try {
|
|
185
|
+
$major = [int](($ver -split '\.')[0])
|
|
186
|
+
} catch { $major = 0 }
|
|
187
|
+
if ($major -ge $DotnetRequiredMajor) {
|
|
188
|
+
CheckOk 'dotnet' "$ver (>= $DotnetRequiredMajor.0)"
|
|
189
|
+
} else {
|
|
190
|
+
CheckFail 'dotnet' "$ver (requires >= $DotnetRequiredMajor.0)"
|
|
191
|
+
MarkMissingTool "dotnet>=$DotnetRequiredMajor"
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
if (-not (Test-Command pandoc)) {
|
|
196
|
+
CheckFail 'pandoc' 'not found'
|
|
197
|
+
MarkMissingTool 'pandoc'
|
|
198
|
+
} else {
|
|
199
|
+
$pv = ((& pandoc --version 2>$null | Select-Object -First 1) -replace '.*?(\d+\.\d+(?:\.\d+)?).*', '$1')
|
|
200
|
+
CheckOk 'pandoc' $pv
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
if (Test-Command zip) {
|
|
204
|
+
CheckOk 'zip' 'available'
|
|
205
|
+
} elseif (Get-Command Compress-Archive -ErrorAction SilentlyContinue) {
|
|
206
|
+
CheckOk 'zip' 'Compress-Archive (PowerShell built-in)'
|
|
207
|
+
} else {
|
|
208
|
+
CheckFail 'zip' 'no zip writer (zip.exe / Compress-Archive)'
|
|
209
|
+
MarkMissingTool 'zip'
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
if (-not (Test-Path $DotnetDir -PathType Container)) {
|
|
213
|
+
CheckFail 'project' "directory not found: $DotnetDir"
|
|
214
|
+
$script:ProjectBroken = $true
|
|
215
|
+
} else {
|
|
216
|
+
$built = $false
|
|
217
|
+
foreach ($tfm in @('net10.0', 'net9.0', 'net8.0')) {
|
|
218
|
+
$dll = Join-Path $DotnetDir "AlranAIDocx.Cli\bin\Debug\$tfm\AlranAIDocx.Cli.dll"
|
|
219
|
+
if (Test-Path $dll) { $built = $true; break }
|
|
220
|
+
}
|
|
221
|
+
if ($built) {
|
|
222
|
+
CheckOk 'project' 'built'
|
|
223
|
+
} else {
|
|
224
|
+
try {
|
|
225
|
+
& dotnet restore $DotnetDir --verbosity quiet *> $null
|
|
226
|
+
if ($LASTEXITCODE -eq 0) {
|
|
227
|
+
& dotnet build $DotnetDir --verbosity quiet --no-restore *> $null
|
|
228
|
+
if ($LASTEXITCODE -eq 0) {
|
|
229
|
+
CheckOk 'project' 'restore+build succeeded'
|
|
230
|
+
} else {
|
|
231
|
+
CheckFail 'project' 'restore succeeded but build failed'
|
|
232
|
+
$script:ProjectBroken = $true
|
|
233
|
+
}
|
|
234
|
+
} else {
|
|
235
|
+
CheckFail 'project' 'restore failed'
|
|
236
|
+
$script:ProjectBroken = $true
|
|
237
|
+
}
|
|
238
|
+
} catch {
|
|
239
|
+
CheckFail 'project' "restore/build threw: $_"
|
|
240
|
+
$script:ProjectBroken = $true
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
Write-Host ""
|
|
247
|
+
if ($Status -eq 'READY') {
|
|
248
|
+
Write-Host 'Status: READY'
|
|
249
|
+
# Advisory — fulfils the "see advisory below to persist" promise on the
|
|
250
|
+
# OK line. Not a failure (we keep exit 0 and READY status), just a nudge so
|
|
251
|
+
# the next subprocess does not have to force UTF-8 again.
|
|
252
|
+
if ($script:LocaleHealed) {
|
|
253
|
+
Write-Host ''
|
|
254
|
+
Write-Host '----- Advisory -----'
|
|
255
|
+
Write-Host ''
|
|
256
|
+
Write-Host "[locale] Console encoding was forced to UTF-8 for this session (was console=$($script:LocaleHealedFrom))."
|
|
257
|
+
Write-Host ' Skill scripts in THIS PowerShell session will keep working — no further action needed.'
|
|
258
|
+
Write-Host ' But every NEW process starts from scratch and must force again.'
|
|
259
|
+
Write-Host ' To make UTF-8 sticky system-wide (Windows 10 1903+):'
|
|
260
|
+
Write-Host ' Settings -> Time & Language -> Language & region ->'
|
|
261
|
+
Write-Host ' Administrative language settings -> Change system locale ->'
|
|
262
|
+
Write-Host ' check "Beta: Use Unicode UTF-8 for worldwide language support" -> reboot.'
|
|
263
|
+
Write-Host ' Per-shell alternative, add to your $PROFILE so every PowerShell starts UTF-8:'
|
|
264
|
+
Write-Host ' chcp.com 65001 | Out-Null'
|
|
265
|
+
Write-Host ' [Console]::OutputEncoding = [System.Text.Encoding]::UTF8'
|
|
266
|
+
}
|
|
267
|
+
exit 0
|
|
268
|
+
} else {
|
|
269
|
+
Write-Host 'Status: NOT READY'
|
|
270
|
+
Write-Host ''
|
|
271
|
+
Write-Host '----- Remediation -----'
|
|
272
|
+
|
|
273
|
+
# Locale block — most common subprocess pitfall, surface first.
|
|
274
|
+
if ($script:LocaleBroken) {
|
|
275
|
+
Write-Host ''
|
|
276
|
+
Write-Host '[locale] PowerShell console is not UTF-8 and could not be forced.'
|
|
277
|
+
Write-Host ' Caller (one-shot for this session, no system changes):'
|
|
278
|
+
Write-Host ' chcp.com 65001 | Out-Null'
|
|
279
|
+
Write-Host ' [Console]::OutputEncoding = [System.Text.Encoding]::UTF8'
|
|
280
|
+
Write-Host ' Persist (System-wide UTF-8 — Windows 10 1903+):'
|
|
281
|
+
Write-Host ' Settings -> Time & Language -> Language & region ->'
|
|
282
|
+
Write-Host ' Administrative language settings -> Change system locale ->'
|
|
283
|
+
Write-Host ' check "Beta: Use Unicode UTF-8 for worldwide language support" -> reboot.'
|
|
284
|
+
Write-Host ' Or, per-shell, add the two lines above to your $PROFILE.'
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
# Permissions / MOTW
|
|
288
|
+
if ($script:PermsBroken) {
|
|
289
|
+
Write-Host ''
|
|
290
|
+
Write-Host '[permissions] Some .ps1 scripts carry Mark-of-the-Web. Fix:'
|
|
291
|
+
Write-Host " Get-ChildItem -Path '$ScriptDir' -Filter '*.ps1' | Unblock-File"
|
|
292
|
+
Write-Host ' Or run scripts/setup.ps1 which unblocks as part of setup.'
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
# Missing tools — composite hint
|
|
296
|
+
if ($script:MissingTools.Count -gt 0) {
|
|
297
|
+
$toolList = ($script:MissingTools | Sort-Object -Unique) -join ' '
|
|
298
|
+
Write-Host ''
|
|
299
|
+
Write-Host "[missing tools] $toolList"
|
|
300
|
+
Write-Host " Recommended: powershell -ExecutionPolicy Bypass -File `"$ScriptDir\setup.ps1`""
|
|
301
|
+
Write-Host ' setup.ps1 handles winget/scoop/choco fallbacks automatically.'
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
# dotnet project build failure
|
|
305
|
+
if ($script:ProjectBroken) {
|
|
306
|
+
Write-Host ''
|
|
307
|
+
Write-Host '[dotnet project] build/restore failed. To diagnose:'
|
|
308
|
+
Write-Host " dotnet restore `"$DotnetDir`" --verbosity normal"
|
|
309
|
+
Write-Host " dotnet build `"$DotnetDir`" --verbosity normal --no-restore"
|
|
310
|
+
Write-Host " Common causes: dotnet SDK < $DotnetRequiredMajor.0, blocked NuGet feed,"
|
|
311
|
+
Write-Host ' or a clobbered intermediate build. Try removing all bin/obj dirs under'
|
|
312
|
+
Write-Host ' the dotnet project tree, then rebuild.'
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
Write-Host ''
|
|
316
|
+
if ($Level -eq 'Read') {
|
|
317
|
+
Write-Host 'The read-level gate requires: python (3.x), zip extractor, UTF-8 console, unblocked scripts.'
|
|
318
|
+
Write-Host "Re-check: powershell -ExecutionPolicy Bypass -File `"$($MyInvocation.MyCommand.Path)`" -Level Read"
|
|
319
|
+
} elseif ($Level -eq 'Render') {
|
|
320
|
+
Write-Host 'The render-level gate requires read-level items plus: soffice.exe, pdftoppm.exe.'
|
|
321
|
+
Write-Host "Re-check: powershell -ExecutionPolicy Bypass -File `"$($MyInvocation.MyCommand.Path)`" -Level Render"
|
|
322
|
+
} else {
|
|
323
|
+
Write-Host "The full-level gate requires render-level items plus: dotnet>=$DotnetRequiredMajor, pandoc, zip writer, built dotnet project."
|
|
324
|
+
Write-Host "Re-check: powershell -ExecutionPolicy Bypass -File `"$($MyInvocation.MyCommand.Path)`" -Level Full"
|
|
325
|
+
}
|
|
326
|
+
exit 1
|
|
327
|
+
}
|
|
@@ -0,0 +1,340 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# docx strict environment check
|
|
3
|
+
# This script is authoritative for whether the skill may run.
|
|
4
|
+
# Supports --level read|render|full (default: full).
|
|
5
|
+
set -euo pipefail
|
|
6
|
+
|
|
7
|
+
# --- Parse --level argument ---
|
|
8
|
+
LEVEL="full"
|
|
9
|
+
while [[ $# -gt 0 ]]; do
|
|
10
|
+
case "$1" in
|
|
11
|
+
--level)
|
|
12
|
+
shift
|
|
13
|
+
LEVEL="${1:-}"
|
|
14
|
+
shift
|
|
15
|
+
;;
|
|
16
|
+
*)
|
|
17
|
+
echo "Unknown argument: $1" >&2
|
|
18
|
+
exit 2
|
|
19
|
+
;;
|
|
20
|
+
esac
|
|
21
|
+
done
|
|
22
|
+
|
|
23
|
+
case "$LEVEL" in
|
|
24
|
+
read|render|full) ;;
|
|
25
|
+
*)
|
|
26
|
+
echo "Invalid --level value: '$LEVEL'. Must be one of: read, render, full" >&2
|
|
27
|
+
exit 2
|
|
28
|
+
;;
|
|
29
|
+
esac
|
|
30
|
+
|
|
31
|
+
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
32
|
+
PROJECT_DIR="$(cd "$SCRIPT_DIR/.." && pwd)"
|
|
33
|
+
DOTNET_DIR="$SCRIPT_DIR/dotnet"
|
|
34
|
+
DOTNET_REQUIRED_MAJOR=9
|
|
35
|
+
|
|
36
|
+
export DOTNET_CLI_UI_LANGUAGE=en
|
|
37
|
+
|
|
38
|
+
resolve_soffice_path() {
|
|
39
|
+
local candidates=(
|
|
40
|
+
"$(command -v soffice 2>/dev/null || true)"
|
|
41
|
+
"$HOME/.local/bin/soffice"
|
|
42
|
+
"$HOME/Applications/LibreOffice.app/Contents/MacOS/soffice"
|
|
43
|
+
"/Applications/LibreOffice.app/Contents/MacOS/soffice"
|
|
44
|
+
)
|
|
45
|
+
local p
|
|
46
|
+
for p in "${candidates[@]}"; do
|
|
47
|
+
[ -n "$p" ] || continue
|
|
48
|
+
[ -x "$p" ] || continue
|
|
49
|
+
printf '%s\n' "$p"
|
|
50
|
+
return 0
|
|
51
|
+
done
|
|
52
|
+
return 1
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
OS="unknown"
|
|
56
|
+
case "$(uname -s)" in
|
|
57
|
+
Darwin) OS="macos" ;;
|
|
58
|
+
Linux) OS="linux"; grep -qi microsoft /proc/version 2>/dev/null && OS="wsl" ;;
|
|
59
|
+
MINGW*|MSYS*|CYGWIN*) OS="windows-shell" ;;
|
|
60
|
+
esac
|
|
61
|
+
|
|
62
|
+
echo "=== docx Environment Check (level: $LEVEL) ==="
|
|
63
|
+
echo ""
|
|
64
|
+
|
|
65
|
+
STATUS="READY"
|
|
66
|
+
# Failure buckets — populated by check_fail, rendered at the end so the
|
|
67
|
+
# remediation section can speak to the user in their language without
|
|
68
|
+
# repeating "go install python3" five times.
|
|
69
|
+
MISSING_TOOLS="" # python3, unzip, soffice, pdftoppm, dotnet, pandoc, zip
|
|
70
|
+
LOCALE_BROKEN=0
|
|
71
|
+
LOCALE_HEALED=0 # set when locale self-heal succeeds; READY path still emits
|
|
72
|
+
# a short advisory so the "see hint below" promise on the OK
|
|
73
|
+
# line is actually fulfilled (and the user gets the persist
|
|
74
|
+
# commands without having to fail the gate first).
|
|
75
|
+
LOCALE_HEALED_FROM_LANG=""
|
|
76
|
+
LOCALE_HEALED_FROM_CHARMAP=""
|
|
77
|
+
LOCALE_HEALED_TO=""
|
|
78
|
+
PERMS_BROKEN=0
|
|
79
|
+
PROJECT_BROKEN=0
|
|
80
|
+
|
|
81
|
+
check_ok() {
|
|
82
|
+
printf "[OK] %-14s %s\n" "$1" "$2"
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
check_fail() {
|
|
86
|
+
printf "[FAIL] %-14s %s\n" "$1" "$2"
|
|
87
|
+
STATUS="NOT READY"
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
# Same as check_fail but also tag the failure bucket so the end-of-run
|
|
91
|
+
# remediation section can be specific. We keep check_fail around because
|
|
92
|
+
# daemon-side parsers may scan for "[FAIL]" prefixes verbatim.
|
|
93
|
+
mark_missing_tool() {
|
|
94
|
+
MISSING_TOOLS="$MISSING_TOOLS $1"
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
# --- read-level checks (always run) ---
|
|
98
|
+
|
|
99
|
+
if ! command -v python3 >/dev/null 2>&1; then
|
|
100
|
+
check_fail "python3" "not found"
|
|
101
|
+
mark_missing_tool "python3"
|
|
102
|
+
else
|
|
103
|
+
check_ok "python3" "$(python3 --version 2>/dev/null | awk '{print $2}')"
|
|
104
|
+
fi
|
|
105
|
+
|
|
106
|
+
if ! command -v unzip >/dev/null 2>&1; then
|
|
107
|
+
check_fail "unzip" "not found"
|
|
108
|
+
mark_missing_tool "unzip"
|
|
109
|
+
else
|
|
110
|
+
check_ok "unzip" "available"
|
|
111
|
+
fi
|
|
112
|
+
|
|
113
|
+
# Locale check (3-step, with self-heal):
|
|
114
|
+
# 1. $LANG explicitly carries utf-8? -> OK
|
|
115
|
+
# 2. `locale charmap` reports UTF-8? -> OK (LANG empty is fine on macOS GUI shells)
|
|
116
|
+
# 3. Try hot-patching LC_ALL=C.UTF-8 for the rest of this run and re-check.
|
|
117
|
+
# This rescues subprocess contexts (skill spawners, daemon workers) where
|
|
118
|
+
# $LANG is stripped but a UTF-8 locale is installed.
|
|
119
|
+
# Otherwise -> fail with an actionable remediation in the summary block.
|
|
120
|
+
current_lang="${LANG:-}"
|
|
121
|
+
if [ -n "$current_lang" ] && echo "$current_lang" | grep -qi 'utf-8\|utf8'; then
|
|
122
|
+
check_ok "locale" "$current_lang"
|
|
123
|
+
else
|
|
124
|
+
charmap="$(locale charmap 2>/dev/null || echo "unknown")"
|
|
125
|
+
if echo "$charmap" | grep -qi 'utf-8\|utf8'; then
|
|
126
|
+
check_ok "locale" "charmap=$charmap (LANG empty/non-UTF-8, but system charmap is UTF-8)"
|
|
127
|
+
else
|
|
128
|
+
healed=0
|
|
129
|
+
for candidate in C.UTF-8 en_US.UTF-8; do
|
|
130
|
+
# Use a subshell + locale charmap so we don't depend on `locale -a`
|
|
131
|
+
# (which is slow on macOS and absent on minimal Linux images).
|
|
132
|
+
if [ "$(LC_ALL="$candidate" locale charmap 2>/dev/null)" = "UTF-8" ]; then
|
|
133
|
+
export LANG="$candidate"
|
|
134
|
+
export LC_ALL="$candidate"
|
|
135
|
+
check_ok "locale" "self-healed to $candidate (was LANG='$current_lang', charmap='$charmap'; see advisory below to persist)"
|
|
136
|
+
healed=1
|
|
137
|
+
LOCALE_HEALED=1
|
|
138
|
+
LOCALE_HEALED_FROM_LANG="$current_lang"
|
|
139
|
+
LOCALE_HEALED_FROM_CHARMAP="$charmap"
|
|
140
|
+
LOCALE_HEALED_TO="$candidate"
|
|
141
|
+
break
|
|
142
|
+
fi
|
|
143
|
+
done
|
|
144
|
+
if [ "$healed" -eq 0 ]; then
|
|
145
|
+
check_fail "locale" "LANG='$current_lang', charmap='$charmap' — neither is UTF-8 and self-heal failed"
|
|
146
|
+
LOCALE_BROKEN=1
|
|
147
|
+
fi
|
|
148
|
+
fi
|
|
149
|
+
fi
|
|
150
|
+
|
|
151
|
+
perm_issues=0
|
|
152
|
+
for s in "$SCRIPT_DIR"/*.sh; do
|
|
153
|
+
if [ -f "$s" ] && [ ! -x "$s" ]; then
|
|
154
|
+
perm_issues=$((perm_issues + 1))
|
|
155
|
+
fi
|
|
156
|
+
done
|
|
157
|
+
if [ "$perm_issues" -eq 0 ]; then
|
|
158
|
+
check_ok "permissions" "all scripts executable"
|
|
159
|
+
else
|
|
160
|
+
check_fail "permissions" "$perm_issues script(s) not executable"
|
|
161
|
+
PERMS_BROKEN=1
|
|
162
|
+
fi
|
|
163
|
+
|
|
164
|
+
# --- render-level checks (render + full) ---
|
|
165
|
+
|
|
166
|
+
if [[ "$LEVEL" == "render" || "$LEVEL" == "full" ]]; then
|
|
167
|
+
SOFFICE_PATH="$(resolve_soffice_path 2>/dev/null || true)"
|
|
168
|
+
if [ -z "$SOFFICE_PATH" ]; then
|
|
169
|
+
check_fail "soffice" "not found"
|
|
170
|
+
mark_missing_tool "soffice"
|
|
171
|
+
else
|
|
172
|
+
check_ok "soffice" "$SOFFICE_PATH"
|
|
173
|
+
fi
|
|
174
|
+
|
|
175
|
+
if ! command -v pdftoppm >/dev/null 2>&1; then
|
|
176
|
+
check_fail "pdftoppm" "not found"
|
|
177
|
+
mark_missing_tool "pdftoppm"
|
|
178
|
+
else
|
|
179
|
+
check_ok "pdftoppm" "available"
|
|
180
|
+
fi
|
|
181
|
+
fi
|
|
182
|
+
|
|
183
|
+
# --- full-level checks (full only) ---
|
|
184
|
+
|
|
185
|
+
if [[ "$LEVEL" == "full" ]]; then
|
|
186
|
+
if ! command -v dotnet >/dev/null 2>&1; then
|
|
187
|
+
check_fail "dotnet" "not found"
|
|
188
|
+
mark_missing_tool "dotnet"
|
|
189
|
+
else
|
|
190
|
+
ver="$(dotnet --version 2>/dev/null || echo 0.0.0)"
|
|
191
|
+
major="${ver%%.*}"
|
|
192
|
+
if [ "$major" -ge "$DOTNET_REQUIRED_MAJOR" ] 2>/dev/null; then
|
|
193
|
+
check_ok "dotnet" "$ver (>= $DOTNET_REQUIRED_MAJOR.0)"
|
|
194
|
+
else
|
|
195
|
+
check_fail "dotnet" "$ver (requires >= $DOTNET_REQUIRED_MAJOR.0)"
|
|
196
|
+
mark_missing_tool "dotnet"
|
|
197
|
+
fi
|
|
198
|
+
fi
|
|
199
|
+
|
|
200
|
+
if ! command -v pandoc >/dev/null 2>&1; then
|
|
201
|
+
check_fail "pandoc" "not found"
|
|
202
|
+
mark_missing_tool "pandoc"
|
|
203
|
+
else
|
|
204
|
+
check_ok "pandoc" "$(pandoc --version 2>/dev/null | head -1 | grep -oE '[0-9]+\.[0-9]+(\.[0-9]+)?' || echo '?')"
|
|
205
|
+
fi
|
|
206
|
+
|
|
207
|
+
if ! command -v zip >/dev/null 2>&1; then
|
|
208
|
+
check_fail "zip" "not found"
|
|
209
|
+
mark_missing_tool "zip"
|
|
210
|
+
else
|
|
211
|
+
check_ok "zip" "available"
|
|
212
|
+
fi
|
|
213
|
+
|
|
214
|
+
if [ ! -d "$DOTNET_DIR" ]; then
|
|
215
|
+
check_fail "project" "directory not found: $DOTNET_DIR"
|
|
216
|
+
PROJECT_BROKEN=1
|
|
217
|
+
else
|
|
218
|
+
if [ -f "$DOTNET_DIR/AlranAIDocx.Cli/bin/Debug/net10.0/AlranAIDocx.Cli.dll" ] || \
|
|
219
|
+
[ -f "$DOTNET_DIR/AlranAIDocx.Cli/bin/Debug/net9.0/AlranAIDocx.Cli.dll" ] || \
|
|
220
|
+
[ -f "$DOTNET_DIR/AlranAIDocx.Cli/bin/Debug/net8.0/AlranAIDocx.Cli.dll" ]; then
|
|
221
|
+
check_ok "project" "built"
|
|
222
|
+
else
|
|
223
|
+
if dotnet restore "$DOTNET_DIR" --verbosity quiet >/dev/null 2>&1 && \
|
|
224
|
+
dotnet build "$DOTNET_DIR" --verbosity quiet --no-restore >/dev/null 2>&1; then
|
|
225
|
+
check_ok "project" "restore+build succeeded"
|
|
226
|
+
else
|
|
227
|
+
check_fail "project" "restore/build failed"
|
|
228
|
+
PROJECT_BROKEN=1
|
|
229
|
+
fi
|
|
230
|
+
fi
|
|
231
|
+
fi
|
|
232
|
+
fi
|
|
233
|
+
|
|
234
|
+
echo ""
|
|
235
|
+
if [ "$STATUS" = "READY" ]; then
|
|
236
|
+
echo "Status: READY"
|
|
237
|
+
# Advisory — fulfils the "see advisory below to persist" promise on the
|
|
238
|
+
# self-heal OK line. Not a failure (we keep exit 0 and READY status), just a
|
|
239
|
+
# nudge so the next subprocess does not have to self-heal again.
|
|
240
|
+
if [ "$LOCALE_HEALED" -eq 1 ]; then
|
|
241
|
+
echo ""
|
|
242
|
+
echo "----- Advisory -----"
|
|
243
|
+
echo ""
|
|
244
|
+
echo "[locale] Self-healed to '$LOCALE_HEALED_TO' for this run (was LANG='$LOCALE_HEALED_FROM_LANG', charmap='$LOCALE_HEALED_FROM_CHARMAP')."
|
|
245
|
+
echo " Skill scripts in THIS shell will keep working — no further action needed."
|
|
246
|
+
echo " But every NEW subprocess starts from scratch and must self-heal again."
|
|
247
|
+
echo " To make UTF-8 sticky for the Alran daemon and its workers:"
|
|
248
|
+
if [ "$OS" = "macos" ]; then
|
|
249
|
+
echo " launchctl setenv LANG en_US.UTF-8"
|
|
250
|
+
echo " launchctl setenv LC_ALL en_US.UTF-8"
|
|
251
|
+
echo " # then restart the daemon so it inherits the new env"
|
|
252
|
+
elif [ "$OS" = "linux" ] || [ "$OS" = "wsl" ]; then
|
|
253
|
+
echo " # daemon launched via systemd: add to your unit file's [Service] section:"
|
|
254
|
+
echo " Environment=LANG=en_US.UTF-8"
|
|
255
|
+
echo " Environment=LC_ALL=en_US.UTF-8"
|
|
256
|
+
echo " # daemon launched from shell: export the two vars in the parent shell"
|
|
257
|
+
echo " # before starting the daemon (NOT in ~/.zshrc — see below)."
|
|
258
|
+
fi
|
|
259
|
+
echo " Note: editing ~/.zshrc does NOT help — Alran subprocesses are non-interactive"
|
|
260
|
+
echo " and never source it. Use the launchctl / systemd / parent-shell paths above."
|
|
261
|
+
fi
|
|
262
|
+
else
|
|
263
|
+
echo "Status: NOT READY"
|
|
264
|
+
echo ""
|
|
265
|
+
echo "----- Remediation -----"
|
|
266
|
+
|
|
267
|
+
# Locale block — most common subprocess/skill-spawner pitfall, surface first.
|
|
268
|
+
if [ "$LOCALE_BROKEN" -eq 1 ]; then
|
|
269
|
+
echo ""
|
|
270
|
+
echo "[locale] No UTF-8 locale is exposed to this process."
|
|
271
|
+
echo " Caller (one-shot, no system changes):"
|
|
272
|
+
echo " LANG=en_US.UTF-8 LC_ALL=en_US.UTF-8 bash $0 --level $LEVEL"
|
|
273
|
+
if [ "$OS" = "macos" ]; then
|
|
274
|
+
echo " macOS (persist for GUI apps + Alran daemon; survives reboot once set in launchd):"
|
|
275
|
+
echo " launchctl setenv LANG en_US.UTF-8"
|
|
276
|
+
echo " launchctl setenv LC_ALL en_US.UTF-8"
|
|
277
|
+
echo " Then restart the daemon so it inherits the new env."
|
|
278
|
+
elif [ "$OS" = "linux" ] || [ "$OS" = "wsl" ]; then
|
|
279
|
+
echo " Linux/WSL (persist for interactive shells):"
|
|
280
|
+
echo " echo 'export LANG=en_US.UTF-8' >> ~/.bashrc"
|
|
281
|
+
echo " echo 'export LC_ALL=en_US.UTF-8' >> ~/.bashrc"
|
|
282
|
+
echo " If your distro has no en_US.UTF-8, install glibc-locale-source / glibc-langpack-en"
|
|
283
|
+
echo " or add 'en_US.UTF-8 UTF-8' to /etc/locale.gen and run 'sudo locale-gen'."
|
|
284
|
+
fi
|
|
285
|
+
echo " Note: editing ~/.zshrc does NOT help — Alran subprocesses are non-interactive"
|
|
286
|
+
echo " and never source it. Use launchctl (macOS) or the caller-prefix approach."
|
|
287
|
+
fi
|
|
288
|
+
|
|
289
|
+
# Permissions block — cheap to fix, surface before tool installs.
|
|
290
|
+
if [ "$PERMS_BROKEN" -eq 1 ]; then
|
|
291
|
+
echo ""
|
|
292
|
+
echo "[permissions] Some scripts are not executable. Fix:"
|
|
293
|
+
echo " chmod +x $SCRIPT_DIR/*.sh"
|
|
294
|
+
fi
|
|
295
|
+
|
|
296
|
+
# Missing tools block — show one composite install hint instead of one per tool.
|
|
297
|
+
if [ -n "$MISSING_TOOLS" ]; then
|
|
298
|
+
# Squash leading space + dedup.
|
|
299
|
+
tools="$(echo "$MISSING_TOOLS" | tr ' ' '\n' | awk 'NF' | sort -u | tr '\n' ' ')"
|
|
300
|
+
echo ""
|
|
301
|
+
echo "[missing tools] $tools"
|
|
302
|
+
if [ "$OS" = "macos" ]; then
|
|
303
|
+
echo " Recommended: bash $SCRIPT_DIR/setup.sh"
|
|
304
|
+
echo " This installs everything via Homebrew without sudo."
|
|
305
|
+
elif [ "$OS" = "linux" ] || [ "$OS" = "wsl" ]; then
|
|
306
|
+
# apt is the most common; pacman/dnf users will know what to do.
|
|
307
|
+
echo " Debian/Ubuntu: sudo apt-get update && sudo apt-get install -y \\"
|
|
308
|
+
echo " python3 unzip zip libreoffice poppler-utils pandoc"
|
|
309
|
+
echo " dotnet: see https://learn.microsoft.com/dotnet/core/install/linux"
|
|
310
|
+
echo " Or, if package manager is unavailable: bash $SCRIPT_DIR/setup.sh"
|
|
311
|
+
else
|
|
312
|
+
echo " Run: bash $SCRIPT_DIR/setup.sh"
|
|
313
|
+
fi
|
|
314
|
+
fi
|
|
315
|
+
|
|
316
|
+
# dotnet project build failure — usually means dotnet SDK is too old or
|
|
317
|
+
# NuGet feed is blocked. Not solvable by re-running setup blindly.
|
|
318
|
+
if [ "$PROJECT_BROKEN" -eq 1 ]; then
|
|
319
|
+
echo ""
|
|
320
|
+
echo "[dotnet project] build/restore failed. To diagnose:"
|
|
321
|
+
echo " dotnet restore $DOTNET_DIR --verbosity normal"
|
|
322
|
+
echo " dotnet build $DOTNET_DIR --verbosity normal --no-restore"
|
|
323
|
+
echo " Common causes: dotnet SDK < $DOTNET_REQUIRED_MAJOR.0, blocked NuGet feed,"
|
|
324
|
+
echo " or a clobbered intermediate build. Try 'rm -rf $DOTNET_DIR/**/{bin,obj}' then rebuild."
|
|
325
|
+
fi
|
|
326
|
+
|
|
327
|
+
# Level-specific tail.
|
|
328
|
+
echo ""
|
|
329
|
+
if [[ "$LEVEL" == "read" ]]; then
|
|
330
|
+
echo "The read-level gate requires: python3, unzip, UTF-8 locale, executable scripts."
|
|
331
|
+
echo "Re-check with: bash $0 --level read"
|
|
332
|
+
elif [[ "$LEVEL" == "render" ]]; then
|
|
333
|
+
echo "The render-level gate requires read-level items plus: soffice, pdftoppm."
|
|
334
|
+
echo "Re-check with: bash $0 --level render"
|
|
335
|
+
else
|
|
336
|
+
echo "The full-level gate requires render-level items plus: dotnet>=$DOTNET_REQUIRED_MAJOR, pandoc, zip, built dotnet project."
|
|
337
|
+
echo "Re-check with: bash $0 --level full"
|
|
338
|
+
fi
|
|
339
|
+
exit 1
|
|
340
|
+
fi
|