Skip to content

2654400439/Paper2Seminar / skills/paper-ppt-orchestrator

paper-ppt-orchestrator

Verified

Build complete fixed-layout academic-paper presentations from a PDF with bundled PPTX and one-page HTML templates. Use for full paper reading, complexity-aware slide budgeting, subsection coverage mapping, figure extraction, TikZ or Matplotlib evidence visuals, deterministic PPTX assembly, and final QA. Trigger for requests to turn a paper PDF into a discussion-group deck, especially 12-16+ page systems, security, networking, or measurement papers.

FileKindSize
SKILL.mdskill md17.9 KB
agents/openai.yamlconfig296 B
assets/one-page-summary.htmlother7.8 KB
assets/seminar-template.pptxbinary572.7 KB
references/content-design.mdmarkdown5.7 KB
references/data-viz.schema.jsonconfig2.9 KB
references/deck-plan.schema.jsonconfig8.5 KB
references/deck-sizing.mdmarkdown3.4 KB
references/environment-compatibility.mdmarkdown2.8 KB
references/feature-registry.jsonconfig1.4 KB
references/figure-extraction.mdmarkdown5.1 KB
references/job-request.defaults.jsonconfig1.6 KB
references/job-request.schema.jsonconfig7.5 KB
references/one-page-template.mdmarkdown3.1 KB
references/qa-gates.mdmarkdown10.0 KB
references/speaker-notes.mdmarkdown3.1 KB
references/template-contract.mdmarkdown5.1 KB
references/tikz-layout.mdmarkdown12.2 KB
references/visual-selection.mdmarkdown6.5 KB
references/workflow.mdmarkdown9.8 KB
requirements-doclayout.txtmarkdown238 B
requirements-ui.txtmarkdown39 B
requirements.txtmanifest68 B
scripts/apply_speaker_notes.pyscript6.1 KB
scripts/build_ppt.pyscript16.3 KB
scripts/crop_author_block.pyscript7.9 KB
scripts/crop_image_region.pyscript2.4 KB
scripts/export_pptx_pages.ps1script1.3 KB
scripts/extract_paper_assets.pyscript22.3 KB
scripts/job_request.pyscript17.1 KB
scripts/make_contact_sheet.pyscript4.0 KB
scripts/paper_ppt.pyscript17.1 KB
scripts/preflight_capabilities.pyscript8.3 KB
scripts/render_data_viz.pyscript14.6 KB
scripts/render_deck_overview.pyscript2.4 KB
scripts/render_one_page_html.pyscript13.4 KB
scripts/render_readability.pyscript4.1 KB
scripts/update_qa_status.pyscript10.1 KB
scripts/validate_deck_plan.pyscript33.9 KB
webapp/__init__.pyscript49 B
webapp/backend.pyscript14.5 KB
webapp/job_runner.pyscript3.2 KB
webapp/streamlit_app.pyscript17.3 KB

scripts/preflight_capabilities.py

View on GitHub
#!/usr/bin/env python3
"""Inspect host tools and record agent-visible media capabilities."""

from __future__ import annotations

import argparse
import importlib.util
import json
import os
import platform
import shutil
import subprocess
import sys
from datetime import datetime, timezone
from pathlib import Path
from typing import Any

from render_one_page_html import browser_candidates, browser_version
from extract_paper_assets import MODEL_SHA256, default_model_path, sha256_file


DECLARED_STATES = ("available", "unavailable", "unknown")


def command_version(path: str | Path, arguments: tuple[str, ...] = ("--version",)) -> str:
    try:
        completed = subprocess.run(
            [str(path), *arguments],
            text=True,
            encoding="utf-8",
            errors="replace",
            capture_output=True,
            check=False,
            timeout=8,
        )
    except (OSError, subprocess.TimeoutExpired):
        return "unknown"
    payload = completed.stdout.strip() or completed.stderr.strip()
    lines = [
        line.strip()
        for line in payload.splitlines()
        if line.strip() and " INFO " not in line and " ERROR " not in line
    ]
    return (lines[0] if lines else "unknown")[:300]


