@laitszkin/apollo-toolkit 2.14.23 → 3.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +3 -0
- package/CHANGELOG.md +17 -0
- package/README.md +9 -0
- package/analyse-app-logs/README.md +5 -5
- package/analyse-app-logs/SKILL.md +7 -5
- package/analyse-app-logs/scripts/__pycache__/filter_logs_by_time.cpython-312.pyc +0 -0
- package/analyse-app-logs/scripts/__pycache__/log_cli_utils.cpython-312.pyc +0 -0
- package/analyse-app-logs/scripts/__pycache__/search_logs.cpython-312.pyc +0 -0
- package/codex/codex-memory-manager/README.md +2 -2
- package/codex/codex-memory-manager/SKILL.md +5 -5
- package/codex/codex-memory-manager/tests/test_extract_recent_conversations.py +3 -2
- package/codex/learn-skill-from-conversations/README.md +1 -1
- package/codex/learn-skill-from-conversations/SKILL.md +2 -2
- package/codex/learn-skill-from-conversations/tests/test_extract_recent_conversations.py +3 -2
- package/docs-to-voice/README.md +3 -3
- package/docs-to-voice/SKILL.md +4 -4
- package/docs-to-voice/scripts/__pycache__/docs_to_voice.cpython-312.pyc +0 -0
- package/docs-to-voice/tests/test_docs_to_voice_shell_wrapper.py +51 -0
- package/feature-propose/SKILL.md +1 -0
- package/generate-spec/README.md +3 -6
- package/generate-spec/SKILL.md +2 -3
- package/generate-spec/scripts/__pycache__/create-specscpython-312.pyc +0 -0
- package/generate-spec/tests/test_create_specs.py +166 -0
- package/jupiter-development/SKILL.md +5 -0
- package/katex/SKILL.md +3 -3
- package/katex/scripts/__pycache__/render_katex.cpython-312.pyc +0 -0
- package/katex/tests/test_render_katex.py +174 -0
- package/learning-error-book/SKILL.md +2 -2
- package/learning-error-book/tests/test_render_error_book_json_to_pdf.py +134 -0
- package/lib/cli.js +66 -0
- package/lib/tool-runner.js +214 -0
- package/maintain-project-constraints/SKILL.md +3 -3
- package/maintain-skill-catalog/SKILL.md +2 -2
- package/novel-to-short-video/SKILL.md +2 -2
- package/open-github-issue/README.md +31 -22
- package/open-github-issue/SKILL.md +54 -40
- package/open-github-issue/scripts/__pycache__/open_github_issue.cpython-312.pyc +0 -0
- package/open-github-issue/scripts/open_github_issue.py +130 -3
- package/open-github-issue/tests/test_open_github_issue.py +95 -0
- package/openai-text-to-image-storyboard/README.md +1 -1
- package/openai-text-to-image-storyboard/SKILL.md +1 -1
- package/openai-text-to-image-storyboard/tests/test_generate_storyboard_images.py +177 -0
- package/package.json +1 -1
- package/read-github-issue/SKILL.md +9 -9
- package/read-github-issue/scripts/__pycache__/find_issues.cpython-312.pyc +0 -0
- package/read-github-issue/scripts/__pycache__/read_issue.cpython-312.pyc +0 -0
- package/resolve-review-comments/SKILL.md +8 -8
- package/resolve-review-comments/scripts/__pycache__/review_threads.cpython-312.pyc +0 -0
- package/review-codebases/README.md +2 -0
- package/review-codebases/SKILL.md +1 -0
- package/scheduled-runtime-health-check/SKILL.md +3 -0
- package/systematic-debug/SKILL.md +3 -0
- package/text-to-short-video/README.md +1 -1
- package/text-to-short-video/SKILL.md +1 -1
- package/text-to-short-video/scripts/__pycache__/enforce_video_aspect_ratio.cpython-312.pyc +0 -0
- package/text-to-short-video/tests/test_enforce_video_aspect_ratio.py +194 -0
- package/weekly-financial-event-report/SKILL.md +2 -2
- package/weekly-financial-event-report/tests/test_extract_pdf_text_pdfkit.py +64 -0
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
import importlib.util
|
|
6
|
+
import shutil
|
|
7
|
+
import subprocess
|
|
8
|
+
import sys
|
|
9
|
+
import tempfile
|
|
10
|
+
import unittest
|
|
11
|
+
from pathlib import Path
|
|
12
|
+
|
|
13
|
+
REPORTLAB_AVAILABLE = importlib.util.find_spec("reportlab") is not None
|
|
14
|
+
|
|
15
|
+
if REPORTLAB_AVAILABLE:
|
|
16
|
+
from reportlab.pdfgen import canvas
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
SCRIPT_PATH = Path(__file__).resolve().parents[1] / "scripts" / "extract_pdf_text_pdfkit.swift"
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
@unittest.skipUnless(shutil.which("swift"), "swift is required for PDFKit script tests")
|
|
23
|
+
@unittest.skipUnless(sys.platform == "darwin", "PDFKit script tests only work on macOS")
|
|
24
|
+
class ExtractPdfTextPdfkitTests(unittest.TestCase):
|
|
25
|
+
def run_script(self, *args: str) -> subprocess.CompletedProcess[str]:
|
|
26
|
+
return subprocess.run(
|
|
27
|
+
["swift", str(SCRIPT_PATH), *args],
|
|
28
|
+
capture_output=True,
|
|
29
|
+
text=True,
|
|
30
|
+
check=False,
|
|
31
|
+
)
|
|
32
|
+
|
|
33
|
+
def test_missing_path_prints_usage(self) -> None:
|
|
34
|
+
result = self.run_script()
|
|
35
|
+
self.assertEqual(result.returncode, 1)
|
|
36
|
+
self.assertIn("Usage: swift scripts/extract_pdf_text_pdfkit.swift", result.stderr)
|
|
37
|
+
|
|
38
|
+
def test_unreadable_pdf_reports_missing_file(self) -> None:
|
|
39
|
+
result = self.run_script("/tmp/does-not-exist.pdf")
|
|
40
|
+
self.assertEqual(result.returncode, 1)
|
|
41
|
+
self.assertIn("Unable to open PDF", result.stderr)
|
|
42
|
+
|
|
43
|
+
@unittest.skipUnless(REPORTLAB_AVAILABLE, "reportlab is required to generate fixture PDFs")
|
|
44
|
+
def test_extracts_text_from_generated_pdf(self) -> None:
|
|
45
|
+
with tempfile.TemporaryDirectory() as temp_dir:
|
|
46
|
+
pdf_path = Path(temp_dir) / "sample.pdf"
|
|
47
|
+
pdf = canvas.Canvas(str(pdf_path))
|
|
48
|
+
pdf.drawString(72, 720, "Weekly event headline")
|
|
49
|
+
pdf.showPage()
|
|
50
|
+
pdf.drawString(72, 720, "Second page details")
|
|
51
|
+
pdf.save()
|
|
52
|
+
|
|
53
|
+
result = self.run_script(str(pdf_path))
|
|
54
|
+
|
|
55
|
+
self.assertEqual(result.returncode, 0, result.stderr)
|
|
56
|
+
self.assertIn(f"PDF_PATH={pdf_path}", result.stdout)
|
|
57
|
+
self.assertIn("PAGE_COUNT=2", result.stdout)
|
|
58
|
+
self.assertIn("=== PAGE 1 ===", result.stdout)
|
|
59
|
+
self.assertIn("Weekly event headline", result.stdout)
|
|
60
|
+
self.assertIn("Second page details", result.stdout)
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
if __name__ == "__main__":
|
|
64
|
+
unittest.main()
|