AI turns documents or topics into real, native PowerPoint decks—with native shapes, transitions and animations, data-backed charts and tables on demand, audio narration from speaker notes, and support for your own .pptx templates. · by Hugo He
chore(scripts): normalize python script style and typing annotations
hugohe3c44390566376
diff --git a/skills/ppt-master/scripts/analyze_images.py b/skills/ppt-master/scripts/analyze_images.pyindex 2adb4a0f..0ffa941e 100644--- a/skills/ppt-master/scripts/analyze_images.py+++ b/skills/ppt-master/scripts/analyze_images.py@@ -24,28 +24,42 @@ except ImportError:print("Error: PIL/Pillow not installed. Run: pip install Pillow")sys.exit(1)+IMAGE_EXTENSIONS = {".jpg", ".jpeg", ".png", ".gif", ".webp", ".bmp", ".tiff", ".tif"}+REPORT_WIDTH = 100+CATEGORY_WIDTH = 50+PPT_WIDTH = 1280+PPT_HEIGHT = 720+FULL_SCREEN_MIN_RATIO = 1.5+FULL_SCREEN_MAX_RATIO = 2.0-def analyze_images(images_dir):- """Analyze size information of all images in the specified directory"""+ImageAnalysis = dict[str, str | float | int]- # Supported image formats- image_extensions = {'.jpg', '.jpeg', '.png', '.gif', '.webp', '.bmp', '.tiff', '.tif'}- results = []+def analyze_images(images_dir: str) -> list[ImageAnalysis]:+ """Analyze all image files in a directory.++ Args:+ images_dir: Directory that contains image files.++ Returns:+ A list of image analysis records sorted by filename.+ """++ results: list[ImageAnalysis] = []# Iterate through all files in the directoryfor filename in sorted(os.listdir(images_dir)):filepath = os.path.join(images_dir, filename)# Check if it is an image file- if os.path.isfile(filepath) and Path(filename).suffix.lower() in image_extensions:+ if os.path.isfile(filepath) and Path(filename).suffix.lower() in IMAGE_EXTENSIONS:try:with Image.open(filepath) as img:width, height = img.sizeaspect_ratio = width / height# Determine PPT layout recommendation- if aspect_ratio > 1.5:+ if aspect_ratio > FULL_SCREEN_MIN_RATIO:layout_hint = "Wide landscape"elif aspect_ratio > 1.2:layout_hint = "Standard landscape"@@ -70,26 +84,30 @@ def analyze_images(images_dir):return results-def print_results(results):- """Print analysis results"""+def print_results(results: list[ImageAnalysis]) -> None:+ """Print the analysis report to stdout.- print("\n" + "="*100)+ Args:+ results: Image analysis records returned by `analyze_images`.+ """++ print("\n" + "=" * REPORT_WIDTH)print("Image Size Analysis Report")- print("="*100)+ print("=" * REPORT_WIDTH)# Table headerprint(f"\n{'No.':<4} {'Width':<7} {'Height':<7} {'Ratio':<7} {'Size':<10} {'Layout':<15} {'Filename'}")- print("-"*100)+ print("-" * REPORT_WIDTH)for i, img in enumerate(results, 1):print(f"{i:<4} {img['width']:<7} {img['height']:<7} {img['aspect_ratio']:<7.2f} {img['filesize_kb']:<10.1f}KB {img['layout_hint']:<15} {img['filename'][:40]}")- print("-"*100)+ print("-" * REPORT_WIDTH)print(f"Total: {len(results)} images\n")# Group statistics by aspect ratioprint("\nGroup by Aspect Ratio:")- print("-"*50)+ print("-" * CATEGORY_WIDTH)categories = {"Wide (>1.5)": [],@@ -121,28 +139,32 @@ def print_results(results):print(f" ... and {len(imgs) - 5} more")# PPT layout recommendations- print("\\n" + "="*100)+ print("\\n" + "=" * REPORT_WIDTH)print("PPT Fit Suggestions (16:9 = 1280x720)")- print("="*100)+ print("=" * REPORT_WIDTH)- ppt_width, ppt_height = 1280, 720+ ppt_width, ppt_height = PPT_WIDTH, PPT_HEIGHTppt_ratio = ppt_width / ppt_heightprint(f"\\nStandard PPT canvas: {ppt_width}x{ppt_height} (ratio {ppt_ratio:.2f})")fit_count = 0for img in results:- if 1.5 <= img['aspect_ratio'] <= 2.0:+ if FULL_SCREEN_MIN_RATIO <= img["aspect_ratio"] <= FULL_SCREEN_MAX_RATIO:fit_count += 1print(f"\\nImages suitable for full-screen display: {fit_count}")-def generate_markdown(results):- """Generate a Markdown-format image resource inventory"""- print("\\n" + "="*100)+def generate_markdown(results: list[ImageAnalysis]) -> None:+ """Print a Markdown-ready image inventory section.++ Args:+ results: Image analysis records returned by `analyze_images`.+ """+ print("\\n" + "=" * REPORT_WIDTH)print("Markdown Snippet for Strategist (Copy & Paste)")- print("="*100)+ print("=" * REPORT_WIDTH)print("\\n## Image Resource Inventory (Auto-scan Results)\\n")print("| Filename | Size | Ratio | Layout Suggestion | Usage | Status | Generation Description |")print("|----------|------|-------|-------------------|-------|--------|-----------------------|")@@ -159,11 +181,16 @@ def generate_markdown(results):# Usage and generation description to be filled in by the strategist; placeholders used hereprint(f"| {img['filename']} | {img['width']}x{img['height']} | {img['aspect_ratio']:.2f} | {layout_desc} | (to be filled) | Existing | - |")- print("\\n" + "="*100 + "\\n")+ print("\\n" + "=" * REPORT_WIDTH + "\\n")++def save_csv(results: list[ImageAnalysis], csv_path: str) -> None:+ """Save analysis results to a CSV file.-def save_csv(results, csv_path):- """Save results to a CSV file"""+ Args:+ results: Image analysis records returned by `analyze_images`.+ csv_path: Destination CSV path.+ """with open(csv_path, 'w', encoding='utf-8') as f:f.write("No,Filename,Width,Height,AspectRatio,SizeKB,Layout\n")for i, img in enumerate(results, 1):@@ -171,7 +198,8 @@ def save_csv(results, csv_path):print(f"\nCSV saved to: {csv_path}")-def main():+def main() -> None:+ """Run the CLI entry point."""if len(sys.argv) < 2:print("Usage: python analyze_images.py <images_folder_path>")print("Example: python analyze_images.py projects/myproject/images")diff --git a/skills/ppt-master/scripts/batch_validate.py b/skills/ppt-master/scripts/batch_validate.pyindex bf7d13fb..cdb6df64 100644--- a/skills/ppt-master/scripts/batch_validate.py+++ b/skills/ppt-master/scripts/batch_validate.py@@ -12,9 +12,8 @@ Usage:"""import sys-from pathlib import Path-from typing import List, Dictfrom collections import defaultdict+from pathlib import Pathtry:from project_utils import (@@ -34,7 +33,7 @@ class BatchValidator:"""Batch validator"""def __init__(self):- self.results = []+ self.results: list[dict[str, object]] = []self.summary = {'total': 0,'valid': 0,@@ -45,7 +44,7 @@ class BatchValidator:'svg_issues': 0}- def validate_directory(self, directory: str, recursive: bool = False) -> List[Dict]:+ def validate_directory(self, directory: str, recursive: bool = False) -> list[dict[str, object]]:"""Validate all projects in a directory@@ -77,7 +76,7 @@ class BatchValidator:return self.results- def validate_project(self, project_path: str) -> Dict:+ def validate_project(self, project_path: str) -> dict[str, object]:"""Validate a single project@@ -160,8 +159,8 @@ class BatchValidator:return result- def print_summary(self):- """Print validation summary"""+ def print_summary(self) -> None:+ """Print a summary of validation results."""print("\n" + "=" * 80)print("[Summary] Validation Summary")print("=" * 80)@@ -211,7 +210,7 @@ class BatchValidator:return 0return int(count / self.summary['total'] * 100)- def export_report(self, output_file: str = 'validation_report.txt'):+ def export_report(self, output_file: str = 'validation_report.txt') -> None:"""Export validation report to file@@ -255,8 +254,8 @@ class BatchValidator:print(f"\n[REPORT] Validation report exported: {output_file}")-def main():- """Main function"""+def main() -> None:+ """Run the CLI entry point."""if len(sys.argv) < 2:print("PPT Master - Batch Project Validation Tool\n")print("Usage:")diff --git a/skills/ppt-master/scripts/config.py b/skills/ppt-master/scripts/config.pyindex 93173fdf..48db77a1 100644--- a/skills/ppt-master/scripts/config.py+++ b/skills/ppt-master/scripts/config.py@@ -548,7 +548,7 @@ class Config:# Command Line Interface# ============================================================-def main():+def main() -> None:"""Command line entry point."""import sysdiff --git a/skills/ppt-master/scripts/doc_to_md.py b/skills/ppt-master/scripts/doc_to_md.pyindex c1b6a3f4..c56bee54 100644--- a/skills/ppt-master/scripts/doc_to_md.py+++ b/skills/ppt-master/scripts/doc_to_md.py@@ -49,7 +49,7 @@ def check_pandoc() -> bool:return shutil.which("pandoc") is not None-def convert_to_markdown(input_path: str, output_path: str = None) -> str:+def convert_to_markdown(input_path: str, output_path: str | None = None) -> str:"""Convert a document to Markdown using Pandoc.@@ -153,9 +153,9 @@ def convert_to_markdown(input_path: str, output_path: str = None) -> str:# 3. Convert <img> HTML tags to Markdown  syntax# Pandoc generates <img> when the source has styling (width/height)- def _img_to_md(m):- src = m.group("src")- alt = m.group("alt") or Path(src).stem+ def _img_to_md(match: re.Match[str]) -> str:+ src = match.group("src")+ alt = match.group("alt") or Path(src).stemreturn f""markdown_content = re.sub(@@ -193,7 +193,8 @@ def _format_size(size: int) -> str:return f"{size:.1f} GB"-def main():+def main() -> None:+ """Run the CLI entry point."""parser = argparse.ArgumentParser(description="Convert documents to Markdown using Pandoc",formatter_class=argparse.RawDescriptionHelpFormatter,diff --git a/skills/ppt-master/scripts/error_helper.py b/skills/ppt-master/scripts/error_helper.pyindex c77c49d2..10896a4c 100644--- a/skills/ppt-master/scripts/error_helper.py+++ b/skills/ppt-master/scripts/error_helper.py@@ -415,8 +415,8 @@ class ErrorHelper:print("-" * 80)-def main():- """Main function - for testing."""+def main() -> None:+ """Run the CLI entry point for error lookup."""import sysif len(sys.argv) > 1:diff --git a/skills/ppt-master/scripts/finalize_svg.py b/skills/ppt-master/scripts/finalize_svg.pyindex 021b3f89..b6d24a90 100644--- a/skills/ppt-master/scripts/finalize_svg.py+++ b/skills/ppt-master/scripts/finalize_svg.py@@ -40,8 +40,8 @@ from svg_finalize.embed_images import embed_images_in_svgfrom svg_finalize.fix_image_aspect import fix_image_aspect_in_svg-def safe_print(text):- """Safe print that handles Windows terminal encoding issues"""+def safe_print(text: str) -> None:+ """Print text while tolerating Windows terminal encoding limits."""try:print(text)except UnicodeEncodeError:@@ -92,7 +92,12 @@ def process_rounded_rect(svg_file: Path, verbose: bool = False) -> int:return 0-def finalize_project(project_dir: Path, options: dict, dry_run: bool = False, quiet: bool = False):+def finalize_project(+ project_dir: Path,+ options: dict[str, bool],+ dry_run: bool = False,+ quiet: bool = False,+) -> bool:"""Finalize SVG files in the project@@ -231,7 +236,8 @@ def finalize_project(project_dir: Path, options: dict, dry_run: bool = False, qureturn True-def main():+def main() -> None:+ """Run the CLI entry point."""parser = argparse.ArgumentParser(description='PPT Master - SVG Post-processing Tool',formatter_class=argparse.RawDescriptionHelpFormatter,diff --git a/skills/ppt-master/scripts/gemini_watermark_remover.py b/skills/ppt-master/scripts/gemini_watermark_remover.pyindex 2c4b4680..e2f502e8 100644--- a/skills/ppt-master/scripts/gemini_watermark_remover.py+++ b/skills/ppt-master/scripts/gemini_watermark_remover.py@@ -36,6 +36,11 @@ sys.path.insert(0, str(Path(__file__).parent))ALPHA_THRESHOLD = 0.002 # Alpha threshold; values below this are not processedMAX_ALPHA = 0.99 # Maximum alpha value to prevent division by zeroLOGO_VALUE = 255 # Logo pixel value (white)+LARGE_IMAGE_THRESHOLD = 1024+LARGE_LOGO_SIZE = 96+SMALL_LOGO_SIZE = 48+LARGE_MARGIN = 64+SMALL_MARGIN = 32# Watermark background image pathsSCRIPT_DIR = Path(__file__).parent@@ -43,7 +48,7 @@ BG_48_PATH = SCRIPT_DIR / "assets" / "bg_48.png"BG_96_PATH = SCRIPT_DIR / "assets" / "bg_96.png"-def detect_watermark_config(width: int, height: int) -> dict:+def detect_watermark_config(width: int, height: int) -> dict[str, int]:"""Detect watermark configuration based on image dimensions@@ -54,12 +59,20 @@ def detect_watermark_config(width: int, height: int) -> dict:Returns:Configuration dict containing logo_size, margin_right, margin_bottom"""- if width > 1024 and height > 1024:- return {"logo_size": 96, "margin_right": 64, "margin_bottom": 64}- return {"logo_size": 48, "margin_right": 32, "margin_bottom": 32}+ if width > LARGE_IMAGE_THRESHOLD and height > LARGE_IMAGE_THRESHOLD:+ return {+ "logo_size": LARGE_LOGO_SIZE,+ "margin_right": LARGE_MARGIN,+ "margin_bottom": LARGE_MARGIN,+ }+ return {+ "logo_size": SMALL_LOGO_SIZE,+ "margin_right": SMALL_MARGIN,+ "margin_bottom": SMALL_MARGIN,+ }-def calculate_watermark_position(width: int, height: int, config: dict) -> dict:+def calculate_watermark_position(width: int, height: int, config: dict[str, int]) -> dict[str, int]:"""Calculate watermark position@@ -173,7 +186,8 @@ def process_image(input_path: Path, output_path: Path | None = None, verbose: boreturn output_path-def main():+def main() -> None:+ """Run the CLI entry point."""parser = argparse.ArgumentParser(description='PPT Master - Gemini Watermark Remover',formatter_class=argparse.RawDescriptionHelpFormatter,diff --git a/skills/ppt-master/scripts/generate_examples_index.py b/skills/ppt-master/scripts/generate_examples_index.pyindex d9db3bd2..2f7c41c0 100644--- a/skills/ppt-master/scripts/generate_examples_index.py+++ b/skills/ppt-master/scripts/generate_examples_index.py@@ -200,8 +200,8 @@ def generate_examples_index(examples_dir: str = 'examples') -> str:return "\n".join(content)-def main():- """Main function"""+def main() -> None:+ """Run the CLI entry point."""examples_dir = 'examples'if len(sys.argv) > 1:diff --git a/skills/ppt-master/scripts/image_backends/backend_bfl.py b/skills/ppt-master/scripts/image_backends/backend_bfl.pyindex e36362df..3497cd20 100644--- a/skills/ppt-master/scripts/image_backends/backend_bfl.py+++ b/skills/ppt-master/scripts/image_backends/backend_bfl.py@@ -54,6 +54,7 @@ ASPECT_RATIO_TO_DIMENSIONS = {def _submit_request(url: str, headers: dict, payload: dict) -> dict:+ """Submit a BFL generation request and return the JSON response."""response = requests.post(url, headers=headers, json=payload, timeout=180)if response.status_code != 200:raise http_error(response, "BFL generation request")@@ -64,6 +65,7 @@ def _generate_image(api_key: str, prompt: str, negative_prompt: str = None,aspect_ratio: str = "1:1", image_size: str = "1K",output_dir: str = None, filename: str = None,model: str = DEFAULT_MODEL, base_url: str = DEFAULT_BASE_URL) -> str:+ """Generate one image with the Black Forest Labs backend."""del image_size # BFL quality is primarily controlled by model choice.if aspect_ratio not in VALID_ASPECT_RATIOS:@@ -140,6 +142,7 @@ def generate(prompt: str, negative_prompt: str = None,aspect_ratio: str = "1:1", image_size: str = "1K",output_dir: str = None, filename: str = None,model: str = None, max_retries: int = MAX_RETRIES) -> str:+ """Generate an image with retries using the BFL backend."""api_key = require_api_key("BFL_API_KEY",message="No API key found. Set BFL_API_KEY in the current environment or the project-root .env.",diff --git a/skills/ppt-master/scripts/image_backends/backend_common.py b/skills/ppt-master/scripts/image_backends/backend_common.pyindex 5148f198..5f9437a7 100644--- a/skills/ppt-master/scripts/image_backends/backend_common.py+++ b/skills/ppt-master/scripts/image_backends/backend_common.py@@ -83,6 +83,7 @@ def detect_image_extension(image_bytes: bytes, content_type: str = None) -> strdef _normalize_extension(ext: str) -> str:+ """Normalize equivalent image extensions to a canonical form."""ext = ext.lower()if ext == ".jpeg":return ".jpg"@@ -135,7 +136,7 @@ def save_image_bytes(image_bytes: bytes, path: str, content_type: str = None) ->return path-def report_resolution(path: str):+def report_resolution(path: str) -> None:"""Try to report image resolution using PIL."""if HAS_PIL:try:@@ -185,7 +186,7 @@ def download_image(url: str, path: str, headers: dict = None, timeout: int = 180)-def require_api_key(*candidates: str, message: str):+def require_api_key(*candidates: str, message: str) -> str:"""Return the first non-empty env var from candidates or raise."""for name in candidates:value = os.environ.get(name)@@ -202,12 +203,16 @@ def http_error(response: requests.Response, label: str) -> RuntimeError:return RuntimeError(f"{label} failed ({response.status_code}): {body}")-def poll_json(url: str, headers: dict, *,- interval_seconds: float = 2.0,- timeout_seconds: int = 300,- status_label: str = "status",- ready_values=None,- failed_values=None) -> dict:+def poll_json(+ url: str,+ headers: dict[str, str],+ *,+ interval_seconds: float = 2.0,+ timeout_seconds: int = 300,+ status_label: str = "status",+ ready_values: list[str] | None = None,+ failed_values: list[str] | None = None,+) -> dict:"""Poll a JSON endpoint until it reports a ready or failed status."""ready = {value.lower() for value in (ready_values or ["ready", "success", "succeeded"])}failed = {value.lower() for value in (failed_values or ["error", "failed", "fail"])}diff --git a/skills/ppt-master/scripts/image_backends/backend_fal.py b/skills/ppt-master/scripts/image_backends/backend_fal.pyindex ab05082e..d4b80c43 100644--- a/skills/ppt-master/scripts/image_backends/backend_fal.py+++ b/skills/ppt-master/scripts/image_backends/backend_fal.py@@ -30,6 +30,7 @@ DEFAULT_MODEL = "fal-ai/imagen3/fast"def _resolve_url(base_url: str, model: str) -> str:+ """Resolve the full fal endpoint URL for a model."""base = base_url.rstrip("/")if base.endswith(model):return base@@ -40,6 +41,7 @@ def _generate_image(api_key: str, prompt: str, negative_prompt: str = None,aspect_ratio: str = "1:1", image_size: str = "1K",output_dir: str = None, filename: str = None,model: str = DEFAULT_MODEL, base_url: str = DEFAULT_ENDPOINT) -> str:+ """Generate one image with the fal.ai backend."""del image_sizeif aspect_ratio not in VALID_ASPECT_RATIOS:@@ -89,6 +91,7 @@ def generate(prompt: str, negative_prompt: str = None,aspect_ratio: str = "1:1", image_size: str = "1K",output_dir: str = None, filename: str = None,model: str = None, max_retries: int = MAX_RETRIES) -> str:+ """Generate an image with retries using the fal.ai backend."""api_key = require_api_key("FAL_KEY","FAL_API_KEY",diff --git a/skills/ppt-master/scripts/image_backends/backend_ideogram.py b/skills/ppt-master/scripts/image_backends/backend_ideogram.pyindex bdecd190..7a3a5a26 100644--- a/skills/ppt-master/scripts/image_backends/backend_ideogram.py+++ b/skills/ppt-master/scripts/image_backends/backend_ideogram.py@@ -52,6 +52,7 @@ IMAGE_SIZE_TO_SPEED = {def _resolve_url(base_url: str) -> str:+ """Resolve the Ideogram generation endpoint."""base = base_url.rstrip("/")if base.endswith("/generate"):return base@@ -62,6 +63,7 @@ def _generate_image(api_key: str, prompt: str, negative_prompt: str = None,aspect_ratio: str = "1:1", image_size: str = "1K",output_dir: str = None, filename: str = None,model: str = DEFAULT_MODEL, base_url: str = DEFAULT_BASE_URL) -> str:+ """Generate one image with the Ideogram backend."""normalized_model = model.strip().lower()if normalized_model not in MODEL_ALIASES:raise ValueError(@@ -115,6 +117,7 @@ def generate(prompt: str, negative_prompt: str = None,aspect_ratio: str = "1:1", image_size: str = "1K",output_dir: str = None, filename: str = None,model: str = None, max_retries: int = MAX_RETRIES) -> str:+ """Generate an image with retries using the Ideogram backend."""api_key = require_api_key("IDEOGRAM_API_KEY",message="No API key found. Set IDEOGRAM_API_KEY in the current environment or the project-root .env.",diff --git a/skills/ppt-master/scripts/image_backends/backend_qwen.py b/skills/ppt-master/scripts/image_backends/backend_qwen.pyindex 67d25264..b491a5c6 100644--- a/skills/ppt-master/scripts/image_backends/backend_qwen.py+++ b/skills/ppt-master/scripts/image_backends/backend_qwen.py@@ -81,6 +81,7 @@ ASPECT_RATIO_SIZE_MAP = {def _resolve_url(base_url: str) -> str:+ """Resolve the Qwen generation endpoint."""base = base_url.rstrip("/")if base.endswith("/generation"):return base@@ -88,6 +89,7 @@ def _resolve_url(base_url: str) -> str:def _resolve_size(aspect_ratio: str, image_size: str) -> str:+ """Resolve the target resolution for a ratio and logical size preset."""normalized = normalize_image_size(image_size)size = (ASPECT_RATIO_SIZE_MAP.get(normalized) or {}).get(aspect_ratio)if not size:@@ -103,6 +105,7 @@ def _generate_image(api_key: str, prompt: str, negative_prompt: str = None,aspect_ratio: str = "1:1", image_size: str = "1K",output_dir: str = None, filename: str = None,model: str = DEFAULT_MODEL, base_url: str = DEFAULT_ENDPOINT) -> str:+ """Generate one image with the Qwen backend."""size = _resolve_size(aspect_ratio, image_size)url = _resolve_url(base_url)headers = {@@ -158,6 +161,7 @@ def generate(prompt: str, negative_prompt: str = None,aspect_ratio: str = "1:1", image_size: str = "1K",output_dir: str = None, filename: str = None,model: str = None, max_retries: int = MAX_RETRIES) -> str:+ """Generate an image with retries using the Qwen backend."""api_key = require_api_key("QWEN_API_KEY","DASHSCOPE_API_KEY",diff --git a/skills/ppt-master/scripts/image_backends/backend_replicate.py b/skills/ppt-master/scripts/image_backends/backend_replicate.pyindex 7db92b5d..8b7b5ee2 100644--- a/skills/ppt-master/scripts/image_backends/backend_replicate.py+++ b/skills/ppt-master/scripts/image_backends/backend_replicate.py@@ -31,6 +31,7 @@ DEFAULT_MODEL = "black-forest-labs/flux-1.1-pro"def _split_model(model: str) -> tuple[str, str]:+ """Split a Replicate model reference into owner and name."""parts = [part for part in model.strip().split("/") if part]if len(parts) != 2:raise ValueError(@@ -40,6 +41,7 @@ def _split_model(model: str) -> tuple[str, str]:def _extract_output_url(payload: dict) -> str | None:+ """Extract an output URL from a Replicate prediction payload."""output = payload.get("output")if isinstance(output, str):return output@@ -58,6 +60,7 @@ def _generate_image(api_key: str, prompt: str, negative_prompt: str = None,aspect_ratio: str = "1:1", image_size: str = "1K",output_dir: str = None, filename: str = None,model: str = DEFAULT_MODEL, base_url: str = DEFAULT_BASE_URL) -> str:+ """Generate one image with the Replicate backend."""del image_sizeif aspect_ratio not in VALID_ASPECT_RATIOS:@@ -132,6 +135,7 @@ def generate(prompt: str, negative_prompt: str = None,aspect_ratio: str = "1:1", image_size: str = "1K",output_dir: str = None, filename: str = None,model: str = None, max_retries: int = MAX_RETRIES) -> str:+ """Generate an image with retries using the Replicate backend."""api_key = require_api_key("REPLICATE_API_KEY","REPLICATE_API_TOKEN",diff --git a/skills/ppt-master/scripts/image_backends/backend_siliconflow.py b/skills/ppt-master/scripts/image_backends/backend_siliconflow.pyindex fa4f6ee3..6a335ac0 100644--- a/skills/ppt-master/scripts/image_backends/backend_siliconflow.py+++ b/skills/ppt-master/scripts/image_backends/backend_siliconflow.py@@ -77,6 +77,7 @@ ASPECT_RATIO_SIZE_MAP = {def _resolve_url(base_url: str) -> str:+ """Resolve the SiliconFlow generation endpoint."""base = base_url.rstrip("/")if base.endswith("/images/generations"):return base@@ -84,6 +85,7 @@ def _resolve_url(base_url: str) -> str:def _resolve_size(aspect_ratio: str, image_size: str) -> str:+ """Resolve the target resolution for a ratio and logical size preset."""normalized = normalize_image_size(image_size)size = (ASPECT_RATIO_SIZE_MAP.get(normalized) or {}).get(aspect_ratio)if not size:@@ -99,6 +101,7 @@ def _generate_image(api_key: str, prompt: str, negative_prompt: str = None,aspect_ratio: str = "1:1", image_size: str = "1K",output_dir: str = None, filename: str = None,model: str = DEFAULT_MODEL, base_url: str = DEFAULT_ENDPOINT) -> str:+ """Generate one image with the SiliconFlow backend."""size = _resolve_size(aspect_ratio, image_size)url = _resolve_url(base_url)headers = {@@ -142,6 +145,7 @@ def generate(prompt: str, negative_prompt: str = None,aspect_ratio: str = "1:1", image_size: str = "1K",output_dir: str = None, filename: str = None,model: str = None, max_retries: int = MAX_RETRIES) -> str:+ """Generate an image with retries using the SiliconFlow backend."""api_key = require_api_key("SILICONFLOW_API_KEY",message="No API key found. Set SILICONFLOW_API_KEY in the current environment or the project-root .env.",diff --git a/skills/ppt-master/scripts/image_backends/backend_stability.py b/skills/ppt-master/scripts/image_backends/backend_stability.pyindex f528ec05..f4847b70 100644--- a/skills/ppt-master/scripts/image_backends/backend_stability.py+++ b/skills/ppt-master/scripts/image_backends/backend_stability.py@@ -41,6 +41,7 @@ MODEL_ENDPOINTS = {def _resolve_endpoint(model: str, image_size: str, base_url: str) -> tuple[str, str]:+ """Resolve the Stability model alias and endpoint URL."""resolved_model = model or DEFAULT_MODELif not model and image_size.upper() in ("2K", "4K"):resolved_model = "stable-image-ultra"@@ -59,6 +60,7 @@ def _generate_image(api_key: str, prompt: str, negative_prompt: str = None,aspect_ratio: str = "1:1", image_size: str = "1K",output_dir: str = None, filename: str = None,model: str = DEFAULT_MODEL, base_url: str = DEFAULT_BASE_URL) -> str:+ """Generate one image with the Stability backend."""if aspect_ratio not in VALID_ASPECT_RATIOS:raise ValueError(f"Unsupported aspect ratio '{aspect_ratio}' for Stability backend. "@@ -106,6 +108,7 @@ def generate(prompt: str, negative_prompt: str = None,aspect_ratio: str = "1:1", image_size: str = "1K",output_dir: str = None, filename: str = None,model: str = None, max_retries: int = MAX_RETRIES) -> str:+ """Generate an image with retries using the Stability backend."""api_key = require_api_key("STABILITY_API_KEY",message="No API key found. Set STABILITY_API_KEY in the current environment or the project-root .env.",diff --git a/skills/ppt-master/scripts/image_backends/backend_volcengine.py b/skills/ppt-master/scripts/image_backends/backend_volcengine.pyindex 0e7c702c..7a9ec02c 100644--- a/skills/ppt-master/scripts/image_backends/backend_volcengine.py+++ b/skills/ppt-master/scripts/image_backends/backend_volcengine.py@@ -81,6 +81,7 @@ ASPECT_RATIO_SIZE_MAP = {def _resolve_url(base_url: str) -> str:+ """Resolve the Volcengine generation endpoint."""base = base_url.rstrip("/")if base.endswith("/images/generations"):return base@@ -88,6 +89,7 @@ def _resolve_url(base_url: str) -> str:def _resolve_size(aspect_ratio: str, image_size: str) -> str:+ """Resolve the target resolution for a ratio and logical size preset."""normalized = normalize_image_size(image_size)size = (ASPECT_RATIO_SIZE_MAP.get(normalized) or {}).get(aspect_ratio)if not size:@@ -103,6 +105,7 @@ def _generate_image(api_key: str, prompt: str, negative_prompt: str = None,aspect_ratio: str = "1:1", image_size: str = "1K",output_dir: str = None, filename: str = None,model: str = DEFAULT_MODEL, base_url: str = DEFAULT_ENDPOINT) -> str:+ """Generate one image with the Volcengine backend."""size = _resolve_size(aspect_ratio, image_size)url = _resolve_url(base_url)headers = {@@ -148,6 +151,7 @@ def generate(prompt: str, negative_prompt: str = None,aspect_ratio: str = "1:1", image_size: str = "1K",output_dir: str = None, filename: str = None,model: str = None, max_retries: int = MAX_RETRIES) -> str:+ """Generate an image with retries using the Volcengine backend."""api_key = require_api_key("VOLCENGINE_API_KEY","ARK_API_KEY",diff --git a/skills/ppt-master/scripts/image_backends/backend_zhipu.py b/skills/ppt-master/scripts/image_backends/backend_zhipu.pyindex 6516da34..3e6ccc05 100644--- a/skills/ppt-master/scripts/image_backends/backend_zhipu.py+++ b/skills/ppt-master/scripts/image_backends/backend_zhipu.py@@ -81,6 +81,7 @@ ASPECT_RATIO_SIZE_MAP = {def _resolve_url(base_url: str) -> str:+ """Resolve the Zhipu generation endpoint."""base = base_url.rstrip("/")if base.endswith("/images/generations"):return base@@ -88,6 +89,7 @@ def _resolve_url(base_url: str) -> str:def _resolve_size(aspect_ratio: str, image_size: str) -> str:+ """Resolve the target resolution for a ratio and logical size preset."""normalized = normalize_image_size(image_size)size = (ASPECT_RATIO_SIZE_MAP.get(normalized) or {}).get(aspect_ratio)if not size:@@ -103,6 +105,7 @@ def _generate_image(api_key: str, prompt: str, negative_prompt: str = None,aspect_ratio: str = "1:1", image_size: str = "1K",output_dir: str = None, filename: str = None,model: str = DEFAULT_MODEL, base_url: str = DEFAULT_ENDPOINT) -> str:+ """Generate one image with the Zhipu backend."""size = _resolve_size(aspect_ratio, image_size)url = _resolve_url(base_url)headers = {@@ -149,6 +152,7 @@ def generate(prompt: str, negative_prompt: str = None,aspect_ratio: str = "1:1", image_size: str = "1K",output_dir: str = None, filename: str = None,model: str = None, max_retries: int = MAX_RETRIES) -> str:+ """Generate an image with retries using the Zhipu backend."""api_key = require_api_key("ZHIPU_API_KEY","BIGMODEL_API_KEY",diff --git a/skills/ppt-master/scripts/image_gen.py b/skills/ppt-master/scripts/image_gen.pyindex 7c266233..0f7226ea 100644--- a/skills/ppt-master/scripts/image_gen.py+++ b/skills/ppt-master/scripts/image_gen.py@@ -168,16 +168,18 @@ SUPPORTED_BACKENDS = tuple(sorted(BACKEND_REGISTRY))def _is_image_env_key(name: str) -> bool:+ """Return whether an env var name belongs to image generation config."""return name.startswith(IMAGE_ENV_PREFIXES)def _strip_env_quotes(value: str) -> str:+ """Strip matching surrounding quotes from a `.env` value."""if len(value) >= 2 and value[0] == value[-1] and value[0] in ("'", '"'):return value[1:-1]return value-def _load_image_env_file():+def _load_image_env_file() -> None:"""Load image generation config from the project-root `.env` as a fallback layer.@@ -225,7 +227,7 @@ def _load_image_env_file():os.environ.setdefault(key, _strip_env_quotes(value.strip()))-def _validate_runtime_config():+def _validate_runtime_config() -> None:"""Reject deprecated global image variables from any configuration source."""for key in DEPRECATED_IMAGE_KEYS:if key not in os.environ:@@ -242,7 +244,8 @@ def _validate_runtime_config():)-def _build_backend_aliases():+def _build_backend_aliases() -> dict[str, str]:+ """Build a lookup from aliases to canonical backend names."""aliases = {}for canonical_name, config in BACKEND_REGISTRY.items():aliases[canonical_name] = canonical_name@@ -254,13 +257,14 @@ def _build_backend_aliases():BACKEND_ALIASES = _build_backend_aliases()-def _load_backend(canonical_name: str):+def _load_backend(canonical_name: str) -> tuple[object, str]:+ """Import and return the configured backend module."""module_name = f"image_backends.{BACKEND_REGISTRY[canonical_name]['module']}"module = __import__(module_name, fromlist=["*"])return module, canonical_name-def _print_backend_list():+def _print_backend_list() -> None:"""Print supported backends grouped by support tier."""print("Supported image backends:\n")tiers = ("core", "extended", "experimental")@@ -280,7 +284,7 @@ def _print_backend_list():print(f"Config fallback file: {ENV_PATH}")-def _resolve_backend():+def _resolve_backend() -> tuple[object, str]:"""Determine which backend to use from explicit configuration.@@ -313,7 +317,8 @@ def _resolve_backend():sys.exit(1)-def main():+def main() -> None:+ """Run the CLI entry point."""parser = argparse.ArgumentParser(description="Generate images using AI image model providers.")diff --git a/skills/ppt-master/scripts/pdf_to_md.py b/skills/ppt-master/scripts/pdf_to_md.pyindex 4b8e3949..b018670f 100644--- a/skills/ppt-master/scripts/pdf_to_md.py+++ b/skills/ppt-master/scripts/pdf_to_md.py@@ -13,9 +13,23 @@ import refrom pathlib import Pathfrom collections import Counter+FONT_BODY_SIZE = 12+FONT_H1_SIZE = 24+FONT_H2_SIZE = 18+FONT_H3_SIZE = 14+HEADER_FOOTER_SAMPLE_LIMIT = 40+HEADER_FOOTER_EDGE_SAMPLE_SIZE = 20-def analyze_font_sizes(doc) -> dict:- """Analyze font size distribution in the document to infer heading levels."""++def analyze_font_sizes(doc: fitz.Document) -> dict[str, float]:+ """Analyze font size distribution to infer heading levels.++ Args:+ doc: Open PDF document.++ Returns:+ A size mapping containing body and inferred heading sizes.+ """size_counter = Counter()for page in doc:@@ -30,7 +44,12 @@ def analyze_font_sizes(doc) -> dict:size_counter[size] += len(text)if not size_counter:- return {"body": 12, "h1": 24, "h2": 18, "h3": 14}+ return {+ "body": FONT_BODY_SIZE,+ "h1": FONT_H1_SIZE,+ "h2": FONT_H2_SIZE,+ "h3": FONT_H3_SIZE,+ }sorted_sizes = sorted(size_counter.items(), key=lambda x: x[1], reverse=True)body_size = sorted_sizes[0][0]@@ -177,7 +196,7 @@ def remove_page_footer(text: str) -> str:return text.rstrip()-def detect_headers_footers(doc, threshold_ratio: float = 0.6) -> set:+def detect_headers_footers(doc: fitz.Document, threshold_ratio: float = 0.6) -> set[str]:"""Detect headers and footers statistically.@@ -193,8 +212,11 @@ def detect_headers_footers(doc, threshold_ratio: float = 0.6) -> set:# Sample first 20 and last 20 pages (avoid processing too slowly)pages_to_scan = list(range(len(doc)))- if len(doc) > 40:- pages_to_scan = pages_to_scan[:20] + pages_to_scan[-20:]+ if len(doc) > HEADER_FOOTER_SAMPLE_LIMIT:+ pages_to_scan = (+ pages_to_scan[:HEADER_FOOTER_EDGE_SAMPLE_SIZE]+ + pages_to_scan[-HEADER_FOOTER_EDGE_SAMPLE_SIZE:]+ )for i in pages_to_scan:page = doc[i]@@ -303,8 +325,21 @@ MAX_LOW_INFO_BPP = 0.08 # Bytes-per-pixel threshold for low-info imagesMAX_LOW_INFO_AREA = 500000 # Area threshold: only apply bpp filter below this-def should_keep_image(block, page_rect, seen_hashes=None) -> bool:- """Filter out small/decorative/duplicate images commonly found in PPT-converted PDFs."""+def should_keep_image(+ block: dict[str, object],+ page_rect: fitz.Rect,+ seen_hashes: set[str] | None = None,+) -> bool:+ """Filter out small, decorative, or duplicate images.++ Args:+ block: Image block extracted from PyMuPDF.+ page_rect: Current page rectangle.+ seen_hashes: Optional set used to deduplicate image payloads.++ Returns:+ Whether the image should be kept in the Markdown output.+ """w, h = block.get("width", 0), block.get("height", 0)# Pixel dimension filter@@ -690,8 +725,13 @@ def extract_pdf_to_markdown(pdf_path: str, output_path: str = None) -> str:return markdown_content-def process_directory(input_dir: str, output_dir: str = None):- """Process all PDF files in the directory."""+def process_directory(input_dir: str, output_dir: str | None = None) -> None:+ """Convert all PDFs in a directory to Markdown.++ Args:+ input_dir: Directory containing PDF files.+ output_dir: Optional output directory for Markdown files.+ """input_path = Path(input_dir)if output_dir:@@ -709,7 +749,8 @@ def process_directory(input_dir: str, output_dir: str = None):extract_pdf_to_markdown(str(pdf_file), str(output_file))-def main():+def main() -> int:+ """Run the CLI entry point."""parser = argparse.ArgumentParser(description='PDF to Markdown converter (with structure detection and LLM optimization)',formatter_class=argparse.RawDescriptionHelpFormatter,diff --git a/skills/ppt-master/scripts/project_manager.py b/skills/ppt-master/scripts/project_manager.pyindex aaafae67..0d84a931 100644--- a/skills/ppt-master/scripts/project_manager.py+++ b/skills/ppt-master/scripts/project_manager.py@@ -16,7 +16,6 @@ import subprocessimport sysfrom datetime import datetimefrom pathlib import Path-from typing import Dict, List, Optional, Tuplefrom urllib.parse import urlparsetry:@@ -56,11 +55,13 @@ WECHAT_HOST_KEYWORDS = ("mp.weixin.qq.com", "weixin.qq.com")def is_url(value: str) -> bool:+ """Return whether a string looks like an HTTP(S) URL."""parsed = urlparse(value)return parsed.scheme in {"http", "https"} and bool(parsed.netloc)def sanitize_name(value: str) -> str:+ """Sanitize a user-facing name into a filesystem-safe token."""safe = "".join(ch if ch.isalnum() or ch in "-_." else "_" for ch in value.strip())safe = safe.strip("._")while "__" in safe:@@ -69,6 +70,7 @@ def sanitize_name(value: str) -> str:def derive_url_basename(url: str) -> str:+ """Derive a stable base filename from a URL."""parsed = urlparse(url)parts = [sanitize_name(parsed.netloc)]if parsed.path and parsed.path != "/":@@ -79,6 +81,7 @@ def derive_url_basename(url: str) -> str:def is_within_path(path: Path, parent: Path) -> bool:+ """Return whether `path` resolves inside `parent`."""try:path.resolve().relative_to(parent.resolve())return True@@ -98,7 +101,7 @@ class ProjectManager:self,project_name: str,canvas_format: str = "ppt169",- base_dir: Optional[str] = None,+ base_dir: str | None = None,) -> str:base_path = Path(base_dir) if base_dir else self.base_dir@@ -195,7 +198,7 @@ class ProjectManager:shutil.copytree(source, destination)return destination- def _run_tool(self, args: List[str]) -> None:+ def _run_tool(self, args: list[str]) -> None:try:result = subprocess.run(args,@@ -272,7 +275,7 @@ class ProjectManager:canonical = re.sub(r"([^\s\]()/]+_files)/", "__ASSET_DIR__/", canonical)return canonical.strip()- def _find_equivalent_markdown(self, source_path: Path, sources_dir: Path) -> Optional[Path]:+ def _find_equivalent_markdown(self, source_path: Path, sources_dir: Path) -> Path | None:source_content = source_path.read_text(encoding="utf-8", errors="replace")canonical_source = self._canonicalize_markdown_content(source_content)@@ -291,7 +294,7 @@ class ProjectManager:return None- def _companion_asset_dir(self, source_path: Path) -> Optional[Path]:+ def _companion_asset_dir(self, source_path: Path) -> Path | None:candidate = source_path.with_name(f"{source_path.stem}_files")if candidate.exists() and candidate.is_dir():return candidate@@ -316,7 +319,7 @@ class ProjectManager:source_path: Path,sources_dir: Path,move: bool,- ) -> Tuple[Path, Optional[Path], Optional[str]]:+ ) -> tuple[Path, Path | None, str | None]:archived_markdown = self._copy_or_move_file(source_path,sources_dir / source_path.name,@@ -349,9 +352,9 @@ class ProjectManager:def import_sources(self,project_path: str,- source_items: List[str],+ source_items: list[str],move: bool = False,- ) -> Dict[str, List[str]]:+ ) -> dict[str, list[str]]:project_dir = Path(project_path)if not project_dir.exists() or not project_dir.is_dir():raise FileNotFoundError(f"Project directory not found: {project_dir}")@@ -359,7 +362,7 @@ class ProjectManager:raise ValueError("At least one source path or URL is required")sources_dir = self._source_dir(project_dir)- summary: Dict[str, List[str]] = {+ summary: dict[str, list[str]] = {"archived": [],"markdown": [],"assets": [],@@ -477,7 +480,7 @@ class ProjectManager:return summary- def validate_project(self, project_path: str) -> Tuple[bool, List[str], List[str]]:+ def validate_project(self, project_path: str) -> tuple[bool, list[str], list[str]]:project_path_obj = Path(project_path)is_valid, errors, warnings = validate_project_structure(str(project_path_obj))@@ -492,7 +495,7 @@ class ProjectManager:return is_valid, errors, warnings- def get_project_info(self, project_path: str) -> Dict:+ def get_project_info(self, project_path: str) -> dict[str, object]:shared = get_project_info_common(project_path)return {"name": shared.get("name", Path(project_path).name),@@ -508,10 +511,12 @@ class ProjectManager:def print_usage() -> None:+ """Print CLI usage information from the module docstring."""print(__doc__)-def parse_init_args(argv: List[str]) -> Tuple[str, str, str]:+def parse_init_args(argv: list[str]) -> tuple[str, str, str]:+ """Parse arguments for the `init` subcommand."""if len(argv) < 3:raise ValueError("Project name is required")@@ -533,13 +538,14 @@ def parse_init_args(argv: List[str]) -> Tuple[str, str, str]:return project_name, canvas_format, base_dir-def parse_import_args(argv: List[str]) -> Tuple[str, List[str], bool]:+def parse_import_args(argv: list[str]) -> tuple[str, list[str], bool]:+ """Parse arguments for the `import-sources` subcommand."""if len(argv) < 4:raise ValueError("Project path and at least one source are required")project_path = argv[2]move = False- sources: List[str] = []+ sources: list[str] = []for arg in argv[3:]:if arg == "--move":@@ -551,6 +557,7 @@ def parse_import_args(argv: List[str]) -> Tuple[str, List[str], bool]:def main() -> None:+ """Run the CLI entry point."""if len(sys.argv) < 2:print_usage()sys.exit(1)diff --git a/skills/ppt-master/scripts/rotate_images.py b/skills/ppt-master/scripts/rotate_images.pyindex 7537a6fb..eda943e6 100644--- a/skills/ppt-master/scripts/rotate_images.py+++ b/skills/ppt-master/scripts/rotate_images.py@@ -520,8 +520,8 @@ class ImageRotator:</html>"""-def main():- """Main function"""+def main() -> None:+ """Run the CLI entry point."""if len(sys.argv) < 2:print(__doc__)sys.exit(1)diff --git a/skills/ppt-master/scripts/svg_finalize/crop_images.py b/skills/ppt-master/scripts/svg_finalize/crop_images.pyindex d5a500df..358b8795 100644--- a/skills/ppt-master/scripts/svg_finalize/crop_images.py+++ b/skills/ppt-master/scripts/svg_finalize/crop_images.py@@ -18,6 +18,7 @@ Usage:import osimport reimport hashlib+import sysfrom pathlib import Pathfrom xml.etree import ElementTree as ETfrom urllib.parse import unquote@@ -29,7 +30,7 @@ except ImportError:exit(1)-def parse_preserve_aspect_ratio(attr: str) -> tuple:+def parse_preserve_aspect_ratio(attr: str) -> tuple[str, str]:"""Parse the preserveAspectRatio attribute.@@ -47,7 +48,7 @@ def parse_preserve_aspect_ratio(attr: str) -> tuple:return (align, meet_or_slice)-def get_crop_anchor(align: str) -> tuple:+def get_crop_anchor(align: str) -> tuple[float, float]:"""Return the crop anchor point based on the align value.@@ -74,8 +75,13 @@ def get_crop_anchor(align: str) -> tuple:return (x_anchor, y_anchor)-def crop_image_to_size(img: Image.Image, target_width: int, target_height: int,- x_anchor: float = 0.5, y_anchor: float = 0.5) -> Image.Image:+def crop_image_to_size(+ img: Image.Image,+ target_width: int,+ target_height: int,+ x_anchor: float = 0.5,+ y_anchor: float = 0.5,+) -> Image.Image:"""Crop an image to the target aspect ratio, preserving original resolution (no scaling).@@ -121,8 +127,12 @@ def crop_image_to_size(img: Image.Image, target_width: int, target_height: int,return img.crop((left, top, right, bottom))-def process_svg_images(svg_file: str, output_dir: str = None, dry_run: bool = False,- verbose: bool = True) -> tuple:+def process_svg_images(+ svg_file: str,+ output_dir: str | Path | None = None,+ dry_run: bool = False,+ verbose: bool = True,+) -> tuple[int, int]:"""Process images in an SVG file, cropping based on the preserveAspectRatio attribute.@@ -269,13 +279,13 @@ def process_svg_images(svg_file: str, output_dir: str = None, dry_run: bool = Fareturn (processed_count, error_count)-def process_directory(directory: str, dry_run: bool = False, verbose: bool = True) -> tuple:+def process_directory(directory: str, dry_run: bool = False, verbose: bool = True) -> tuple[int, int]:"""Process all SVG files in a directory."""- directory = Path(directory)+ directory_path = Path(directory)total_processed = 0total_errors = 0- for svg_file in directory.glob('*.svg'):+ for svg_file in directory_path.glob('*.svg'):if verbose:print(f" Processing: {svg_file.name}")processed, errors = process_svg_images(str(svg_file), dry_run=dry_run, verbose=verbose)@@ -285,9 +295,8 @@ def process_directory(directory: str, dry_run: bool = False, verbose: bool = Trureturn (total_processed, total_errors)-def main():- import argparse-+def main() -> None:+ """Run the CLI entry point."""parser = argparse.ArgumentParser(description='PPT Master - Smart Image Cropping Tool',formatter_class=argparse.RawDescriptionHelpFormatter,@@ -314,7 +323,7 @@ preserveAspectRatio usage:if not args.path.exists():print(f"[ERROR] Path not found: {args.path}")- exit(1)+ sys.exit(1)print("PPT Master - Smart Image Cropping")print("=" * 50)diff --git a/skills/ppt-master/scripts/svg_finalize/embed_icons.py b/skills/ppt-master/scripts/svg_finalize/embed_icons.pyindex dd23cca7..ab4bc325 100644--- a/skills/ppt-master/scripts/svg_finalize/embed_icons.py+++ b/skills/ppt-master/scripts/svg_finalize/embed_icons.py@@ -64,7 +64,7 @@ def extract_paths_from_icon(icon_path: Path) -> list[str]:return paths-def parse_use_element(use_match: str) -> dict:+def parse_use_element(use_match: str) -> dict[str, str | float]:"""Parse attributes of a use element.@@ -74,7 +74,7 @@ def parse_use_element(use_match: str) -> dict:Returns:Attribute dictionary"""- attrs = {}+ attrs: dict[str, str | float] = {}# Extract data-iconicon_match = re.search(r'data-icon="([^"]+)"', use_match)@@ -95,7 +95,7 @@ def parse_use_element(use_match: str) -> dict:return attrs-def generate_icon_group(attrs: dict, paths: list[str]) -> str:+def generate_icon_group(attrs: dict[str, str | float], paths: list[str]) -> str:"""Generate the icon's <g> element.@@ -196,7 +196,8 @@ def process_svg_file(svg_path: Path, icons_dir: Path, dry_run: bool = False, verreturn replaced_count-def main():+def main() -> None:+ """Run the CLI entry point."""parser = argparse.ArgumentParser(description='Replace icon placeholders in SVG files with actual icon code',formatter_class=argparse.RawDescriptionHelpFormatter,diff --git a/skills/ppt-master/scripts/svg_finalize/embed_images.py b/skills/ppt-master/scripts/svg_finalize/embed_images.pyindex b3bb88c5..26d54e1e 100644--- a/skills/ppt-master/scripts/svg_finalize/embed_images.py+++ b/skills/ppt-master/scripts/svg_finalize/embed_images.py@@ -19,8 +19,8 @@ import sysimport argparse-def get_mime_type(filename, file_bytes=None):- """Return the MIME type based on file bytes first, then extension as fallback."""+def get_mime_type(filename: str, file_bytes: bytes | None = None) -> str:+ """Return the MIME type based on file bytes first, then extension."""if file_bytes:if file_bytes.startswith(b"\x89PNG\r\n\x1a\n"):return 'image/png'@@ -44,7 +44,7 @@ def get_mime_type(filename, file_bytes=None):}return mime_map.get(ext, 'application/octet-stream')-def get_file_size_str(size_bytes):+def get_file_size_str(size_bytes: int) -> str:"""Convert byte count to a human-readable file size string."""if size_bytes < 1024:return f"{size_bytes} B"@@ -53,7 +53,7 @@ def get_file_size_str(size_bytes):else:return f"{size_bytes / (1024 * 1024):.1f} MB"-def embed_images_in_svg(svg_path, dry_run=False):+def embed_images_in_svg(svg_path: str, dry_run: bool = False) -> tuple[int, int]:"""Convert externally referenced images in an SVG file to Base64 inline format.@@ -136,7 +136,8 @@ def embed_images_in_svg(svg_path, dry_run=False):return (images_embedded, new_size)-def main():+def main() -> None:+ """Run the CLI entry point."""parser = argparse.ArgumentParser(description='Convert externally referenced images in SVG files to Base64 inline format',formatter_class=argparse.RawDescriptionHelpFormatter,diff --git a/skills/ppt-master/scripts/svg_finalize/fix_image_aspect.py b/skills/ppt-master/scripts/svg_finalize/fix_image_aspect.pyindex ffe5ff22..029fbcdf 100644--- a/skills/ppt-master/scripts/svg_finalize/fix_image_aspect.py+++ b/skills/ppt-master/scripts/svg_finalize/fix_image_aspect.py@@ -41,7 +41,7 @@ except ImportError:print(" Will try to use basic method for JPEG/PNG files.")-def get_image_dimensions_pil(image_path):+def get_image_dimensions_pil(image_path: str) -> tuple[int | None, int | None]:"""Get image dimensions using PIL."""try:with Image.open(image_path) as img:@@ -51,8 +51,8 @@ def get_image_dimensions_pil(image_path):return None, None-def get_image_dimensions_basic(image_path):- """Get image dimensions using basic method (no PIL dependency)."""+def get_image_dimensions_basic(image_path: str) -> tuple[int | None, int | None]:+ """Get image dimensions using basic parsing without PIL."""try:with open(image_path, 'rb') as f:data = f.read(64) # Read header information@@ -97,7 +97,7 @@ def get_image_dimensions_basic(image_path):return None, None-def get_image_dimensions_from_base64(data_uri):+def get_image_dimensions_from_base64(data_uri: str) -> tuple[int | None, int | None]:"""Get image dimensions from a Base64 data URI."""import iotry:@@ -126,8 +126,8 @@ def get_image_dimensions_from_base64(data_uri):return None, None-def get_image_dimensions(href, svg_dir):- """Get image dimensions."""+def get_image_dimensions(href: str, svg_dir: str) -> tuple[int | None, int | None]:+ """Get image dimensions for either inline or external images."""# Handle data URIif href.startswith('data:'):return get_image_dimensions_from_base64(href)@@ -148,7 +148,13 @@ def get_image_dimensions(href, svg_dir):return get_image_dimensions_basic(full_path)-def calculate_fitted_dimensions(img_width, img_height, box_width, box_height, mode='meet'):+def calculate_fitted_dimensions(+ img_width: int,+ img_height: int,+ box_width: float,+ box_height: float,+ mode: str = 'meet',+) -> tuple[float, float, float, float]:"""Calculate the fitted dimensions for an image within a bounding box.@@ -192,7 +198,7 @@ def calculate_fitted_dimensions(img_width, img_height, box_width, box_height, moreturn new_width, new_height, offset_x, offset_y-def fix_image_aspect_in_svg(svg_path, dry_run=False, verbose=True):+def fix_image_aspect_in_svg(svg_path: str, dry_run: bool = False, verbose: bool = True) -> int:"""Fix image aspect ratios in an SVG file.@@ -314,7 +320,8 @@ def fix_image_aspect_in_svg(svg_path, dry_run=False, verbose=True):return fixed_count-def main():+def main() -> None:+ """Run the CLI entry point."""parser = argparse.ArgumentParser(description='Fix image aspect ratios in SVG to prevent stretching when PowerPoint converts to shapes',formatter_class=argparse.RawDescriptionHelpFormatter,diff --git a/skills/ppt-master/scripts/svg_finalize/flatten_tspan.py b/skills/ppt-master/scripts/svg_finalize/flatten_tspan.pyindex 25f86799..d55d452d 100644--- a/skills/ppt-master/scripts/svg_finalize/flatten_tspan.py+++ b/skills/ppt-master/scripts/svg_finalize/flatten_tspan.py@@ -46,7 +46,8 @@ TEXT_STYLE_ATTRS = {num_re = re.compile(r"^[\s,]*([+-]?(?:\d+\.?\d*|\d*\.\d+))")-def parse_first_number(val: str):+def parse_first_number(val: str | None) -> float | None:+ """Parse the first numeric token from an SVG attribute value."""if val is None:return Nonem = num_re.match(val)@@ -58,7 +59,8 @@ def parse_first_number(val: str):return None-def format_number(n: float) -> str:+def format_number(n: float | None) -> str | None:+ """Format a float for compact SVG attribute output."""if n is None:return Noneif abs(n - round(n)) < 1e-6:@@ -68,8 +70,9 @@ def format_number(n: float) -> str:return s-def parse_style(style_str: str) -> dict:- out = {}+def parse_style(style_str: str | None) -> dict[str, str]:+ """Parse an inline SVG style string into a mapping."""+ out: dict[str, str] = {}if not style_str:return out# split by ; and then :@@ -82,28 +85,37 @@ def parse_style(style_str: str) -> dict:return out-def style_to_string(style_map: dict) -> str:+def style_to_string(style_map: dict[str, str]) -> str:+ """Serialize a style mapping back into an inline SVG style string."""if not style_map:return ""return ";".join(f"{k}:{v}" for k, v in style_map.items())-def merge_styles(parent_style: str, child_style: str) -> str:+def merge_styles(parent_style: str | None, child_style: str | None) -> str:+ """Merge parent and child inline styles, preferring child values."""p = parse_style(parent_style)c = parse_style(child_style)p.update(c) # child overridesreturn style_to_string(p)-def get_attr(elem, name, default=None):+def get_attr(elem: ET.Element | None, name: str, default: str | None = None) -> str | None:+ """Read an attribute from an element with a default fallback."""return elem.get(name) if elem is not None and name in elem.attrib else default-def compute_line_positions(text_el, tspan_el, cur_x, cur_y):+def compute_line_positions(+ text_el: ET.Element,+ tspan_el: ET.Element,+ cur_x: float | None,+ cur_y: float | None,+) -> tuple[float | None, float | None]:"""Compute absolute x,y for a tspan based on parent <text> current baseline and tspan's x/y/dx/dy.Returns (new_x, new_y)."""+ del text_el# Prefer explicit x/y on tspant_x_attr = get_attr(tspan_el, "x")t_y_attr = get_attr(tspan_el, "y")@@ -129,7 +141,8 @@ def compute_line_positions(text_el, tspan_el, cur_x, cur_y):return nx, ny-def collect_text_content(el) -> str:+def collect_text_content(el: ET.Element) -> str:+ """Collect all text content from an element subtree."""# Gather all text within the element (flatten nested tspans if any)parts = []for s in el.itertext():@@ -138,7 +151,12 @@ def collect_text_content(el) -> str:return "".join(parts)-def copy_text_attrs(src_el, dst_el, exclude=None):+def copy_text_attrs(+ src_el: ET.Element,+ dst_el: ET.Element,+ exclude: set[str] | None = None,+) -> None:+ """Copy shared text styling attributes between SVG text elements."""exclude = exclude or set()# Copy style string firstif "style" in src_el.attrib and "style" not in exclude:@@ -156,14 +174,15 @@ def copy_text_attrs(src_el, dst_el, exclude=None):def flatten_text_with_tspans(tree: ET.ElementTree) -> bool:+ """Flatten multi-line tspan text into independent text nodes when needed."""root = tree.getroot()parent_map = {c: p for p in root.iter() for c in p}changed = False- def is_svg_tag(el, name):+ def is_svg_tag(el: ET.Element, name: str) -> bool:return el.tag == f"{{{SVG_NS}}}{name}"- def is_new_line_tspan(tspan):+ def is_new_line_tspan(tspan: ET.Element) -> bool:"""Determine whether a tspan represents a new line (has its own y or non-zero dy)."""t_dy_attr = get_attr(tspan, "dy")t_y_attr = get_attr(tspan, "y")@@ -273,7 +292,13 @@ def flatten_text_with_tspans(tree: ET.ElementTree) -> bool:return changed-def _create_text_element_from_line(text_el, lead_text, tspans, x, y):+def _create_text_element_from_line(+ text_el: ET.Element,+ lead_text: str | None,+ tspans: list[ET.Element],+ x: float | None,+ y: float | None,+) -> ET.Element:"""Create a text element from a line's content (may contain leading text and multiple tspans).If there is only one tspan and no leading text, create a simple text element.@@ -345,6 +370,7 @@ def _create_text_element_from_line(text_el, lead_text, tspans, x, y):def process_svg_file(src_path: str, dst_path: str) -> bool:+ """Flatten eligible tspan lines in one SVG file."""try:tree = ET.parse(src_path)except ET.ParseError as e:@@ -375,7 +401,7 @@ def _compute_default_out_base(inp: str) -> str:return base + "_flattext" + ext-def _interactive_get_paths():+def _interactive_get_paths() -> tuple[str | None, str | None]:"""Interactive mode: prompt the user for input path (SVG file or directory)and optional output path. Returns (inp, out_base) or (None, None) if cancelled.@@ -405,7 +431,8 @@ def _interactive_get_paths():return inp, out_base-def main():+def main() -> None:+ """Run the CLI entry point."""# CLI parsing with optional interactive modeparser = argparse.ArgumentParser(description="Flatten <tspan> lines into multiple <text> nodes for better compatibility.",diff --git a/skills/ppt-master/scripts/svg_finalize/svg_rect_to_path.py b/skills/ppt-master/scripts/svg_finalize/svg_rect_to_path.pyindex ea93337a..18b592da 100644--- a/skills/ppt-master/scripts/svg_finalize/svg_rect_to_path.py+++ b/skills/ppt-master/scripts/svg_finalize/svg_rect_to_path.py@@ -23,12 +23,18 @@ import sysimport reimport argparsefrom pathlib import Path-from typing import Tuple, Dict, List+from typing import Anyfrom xml.etree import ElementTree as ET-def rect_to_rounded_path(x: float, y: float, width: float, height: float,- rx: float, ry: float) -> str:+def rect_to_rounded_path(+ x: float,+ y: float,+ width: float,+ height: float,+ rx: float,+ ry: float,+) -> str:"""Convert a rounded rectangle to an SVG path string.Uses elliptical arc commands to draw rounded corners.@@ -105,13 +111,13 @@ def process_svg(content: str, verbose: bool = False) -> Tuple[str, int]:if root.tag.startswith('{'):ns = root.tag.split('}')[0] + '}'- def get_tag_name(tag):+ def get_tag_name(tag: str) -> str:"""Get tag name without namespace."""if tag.startswith('{'):return tag.split('}')[1]return tag- def process_element(elem):+ def process_element(elem: ET.Element) -> None:"""Process a single element."""nonlocal converted_counttag_name = get_tag_name(elem.tag)@@ -170,7 +176,7 @@ def process_svg(content: str, verbose: bool = False) -> Tuple[str, int]:return result, converted_count-def process_svg_file(input_path: Path, output_path: Path, verbose: bool = False) -> Tuple[bool, int]:+def process_svg_file(input_path: Path, output_path: Path, verbose: bool = False) -> tuple[bool, int]:"""Process a single SVG file."""try:with open(input_path, 'r', encoding='utf-8') as f:@@ -192,7 +198,7 @@ def process_svg_file(input_path: Path, output_path: Path, verbose: bool = False)return False, 0-def find_svg_files(project_path: Path, source: str = 'output') -> Tuple[List[Path], str]:+def find_svg_files(project_path: Path, source: str = 'output') -> tuple[list[Path], str]:"""Find SVG files in a project."""dir_map = {'output': 'svg_output',@@ -218,7 +224,8 @@ def find_svg_files(project_path: Path, source: str = 'output') -> Tuple[List[Patreturn sorted(svg_dir.glob('*.svg')), dir_name-def main():+def main() -> None:+ """Run the CLI entry point."""parser = argparse.ArgumentParser(description='PPT Master - SVG Rounded Rectangle to Path Tool',formatter_class=argparse.RawDescriptionHelpFormatter,diff --git a/skills/ppt-master/scripts/svg_position_calculator.py b/skills/ppt-master/scripts/svg_position_calculator.pyindex 6870c6f4..00dfd5e3 100644--- a/skills/ppt-master/scripts/svg_position_calculator.py+++ b/skills/ppt-master/scripts/svg_position_calculator.py@@ -1293,7 +1293,8 @@ def from_json_config(config_file: str) -> None:print(" ".join(points_list))-def main():+def main() -> None:+ """Run the CLI entry point."""parser = argparse.ArgumentParser(description='SVG Position Calculation and Validation Tool',formatter_class=argparse.RawDescriptionHelpFormatter,diff --git a/skills/ppt-master/scripts/svg_quality_checker.py b/skills/ppt-master/scripts/svg_quality_checker.pyindex 19da4cec..b83114b3 100644--- a/skills/ppt-master/scripts/svg_quality_checker.py+++ b/skills/ppt-master/scripts/svg_quality_checker.py@@ -424,8 +424,8 @@ class SVGQualityChecker:print(f"\n[REPORT] Check report exported: {output_file}")-def main():- """Main function"""+def main() -> None:+ """Run the CLI entry point."""if len(sys.argv) < 2:print("PPT Master - SVG Quality Check Tool\n")print("Usage:")diff --git a/skills/ppt-master/scripts/total_md_split.py b/skills/ppt-master/scripts/total_md_split.pyindex 3004ae79..e0cf80ee 100644--- a/skills/ppt-master/scripts/total_md_split.py+++ b/skills/ppt-master/scripts/total_md_split.py@@ -24,11 +24,9 @@ Notes:"""import sys-import osimport argparseimport refrom pathlib import Path-from typing import List, Dict, Tuple, OptionalHEADING_RE = re.compile(r'^(#{1,6})\s*(.+?)\s*$')HR_RE = re.compile(r'^\s*[-*]{3,}\s*$')@@ -47,7 +45,7 @@ def normalize_title(title: str) -> str:-def extract_leading_number(text: str) -> Optional[int]:+def extract_leading_number(text: str) -> int | None:"""Extract leading slide number if present."""if not text:return None@@ -74,10 +72,11 @@ def extract_leading_number(text: str) -> Optional[int]:return None-def build_match_maps(svg_stems: List[str]) -> Tuple[set, Dict[str, List[str]], Dict[int, List[str]]]:+def build_match_maps(svg_stems: list[str]) -> tuple[set[str], dict[str, list[str]], dict[int, list[str]]]:+ """Build exact, normalized, and numeric maps for SVG stem matching."""exact = set(svg_stems)- norm_map: Dict[str, List[str]] = {}- num_map: Dict[int, List[str]] = {}+ norm_map: dict[str, list[str]] = {}+ num_map: dict[int, list[str]] = {}for stem in svg_stems:norm = normalize_title(stem)if norm:@@ -90,11 +89,12 @@ def build_match_maps(svg_stems: List[str]) -> Tuple[set, Dict[str, List[str]], Ddef match_title(raw_title: str,- exact: set,- norm_map: Dict[str, List[str]],- num_map: Dict[int, List[str]],- svg_stems: Optional[List[str]] = None,-) -> Optional[str]:+ exact: set[str],+ norm_map: dict[str, list[str]],+ num_map: dict[int, list[str]],+ svg_stems: list[str] | None = None,+) -> str | None:+ """Match a note heading to its corresponding SVG stem."""if raw_title in exact:return raw_titlenorm = normalize_title(raw_title)@@ -110,7 +110,7 @@ def match_title(return None-def find_svg_files(project_path: Path) -> List[Path]:+def find_svg_files(project_path: Path) -> list[Path]:"""Find SVG files in the project@@ -129,7 +129,11 @@ def find_svg_files(project_path: Path) -> List[Path]:return sorted(svg_dir.glob('*.svg'))-def parse_total_md(md_path: Path, svg_stems: Optional[List[str]] = None, verbose: bool = True) -> Dict[str, str]:+def parse_total_md(+ md_path: Path,+ svg_stems: list[str] | None = None,+ verbose: bool = True,+) -> dict[str, str]:"""Parse total.md file and extract speaker notes content for each level-1 heading@@ -154,10 +158,10 @@ def parse_total_md(md_path: Path, svg_stems: Optional[List[str]] = None, verboseexact, norm_map, num_map = build_match_maps(svg_stems)# Parse by headings (supports # / ## / ###)- notes: Dict[str, str] = {}- current_key: Optional[str] = None- current_lines: List[str] = []- unmatched_headings: List[str] = []+ notes: dict[str, str] = {}+ current_key: str | None = None+ current_lines: list[str] = []+ unmatched_headings: list[str] = []lines = content.splitlines()for line in lines:@@ -199,7 +203,7 @@ def parse_total_md(md_path: Path, svg_stems: Optional[List[str]] = None, verbosereturn notes-def check_svg_note_mapping(svg_files: List[Path], notes: Dict[str, str]) -> Tuple[bool, List[str]]:+def check_svg_note_mapping(svg_files: list[Path], notes: dict[str, str]) -> tuple[bool, list[str]]:"""Check the mapping between SVG files and speaker notes@@ -223,7 +227,7 @@ def check_svg_note_mapping(svg_files: List[Path], notes: Dict[str, str]) -> Tuplreturn len(missing_notes) == 0, missing_notes-def split_notes(notes: Dict[str, str], output_dir: Path, verbose: bool = True) -> bool:+def split_notes(notes: dict[str, str], output_dir: Path, verbose: bool = True) -> bool:"""Split and save notes dictionary into multiple files@@ -266,7 +270,8 @@ def split_notes(notes: Dict[str, str], output_dir: Path, verbose: bool = True) -return success_count == len(notes)-def main():+def main() -> None:+ """Run the CLI entry point."""parser = argparse.ArgumentParser(description='PPT Master - Speaker Notes Splitting Tool',formatter_class=argparse.RawDescriptionHelpFormatter,diff --git a/skills/ppt-master/scripts/web_to_md.py b/skills/ppt-master/scripts/web_to_md.pyindex 6ff5987d..7a530d43 100644--- a/skills/ppt-master/scripts/web_to_md.py+++ b/skills/ppt-master/scripts/web_to_md.py@@ -20,11 +20,12 @@ Note:"""import argparse-import sys+import datetime+import ioimport osimport re+import sysimport time-import datetimefrom urllib.parse import urljoin, urlparsetry:@@ -37,7 +38,6 @@ except ImportError:try:from PIL import Image- import ioPILLOW_AVAILABLE = Trueexcept ImportError:PILLOW_AVAILABLE = False@@ -78,9 +78,14 @@ CONFIG = {}-def fetch_url(url):- """- Fetches the URL handling headers, timeout and encoding detection.+def fetch_url(url: str) -> str:+ """Fetch a web page with explicit headers and encoding detection.++ Args:+ url: Target URL.++ Returns:+ The response body as text."""headers = {"User-Agent": CONFIG["user_agent"],@@ -101,8 +106,8 @@ def fetch_url(url):raise Exception(f"Failed to fetch {url}: {str(e)}")-def clean_title(title):- """Removes common suffixes from titles."""+def clean_title(title: str) -> str:+ """Remove common site suffixes from a title."""if not title:return ""# Remove site name suffixes often found in Chinese titles@@ -110,8 +115,8 @@ def clean_title(title):return clean.strip()-def sanitize_filename(name):- """Sanitizes the filename for file system."""+def sanitize_filename(name: str) -> str:+ """Sanitize a string for filesystem-safe filenames."""# Replace whitespace with underscore firstclean = re.sub(r'\s+', '_', name)# Remove all except Chinese, English, Numbers, Underscore@@ -121,8 +126,8 @@ def sanitize_filename(name):return clean[:80] # Truncate-def derive_base_name(title, url):- """Derive a safe, non-empty basename from title or URL."""+def derive_base_name(title: str, url: str) -> str:+ """Derive a safe, non-empty basename from a title or URL."""base = sanitize_filename(title or "")if base:return base@@ -141,8 +146,8 @@ def derive_base_name(title, url):return f"untitled_{ts}"-def build_image_filename(abs_url, seq, content_type=None):- """Builds a safe image filename using URL and optional content-type hint."""+def build_image_filename(abs_url: str, seq: int, content_type: str | None = None) -> str:+ """Build a safe image filename from URL metadata."""parsed = urlparse(abs_url)basename = os.path.basename(parsed.path).split('?')[0]stem, ext = os.path.splitext(basename)@@ -164,8 +169,13 @@ def build_image_filename(abs_url, seq, content_type=None):return f"{stem}{ext}"-def download_and_rewrite_images(content_element, page_url, image_dir, rel_prefix):- """Download images under content_element and rewrite src to local relative paths."""+def download_and_rewrite_images(+ content_element: Tag | None,+ page_url: str,+ image_dir: str,+ rel_prefix: str,+) -> int:+ """Download images under the main content node and rewrite `src` paths."""if content_element is None:return 0images = list(content_element.find_all("img"))@@ -264,8 +274,8 @@ def download_and_rewrite_images(content_element, page_url, image_dir, rel_prefixreturn saved-def extract_metadata(soup, url):- """Extracts metadata like title, date, author from Soup."""+def extract_metadata(soup: BeautifulSoup, url: str) -> dict[str, str]:+ """Extract page metadata such as title, date, description, and author."""# 1. Titletitle_tag = soup.title@@ -345,10 +355,8 @@ def extract_metadata(soup, url):}-def find_main_content(soup):- """- Tries to find the main content area using reliable heuristics for Chinese gov/news sites.- """+def find_main_content(soup: BeautifulSoup) -> Tag | None:+ """Find the most likely main content container in a page."""# 1. Clean up first (remove known clutter)for tag in soup(["script", "style", "nav", "header", "footer", "aside", "noscript", "iframe"]):tag.decompose()@@ -402,10 +410,8 @@ def find_main_content(soup):return best_element if best_element else soup.body-def element_to_markdown(element):- """- Recursive function to convert a BS4 element to Markdown.- """+def element_to_markdown(element: Tag | NavigableString | None) -> str:+ """Recursively convert a BeautifulSoup node to Markdown."""if element is None:return ""@@ -505,14 +511,11 @@ def element_to_markdown(element):return f"{content} "-def simple_html_to_markdown_traversal(soup):- """- A more robust HTML to Markdown converter using BS4 traversal.- We handle block elements by adding newlines.- """+def simple_html_to_markdown_traversal(soup: Tag | BeautifulSoup | None) -> str:+ """Convert HTML content to Markdown using BeautifulSoup traversal."""lines = []- def traverse(node):+ def traverse(node: Tag | NavigableString) -> str:if isinstance(node, NavigableString):text = str(node)# Normalize whitespace but keep single spaces@@ -617,7 +620,8 @@ def simple_html_to_markdown_traversal(soup):return md or ""-def process_url(url, output_file=None):+def process_url(url: str, output_file: str | None = None) -> tuple[bool, str, str | None]:+ """Fetch, convert, and save one web page as Markdown."""print(f"\n[Fetching] {url}")try:html = fetch_url(url)@@ -690,7 +694,8 @@ def process_url(url, output_file=None):return False, url, str(e)-def main():+def main() -> None:+ """Run the CLI entry point."""parser = argparse.ArgumentParser(description="Web to Markdown Converter (Python)")parser.add_argument("urls", nargs="*", help="URLs to process")