def executable_record(
    names: tuple[str, ...],
    version_arguments: tuple[str, ...] = ("--version",),
) -> dict[str, Any]:
    for name in names:
        path = shutil.which(name)
        if path:
            return {
                "status": "available",
                "path": str(Path(path).resolve()),
                "version": command_version(path, version_arguments),
            }
    return {"status": "unavailable", "path": None, "version": None}


def module_record(name: str) -> dict[str, Any]:
    return {"status": "available" if importlib.util.find_spec(name) else "unavailable"}


def model_record() -> dict[str, Any]:
    path = default_model_path().expanduser()
    if not path.is_file():
        return {"status": "unavailable", "path": str(path), "sha256": None}
    digest = sha256_file(path)
    return {
        "status": "available" if digest == MODEL_SHA256 else "hash_mismatch",
        "path": str(path.resolve()),
        "sha256": digest,
    }


def find_powerpoint() -> Path | None:
    direct = shutil.which("POWERPNT") or shutil.which("POWERPNT.EXE")
    if direct:
        return Path(direct).resolve()
    if platform.system() != "Windows":
        return None
    roots = [os.environ.get("PROGRAMFILES"), os.environ.get("PROGRAMFILES(X86)")]
    for root in roots:
        if not root:
            continue
        candidate = Path(root) / "Microsoft Office" / "root" / "Office16" / "POWERPNT.EXE"
        if candidate.is_file():
            return candidate.resolve()
    try:
        import winreg

        with winreg.OpenKey(
            winreg.HKEY_LOCAL_MACHINE,
            r"SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\POWERPNT.EXE",
        ) as key:
            value, _ = winreg.QueryValueEx(key, None)
            candidate = Path(value)
            return candidate.resolve() if candidate.is_file() else None
    except (ImportError, FileNotFoundError, OSError):
        return None


def choose_conceptual_mode(imagegen: str, web_search: str) -> dict[str, str]:
    if imagegen == "available":
        return {
            "selected": "imagegen",
            "reason": "image generation was declared available",
        }
    if imagegen == "unavailable" and web_search == "available":
        return {
            "selected": "external_image",
            "reason": "image generation is unavailable and licensed image search is available",
        }
    if imagegen == "unavailable" and web_search == "unavailable":
        return {
            "selected": "tikz_or_none",
            "reason": "neither image generation nor web image search is available",
        }
    return {
        "selected": "unresolved",
        "reason": "declare imagegen and web-search capability before visual routing",
    }


