@laitszkin/apollo-toolkit 3.13.2 → 3.14.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.
Files changed (154) hide show
  1. package/AGENTS.md +7 -7
  2. package/CHANGELOG.md +36 -0
  3. package/CLAUDE.md +8 -8
  4. package/analyse-app-logs/SKILL.md +3 -3
  5. package/bin/apollo-toolkit.ts +7 -0
  6. package/codex/codex-memory-manager/SKILL.md +2 -2
  7. package/codex/learn-skill-from-conversations/SKILL.md +3 -3
  8. package/dist/bin/apollo-toolkit.d.ts +2 -0
  9. package/dist/bin/apollo-toolkit.js +7 -0
  10. package/dist/lib/cli.d.ts +41 -0
  11. package/dist/lib/cli.js +655 -0
  12. package/dist/lib/installer.d.ts +59 -0
  13. package/dist/lib/installer.js +404 -0
  14. package/dist/lib/tool-runner.d.ts +19 -0
  15. package/dist/lib/tool-runner.js +536 -0
  16. package/dist/lib/tools/architecture.d.ts +2 -0
  17. package/dist/lib/tools/architecture.js +23 -0
  18. package/dist/lib/tools/create-specs.d.ts +2 -0
  19. package/dist/lib/tools/create-specs.js +175 -0
  20. package/dist/lib/tools/docs-to-voice.d.ts +2 -0
  21. package/dist/lib/tools/docs-to-voice.js +705 -0
  22. package/dist/lib/tools/enforce-video-aspect-ratio.d.ts +2 -0
  23. package/dist/lib/tools/enforce-video-aspect-ratio.js +312 -0
  24. package/dist/lib/tools/extract-conversations.d.ts +2 -0
  25. package/dist/lib/tools/extract-conversations.js +105 -0
  26. package/dist/lib/tools/extract-pdf-text.d.ts +2 -0
  27. package/dist/lib/tools/extract-pdf-text.js +92 -0
  28. package/dist/lib/tools/filter-logs.d.ts +2 -0
  29. package/dist/lib/tools/filter-logs.js +94 -0
  30. package/dist/lib/tools/find-github-issues.d.ts +2 -0
  31. package/dist/lib/tools/find-github-issues.js +176 -0
  32. package/dist/lib/tools/generate-storyboard-images.d.ts +2 -0
  33. package/dist/lib/tools/generate-storyboard-images.js +419 -0
  34. package/dist/lib/tools/log-cli-utils.d.ts +35 -0
  35. package/dist/lib/tools/log-cli-utils.js +233 -0
  36. package/dist/lib/tools/open-github-issue.d.ts +2 -0
  37. package/dist/lib/tools/open-github-issue.js +750 -0
  38. package/dist/lib/tools/read-github-issue.d.ts +2 -0
  39. package/dist/lib/tools/read-github-issue.js +134 -0
  40. package/dist/lib/tools/render-error-book.d.ts +2 -0
  41. package/dist/lib/tools/render-error-book.js +265 -0
  42. package/dist/lib/tools/render-katex.d.ts +2 -0
  43. package/dist/lib/tools/render-katex.js +294 -0
  44. package/dist/lib/tools/review-threads.d.ts +2 -0
  45. package/dist/lib/tools/review-threads.js +491 -0
  46. package/dist/lib/tools/search-logs.d.ts +2 -0
  47. package/dist/lib/tools/search-logs.js +164 -0
  48. package/dist/lib/tools/sync-memory-index.d.ts +2 -0
  49. package/dist/lib/tools/sync-memory-index.js +113 -0
  50. package/dist/lib/tools/validate-openai-agent-config.d.ts +2 -0
  51. package/dist/lib/tools/validate-openai-agent-config.js +190 -0
  52. package/dist/lib/tools/validate-skill-frontmatter.d.ts +2 -0
  53. package/dist/lib/tools/validate-skill-frontmatter.js +118 -0
  54. package/dist/lib/types.d.ts +82 -0
  55. package/dist/lib/types.js +2 -0
  56. package/dist/lib/updater.d.ts +34 -0
  57. package/dist/lib/updater.js +112 -0
  58. package/dist/lib/utils/format.d.ts +2 -0
  59. package/dist/lib/utils/format.js +6 -0
  60. package/dist/lib/utils/terminal.d.ts +12 -0
  61. package/dist/lib/utils/terminal.js +26 -0
  62. package/docs-to-voice/SKILL.md +0 -1
  63. package/generate-spec/SKILL.md +1 -1
  64. package/katex/SKILL.md +1 -2
  65. package/lib/cli.ts +780 -0
  66. package/lib/installer.ts +466 -0
  67. package/lib/tool-runner.ts +561 -0
  68. package/lib/tools/architecture.ts +20 -0
  69. package/lib/tools/create-specs.ts +204 -0
  70. package/lib/tools/docs-to-voice.ts +799 -0
  71. package/lib/tools/enforce-video-aspect-ratio.ts +368 -0
  72. package/lib/tools/extract-conversations.ts +114 -0
  73. package/lib/tools/extract-pdf-text.ts +99 -0
  74. package/lib/tools/filter-logs.ts +118 -0
  75. package/lib/tools/find-github-issues.ts +211 -0
  76. package/lib/tools/generate-storyboard-images.ts +455 -0
  77. package/lib/tools/log-cli-utils.ts +262 -0
  78. package/lib/tools/open-github-issue.ts +930 -0
  79. package/lib/tools/read-github-issue.ts +179 -0
  80. package/lib/tools/render-error-book.ts +300 -0
  81. package/lib/tools/render-katex.ts +325 -0
  82. package/lib/tools/review-threads.ts +590 -0
  83. package/lib/tools/search-logs.ts +200 -0
  84. package/lib/tools/sync-memory-index.ts +114 -0
  85. package/lib/tools/validate-openai-agent-config.ts +213 -0
  86. package/lib/tools/validate-skill-frontmatter.ts +124 -0
  87. package/lib/types.ts +90 -0
  88. package/lib/updater.ts +165 -0
  89. package/lib/utils/format.ts +7 -0
  90. package/lib/utils/terminal.ts +22 -0
  91. package/open-github-issue/SKILL.md +2 -2
  92. package/optimise-skill/SKILL.md +1 -1
  93. package/package.json +13 -4
  94. package/resources/project-architecture/assets/architecture.css +764 -0
  95. package/resources/project-architecture/assets/viewer.client.js +144 -0
  96. package/resources/project-architecture/index.html +42 -0
  97. package/review-spec-related-changes/SKILL.md +1 -1
  98. package/solve-issues-found-during-review/SKILL.md +2 -1
  99. package/tsconfig.json +28 -0
  100. package/analyse-app-logs/scripts/__pycache__/filter_logs_by_time.cpython-312.pyc +0 -0
  101. package/analyse-app-logs/scripts/__pycache__/log_cli_utils.cpython-312.pyc +0 -0
  102. package/analyse-app-logs/scripts/__pycache__/search_logs.cpython-312.pyc +0 -0
  103. package/analyse-app-logs/scripts/filter_logs_by_time.py +0 -64
  104. package/analyse-app-logs/scripts/log_cli_utils.py +0 -112
  105. package/analyse-app-logs/scripts/search_logs.py +0 -137
  106. package/analyse-app-logs/tests/test_filter_logs_by_time.py +0 -95
  107. package/analyse-app-logs/tests/test_search_logs.py +0 -100
  108. package/codex/codex-memory-manager/scripts/extract_recent_conversations.py +0 -369
  109. package/codex/codex-memory-manager/scripts/sync_memory_index.py +0 -130
  110. package/codex/codex-memory-manager/tests/test_extract_recent_conversations.py +0 -177
  111. package/codex/codex-memory-manager/tests/test_memory_template.py +0 -37
  112. package/codex/codex-memory-manager/tests/test_sync_memory_index.py +0 -84
  113. package/codex/learn-skill-from-conversations/scripts/extract_recent_conversations.py +0 -369
  114. package/codex/learn-skill-from-conversations/tests/test_extract_recent_conversations.py +0 -177
  115. package/docs-to-voice/scripts/__pycache__/docs_to_voice.cpython-312.pyc +0 -0
  116. package/docs-to-voice/scripts/docs_to_voice.py +0 -1385
  117. package/docs-to-voice/scripts/docs_to_voice.sh +0 -11
  118. package/docs-to-voice/tests/test_docs_to_voice_api_max_chars.py +0 -210
  119. package/docs-to-voice/tests/test_docs_to_voice_sentence_timeline.py +0 -115
  120. package/docs-to-voice/tests/test_docs_to_voice_settings.py +0 -43
  121. package/docs-to-voice/tests/test_docs_to_voice_shell_wrapper.py +0 -51
  122. package/docs-to-voice/tests/test_docs_to_voice_speech_rate.py +0 -57
  123. package/generate-spec/scripts/__pycache__/create-specscpython-312.pyc +0 -0
  124. package/generate-spec/scripts/create-specs +0 -215
  125. package/generate-spec/tests/test_create_specs.py +0 -200
  126. package/init-project-html/scripts/architecture-bootstrap-render.js +0 -16
  127. package/init-project-html/scripts/architecture.js +0 -296
  128. package/katex/scripts/__pycache__/render_katex.cpython-312.pyc +0 -0
  129. package/katex/scripts/render_katex.py +0 -247
  130. package/katex/scripts/render_katex.sh +0 -11
  131. package/katex/tests/test_render_katex.py +0 -174
  132. package/learning-error-book/scripts/render_error_book_json_to_pdf.py +0 -590
  133. package/learning-error-book/tests/test_render_error_book_json_to_pdf.py +0 -134
  134. package/open-github-issue/scripts/__pycache__/open_github_issue.cpython-312.pyc +0 -0
  135. package/open-github-issue/scripts/open_github_issue.py +0 -705
  136. package/open-github-issue/tests/test_open_github_issue.py +0 -381
  137. package/openai-text-to-image-storyboard/scripts/generate_storyboard_images.py +0 -763
  138. package/openai-text-to-image-storyboard/tests/test_generate_storyboard_images.py +0 -177
  139. package/read-github-issue/scripts/__pycache__/find_issues.cpython-312.pyc +0 -0
  140. package/read-github-issue/scripts/__pycache__/read_issue.cpython-312.pyc +0 -0
  141. package/read-github-issue/scripts/find_issues.py +0 -148
  142. package/read-github-issue/scripts/read_issue.py +0 -108
  143. package/read-github-issue/tests/test_find_issues.py +0 -127
  144. package/read-github-issue/tests/test_read_issue.py +0 -109
  145. package/resolve-review-comments/scripts/__pycache__/review_threads.cpython-312.pyc +0 -0
  146. package/resolve-review-comments/scripts/review_threads.py +0 -425
  147. package/resolve-review-comments/tests/test_review_threads.py +0 -74
  148. package/scripts/validate_openai_agent_config.py +0 -209
  149. package/scripts/validate_skill_frontmatter.py +0 -131
  150. package/text-to-short-video/scripts/__pycache__/enforce_video_aspect_ratio.cpython-312.pyc +0 -0
  151. package/text-to-short-video/scripts/enforce_video_aspect_ratio.py +0 -350
  152. package/text-to-short-video/tests/test_enforce_video_aspect_ratio.py +0 -194
  153. package/weekly-financial-event-report/scripts/extract_pdf_text_pdfkit.swift +0 -99
  154. package/weekly-financial-event-report/tests/test_extract_pdf_text_pdfkit.py +0 -64
