2654400439/Paper2Seminar / skills/paper-ppt-orchestrator
paper-ppt-orchestrator
VerifiedBuild 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.
webapp/job_runner.py
View on GitHub"""Detached runner used by the Streamlit task console."""
from __future__ import annotations
import json
import os
import subprocess
import sys
from pathlib import Path
from backend import CodexAdapter, repository_root, utc_now, write_json_atomic
from job_request import JobRequestError, validate_request
def agent_environment(job_dir: Path) -> dict[str, str]:
environment = os.environ.copy()
cache_dir = job_dir / ".cache"
yolo_dir = cache_dir / "yolo"
matplotlib_dir = cache_dir / "matplotlib"
yolo_dir.mkdir(parents=True, exist_ok=True)
matplotlib_dir.mkdir(parents=True, exist_ok=True)
environment["YOLO_CONFIG_DIR"] = str(yolo_dir.resolve())
environment["MPLCONFIGDIR"] = str(matplotlib_dir.resolve())
return environment
def update(path: Path, request: dict, state: str, message: str, **extra: object) -> None:
write_json_atomic(
path,
{
"job_id": request["job"]["id"],
"state": state,
"message": message,
"updated_at": utc_now(),
**extra,
},
)
def main() -> int:
if len(sys.argv) != 2:
print("usage: job_runner.py JOB_REQUEST", file=sys.stderr)
return 2
request_path = Path(sys.argv[1]).resolve()
request = json.loads(request_path.read_text(encoding="utf-8"))
try:
validate_request(request)
except JobRequestError as exc:
print(f"invalid job request: {exc}", file=sys.stderr)
return 2
if request["interaction"]["confirmed"] is not True:
print("job request is not confirmed", file=sys.stderr)
return 2
paths = request["execution"]["paths"]
job_dir = Path(paths["job_dir"])
status_path = job_dir / "job-status.json"
log_path = job_dir / "agent.log"
prompt = (job_dir / "agent-prompt.txt").read_text(encoding="utf-8")
try:
command = CodexAdapter.command(repository_root())
environment = agent_environment(job_dir)
update(status_path, request, "running", "Agent 正在执行完整工作流")
with log_path.open("w", encoding="utf-8") as log:
process = subprocess.Popen(
command,
cwd=repository_root(),
stdin=subprocess.PIPE,
stdout=log,
stderr=subprocess.STDOUT,
text=True,
encoding="utf-8",
errors="replace",
env=environment,
)
process.communicate(prompt)
output = Path(paths["output_pptx"])
if process.returncode != 0:
update(status_path, request, "failed", f"Agent 退出码为 {process.returncode}", log=str(log_path))
return process.returncode or 1
if not output.is_file():
update(status_path, request, "failed", "Agent 已结束,但没有找到最终 PPTX", log=str(log_path))
return 1
update(
status_path,
request,
"completed",
"PPT 已生成并完成验证",
output_pptx=str(output),
log=str(log_path),
)
return 0
except Exception as exc:
update(status_path, request, "failed", str(exc), log=str(log_path))
return 1
if __name__ == "__main__":
raise SystemExit(main())
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| 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: 472k | Updated | Claude CodeCodex | Verified | Install |
| 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: 472k | Updated | Claude CodeCodex | Verified | Install |
| rea-tool-designmorluto/reaAudit, investigate, design, or change REA investigation tools, CLI/MCP contracts, provider capabilities, and Evidence semantics. | Stars: 472k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-auditDietrichGebert/ponytailQuality audit of the whole repo: bugs, security, real load, missing tests, speed, and what to delete. Most important first. | Stars: 196k | Updated | Claude CodeCodex | Verified | Install |