@laitszkin/apollo-toolkit 3.13.2 → 3.14.0
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 +27 -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 +34 -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 +184 -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 +34 -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 +209 -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
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.createSpecsHandler = createSpecsHandler;
|
|
7
|
+
const node_fs_1 = __importDefault(require("node:fs"));
|
|
8
|
+
const node_path_1 = __importDefault(require("node:path"));
|
|
9
|
+
const TEMPLATE_FILENAMES = [
|
|
10
|
+
'spec.md',
|
|
11
|
+
'tasks.md',
|
|
12
|
+
'checklist.md',
|
|
13
|
+
'contract.md',
|
|
14
|
+
'design.md',
|
|
15
|
+
];
|
|
16
|
+
const COORDINATION_TEMPLATE = 'coordination.md';
|
|
17
|
+
const PREPARATION_TEMPLATE = 'preparation.md';
|
|
18
|
+
const PLACEHOLDER_NAMES = ['[Feature Name]', '[功能名稱]'];
|
|
19
|
+
function slugify(text) {
|
|
20
|
+
return text
|
|
21
|
+
.toLowerCase()
|
|
22
|
+
.trim()
|
|
23
|
+
.replace(/[^a-z0-9]+/g, '-')
|
|
24
|
+
.replace(/-+/g, '-')
|
|
25
|
+
.replace(/^-|-$/g, '');
|
|
26
|
+
}
|
|
27
|
+
function renderContent(content, today, featureName, changeName, batchName) {
|
|
28
|
+
let rendered = content.replace(/\[YYYY-MM-DD\]/g, today);
|
|
29
|
+
for (const placeholder of PLACEHOLDER_NAMES) {
|
|
30
|
+
const escaped = placeholder.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
|
|
31
|
+
rendered = rendered.replace(new RegExp(escaped, 'g'), featureName);
|
|
32
|
+
}
|
|
33
|
+
rendered = rendered.replace(/\[change_name\]/g, changeName);
|
|
34
|
+
rendered = rendered.replace(/\[batch_name\]/g, batchName || 'None');
|
|
35
|
+
return rendered;
|
|
36
|
+
}
|
|
37
|
+
async function createSpecsHandler(args, context) {
|
|
38
|
+
const stderr = context.stderr || process.stderr;
|
|
39
|
+
// Parse CLI args manually for portability (no argparse dependency)
|
|
40
|
+
const parsed = {};
|
|
41
|
+
const positionalArgs = [];
|
|
42
|
+
for (let i = 0; i < args.length; i++) {
|
|
43
|
+
const arg = args[i];
|
|
44
|
+
if (arg.startsWith('--')) {
|
|
45
|
+
const eqIndex = arg.indexOf('=');
|
|
46
|
+
let key;
|
|
47
|
+
let value;
|
|
48
|
+
if (eqIndex !== -1) {
|
|
49
|
+
key = arg.slice(2, eqIndex);
|
|
50
|
+
value = arg.slice(eqIndex + 1);
|
|
51
|
+
}
|
|
52
|
+
else {
|
|
53
|
+
key = arg.slice(2);
|
|
54
|
+
const next = args[i + 1];
|
|
55
|
+
if (next !== undefined && !next.startsWith('--')) {
|
|
56
|
+
value = next;
|
|
57
|
+
i++;
|
|
58
|
+
}
|
|
59
|
+
else {
|
|
60
|
+
value = true;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
if (key === 'force' || key === 'with-coordination' || key === 'with-preparation') {
|
|
64
|
+
parsed[key] = value === true || value === 'true';
|
|
65
|
+
}
|
|
66
|
+
else if (key === 'change-name' || key === 'slug') {
|
|
67
|
+
parsed['change-name'] = String(value);
|
|
68
|
+
}
|
|
69
|
+
else if (key === 'batch-name') {
|
|
70
|
+
parsed['batch-name'] = String(value);
|
|
71
|
+
}
|
|
72
|
+
else if (key === 'output-dir') {
|
|
73
|
+
parsed['output-dir'] = String(value);
|
|
74
|
+
}
|
|
75
|
+
else if (key === 'template-dir') {
|
|
76
|
+
parsed['template-dir'] = String(value);
|
|
77
|
+
}
|
|
78
|
+
else if (key === 'help' || key === 'h') {
|
|
79
|
+
parsed['help'] = true;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
else {
|
|
83
|
+
positionalArgs.push(arg);
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
if (parsed['help']) {
|
|
87
|
+
const stdout = context.stdout || process.stdout;
|
|
88
|
+
stdout.write(`Usage: apltk create-specs <feature_name> [options]
|
|
89
|
+
|
|
90
|
+
Options:
|
|
91
|
+
--change-name, --slug Folder name (defaults to slugified feature_name)
|
|
92
|
+
--batch-name Optional batch folder name
|
|
93
|
+
--with-coordination Create coordination.md (requires --batch-name)
|
|
94
|
+
--with-preparation Create preparation.md (requires --batch-name)
|
|
95
|
+
--output-dir Output base directory (default: docs/plans)
|
|
96
|
+
--template-dir Template directory
|
|
97
|
+
--force Overwrite existing files
|
|
98
|
+
`);
|
|
99
|
+
return 0;
|
|
100
|
+
}
|
|
101
|
+
const featureName = (positionalArgs[0] || '').trim();
|
|
102
|
+
if (!featureName) {
|
|
103
|
+
stderr.write('Error: feature_name is required.\n');
|
|
104
|
+
return 1;
|
|
105
|
+
}
|
|
106
|
+
const changeName = parsed['change-name']?.trim() || slugify(featureName);
|
|
107
|
+
if (!changeName) {
|
|
108
|
+
stderr.write('Error: Unable to build change_name. Provide --change-name with ASCII letters/numbers.\n');
|
|
109
|
+
return 1;
|
|
110
|
+
}
|
|
111
|
+
const batchName = parsed['batch-name']?.trim() || null;
|
|
112
|
+
if (parsed['with-coordination'] && !batchName) {
|
|
113
|
+
stderr.write('Error: --with-coordination requires --batch-name.\n');
|
|
114
|
+
return 1;
|
|
115
|
+
}
|
|
116
|
+
if (parsed['with-preparation'] && !batchName) {
|
|
117
|
+
stderr.write('Error: --with-preparation requires --batch-name.\n');
|
|
118
|
+
return 1;
|
|
119
|
+
}
|
|
120
|
+
// Resolve template directory
|
|
121
|
+
const sourceRoot = context.sourceRoot || node_path_1.default.resolve(__dirname, '..', '..', '..');
|
|
122
|
+
const templateDirRaw = parsed['template-dir'] || node_path_1.default.join(sourceRoot, 'generate-spec', 'references', 'templates');
|
|
123
|
+
const templateDir = node_path_1.default.resolve(templateDirRaw);
|
|
124
|
+
if (!node_fs_1.default.existsSync(templateDir)) {
|
|
125
|
+
stderr.write(`Error: Template directory not found: ${templateDir}\n`);
|
|
126
|
+
return 1;
|
|
127
|
+
}
|
|
128
|
+
// Check template files exist
|
|
129
|
+
const missingTemplates = TEMPLATE_FILENAMES.filter((name) => !node_fs_1.default.existsSync(node_path_1.default.join(templateDir, name)));
|
|
130
|
+
if (parsed['with-coordination'] && !node_fs_1.default.existsSync(node_path_1.default.join(templateDir, COORDINATION_TEMPLATE))) {
|
|
131
|
+
missingTemplates.push(COORDINATION_TEMPLATE);
|
|
132
|
+
}
|
|
133
|
+
if (parsed['with-preparation'] && !node_fs_1.default.existsSync(node_path_1.default.join(templateDir, PREPARATION_TEMPLATE))) {
|
|
134
|
+
missingTemplates.push(PREPARATION_TEMPLATE);
|
|
135
|
+
}
|
|
136
|
+
if (missingTemplates.length > 0) {
|
|
137
|
+
stderr.write(`Error: Missing template files in ${templateDir}: ${missingTemplates.join(', ')}\n`);
|
|
138
|
+
return 1;
|
|
139
|
+
}
|
|
140
|
+
const outputDir = node_path_1.default.resolve(parsed['output-dir'] || 'docs/plans');
|
|
141
|
+
const today = new Date().toISOString().slice(0, 10);
|
|
142
|
+
const dateRoot = node_path_1.default.join(outputDir, today);
|
|
143
|
+
const batchRoot = batchName ? node_path_1.default.join(dateRoot, batchName) : null;
|
|
144
|
+
const outputRoot = batchRoot ? node_path_1.default.join(batchRoot, changeName) : node_path_1.default.join(dateRoot, changeName);
|
|
145
|
+
const outputPaths = TEMPLATE_FILENAMES.map((name) => node_path_1.default.join(outputRoot, name));
|
|
146
|
+
const coordinationPath = (parsed['with-coordination'] && batchRoot) ? node_path_1.default.join(batchRoot, COORDINATION_TEMPLATE) : null;
|
|
147
|
+
const preparationPath = (parsed['with-preparation'] && batchRoot) ? node_path_1.default.join(batchRoot, PREPARATION_TEMPLATE) : null;
|
|
148
|
+
const force = parsed['force'] === true;
|
|
149
|
+
const existingFiles = outputPaths.filter((p) => node_fs_1.default.existsSync(p));
|
|
150
|
+
if (existingFiles.length > 0 && !force) {
|
|
151
|
+
stderr.write(`Error: Files already exist: ${existingFiles.join(', ')}. Use --force to overwrite.\n`);
|
|
152
|
+
return 1;
|
|
153
|
+
}
|
|
154
|
+
node_fs_1.default.mkdirSync(outputRoot, { recursive: true });
|
|
155
|
+
const stdout = context.stdout || process.stdout;
|
|
156
|
+
const todayStr = today;
|
|
157
|
+
for (const filename of TEMPLATE_FILENAMES) {
|
|
158
|
+
const templatePath = node_path_1.default.join(templateDir, filename);
|
|
159
|
+
const outputPath = node_path_1.default.join(outputRoot, filename);
|
|
160
|
+
const content = node_fs_1.default.readFileSync(templatePath, 'utf-8');
|
|
161
|
+
node_fs_1.default.writeFileSync(outputPath, renderContent(content, todayStr, featureName, changeName, batchName), 'utf-8');
|
|
162
|
+
stdout.write(`${outputPath}\n`);
|
|
163
|
+
}
|
|
164
|
+
if (coordinationPath && (force || !node_fs_1.default.existsSync(coordinationPath))) {
|
|
165
|
+
const templateContent = node_fs_1.default.readFileSync(node_path_1.default.join(templateDir, COORDINATION_TEMPLATE), 'utf-8');
|
|
166
|
+
node_fs_1.default.writeFileSync(coordinationPath, renderContent(templateContent, todayStr, featureName, changeName, batchName), 'utf-8');
|
|
167
|
+
stdout.write(`${coordinationPath}\n`);
|
|
168
|
+
}
|
|
169
|
+
if (preparationPath && (force || !node_fs_1.default.existsSync(preparationPath))) {
|
|
170
|
+
const templateContent = node_fs_1.default.readFileSync(node_path_1.default.join(templateDir, PREPARATION_TEMPLATE), 'utf-8');
|
|
171
|
+
node_fs_1.default.writeFileSync(preparationPath, renderContent(templateContent, todayStr, featureName, changeName, batchName), 'utf-8');
|
|
172
|
+
stdout.write(`${preparationPath}\n`);
|
|
173
|
+
}
|
|
174
|
+
return 0;
|
|
175
|
+
}
|