def build_report(imagegen: str, web_search: str) -> dict[str, Any]:
    browsers = browser_candidates()
    powerpoint = find_powerpoint()
    warnings: list[str] = []
    if not browsers:
        warnings.append("No Chromium-family browser was found; fixed one-page rendering is unavailable.")
    if platform.system() == "Windows" and powerpoint is None:
        warnings.append("PowerPoint was not found; use LibreOffice or OfficeCLI for slide rendering.")
    if imagegen == "unknown" or web_search == "unknown":
        warnings.append("Agent-only media capabilities remain unknown; do not retry blindly before declaring them.")
    layout_model = model_record()
    doclayout_modules = {
        name: module_record(name)
        for name in ("doclayout_yolo", "torch", "torchvision", "cv2", "numpy")
    }
    if layout_model["status"] == "hash_mismatch":
        warnings.append("The cached DocLayout model failed SHA-256 verification; do not load it.")
    doclayout_available = layout_model["status"] == "available" and all(
        item["status"] == "available" for item in doclayout_modules.values()
    )
    if not doclayout_available:
        warnings.append(
            "Default DocLayout extraction is unavailable; install requirements-doclayout.txt "
            "and download the pinned model, or select an explicit fallback."
        )

    return {
        "schema_version": "0.1",
        "generated_at": datetime.now(timezone.utc).isoformat(),
        "host": {
            "platform": platform.platform(),
            "python": sys.version.split()[0],
            "executable": sys.executable,
        },
        "agent_declared": {
            "imagegen": imagegen,
            "web_search": web_search,
        },
        "routing": {
            "conceptual_visual": choose_conceptual_mode(imagegen, web_search),
            "fallback_order": ["imagegen", "external_image", "tikz_or_none"],
        },
        "tools": {
            "browsers": [
                {"path": str(browser), "version": browser_version(browser)} for browser in browsers
            ],
            "officecli": executable_record(("officecli",)),
            "xelatex": executable_record(("xelatex",)),
            "pdftoppm": executable_record(("pdftoppm",), ("-v",)),
            "libreoffice": executable_record(("libreoffice", "soffice")),
            "powershell_7": executable_record(("pwsh",)),
            "windows_powershell": executable_record(
                ("powershell", "powershell.exe"),
                ("-NoProfile", "-Command", "$PSVersionTable.PSVersion.ToString()"),
            ),
            "powerpoint": {
                "status": "installed" if powerpoint else "unavailable",
                "path": str(powerpoint) if powerpoint else None,
                "runtime_access": "not_probed",
            },
            "captioncrop": executable_record(("caption-crop", "captioncrop", "caption_crop.py")),
        },
        "python_modules": {
            name: module_record(name) for name in ("fitz", "PIL", "matplotlib", "jsonschema")
        },
        "paper_asset_extraction": {
            "default_backend": "doclayout",
            "doclayout": {
                "model": layout_model,
                "modules": doclayout_modules,
                "status": "available" if doclayout_available else "unavailable",
            },
            "captioncrop": {
                "status": "optional_external_tool",
                "selection": "use --backend captioncrop and --captioncrop-command when it is not on PATH",
            },
        },
        "warnings": warnings,
    }


def main() -> int:
    parser = argparse.ArgumentParser(description=__doc__)
    parser.add_argument("-o", "--output", type=Path)
    parser.add_argument("--imagegen", choices=DECLARED_STATES, default="unknown")
    parser.add_argument("--web-search", choices=DECLARED_STATES, default="unknown")
    args = parser.parse_args()
    report = build_report(args.imagegen, args.web_search)
    payload = json.dumps(report, ensure_ascii=False, indent=2)
    if args.output:
        args.output.parent.mkdir(parents=True, exist_ok=True)
        args.output.write_text(payload + "\n", encoding="utf-8")
        print(f"Capability report: {args.output.resolve()}")
    else:
        print(payload)
    selected = report["routing"]["conceptual_visual"]["selected"]
    print(f"Conceptual visual route: {selected}")
    return 0


if __name__ == "__main__":
    raise SystemExit(main())
rea-analysis-optimizationmorluto/reaOptimize REA providers and shared analysis workflows for agent context, latency, CPU, and memory while preserving correctness and Evidence. Use for analysis bottlenecks and cache or query design; CI/test-suite optimization belongs to rea-ci-tests-audit.Stars: 472kUpdated Claude CodeCodexVerifiedInstall
rea-ci-tests-auditmorluto/reaAudit REA CI and test suites for correctness, fixture drift, false passes, and measured performance; use for suite or workflow investigations and efficiency changes, rather than ordinary feature testing or a single test failure.Stars: 472kUpdated Claude CodeCodexVerifiedInstall
rea-tool-designmorluto/reaAudit, investigate, design, or change REA investigation tools, CLI/MCP contracts, provider capabilities, and Evidence semantics.Stars: 472kUpdated Claude CodeCodexVerifiedInstall
ponytail-auditDietrichGebert/ponytailQuality audit of the whole repo: bugs, security, real load, missing tests, speed, and what to delete. Most important first.Stars: 196kUpdated Claude CodeCodexVerifiedInstall