@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.
- package/AGENTS.md +7 -7
- package/CHANGELOG.md +36 -0
- package/CLAUDE.md +8 -8
- package/analyse-app-logs/SKILL.md +3 -3
- package/bin/apollo-toolkit.ts +7 -0
- package/codex/codex-memory-manager/SKILL.md +2 -2
- package/codex/learn-skill-from-conversations/SKILL.md +3 -3
- package/dist/bin/apollo-toolkit.d.ts +2 -0
- package/dist/bin/apollo-toolkit.js +7 -0
- package/dist/lib/cli.d.ts +41 -0
- package/dist/lib/cli.js +655 -0
- package/dist/lib/installer.d.ts +59 -0
- package/dist/lib/installer.js +404 -0
- package/dist/lib/tool-runner.d.ts +19 -0
- package/dist/lib/tool-runner.js +536 -0
- package/dist/lib/tools/architecture.d.ts +2 -0
- package/dist/lib/tools/architecture.js +23 -0
- package/dist/lib/tools/create-specs.d.ts +2 -0
- package/dist/lib/tools/create-specs.js +175 -0
- package/dist/lib/tools/docs-to-voice.d.ts +2 -0
- package/dist/lib/tools/docs-to-voice.js +705 -0
- package/dist/lib/tools/enforce-video-aspect-ratio.d.ts +2 -0
- package/dist/lib/tools/enforce-video-aspect-ratio.js +312 -0
- package/dist/lib/tools/extract-conversations.d.ts +2 -0
- package/dist/lib/tools/extract-conversations.js +105 -0
- package/dist/lib/tools/extract-pdf-text.d.ts +2 -0
- package/dist/lib/tools/extract-pdf-text.js +92 -0
- package/dist/lib/tools/filter-logs.d.ts +2 -0
- package/dist/lib/tools/filter-logs.js +94 -0
- package/dist/lib/tools/find-github-issues.d.ts +2 -0
- package/dist/lib/tools/find-github-issues.js +176 -0
- package/dist/lib/tools/generate-storyboard-images.d.ts +2 -0
- package/dist/lib/tools/generate-storyboard-images.js +419 -0
- package/dist/lib/tools/log-cli-utils.d.ts +35 -0
- package/dist/lib/tools/log-cli-utils.js +233 -0
- package/dist/lib/tools/open-github-issue.d.ts +2 -0
- package/dist/lib/tools/open-github-issue.js +750 -0
- package/dist/lib/tools/read-github-issue.d.ts +2 -0
- package/dist/lib/tools/read-github-issue.js +134 -0
- package/dist/lib/tools/render-error-book.d.ts +2 -0
- package/dist/lib/tools/render-error-book.js +265 -0
- package/dist/lib/tools/render-katex.d.ts +2 -0
- package/dist/lib/tools/render-katex.js +294 -0
- package/dist/lib/tools/review-threads.d.ts +2 -0
- package/dist/lib/tools/review-threads.js +491 -0
- package/dist/lib/tools/search-logs.d.ts +2 -0
- package/dist/lib/tools/search-logs.js +164 -0
- package/dist/lib/tools/sync-memory-index.d.ts +2 -0
- package/dist/lib/tools/sync-memory-index.js +113 -0
- package/dist/lib/tools/validate-openai-agent-config.d.ts +2 -0
- package/dist/lib/tools/validate-openai-agent-config.js +190 -0
- package/dist/lib/tools/validate-skill-frontmatter.d.ts +2 -0
- package/dist/lib/tools/validate-skill-frontmatter.js +118 -0
- package/dist/lib/types.d.ts +82 -0
- package/dist/lib/types.js +2 -0
- package/dist/lib/updater.d.ts +34 -0
- package/dist/lib/updater.js +112 -0
- package/dist/lib/utils/format.d.ts +2 -0
- package/dist/lib/utils/format.js +6 -0
- package/dist/lib/utils/terminal.d.ts +12 -0
- package/dist/lib/utils/terminal.js +26 -0
- package/docs-to-voice/SKILL.md +0 -1
- package/generate-spec/SKILL.md +1 -1
- package/katex/SKILL.md +1 -2
- package/lib/cli.ts +780 -0
- package/lib/installer.ts +466 -0
- package/lib/tool-runner.ts +561 -0
- package/lib/tools/architecture.ts +20 -0
- package/lib/tools/create-specs.ts +204 -0
- package/lib/tools/docs-to-voice.ts +799 -0
- package/lib/tools/enforce-video-aspect-ratio.ts +368 -0
- package/lib/tools/extract-conversations.ts +114 -0
- package/lib/tools/extract-pdf-text.ts +99 -0
- package/lib/tools/filter-logs.ts +118 -0
- package/lib/tools/find-github-issues.ts +211 -0
- package/lib/tools/generate-storyboard-images.ts +455 -0
- package/lib/tools/log-cli-utils.ts +262 -0
- package/lib/tools/open-github-issue.ts +930 -0
- package/lib/tools/read-github-issue.ts +179 -0
- package/lib/tools/render-error-book.ts +300 -0
- package/lib/tools/render-katex.ts +325 -0
- package/lib/tools/review-threads.ts +590 -0
- package/lib/tools/search-logs.ts +200 -0
- package/lib/tools/sync-memory-index.ts +114 -0
- package/lib/tools/validate-openai-agent-config.ts +213 -0
- package/lib/tools/validate-skill-frontmatter.ts +124 -0
- package/lib/types.ts +90 -0
- package/lib/updater.ts +165 -0
- package/lib/utils/format.ts +7 -0
- package/lib/utils/terminal.ts +22 -0
- package/open-github-issue/SKILL.md +2 -2
- package/optimise-skill/SKILL.md +1 -1
- package/package.json +13 -4
- package/resources/project-architecture/assets/architecture.css +764 -0
- package/resources/project-architecture/assets/viewer.client.js +144 -0
- package/resources/project-architecture/index.html +42 -0
- package/review-spec-related-changes/SKILL.md +1 -1
- package/solve-issues-found-during-review/SKILL.md +2 -1
- package/tsconfig.json +28 -0
- 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/analyse-app-logs/scripts/filter_logs_by_time.py +0 -64
- package/analyse-app-logs/scripts/log_cli_utils.py +0 -112
- package/analyse-app-logs/scripts/search_logs.py +0 -137
- package/analyse-app-logs/tests/test_filter_logs_by_time.py +0 -95
- package/analyse-app-logs/tests/test_search_logs.py +0 -100
- package/codex/codex-memory-manager/scripts/extract_recent_conversations.py +0 -369
- package/codex/codex-memory-manager/scripts/sync_memory_index.py +0 -130
- package/codex/codex-memory-manager/tests/test_extract_recent_conversations.py +0 -177
- package/codex/codex-memory-manager/tests/test_memory_template.py +0 -37
- package/codex/codex-memory-manager/tests/test_sync_memory_index.py +0 -84
- package/codex/learn-skill-from-conversations/scripts/extract_recent_conversations.py +0 -369
- package/codex/learn-skill-from-conversations/tests/test_extract_recent_conversations.py +0 -177
- package/docs-to-voice/scripts/__pycache__/docs_to_voice.cpython-312.pyc +0 -0
- package/docs-to-voice/scripts/docs_to_voice.py +0 -1385
- package/docs-to-voice/scripts/docs_to_voice.sh +0 -11
- package/docs-to-voice/tests/test_docs_to_voice_api_max_chars.py +0 -210
- package/docs-to-voice/tests/test_docs_to_voice_sentence_timeline.py +0 -115
- package/docs-to-voice/tests/test_docs_to_voice_settings.py +0 -43
- package/docs-to-voice/tests/test_docs_to_voice_shell_wrapper.py +0 -51
- package/docs-to-voice/tests/test_docs_to_voice_speech_rate.py +0 -57
- package/generate-spec/scripts/__pycache__/create-specscpython-312.pyc +0 -0
- package/generate-spec/scripts/create-specs +0 -215
- package/generate-spec/tests/test_create_specs.py +0 -200
- package/init-project-html/scripts/architecture-bootstrap-render.js +0 -16
- package/init-project-html/scripts/architecture.js +0 -296
- package/katex/scripts/__pycache__/render_katex.cpython-312.pyc +0 -0
- package/katex/scripts/render_katex.py +0 -247
- package/katex/scripts/render_katex.sh +0 -11
- package/katex/tests/test_render_katex.py +0 -174
- package/learning-error-book/scripts/render_error_book_json_to_pdf.py +0 -590
- package/learning-error-book/tests/test_render_error_book_json_to_pdf.py +0 -134
- package/open-github-issue/scripts/__pycache__/open_github_issue.cpython-312.pyc +0 -0
- package/open-github-issue/scripts/open_github_issue.py +0 -705
- package/open-github-issue/tests/test_open_github_issue.py +0 -381
- package/openai-text-to-image-storyboard/scripts/generate_storyboard_images.py +0 -763
- package/openai-text-to-image-storyboard/tests/test_generate_storyboard_images.py +0 -177
- 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/read-github-issue/scripts/find_issues.py +0 -148
- package/read-github-issue/scripts/read_issue.py +0 -108
- package/read-github-issue/tests/test_find_issues.py +0 -127
- package/read-github-issue/tests/test_read_issue.py +0 -109
- package/resolve-review-comments/scripts/__pycache__/review_threads.cpython-312.pyc +0 -0
- package/resolve-review-comments/scripts/review_threads.py +0 -425
- package/resolve-review-comments/tests/test_review_threads.py +0 -74
- package/scripts/validate_openai_agent_config.py +0 -209
- package/scripts/validate_skill_frontmatter.py +0 -131
- package/text-to-short-video/scripts/__pycache__/enforce_video_aspect_ratio.cpython-312.pyc +0 -0
- package/text-to-short-video/scripts/enforce_video_aspect_ratio.py +0 -350
- package/text-to-short-video/tests/test_enforce_video_aspect_ratio.py +0 -194
- package/weekly-financial-event-report/scripts/extract_pdf_text_pdfkit.swift +0 -99
- package/weekly-financial-event-report/tests/test_extract_pdf_text_pdfkit.py +0 -64
|
@@ -1,177 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env python3
|
|
2
|
-
"""Edge-case tests for extract_recent_conversations.py."""
|
|
3
|
-
|
|
4
|
-
from __future__ import annotations
|
|
5
|
-
|
|
6
|
-
import json
|
|
7
|
-
import subprocess
|
|
8
|
-
import sys
|
|
9
|
-
import tempfile
|
|
10
|
-
import unittest
|
|
11
|
-
from datetime import datetime, timedelta, timezone
|
|
12
|
-
from pathlib import Path
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
SCRIPT_PATH = (
|
|
16
|
-
Path(__file__).resolve().parents[1] / "scripts" / "extract_recent_conversations.py"
|
|
17
|
-
)
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
def write_session(path: Path, timestamp: datetime) -> None:
|
|
21
|
-
path.parent.mkdir(parents=True, exist_ok=True)
|
|
22
|
-
entries = [
|
|
23
|
-
{
|
|
24
|
-
"type": "session_meta",
|
|
25
|
-
"payload": {"timestamp": timestamp.isoformat()},
|
|
26
|
-
},
|
|
27
|
-
{
|
|
28
|
-
"type": "event_msg",
|
|
29
|
-
"payload": {"type": "user_message", "message": f"user:{path.stem}"},
|
|
30
|
-
},
|
|
31
|
-
{
|
|
32
|
-
"type": "event_msg",
|
|
33
|
-
"payload": {"type": "agent_message", "message": f"assistant:{path.stem}"},
|
|
34
|
-
},
|
|
35
|
-
]
|
|
36
|
-
with path.open("w", encoding="utf-8") as handle:
|
|
37
|
-
for entry in entries:
|
|
38
|
-
handle.write(json.dumps(entry) + "\n")
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
def run_extractor(
|
|
42
|
-
sessions_dir: Path,
|
|
43
|
-
archived_dir: Path | None = None,
|
|
44
|
-
*extra_args: str,
|
|
45
|
-
) -> str:
|
|
46
|
-
effective_archived_dir = archived_dir or (sessions_dir.parent / "__isolated_archived_sessions__")
|
|
47
|
-
cmd = [
|
|
48
|
-
sys.executable,
|
|
49
|
-
str(SCRIPT_PATH),
|
|
50
|
-
"--sessions-dir",
|
|
51
|
-
str(sessions_dir),
|
|
52
|
-
"--archived-sessions-dir",
|
|
53
|
-
str(effective_archived_dir),
|
|
54
|
-
]
|
|
55
|
-
cmd.extend(extra_args)
|
|
56
|
-
result = subprocess.run(cmd, capture_output=True, text=True, check=True)
|
|
57
|
-
return result.stdout
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
class ExtractRecentConversationsTests(unittest.TestCase):
|
|
61
|
-
def test_default_lookback_covers_last_24_hours(self) -> None:
|
|
62
|
-
with tempfile.TemporaryDirectory() as tmp:
|
|
63
|
-
sessions_root = Path(tmp) / "sessions"
|
|
64
|
-
now = datetime.now(timezone.utc)
|
|
65
|
-
write_session(sessions_root / "recent.jsonl", now - timedelta(hours=3))
|
|
66
|
-
|
|
67
|
-
output = run_extractor(sessions_root)
|
|
68
|
-
|
|
69
|
-
self.assertIn("RECENT_CONVERSATIONS_FOUND=1", output)
|
|
70
|
-
self.assertIn("LOOKBACK_MINUTES=1440", output)
|
|
71
|
-
|
|
72
|
-
def test_limit_zero_is_treated_as_unlimited(self) -> None:
|
|
73
|
-
with tempfile.TemporaryDirectory() as tmp:
|
|
74
|
-
sessions_root = Path(tmp) / "sessions"
|
|
75
|
-
now = datetime.now(timezone.utc)
|
|
76
|
-
write_session(sessions_root / "a.jsonl", now - timedelta(minutes=5))
|
|
77
|
-
write_session(sessions_root / "b.jsonl", now - timedelta(minutes=10))
|
|
78
|
-
write_session(sessions_root / "c.jsonl", now - timedelta(minutes=15))
|
|
79
|
-
|
|
80
|
-
output = run_extractor(
|
|
81
|
-
sessions_root,
|
|
82
|
-
None,
|
|
83
|
-
"--lookback-minutes",
|
|
84
|
-
"60",
|
|
85
|
-
"--limit",
|
|
86
|
-
"0",
|
|
87
|
-
)
|
|
88
|
-
|
|
89
|
-
self.assertIn("RECENT_CONVERSATIONS_FOUND=3", output)
|
|
90
|
-
|
|
91
|
-
def test_archived_sessions_are_read_before_cleanup(self) -> None:
|
|
92
|
-
with tempfile.TemporaryDirectory() as tmp:
|
|
93
|
-
sessions_root = Path(tmp) / "sessions"
|
|
94
|
-
archived_root = Path(tmp) / "archived_sessions"
|
|
95
|
-
now = datetime.now(timezone.utc)
|
|
96
|
-
archived_file = archived_root / "archived.jsonl"
|
|
97
|
-
write_session(archived_file, now - timedelta(minutes=30))
|
|
98
|
-
|
|
99
|
-
output = run_extractor(
|
|
100
|
-
sessions_root,
|
|
101
|
-
archived_root,
|
|
102
|
-
"--lookback-minutes",
|
|
103
|
-
"60",
|
|
104
|
-
)
|
|
105
|
-
|
|
106
|
-
self.assertIn("RECENT_CONVERSATIONS_FOUND=1", output)
|
|
107
|
-
self.assertIn("ARCHIVED_SESSIONS_INCLUDED=true", output)
|
|
108
|
-
self.assertIn("user:archived", output)
|
|
109
|
-
self.assertIn("assistant:archived", output)
|
|
110
|
-
self.assertIn("CLEANUP_REMOVED_ARCHIVED_SESSIONS=1", output)
|
|
111
|
-
self.assertFalse(archived_file.exists())
|
|
112
|
-
|
|
113
|
-
def test_cleanup_removes_only_old_sessions_from_sessions_dir(self) -> None:
|
|
114
|
-
with tempfile.TemporaryDirectory() as tmp:
|
|
115
|
-
sessions_root = Path(tmp) / "sessions"
|
|
116
|
-
now = datetime.now(timezone.utc)
|
|
117
|
-
recent_file = sessions_root / "recent.jsonl"
|
|
118
|
-
old_file = sessions_root / "old.jsonl"
|
|
119
|
-
write_session(recent_file, now - timedelta(hours=6))
|
|
120
|
-
write_session(old_file, now - timedelta(days=8))
|
|
121
|
-
|
|
122
|
-
output = run_extractor(
|
|
123
|
-
sessions_root,
|
|
124
|
-
None,
|
|
125
|
-
"--lookback-minutes",
|
|
126
|
-
"1440",
|
|
127
|
-
"--retention-days",
|
|
128
|
-
"7",
|
|
129
|
-
)
|
|
130
|
-
|
|
131
|
-
self.assertIn("RECENT_CONVERSATIONS_FOUND=1", output)
|
|
132
|
-
self.assertIn("CLEANUP_REMOVED_OLD_SESSIONS=1", output)
|
|
133
|
-
self.assertTrue(recent_file.exists())
|
|
134
|
-
self.assertFalse(old_file.exists())
|
|
135
|
-
|
|
136
|
-
def test_archived_cleanup_skips_active_sessions_when_paths_overlap(self) -> None:
|
|
137
|
-
with tempfile.TemporaryDirectory() as tmp:
|
|
138
|
-
sessions_root = Path(tmp) / "sessions"
|
|
139
|
-
now = datetime.now(timezone.utc)
|
|
140
|
-
recent_file = sessions_root / "recent.jsonl"
|
|
141
|
-
write_session(recent_file, now - timedelta(minutes=5))
|
|
142
|
-
|
|
143
|
-
output = run_extractor(
|
|
144
|
-
sessions_root,
|
|
145
|
-
sessions_root,
|
|
146
|
-
"--lookback-minutes",
|
|
147
|
-
"60",
|
|
148
|
-
)
|
|
149
|
-
|
|
150
|
-
self.assertIn("RECENT_CONVERSATIONS_FOUND=1", output)
|
|
151
|
-
self.assertIn("CLEANUP_REMOVED_ARCHIVED_SESSIONS=0", output)
|
|
152
|
-
self.assertTrue(recent_file.exists())
|
|
153
|
-
|
|
154
|
-
def test_limit_one_only_returns_latest_session_across_sources(self) -> None:
|
|
155
|
-
with tempfile.TemporaryDirectory() as tmp:
|
|
156
|
-
sessions_root = Path(tmp) / "sessions"
|
|
157
|
-
archived_root = Path(tmp) / "archived_sessions"
|
|
158
|
-
now = datetime.now(timezone.utc)
|
|
159
|
-
write_session(sessions_root / "older.jsonl", now - timedelta(minutes=20))
|
|
160
|
-
newest = archived_root / "newest.jsonl"
|
|
161
|
-
write_session(newest, now - timedelta(minutes=5))
|
|
162
|
-
|
|
163
|
-
output = run_extractor(
|
|
164
|
-
sessions_root,
|
|
165
|
-
archived_root,
|
|
166
|
-
"--lookback-minutes",
|
|
167
|
-
"60",
|
|
168
|
-
"--limit",
|
|
169
|
-
"1",
|
|
170
|
-
)
|
|
171
|
-
|
|
172
|
-
self.assertIn("RECENT_CONVERSATIONS_FOUND=1", output)
|
|
173
|
-
self.assertIn("newest.jsonl", output)
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
if __name__ == "__main__":
|
|
177
|
-
unittest.main()
|
|
Binary file
|