@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
package/lib/types.ts
ADDED
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
export interface ToolHelp {
|
|
2
|
+
purpose: string;
|
|
3
|
+
useWhen: string[];
|
|
4
|
+
insteadOf?: string[];
|
|
5
|
+
examples?: ToolExample[];
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export interface ToolExample {
|
|
9
|
+
command: string;
|
|
10
|
+
result: string;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export type RunnerKind = 'node' | 'python3' | 'swift';
|
|
14
|
+
|
|
15
|
+
export interface ToolDefinition {
|
|
16
|
+
name: string;
|
|
17
|
+
category: string;
|
|
18
|
+
skill?: string;
|
|
19
|
+
script?: string;
|
|
20
|
+
runner?: RunnerKind;
|
|
21
|
+
description: string;
|
|
22
|
+
aliases?: string[];
|
|
23
|
+
help?: ToolHelp;
|
|
24
|
+
/** Direct function reference for the tool handler (replaces spawn-based execution). */
|
|
25
|
+
handler?: (args: string[], context: ToolContext) => Promise<number>;
|
|
26
|
+
canonicalName?: string;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export interface ToolContext {
|
|
30
|
+
sourceRoot?: string;
|
|
31
|
+
stdout?: NodeJS.WriteStream;
|
|
32
|
+
stderr?: NodeJS.WriteStream;
|
|
33
|
+
env?: NodeJS.ProcessEnv;
|
|
34
|
+
spawnCommand?: Function;
|
|
35
|
+
cwd?: string;
|
|
36
|
+
stdio?: any;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export type InstallMode = 'codex' | 'openclaw' | 'trae' | 'agents' | 'claude-code';
|
|
40
|
+
|
|
41
|
+
export interface InstallTarget {
|
|
42
|
+
id: InstallMode;
|
|
43
|
+
label: string;
|
|
44
|
+
description?: string;
|
|
45
|
+
root?: string;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export interface InstallResult {
|
|
49
|
+
skillNames: string[];
|
|
50
|
+
linkMode: 'symlink' | 'copy';
|
|
51
|
+
targets: { label: string; root: string }[];
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export interface ManifestData {
|
|
55
|
+
version: string;
|
|
56
|
+
installedAt: string;
|
|
57
|
+
linkMode: string;
|
|
58
|
+
skills: string[];
|
|
59
|
+
historicalSkills: string[];
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export interface SyncResult {
|
|
63
|
+
previousSkillNames: string[];
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
export interface ParsedArguments {
|
|
67
|
+
command: 'install' | 'uninstall' | 'tool' | 'tools-help';
|
|
68
|
+
modes: InstallMode[];
|
|
69
|
+
showHelp: boolean;
|
|
70
|
+
showToolsHelp: boolean;
|
|
71
|
+
toolkitHome: string | null;
|
|
72
|
+
toolName: string | null;
|
|
73
|
+
toolArgs: string[];
|
|
74
|
+
linkMode: 'copy' | 'symlink' | null;
|
|
75
|
+
assumeYes: boolean;
|
|
76
|
+
explicitInstallCommand: boolean;
|
|
77
|
+
helpTopic: string;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
export interface CliContext {
|
|
81
|
+
sourceRoot?: string;
|
|
82
|
+
stdout?: NodeJS.WriteStream;
|
|
83
|
+
stderr?: NodeJS.WriteStream;
|
|
84
|
+
stdin?: NodeJS.ReadStream;
|
|
85
|
+
env?: NodeJS.ProcessEnv;
|
|
86
|
+
execCommand?: Function;
|
|
87
|
+
confirmUpdate?: Function;
|
|
88
|
+
runTool?: Function;
|
|
89
|
+
spawnCommand?: Function;
|
|
90
|
+
}
|
package/lib/updater.ts
ADDED
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
import { spawn } from 'node:child_process';
|
|
2
|
+
import { createInterface } from 'node:readline/promises';
|
|
3
|
+
|
|
4
|
+
interface Version {
|
|
5
|
+
parts: number[];
|
|
6
|
+
prerelease: string;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
interface ExecResult {
|
|
10
|
+
stdout: string;
|
|
11
|
+
stderr: string;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
interface UpdateCheckResult {
|
|
15
|
+
checked: boolean;
|
|
16
|
+
updated: boolean;
|
|
17
|
+
latestVersion?: string;
|
|
18
|
+
error?: Error;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
function normalizeVersion(version: string): string {
|
|
22
|
+
return String(version || '')
|
|
23
|
+
.trim()
|
|
24
|
+
.replace(/^v/i, '');
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
function parseVersion(version: string): Version {
|
|
28
|
+
const normalized = normalizeVersion(version);
|
|
29
|
+
const [core, prerelease = ''] = normalized.split('-', 2);
|
|
30
|
+
const parts = core.split('.').map((part) => Number.parseInt(part, 10) || 0);
|
|
31
|
+
return { parts, prerelease };
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export function compareVersions(left: string, right: string): number {
|
|
35
|
+
const leftVersion = parseVersion(left);
|
|
36
|
+
const rightVersion = parseVersion(right);
|
|
37
|
+
const leftParts = leftVersion.parts;
|
|
38
|
+
const rightParts = rightVersion.parts;
|
|
39
|
+
const length = Math.max(leftParts.length, rightParts.length);
|
|
40
|
+
|
|
41
|
+
for (let index = 0; index < length; index += 1) {
|
|
42
|
+
const delta = (leftParts[index] || 0) - (rightParts[index] || 0);
|
|
43
|
+
if (delta !== 0) return delta;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
if (leftVersion.prerelease && !rightVersion.prerelease) return -1;
|
|
47
|
+
if (!leftVersion.prerelease && rightVersion.prerelease) return 1;
|
|
48
|
+
if (leftVersion.prerelease !== rightVersion.prerelease) {
|
|
49
|
+
return leftVersion.prerelease.localeCompare(rightVersion.prerelease);
|
|
50
|
+
}
|
|
51
|
+
return 0;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
function shouldSkipUpdateCheck({ env = process.env, stdin = process.stdin, stdout = process.stdout }: {
|
|
55
|
+
env?: NodeJS.ProcessEnv;
|
|
56
|
+
stdin?: NodeJS.ReadStream;
|
|
57
|
+
stdout?: NodeJS.WriteStream;
|
|
58
|
+
}): boolean {
|
|
59
|
+
return env.APOLLO_TOOLKIT_SKIP_UPDATE_CHECK === '1' || !stdin.isTTY || !stdout.isTTY;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export function execCommand(command: string, args: string[], { env = process.env, stdout, stderr }: {
|
|
63
|
+
env?: NodeJS.ProcessEnv;
|
|
64
|
+
stdout?: NodeJS.WriteStream;
|
|
65
|
+
stderr?: NodeJS.WriteStream;
|
|
66
|
+
} = {}): Promise<ExecResult> {
|
|
67
|
+
return new Promise((resolve, reject) => {
|
|
68
|
+
const child = spawn(command, args, {
|
|
69
|
+
env,
|
|
70
|
+
stdio: ['ignore', 'pipe', 'pipe'],
|
|
71
|
+
});
|
|
72
|
+
|
|
73
|
+
let capturedStdout = '';
|
|
74
|
+
let capturedStderr = '';
|
|
75
|
+
|
|
76
|
+
child.stdout.on('data', (chunk: Buffer) => {
|
|
77
|
+
capturedStdout += chunk.toString('utf8');
|
|
78
|
+
if (stdout) stdout.write(chunk);
|
|
79
|
+
});
|
|
80
|
+
|
|
81
|
+
child.stderr.on('data', (chunk: Buffer) => {
|
|
82
|
+
capturedStderr += chunk.toString('utf8');
|
|
83
|
+
if (stderr) stderr.write(chunk);
|
|
84
|
+
});
|
|
85
|
+
|
|
86
|
+
child.on('error', reject);
|
|
87
|
+
child.on('close', (code: number | null) => {
|
|
88
|
+
if (code !== 0) {
|
|
89
|
+
reject(new Error(capturedStderr.trim() || `${command} exited with code ${code}`));
|
|
90
|
+
return;
|
|
91
|
+
}
|
|
92
|
+
resolve({ stdout: capturedStdout, stderr: capturedStderr });
|
|
93
|
+
});
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
async function defaultConfirmUpdate({ stdin, stdout, currentVersion, latestVersion, packageName }: {
|
|
98
|
+
stdin: NodeJS.ReadStream;
|
|
99
|
+
stdout: NodeJS.WriteStream;
|
|
100
|
+
currentVersion: string;
|
|
101
|
+
latestVersion: string;
|
|
102
|
+
packageName: string;
|
|
103
|
+
}): Promise<boolean> {
|
|
104
|
+
const rl = createInterface({ input: stdin, output: stdout });
|
|
105
|
+
try {
|
|
106
|
+
const answer = await rl.question(
|
|
107
|
+
`A newer ${packageName} release is available (${currentVersion} -> ${latestVersion}). Update now? [Y/n] `,
|
|
108
|
+
);
|
|
109
|
+
const normalized = answer.trim().toLowerCase();
|
|
110
|
+
return normalized === '' || normalized === 'y';
|
|
111
|
+
} finally {
|
|
112
|
+
rl.close();
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
async function getLatestPublishedVersion({ packageName, env = process.env, exec = execCommand }: {
|
|
117
|
+
packageName: string;
|
|
118
|
+
env?: NodeJS.ProcessEnv;
|
|
119
|
+
exec?: typeof execCommand;
|
|
120
|
+
}): Promise<string> {
|
|
121
|
+
const result = await exec('npm', ['view', packageName, 'version', '--json'], { env });
|
|
122
|
+
const parsed = JSON.parse(result.stdout.trim());
|
|
123
|
+
if (Array.isArray(parsed)) {
|
|
124
|
+
return String(parsed[parsed.length - 1] || '').trim();
|
|
125
|
+
}
|
|
126
|
+
return String(parsed || '').trim();
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
export async function checkForPackageUpdate({ packageName, currentVersion, env = process.env, stdin = process.stdin, stdout = process.stdout, stderr = process.stderr, exec = execCommand, confirmUpdate = defaultConfirmUpdate }: {
|
|
130
|
+
packageName: string;
|
|
131
|
+
currentVersion: string;
|
|
132
|
+
env?: NodeJS.ProcessEnv;
|
|
133
|
+
stdin?: NodeJS.ReadStream;
|
|
134
|
+
stdout?: NodeJS.WriteStream;
|
|
135
|
+
stderr?: NodeJS.WriteStream;
|
|
136
|
+
exec?: typeof execCommand;
|
|
137
|
+
confirmUpdate?: typeof defaultConfirmUpdate;
|
|
138
|
+
}): Promise<UpdateCheckResult> {
|
|
139
|
+
if (shouldSkipUpdateCheck({ env, stdin, stdout })) {
|
|
140
|
+
return { checked: false, updated: false };
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
try {
|
|
144
|
+
const latestVersion = await getLatestPublishedVersion({ packageName, env, exec });
|
|
145
|
+
if (!latestVersion || compareVersions(latestVersion, currentVersion) <= 0) {
|
|
146
|
+
return { checked: true, updated: false, latestVersion };
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
const approved = await confirmUpdate({ stdin, stdout, currentVersion, latestVersion, packageName });
|
|
150
|
+
|
|
151
|
+
if (!approved) {
|
|
152
|
+
stdout.write(`Continuing with ${packageName} ${currentVersion}.\n`);
|
|
153
|
+
return { checked: true, updated: false, latestVersion };
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
stdout.write(`Updating ${packageName} to ${latestVersion}...\n`);
|
|
157
|
+
await exec('npm', ['install', '-g', `${packageName}@latest`], { env, stdout, stderr });
|
|
158
|
+
stdout.write(`Update complete. Continuing with ${packageName} ${latestVersion}.\n`);
|
|
159
|
+
|
|
160
|
+
return { checked: true, updated: true, latestVersion };
|
|
161
|
+
} catch (error) {
|
|
162
|
+
stderr.write(`Warning: unable to check or install package updates: ${(error as Error).message}\n`);
|
|
163
|
+
return { checked: false, updated: false, error: error as Error };
|
|
164
|
+
}
|
|
165
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export function supportsColor(stream: { isTTY?: boolean }, env: NodeJS.ProcessEnv = process.env): boolean {
|
|
2
|
+
return Boolean(stream && stream.isTTY && !env.NO_COLOR);
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
export function supportsAnimation(stream: { isTTY?: boolean }, env: NodeJS.ProcessEnv = process.env): boolean {
|
|
6
|
+
return Boolean(stream && stream.isTTY && !env.CI && env.APOLLO_TOOLKIT_NO_ANIMATION !== '1');
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export function color(text: string, code: string, enabled: boolean): string {
|
|
10
|
+
if (!enabled) return text;
|
|
11
|
+
return `\x1b[${code}m${text}\x1b[0m`;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export function clearScreen(output: { isTTY?: boolean; write: (str: string) => boolean }): void {
|
|
15
|
+
if (output.isTTY) {
|
|
16
|
+
output.write('\x1b[2J\x1b[H');
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export function sleep(ms: number): Promise<void> {
|
|
21
|
+
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
22
|
+
}
|
|
@@ -87,5 +87,5 @@ When another skill depends on `open-github-issue`:
|
|
|
87
87
|
|
|
88
88
|
## Resources
|
|
89
89
|
|
|
90
|
-
- `
|
|
91
|
-
- If the
|
|
90
|
+
- `apltk open-github-issue`: Deterministic issue publishing helper with auth fallback and README language detection (TypeScript handler in `lib/tools/open-github-issue.ts`).
|
|
91
|
+
- If the CLI tool is unavailable or fails for environment reasons, fall back to direct `gh issue create` or GitHub REST API publishing instead of retrying the same invocation.
|
package/optimise-skill/SKILL.md
CHANGED
|
@@ -16,7 +16,7 @@ description: 當你需要優化 agent skills 的 `SKILL.md` 時,調用這個
|
|
|
16
16
|
|
|
17
17
|
### 1. 識別交付物
|
|
18
18
|
|
|
19
|
-
完整閱讀整個技能的 `SKILL.md`
|
|
19
|
+
完整閱讀整個技能的 `SKILL.md` 文檔,以及其引用的所有額外檔案,包括但不限於 `references/`、`lib/tools/` 中的 TypeScript handler。基於獲取到的技能上下文資訊,總結出該技能的最終交付產物。
|
|
20
20
|
|
|
21
21
|
### 2. 制定驗收條件
|
|
22
22
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@laitszkin/apollo-toolkit",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.14.1",
|
|
4
4
|
"description": "Apollo Toolkit npm installer for managed skill copying across Codex, OpenClaw, and Trae.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "LaiTszKin",
|
|
@@ -13,12 +13,16 @@
|
|
|
13
13
|
"url": "https://github.com/LaiTszKin/apollo-toolkit/issues"
|
|
14
14
|
},
|
|
15
15
|
"type": "commonjs",
|
|
16
|
+
"main": "dist/lib/cli.js",
|
|
16
17
|
"bin": {
|
|
17
|
-
"apollo-toolkit": "bin/apollo-toolkit.js",
|
|
18
|
-
"apltk": "bin/apollo-toolkit.js"
|
|
18
|
+
"apollo-toolkit": "dist/bin/apollo-toolkit.js",
|
|
19
|
+
"apltk": "dist/bin/apollo-toolkit.js"
|
|
19
20
|
},
|
|
20
21
|
"scripts": {
|
|
21
|
-
"
|
|
22
|
+
"build": "tsc",
|
|
23
|
+
"watch": "tsc --watch",
|
|
24
|
+
"test": "node --test",
|
|
25
|
+
"test:ts": "node --test dist/test/"
|
|
22
26
|
},
|
|
23
27
|
"engines": {
|
|
24
28
|
"node": ">=18.18"
|
|
@@ -37,5 +41,10 @@
|
|
|
37
41
|
"dependencies": {
|
|
38
42
|
"elkjs": "^0.11.1",
|
|
39
43
|
"js-yaml": "^4.1.1"
|
|
44
|
+
},
|
|
45
|
+
"devDependencies": {
|
|
46
|
+
"@types/js-yaml": "^4.0.9",
|
|
47
|
+
"@types/node": "^25.7.0",
|
|
48
|
+
"typescript": "^6.0.3"
|
|
40
49
|
}
|
|
41
50
|
}
|