@@ -1,174 +0,0 @@
1
- #!/usr/bin/env python3
2
-
3
- from __future__ import annotations
4
-
5
- import importlib.util
6
- import io
7
- import json
8
- import os
9
- import random
10
- import string
11
- import subprocess
12
- import sys
13
- import tempfile
14
- import types
15
- import unittest
16
- from pathlib import Path
17
- from unittest.mock import patch
18
-
19
-
20
- SCRIPT_PATH = Path(__file__).resolve().parents[1] / "scripts" / "render_katex.py"
21
- SHELL_SCRIPT_PATH = Path(__file__).resolve().parents[1] / "scripts" / "render_katex.sh"
22
- SPEC = importlib.util.spec_from_file_location("render_katex", SCRIPT_PATH)
23
- MODULE = importlib.util.module_from_spec(SPEC)
24
- SPEC.loader.exec_module(MODULE)
25
-
26
-
27
- class RenderKatexTests(unittest.TestCase):
28
- def test_load_macro_pairs_rejects_invalid_values(self) -> None:
29
- with self.assertRaises(MODULE.KatexRenderError):
30
- MODULE.load_macro_pairs(["\\RR"])
31
-
32
- with self.assertRaises(MODULE.KatexRenderError):
33
- MODULE.load_macro_pairs(["\\RR:"])
34
-
35
- def test_normalize_path_property_returns_absolute_resolved_path(self) -> None:
36
- generator = random.Random(20260418)
37
- alphabet = string.ascii_letters + string.digits
38
-
39
- with tempfile.TemporaryDirectory() as temp_dir:
40
- with patch("pathlib.Path.cwd", return_value=Path(temp_dir)):
41
- for _ in range(120):
42
- depth = generator.randint(1, 4)
43
- pieces = [
44
- "".join(generator.choice(alphabet) for _ in range(generator.randint(1, 8)))
45
- for _ in range(depth)
46
- ]
47
- raw_path = "/".join(pieces)
48
- normalized = MODULE.normalize_path(raw_path)
49
- with self.subTest(raw_path=raw_path):
50
- self.assertTrue(normalized.is_absolute())
51
- self.assertEqual(normalized, (Path(temp_dir) / raw_path).resolve())
52
-
53
- def test_wrap_output_json_includes_metadata(self) -> None:
54
- args = types.SimpleNamespace(
55
- output_format="json",
56
- display_mode=True,
57
- katex_format="htmlAndMathml",
58
- css_href="https://cdn.example.com/katex.css",
59
- )
60
-
61
- payload = json.loads(MODULE.wrap_output("<span>ok</span>", r"x^2", args))
62
- self.assertEqual(payload["tex"], r"x^2")
63
- self.assertEqual(payload["displayMode"], True)
64
- self.assertEqual(payload["content"], "<span>ok</span>")
65
-
66
- def test_run_katex_cli_builds_expected_command(self) -> None:
67
- captured = {}
68
- with tempfile.TemporaryDirectory() as temp_dir:
69
- macro_file = Path(temp_dir) / "macros.json"
70
- macro_file.write_text('{"\\\\RR":"\\\\mathbb{R}"}\n', encoding="utf-8")
71
- args = types.SimpleNamespace(
72
- katex_format="html",
73
- display_mode=True,
74
- leqno=True,
75
- fleqn=False,
76
- color_is_text_color=True,
77
- no_throw_on_error=True,
78
- error_color="#cc0000",
79
- strict="warn",
80
- trust="true",
81
- max_size=12.5,
82
- max_expand=500,
83
- min_rule_thickness=0.08,
84
- macro=[r"\RR:\mathbb{R}"],
85
- macro_file=str(macro_file),
86
- )
87
-
88
- def fake_run(command, **kwargs):
89
- captured["command"] = command
90
- captured["kwargs"] = kwargs
91
- return types.SimpleNamespace(returncode=0, stdout="<span>rendered</span>", stderr="")
92
-
93
- with patch.object(MODULE.subprocess, "run", side_effect=fake_run):
94
- output = MODULE.run_katex_cli(r"\RR + x", args)
95
-
96
- self.assertEqual(output, "<span>rendered</span>")
97
- command = captured["command"]
98
- self.assertIn("--display-mode", command)
99
- self.assertIn("--leqno", command)
100
- self.assertIn("--color-is-text-color", command)
101
- self.assertIn("--no-throw-on-error", command)
102
- self.assertIn("--macro", command)
103
- self.assertIn(r"\RR:\mathbb{R}", command)
104
- self.assertIn("--macro-file", command)
105
- self.assertIn("--input", command)
106
-
107
- def test_main_writes_output_file_when_renderer_succeeds(self) -> None:
108
- with tempfile.TemporaryDirectory() as temp_dir:
109
- output_path = Path(temp_dir) / "out" / "katex.html"
110
- argv = [
111
- "--tex",
112
- r"\int_0^1 x^2 dx",
113
- "--output-format",
114
- "html-page",
115
- "--output-file",
116
- str(output_path),
117
- "--title",
118
- "Sample Render",
119
- ]
120
-
121
- with patch.object(MODULE, "run_katex_cli", return_value="<span>ok</span>"), patch(
122
- "sys.stdout", new_callable=io.StringIO
123
- ) as stdout:
124
- exit_code = MODULE.main(argv)
125
-
126
- self.assertEqual(exit_code, 0)
127
- self.assertIn(str(output_path.resolve()), stdout.getvalue())
128
- self.assertIn("<span>ok</span>", output_path.read_text(encoding="utf-8"))
129
- self.assertIn("Sample Render", output_path.read_text(encoding="utf-8"))
130
-
131
- def test_main_reports_missing_node_tooling(self) -> None:
132
- error = FileNotFoundError(2, "No such file or directory", "npx")
133
-
134
- with patch.object(MODULE, "run_katex_cli", side_effect=error), patch(
135
- "sys.stderr", new_callable=io.StringIO
136
- ) as stderr:
137
- exit_code = MODULE.main(["--tex", r"x+1"])
138
-
139
- self.assertEqual(exit_code, 1)
140
- self.assertIn("node and npx are required", stderr.getvalue())
141
-
142
- def test_shell_wrapper_invokes_python_script_with_same_arguments(self) -> None:
143
- with tempfile.TemporaryDirectory() as temp_dir:
144
- capture_path = Path(temp_dir) / "argv.json"
145
- fake_python = Path(temp_dir) / "python3"
146
- fake_python.write_text(
147
- f"#!{sys.executable}\n"
148
- "import json, os, sys\n"
149
- "with open(os.environ['CAPTURE_PATH'], 'w', encoding='utf-8') as handle:\n"
150
- " json.dump(sys.argv[1:], handle)\n",
151
- encoding="utf-8",
152
- )
153
- fake_python.chmod(0o755)
154
-
155
- env = dict(os.environ)
156
- env["PATH"] = f"{temp_dir}:{env['PATH']}"
157
- env["CAPTURE_PATH"] = str(capture_path)
158
-
159
- result = subprocess.run(
160
- ["bash", str(SHELL_SCRIPT_PATH), "--tex", r"x^2", "--output-format", "json"],
161
- capture_output=True,
162
- text=True,
163
- env=env,
164
- check=False,
165
- )
166
-
167
- self.assertEqual(result.returncode, 0, result.stderr)
168
- argv = json.loads(capture_path.read_text(encoding="utf-8"))
169
- self.assertEqual(argv[0], str(SCRIPT_PATH))
170
- self.assertEqual(argv[1:], ["--tex", r"x^2", "--output-format", "json"])
171
-
172
-
173
- if __name__ == "__main__":
174
- unittest.main()