@hasna/skills 0.1.26 → 0.1.29
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/LICENSE +1 -10
- package/README.md +141 -39
- package/bin/index.js +30122 -27575
- package/bin/mcp.js +22112 -18593
- package/dist/cli/cli.test-utils.d.ts +15 -0
- package/dist/cli/commands/auth.d.ts +2 -0
- package/dist/cli/commands/install.d.ts +1 -1
- package/dist/cli/commands/runtime-mcp.d.ts +4 -0
- package/dist/index.d.ts +9 -4
- package/dist/index.js +11607 -597
- package/dist/lib/auth-store.d.ts +13 -0
- package/dist/lib/installer.d.ts +58 -55
- package/dist/lib/mcp-contracts.d.ts +86 -0
- package/dist/lib/project-state.d.ts +43 -0
- package/dist/lib/registry-data/business-marketing.d.ts +2 -0
- package/dist/lib/registry-data/communication.d.ts +2 -0
- package/dist/lib/registry-data/content-generation.d.ts +2 -0
- package/dist/lib/registry-data/data-analysis.d.ts +2 -0
- package/dist/lib/registry-data/design-branding.d.ts +2 -0
- package/dist/lib/registry-data/development-tools.d.ts +2 -0
- package/dist/lib/registry-data/education-learning.d.ts +2 -0
- package/dist/lib/registry-data/event-management.d.ts +2 -0
- package/dist/lib/registry-data/finance-compliance.d.ts +2 -0
- package/dist/lib/registry-data/health-wellness.d.ts +2 -0
- package/dist/lib/registry-data/index.d.ts +2 -0
- package/dist/lib/registry-data/media-processing.d.ts +2 -0
- package/dist/lib/registry-data/productivity-organization.d.ts +2 -0
- package/dist/lib/registry-data/project-management.d.ts +2 -0
- package/dist/lib/registry-data/research-writing.d.ts +2 -0
- package/dist/lib/registry-data/science-academic.d.ts +2 -0
- package/dist/lib/registry-data/travel-lifestyle.d.ts +2 -0
- package/dist/lib/registry-data/web-browser.d.ts +2 -0
- package/dist/lib/registry-types.d.ts +27 -0
- package/dist/lib/registry.d.ts +6 -18
- package/dist/lib/remote-registry.d.ts +3 -0
- package/dist/lib/run-state.d.ts +60 -0
- package/dist/lib/skill-aliases.d.ts +17 -0
- package/dist/lib/skillinfo.d.ts +5 -1
- package/dist/mcp/discovery-tools.d.ts +2 -0
- package/dist/mcp/helpers.d.ts +26 -0
- package/dist/mcp/http.d.ts +10 -0
- package/dist/mcp/index.d.ts +3 -2
- package/dist/mcp/operation-tools.d.ts +2 -0
- package/dist/mcp/resource-meta-tools.d.ts +2 -0
- package/dist/mcp/schedule-tools.d.ts +2 -0
- package/dist/mcp/server.d.ts +4 -0
- package/dist/types/api.d.ts +7 -4
- package/package.json +23 -10
- package/skills/_common/http-client.ts +1 -1
- package/skills/_common/index.ts +2 -3
- package/skills/_common/install.sh +5 -110
- package/skills/_common/installer.ts +31 -282
- package/skills/_common/skill-install.ts +14 -181
- package/skills/ad-creative-pack/SKILL.md +45 -0
- package/skills/ad-creative-pack/package.json +14 -0
- package/skills/advanced-math/package.json +3 -1
- package/skills/advanced-math/src/calculators.ts +118 -0
- package/skills/advanced-math/src/cli.ts +130 -0
- package/skills/advanced-math/src/conversion.ts +90 -0
- package/skills/advanced-math/src/finance.ts +75 -0
- package/skills/advanced-math/src/formatting.ts +95 -0
- package/skills/advanced-math/src/index.ts +24 -702
- package/skills/advanced-math/src/runtime.ts +49 -0
- package/skills/advanced-math/src/symbolic.ts +110 -0
- package/skills/advanced-math/src/types.ts +36 -0
- package/skills/analyze-data/SKILL.md +2 -2
- package/skills/analyze-data/src/analysis.ts +401 -0
- package/skills/analyze-data/src/cli.ts +66 -0
- package/skills/analyze-data/src/formatters.ts +235 -0
- package/skills/analyze-data/src/index.ts +6 -1027
- package/skills/analyze-data/src/logger.ts +36 -0
- package/skills/analyze-data/src/parsers.ts +57 -0
- package/skills/analyze-data/src/stats.ts +151 -0
- package/skills/analyze-data/src/types.ts +85 -0
- package/skills/api-docs-portal/SKILL.md +46 -0
- package/skills/api-docs-portal/package.json +9 -0
- package/skills/api-test-suite/src/index.ts +13 -0
- package/skills/apidocs/package.json +1 -1
- package/skills/apidocs/src/index.ts +3 -0
- package/skills/audio/package.json +2 -3
- package/skills/audio-cleanup-lab/SKILL.md +2 -2
- package/skills/audio-extract/CLAUDE.md +1 -1
- package/skills/audio-transcript-pack/SKILL.md +43 -0
- package/skills/audio-transcript-pack/package.json +10 -0
- package/skills/blog-article/CLAUDE.md +12 -0
- package/skills/blog-article/SKILL.md +45 -0
- package/skills/{create-blog-article → blog-article}/package.json +3 -3
- package/skills/brand-kit/SKILL.md +45 -0
- package/skills/brand-kit/package.json +14 -0
- package/skills/brand-photo-shoot/SKILL.md +28 -0
- package/skills/brand-photo-shoot/package.json +10 -0
- package/skills/brand-style-guide/SKILL.md +2 -2
- package/skills/brand-style-guide/src/index.ts +0 -0
- package/skills/budget-variance-analyzer/SKILL.md +2 -2
- package/skills/businessactivity/package.json +1 -1
- package/skills/businessactivity/src/index.ts +3 -0
- package/skills/calendar-events/src/ai-parser.ts +103 -0
- package/skills/calendar-events/src/api.ts +157 -0
- package/skills/calendar-events/src/auth.ts +22 -0
- package/skills/calendar-events/src/config.ts +6 -0
- package/skills/calendar-events/src/format.ts +96 -0
- package/skills/calendar-events/src/help.ts +54 -0
- package/skills/calendar-events/src/index.ts +21 -524
- package/skills/calendar-events/src/logger.ts +34 -0
- package/skills/calendar-events/src/types.ts +67 -0
- package/skills/compress-video/SKILL.md +2 -2
- package/skills/consolelog/package.json +1 -1
- package/skills/consolelog/src/index.ts +3 -0
- package/skills/contract-review-report/SKILL.md +43 -0
- package/skills/contract-review-report/package.json +10 -0
- package/skills/convert/SKILL.md +2 -3
- package/skills/customer-feedback-report/SKILL.md +44 -0
- package/skills/customer-feedback-report/package.json +10 -0
- package/skills/dashboard-builder/package.json +3 -1
- package/skills/database-explorer/package.json +3 -1
- package/skills/deepresearch/README.md +4 -13
- package/skills/deploy/src/http-client.ts +1 -1
- package/skills/diff-viewer/package.json +4 -1
- package/skills/doc-generate/package.json +0 -1
- package/skills/doc-generate/src/ai.ts +50 -0
- package/skills/doc-generate/src/cli.ts +203 -0
- package/skills/doc-generate/src/dependencies.ts +44 -0
- package/skills/doc-generate/src/document-builder.ts +299 -0
- package/skills/doc-generate/src/index.ts +40 -764
- package/skills/doc-generate/src/markdown-parser.ts +125 -0
- package/skills/doc-generate/src/types.ts +68 -0
- package/skills/domainpurchase/SKILL.md +1 -1
- package/skills/domainpurchase/package.json +1 -1
- package/skills/domainpurchase/src/index.ts +3 -0
- package/skills/domainsearch/SKILL.md +1 -1
- package/skills/domainsearch/package.json +1 -1
- package/skills/domainsearch/src/index.ts +3 -0
- package/skills/email-sequence/SKILL.md +44 -0
- package/skills/email-sequence/package.json +14 -0
- package/skills/excel/CLAUDE.md +2 -2
- package/skills/experiment-power-calculator/package.json +3 -1
- package/skills/extract-invoice/src/cli.ts +97 -0
- package/skills/extract-invoice/src/extractor.ts +170 -0
- package/skills/extract-invoice/src/file-utils.ts +46 -0
- package/skills/extract-invoice/src/formatters.ts +144 -0
- package/skills/extract-invoice/src/index.ts +44 -629
- package/skills/extract-invoice/src/runtime.ts +46 -0
- package/skills/extract-invoice/src/types.ts +88 -0
- package/skills/folder-tree/package.json +3 -1
- package/skills/form-filler/package.json +3 -1
- package/skills/generate-api-client/package.json +3 -1
- package/skills/generate-api-client/src/generator.ts +47 -0
- package/skills/generate-api-client/src/index.ts +3 -777
- package/skills/generate-api-client/src/logger.ts +34 -0
- package/skills/generate-api-client/src/python-generator.ts +245 -0
- package/skills/generate-api-client/src/spec-loader.ts +48 -0
- package/skills/generate-api-client/src/type-mappers.ts +79 -0
- package/skills/generate-api-client/src/types.ts +76 -0
- package/skills/generate-api-client/src/typescript-generator.ts +247 -0
- package/skills/generate-book-cover/package.json +3 -1
- package/skills/generate-dockerfile/src/cli.ts +78 -0
- package/skills/generate-dockerfile/src/dockerfile-templates.ts +392 -0
- package/skills/generate-dockerfile/src/index.ts +12 -790
- package/skills/generate-dockerfile/src/logger.ts +30 -0
- package/skills/generate-dockerfile/src/project-detection.ts +68 -0
- package/skills/generate-dockerfile/src/support-files.ts +171 -0
- package/skills/generate-dockerfile/src/types.ts +29 -0
- package/skills/generate-documentation/src/ai.ts +131 -0
- package/skills/generate-documentation/src/cli.ts +71 -0
- package/skills/generate-documentation/src/code-parser.ts +300 -0
- package/skills/generate-documentation/src/file-processing.ts +182 -0
- package/skills/generate-documentation/src/index.ts +13 -753
- package/skills/generate-documentation/src/runtime.ts +35 -0
- package/skills/generate-documentation/src/types.ts +30 -0
- package/skills/generate-env/package.json +3 -1
- package/skills/generate-env/src/cli.ts +85 -0
- package/skills/generate-env/src/detection.ts +161 -0
- package/skills/generate-env/src/env-data.ts +66 -0
- package/skills/generate-env/src/generators.ts +240 -0
- package/skills/generate-env/src/index.ts +76 -676
- package/skills/generate-env/src/runtime.ts +30 -0
- package/skills/generate-env/src/types.ts +32 -0
- package/skills/generate-favicon/package.json +3 -1
- package/skills/generate-mock-data/package.json +3 -1
- package/skills/generate-mock-data/src/ai.ts +102 -0
- package/skills/generate-mock-data/src/formatters.ts +84 -0
- package/skills/generate-mock-data/src/generator.ts +377 -0
- package/skills/generate-mock-data/src/index.ts +15 -716
- package/skills/generate-mock-data/src/logger.ts +37 -0
- package/skills/generate-mock-data/src/presets.ts +110 -0
- package/skills/generate-mock-data/src/types.ts +21 -0
- package/skills/generate-pr-description/src/ai.ts +144 -0
- package/skills/generate-pr-description/src/cli.ts +80 -0
- package/skills/generate-pr-description/src/clipboard.ts +30 -0
- package/skills/generate-pr-description/src/formatters.ts +231 -0
- package/skills/generate-pr-description/src/git.ts +153 -0
- package/skills/generate-pr-description/src/index.ts +21 -714
- package/skills/generate-pr-description/src/types.ts +49 -0
- package/skills/generate-presentation/src/ai-clients.ts +61 -0
- package/skills/generate-presentation/src/cli.ts +126 -0
- package/skills/generate-presentation/src/index.ts +3 -751
- package/skills/generate-presentation/src/logger.ts +67 -0
- package/skills/generate-presentation/src/presentation-generator.ts +425 -0
- package/skills/generate-presentation/src/runtime.ts +6 -0
- package/skills/generate-presentation/src/security.ts +12 -0
- package/skills/generate-presentation/src/types.ts +28 -0
- package/skills/generate-qrcode/package.json +4 -1
- package/skills/generate-regex/package.json +3 -1
- package/skills/generate-resume/src/cli.ts +157 -0
- package/skills/generate-resume/src/index.ts +13 -917
- package/skills/generate-resume/src/parsers.ts +95 -0
- package/skills/generate-resume/src/renderers.ts +538 -0
- package/skills/generate-resume/src/security.ts +39 -0
- package/skills/generate-resume/src/types.ts +86 -0
- package/skills/generate-social-posts/src/ai.ts +88 -0
- package/skills/generate-social-posts/src/cli.ts +118 -0
- package/skills/generate-social-posts/src/exporters.ts +126 -0
- package/skills/generate-social-posts/src/generator.ts +130 -0
- package/skills/generate-social-posts/src/index.ts +19 -709
- package/skills/generate-social-posts/src/platforms.ts +39 -0
- package/skills/generate-social-posts/src/runtime.ts +34 -0
- package/skills/generate-social-posts/src/source.ts +116 -0
- package/skills/generate-social-posts/src/types.ts +58 -0
- package/skills/gif-maker/package.json +4 -1
- package/skills/github-manager/package.json +3 -1
- package/skills/gmail/CLAUDE.md +1 -1
- package/skills/highlight-reel-generator/src/index.ts +19 -0
- package/skills/hook/src/commands/create.ts +20 -845
- package/skills/hook/src/templates/root.ts +196 -0
- package/skills/hook/src/templates/source.ts +647 -0
- package/skills/http-server/package.json +3 -1
- package/skills/icon-pack/README.md +28 -0
- package/skills/icon-pack/SKILL.md +23 -0
- package/skills/icon-pack/package.json +29 -0
- package/skills/{audio → icon-pack}/tsconfig.json +10 -12
- package/skills/image/package.json +1 -2
- package/skills/implementation-agent/package.json +3 -1
- package/skills/implementation-agent/src/ai-generation.ts +225 -0
- package/skills/implementation-agent/src/index.ts +3 -960
- package/skills/implementation-agent/src/minimist.d.ts +15 -0
- package/skills/implementation-agent/src/templates.ts +686 -0
- package/skills/implementation-agent/src/types.ts +53 -0
- package/skills/implementation-plan/package.json +3 -1
- package/skills/implementation-todo/package.json +3 -1
- package/skills/invoice/package.json +1 -1
- package/skills/invoice/src/index.ts +3 -0
- package/skills/invoice-reconciliation/SKILL.md +42 -0
- package/skills/invoice-reconciliation/package.json +10 -0
- package/skills/landing-page-pack/SKILL.md +47 -0
- package/skills/landing-page-pack/package.json +14 -0
- package/skills/latex-table-generator/package.json +3 -1
- package/skills/logo-design/SKILL.md +25 -44
- package/skills/logo-design/package.json +3 -15
- package/skills/lorem-generator/package.json +3 -1
- package/skills/lorem-generator/src/index.ts +13 -0
- package/skills/managehook/package.json +1 -1
- package/skills/managehook/src/index.ts +3 -0
- package/skills/managemcp/package.json +1 -1
- package/skills/managemcp/src/index.ts +3 -0
- package/skills/manageskill/package.json +1 -1
- package/skills/manageskill/src/index.ts +3 -0
- package/skills/markdown-validator/package.json +3 -1
- package/skills/markdown-validator/src/index.ts +1 -4
- package/skills/market-research-report/SKILL.md +41 -0
- package/skills/market-research-report/package.json +10 -0
- package/skills/mcp-builder/package.json +4 -1
- package/skills/mcp-builder/src/ai-descriptions.ts +37 -0
- package/skills/mcp-builder/src/generators.ts +513 -0
- package/skills/mcp-builder/src/index.ts +7 -908
- package/skills/mcp-builder/src/minimist.d.ts +15 -0
- package/skills/mcp-builder/src/naming.ts +12 -0
- package/skills/mcp-builder/src/options.ts +170 -0
- package/skills/mcp-builder/src/templates.ts +149 -0
- package/skills/mcp-builder/src/types.ts +42 -0
- package/skills/meeting-pack/SKILL.md +43 -0
- package/skills/meeting-pack/package.json +10 -0
- package/skills/merge-pdfs/package.json +5 -1
- package/skills/migration-plan-pack/SKILL.md +45 -0
- package/skills/migration-plan-pack/package.json +10 -0
- package/skills/music/package.json +2 -3
- package/skills/music-album/SKILL.md +37 -0
- package/skills/music-album/package.json +10 -0
- package/skills/notion-manager/package.json +3 -1
- package/skills/npmpublish/CLAUDE.md +5 -8
- package/skills/npmpublish/README.md +5 -26
- package/skills/npmpublish/src/index.ts +9 -147
- package/skills/one-page-website/SKILL.md +46 -0
- package/skills/one-page-website/package.json +10 -0
- package/skills/one-page-website/tsconfig.json +8 -0
- package/skills/pdf-generate/src/cli.ts +162 -0
- package/skills/pdf-generate/src/html.ts +84 -0
- package/skills/pdf-generate/src/index.ts +11 -800
- package/skills/pdf-generate/src/markdown.ts +27 -0
- package/skills/pdf-generate/src/pdf-writer.ts +78 -0
- package/skills/pdf-generate/src/runtime.ts +34 -0
- package/skills/pdf-generate/src/security.ts +37 -0
- package/skills/pdf-generate/src/templates.ts +311 -0
- package/skills/pdf-generate/src/types.ts +28 -0
- package/skills/pdf-read/SKILL.md +10 -10
- package/skills/pdf-to-dataset/SKILL.md +45 -0
- package/skills/pdf-to-dataset/package.json +10 -0
- package/skills/pdf-to-markdown/SKILL.md +49 -0
- package/skills/pdf-to-markdown/package.json +10 -0
- package/skills/pdf-to-markdown/tsconfig.json +10 -0
- package/skills/performance-audit-report/SKILL.md +42 -0
- package/skills/performance-audit-report/package.json +10 -0
- package/skills/persona-based-adwriter/src/index.ts +19 -0
- package/skills/photo-album/SKILL.md +29 -0
- package/skills/photo-album/package.json +9 -0
- package/skills/photo-album/tsconfig.json +4 -0
- package/skills/pitch-deck/SKILL.md +43 -0
- package/skills/pitch-deck/package.json +9 -0
- package/skills/playlist-maker/SKILL.md +33 -0
- package/skills/playlist-maker/package.json +9 -0
- package/skills/playlist-maker/tsconfig.json +4 -0
- package/skills/product-mockup/SKILL.md +45 -0
- package/skills/product-mockup/package.json +3 -20
- package/skills/product-mockup/tsconfig.json +3 -5
- package/skills/project-retro-companion/src/index.ts +19 -0
- package/skills/proposal-pack/SKILL.md +45 -0
- package/skills/proposal-pack/package.json +10 -0
- package/skills/read-pdf/SKILL.md +5 -4
- package/skills/repo-onboarding-report/SKILL.md +42 -0
- package/skills/repo-onboarding-report/package.json +10 -0
- package/skills/sales-call-recapper/src/index.ts +20 -0
- package/skills/salescopy/package.json +1 -1
- package/skills/salescopy/src/index.ts +3 -0
- package/skills/scaffold-project/src/ai-detect.ts +136 -0
- package/skills/scaffold-project/src/file-generators.ts +292 -0
- package/skills/scaffold-project/src/index.ts +8 -991
- package/skills/scaffold-project/src/project-config.ts +338 -0
- package/skills/scaffold-project/src/templates.ts +173 -0
- package/skills/scaffold-project/src/types.ts +58 -0
- package/skills/scientific-figure-check/package.json +3 -1
- package/skills/sdk-generator/SKILL.md +45 -0
- package/skills/sdk-generator/package.json +10 -0
- package/skills/sdk-generator/tsconfig.json +8 -0
- package/skills/security-audit/src/index.ts +25 -6
- package/skills/security-audit-report/SKILL.md +40 -0
- package/skills/security-audit-report/package.json +10 -0
- package/skills/seo-content-pack/SKILL.md +44 -0
- package/skills/seo-content-pack/package.json +9 -0
- package/skills/short-video-pack/SKILL.md +30 -0
- package/skills/short-video-pack/package.json +10 -0
- package/skills/slack-assistant/package.json +3 -1
- package/skills/slide-deck-generator/SKILL.md +44 -0
- package/skills/slide-deck-generator/package.json +10 -0
- package/skills/sms/package.json +1 -1
- package/skills/sms/src/index.ts +15 -0
- package/skills/social-content-calendar/SKILL.md +45 -0
- package/skills/social-content-calendar/package.json +14 -0
- package/skills/split-pdf/package.json +4 -1
- package/skills/subtitle/package.json +2 -1
- package/skills/subtitle/src/index.ts +3 -0
- package/skills/terraform-generator/package.json +3 -1
- package/skills/test-suite-generator/SKILL.md +41 -0
- package/skills/test-suite-generator/package.json +10 -0
- package/skills/timesheet/package.json +1 -1
- package/skills/timesheet/src/index.ts +3 -0
- package/skills/transcript/SKILL.md +1 -8
- package/skills/validate-config/package.json +3 -1
- package/skills/video/package.json +6 -4
- package/skills/video-downloader/package.json +3 -1
- package/skills/video-highlight-pack/SKILL.md +44 -0
- package/skills/video-highlight-pack/package.json +10 -0
- package/skills/voiceover-jingle-pack/SKILL.md +28 -0
- package/skills/voiceover-jingle-pack/package.json +10 -0
- package/skills/watermark/package.json +6 -1
- package/skills/webcrawling/package.json +2 -1
- package/skills/write/SKILL.md +6 -6
- package/dist/server/serve.d.ts +0 -11
- package/skills/apidocs/.claude/settings.json +0 -5
- package/skills/audio/.env.example +0 -14
- package/skills/audio/QUICKSTART.md +0 -158
- package/skills/audio/README.md +0 -256
- package/skills/audio/src/index-local.ts +0 -206
- package/skills/audio/src/index.ts +0 -95
- package/skills/audio/src/providers/elevenlabs.ts +0 -115
- package/skills/audio/src/providers/google.ts +0 -116
- package/skills/audio/src/providers/minimax.ts +0 -83
- package/skills/audio/src/providers/openai.ts +0 -115
- package/skills/audio/src/types.ts +0 -79
- package/skills/audiobook-chapter-proofer/CLAUDE.md +0 -19
- package/skills/audiobook-chapter-proofer/package.json +0 -27
- package/skills/audiobook-chapter-proofer/src/index.ts +0 -285
- package/skills/browse/src/client.ts +0 -373
- package/skills/browse/src/index-local.ts +0 -430
- package/skills/browse/src/index.ts +0 -110
- package/skills/browse/src/sse-server.ts +0 -919
- package/skills/browse/src/types.ts +0 -104
- package/skills/consolelog/src/server/index.ts +0 -508
- package/skills/create-blog-article/CLAUDE.md +0 -19
- package/skills/create-blog-article/src/index.ts +0 -745
- package/skills/create-blog-article/tsconfig.json +0 -10
- package/skills/deepresearch/src/agents/query-generator.ts +0 -91
- package/skills/deepresearch/src/agents/synthesizer.ts +0 -111
- package/skills/deepresearch/src/index.ts +0 -224
- package/skills/deepresearch/src/research.ts +0 -166
- package/skills/deepresearch/src/services/anthropic.ts +0 -69
- package/skills/deepresearch/src/services/exa.ts +0 -108
- package/skills/deepresearch/src/services/firecrawl.ts +0 -88
- package/skills/deepresearch/src/services/openai.ts +0 -81
- package/skills/deepresearch/src/types.ts +0 -76
- package/skills/deepresearch/src/utils/file.ts +0 -111
- package/skills/deepresearch/src/utils/logger.ts +0 -84
- package/skills/domainpurchase/src/server/index.ts +0 -332
- package/skills/domainsearch/src/server/index.ts +0 -229
- package/skills/e2bswarm/README.md +0 -135
- package/skills/e2bswarm/SKILL.md +0 -118
- package/skills/e2bswarm/examples/tasks-example.json +0 -38
- package/skills/e2bswarm/package.json +0 -59
- package/skills/e2bswarm/src/commands/collect.ts +0 -135
- package/skills/e2bswarm/src/commands/install.ts +0 -164
- package/skills/e2bswarm/src/commands/kill.ts +0 -62
- package/skills/e2bswarm/src/commands/spawn.ts +0 -134
- package/skills/e2bswarm/src/commands/status.ts +0 -90
- package/skills/e2bswarm/src/commands/sync.ts +0 -208
- package/skills/e2bswarm/src/index.ts +0 -121
- package/skills/e2bswarm/src/lib/config.ts +0 -75
- package/skills/e2bswarm/src/lib/e2b.ts +0 -490
- package/skills/e2bswarm/src/lib/github.ts +0 -253
- package/skills/e2bswarm/src/lib/logger.ts +0 -41
- package/skills/e2bswarm/src/lib/paths.ts +0 -75
- package/skills/e2bswarm/src/lib/tasks.ts +0 -320
- package/skills/e2bswarm/src/types/index.ts +0 -107
- package/skills/e2bswarm/templates/codebox/e2b.Dockerfile +0 -38
- package/skills/e2bswarm/templates/codebox/e2b.toml +0 -3
- package/skills/e2bswarm/templates/setup.sh +0 -21
- package/skills/e2bswarm/tsconfig.json +0 -19
- package/skills/generate-book-cover/src/index.ts +0 -694
- package/skills/image/src/index-local.ts +0 -206
- package/skills/image/src/index.ts +0 -96
- package/skills/image/src/providers/google.ts +0 -79
- package/skills/image/src/providers/minimax.ts +0 -94
- package/skills/image/src/providers/openai.ts +0 -80
- package/skills/image/src/providers/xai.ts +0 -73
- package/skills/image/src/types.ts +0 -37
- package/skills/logo-design/CLAUDE.md +0 -30
- package/skills/logo-design/src/index.ts +0 -322
- package/skills/managehook/src/server/index.ts +0 -108
- package/skills/managemcp/src/server/index.ts +0 -108
- package/skills/manageskill/src/server/index.ts +0 -108
- package/skills/music/CLAUDE.md +0 -9
- package/skills/music/src/index.ts +0 -94
- package/skills/music/tsconfig.json +0 -10
- package/skills/pdf-read/src/index.ts +0 -320
- package/skills/product-mockup/CLAUDE.md +0 -19
- package/skills/product-mockup/src/index.ts +0 -290
- package/skills/read-pdf/src/index.ts +0 -388
- package/skills/remove-background/src/index.ts +0 -405
- package/skills/scaffold-project/my-app/.env.example +0 -2
- package/skills/scaffold-project/my-app/README.md +0 -72
- package/skills/scaffold-project/my-app/package.json +0 -29
- package/skills/scaffold-project/my-app/src/index.ts +0 -23
- package/skills/scaffold-project/my-app/tsconfig.json +0 -33
- package/skills/sound-effects/SKILL.md +0 -34
- package/skills/sound-effects/package.json +0 -21
- package/skills/sound-effects/src/index.ts +0 -172
- package/skills/sound-effects/tsconfig.json +0 -8
- package/skills/transcript/src/chunker.ts +0 -215
- package/skills/transcript/src/formatter.ts +0 -134
- package/skills/transcript/src/index-local.ts +0 -226
- package/skills/transcript/src/index.ts +0 -110
- package/skills/transcript/src/providers/elevenlabs.ts +0 -133
- package/skills/transcript/src/providers/gemini.ts +0 -192
- package/skills/transcript/src/providers/index.ts +0 -54
- package/skills/transcript/src/providers/openai.ts +0 -203
- package/skills/transcript/src/types.ts +0 -106
- package/skills/video/.env.example +0 -14
- package/skills/video/EXAMPLES.md +0 -266
- package/skills/video/LICENSE +0 -192
- package/skills/video/README.md +0 -174
- package/skills/video/src/cli.ts +0 -155
- package/skills/video/src/index-local.ts +0 -148
- package/skills/video/src/index.ts +0 -96
- package/skills/video/src/providers/google-veo.ts +0 -126
- package/skills/video/src/providers/index.ts +0 -22
- package/skills/video/src/providers/minimax.ts +0 -100
- package/skills/video/src/providers/openai-sora.ts +0 -164
- package/skills/video/src/providers/runway.ts +0 -159
- package/skills/video/src/types.ts +0 -35
- package/skills/video/tsconfig.json +0 -22
- package/skills/voiceover-casting-assistant/CLAUDE.md +0 -19
- package/skills/voiceover-casting-assistant/package.json +0 -27
- package/skills/voiceover-casting-assistant/src/index.ts +0 -255
- package/skills/voiceover-casting-assistant/tsconfig.json +0 -10
- package/skills/webcrawling/src/commands/config.ts +0 -34
- package/skills/webcrawling/src/commands/crawl.ts +0 -33
- package/skills/webcrawling/src/commands/scrape.ts +0 -32
- package/skills/webcrawling/src/commands/sessions.ts +0 -42
- package/skills/webcrawling/src/lib/crawler.ts +0 -174
- package/skills/webcrawling/src/lib/storage.ts +0 -130
- package/skills/webcrawling/src/types/index.ts +0 -45
- package/skills/webcrawling/src/utils/logger.ts +0 -30
- package/skills/webcrawling/src/utils/paths.ts +0 -28
- /package/skills/{audiobook-chapter-proofer → blog-article}/tsconfig.json +0 -0
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"extends": "../tsconfig.base.json",
|
|
3
|
-
"compilerOptions": {
|
|
4
|
-
"lib": [
|
|
5
|
-
"ESNext"
|
|
6
|
-
],
|
|
7
|
-
"module": "esnext",
|
|
8
|
-
"target": "esnext",
|
|
9
|
-
"moduleDetection": "force",
|
|
10
|
-
"allowImportingTsExtensions": true,
|
|
11
|
-
"noEmit": true,
|
|
12
|
-
"composite": true,
|
|
13
|
-
"downlevelIteration": true,
|
|
14
|
-
"jsx": "react-jsx",
|
|
15
|
-
"allowSyntheticDefaultImports": true,
|
|
16
|
-
"forceConsistentCasingInFileNames": true,
|
|
17
|
-
"allowJs": true
|
|
18
|
-
},
|
|
19
|
-
"include": [
|
|
20
|
-
"src/**/*"
|
|
21
|
-
]
|
|
22
|
-
}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
# voiceover-casting-assistant
|
|
2
|
-
|
|
3
|
-
Voiceover Casting Assistant skill.
|
|
4
|
-
|
|
5
|
-
## Tech Stack
|
|
6
|
-
|
|
7
|
-
- Runtime: Bun
|
|
8
|
-
- Language: TypeScript
|
|
9
|
-
- CLI: Commander.js
|
|
10
|
-
|
|
11
|
-
## CLI
|
|
12
|
-
|
|
13
|
-
```bash
|
|
14
|
-
voiceover-casting-assistant run
|
|
15
|
-
```
|
|
16
|
-
|
|
17
|
-
## Data Directory
|
|
18
|
-
|
|
19
|
-
~/.skill/voiceover-casting-assistant/
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "voiceover-casting-assistant",
|
|
3
|
-
"version": "0.1.0",
|
|
4
|
-
"description": "Voiceover Casting Assistant skill",
|
|
5
|
-
"type": "module",
|
|
6
|
-
"bin": {
|
|
7
|
-
"voiceover-casting-assistant": "./src/index.ts"
|
|
8
|
-
},
|
|
9
|
-
"scripts": {
|
|
10
|
-
"dev": "bun run src/index.ts",
|
|
11
|
-
"build": "bun build src/index.ts --outdir dist --target node",
|
|
12
|
-
"typecheck": "tsc --noEmit"
|
|
13
|
-
},
|
|
14
|
-
"dependencies": {},
|
|
15
|
-
"devDependencies": {
|
|
16
|
-
"@types/bun": "latest",
|
|
17
|
-
"typescript": "^5.7.0"
|
|
18
|
-
},
|
|
19
|
-
"publishConfig": {
|
|
20
|
-
"access": "restricted",
|
|
21
|
-
"registry": "https://registry.npmjs.org/"
|
|
22
|
-
},
|
|
23
|
-
"files": [
|
|
24
|
-
"src",
|
|
25
|
-
"tsconfig.json"
|
|
26
|
-
]
|
|
27
|
-
}
|
|
@@ -1,255 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env bun
|
|
2
|
-
/**
|
|
3
|
-
* voiceover-casting-assistant
|
|
4
|
-
* Generates voiceover casting briefs using OpenAI.
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
import { parseArgs } from "util";
|
|
8
|
-
import { existsSync, mkdirSync, appendFileSync } from "fs";
|
|
9
|
-
import { join, dirname } from "path";
|
|
10
|
-
|
|
11
|
-
type OutputFormat = "markdown" | "json";
|
|
12
|
-
|
|
13
|
-
interface SkillOptions {
|
|
14
|
-
project: string;
|
|
15
|
-
tone?: string;
|
|
16
|
-
audience?: string;
|
|
17
|
-
language?: string;
|
|
18
|
-
voices: number;
|
|
19
|
-
format: OutputFormat;
|
|
20
|
-
model: string;
|
|
21
|
-
output?: string;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
interface OpenAIChatResponse {
|
|
25
|
-
choices?: Array<{
|
|
26
|
-
message?: {
|
|
27
|
-
content?: string | null;
|
|
28
|
-
};
|
|
29
|
-
}>;
|
|
30
|
-
error?: {
|
|
31
|
-
message?: string;
|
|
32
|
-
};
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
const SKILL_SLUG = "voiceover-casting-assistant";
|
|
36
|
-
|
|
37
|
-
function ensureDir(path: string) {
|
|
38
|
-
if (!existsSync(path)) {
|
|
39
|
-
mkdirSync(path, { recursive: true });
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
function getPaths() {
|
|
44
|
-
const sessionStamp = new Date().toISOString().replace(/[:.]/g, "_").replace(/-/g, "_");
|
|
45
|
-
const exportsRoot = process.env.SKILLS_EXPORTS_DIR || join(process.cwd(), ".skills", "exports");
|
|
46
|
-
const logsRoot = process.env.SKILLS_LOGS_DIR || join(process.cwd(), ".skills", "logs");
|
|
47
|
-
|
|
48
|
-
const skillExportsDir = join(exportsRoot, SKILL_SLUG);
|
|
49
|
-
const skillLogsDir = join(logsRoot, SKILL_SLUG);
|
|
50
|
-
|
|
51
|
-
ensureDir(skillExportsDir);
|
|
52
|
-
ensureDir(skillLogsDir);
|
|
53
|
-
|
|
54
|
-
return {
|
|
55
|
-
sessionStamp,
|
|
56
|
-
skillExportsDir,
|
|
57
|
-
skillLogsDir,
|
|
58
|
-
};
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
function createLogger(logDir: string, sessionStamp: string) {
|
|
62
|
-
const logFile = join(logDir, `log_${sessionStamp}.txt`);
|
|
63
|
-
|
|
64
|
-
function write(level: "info" | "success" | "error", message: string) {
|
|
65
|
-
const timestamp = new Date().toISOString();
|
|
66
|
-
const entry = `[${timestamp}] [${level.toUpperCase()}] ${message}\n`;
|
|
67
|
-
appendFileSync(logFile, entry);
|
|
68
|
-
const prefix = level === "success" ? "✅" : level === "error" ? "❌" : "ℹ️";
|
|
69
|
-
console.log(`${prefix} ${message}`);
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
return {
|
|
73
|
-
info: (message: string) => write("info", message),
|
|
74
|
-
success: (message: string) => write("success", message),
|
|
75
|
-
error: (message: string) => write("error", message),
|
|
76
|
-
logFile,
|
|
77
|
-
};
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
function slugify(value: string): string {
|
|
81
|
-
return value
|
|
82
|
-
.toLowerCase()
|
|
83
|
-
.replace(/[^a-z0-9]+/g, "-")
|
|
84
|
-
.replace(/^-+|-+$/g, "")
|
|
85
|
-
.slice(0, 40) || "voiceover";
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
function parseOptions(): SkillOptions {
|
|
89
|
-
const { values, positionals } = parseArgs({
|
|
90
|
-
args: Bun.argv.slice(2),
|
|
91
|
-
options: {
|
|
92
|
-
tone: { type: "string" },
|
|
93
|
-
audience: { type: "string" },
|
|
94
|
-
language: { type: "string" },
|
|
95
|
-
voices: { type: "string" },
|
|
96
|
-
project: { type: "string" },
|
|
97
|
-
format: { type: "string", default: "markdown" },
|
|
98
|
-
model: { type: "string", default: "gpt-4o-mini" },
|
|
99
|
-
output: { type: "string" },
|
|
100
|
-
},
|
|
101
|
-
allowPositionals: true,
|
|
102
|
-
});
|
|
103
|
-
|
|
104
|
-
const project =
|
|
105
|
-
values.project ||
|
|
106
|
-
positionals.join(" ").trim();
|
|
107
|
-
|
|
108
|
-
if (!project) {
|
|
109
|
-
throw new Error(
|
|
110
|
-
"Provide project context via positional argument or --project.\nExample: skills run voiceover-casting-assistant -- \"Ad spot for travel app\""
|
|
111
|
-
);
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
const voices = values.voices ? parseInt(values.voices, 10) : 3;
|
|
115
|
-
if (Number.isNaN(voices) || voices < 1) {
|
|
116
|
-
throw new Error("--voices must be a positive integer.");
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
const format: OutputFormat =
|
|
120
|
-
values.format === "json" ? "json" : values.format === "markdown" ? "markdown" : "markdown";
|
|
121
|
-
|
|
122
|
-
return {
|
|
123
|
-
project,
|
|
124
|
-
tone: values.tone,
|
|
125
|
-
audience: values.audience,
|
|
126
|
-
language: values.language,
|
|
127
|
-
voices,
|
|
128
|
-
format,
|
|
129
|
-
model: values.model,
|
|
130
|
-
output: values.output,
|
|
131
|
-
};
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
function buildPrompt(options: SkillOptions) {
|
|
135
|
-
const system = `You are a voiceover casting director and audio producer.
|
|
136
|
-
Given project details, produce:
|
|
137
|
-
- ${options.voices} candidate personas (name, age range, vocal qualities, archetype)
|
|
138
|
-
- Recommended casting sources (talent agencies, marketplaces, AI voices) matching ${options.language || "English (US)"}
|
|
139
|
-
- Sample script snippets tailored to each persona, with direction (pace, emphasis, emotional cues)
|
|
140
|
-
- Pronunciation guide for brand/product names
|
|
141
|
-
- Recording direction (mic technique, room tone, energy adjustments)
|
|
142
|
-
- Session checklist for producers (file formats, retake notes, legal/usage considerations)
|
|
143
|
-
- If multiple audiences/platforms, highlight adjustments per audience (${options.audience || "General audience"})`;
|
|
144
|
-
|
|
145
|
-
const instructions =
|
|
146
|
-
options.format === "json"
|
|
147
|
-
? "Respond in JSON with keys: overview, personas, scripts, pronunciation, direction, checklist. Personas array should include name, description, qualities, casting_sources."
|
|
148
|
-
: "Respond in polished Markdown. Start with an executive summary blockquote, include tables for personas and script snippets, and bullet lists for pronunciation, direction, checklist.";
|
|
149
|
-
|
|
150
|
-
const userPayload = {
|
|
151
|
-
project_description: options.project,
|
|
152
|
-
tone: options.tone,
|
|
153
|
-
audience: options.audience,
|
|
154
|
-
language: options.language,
|
|
155
|
-
persona_count: options.voices,
|
|
156
|
-
format: options.format,
|
|
157
|
-
};
|
|
158
|
-
|
|
159
|
-
const user = `${instructions}\n\n${JSON.stringify(userPayload, null, 2)}`;
|
|
160
|
-
|
|
161
|
-
return { system, user };
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
async function callOpenAI(options: SkillOptions, system: string, user: string): Promise<string> {
|
|
165
|
-
const apiKey = process.env.OPENAI_API_KEY;
|
|
166
|
-
|
|
167
|
-
if (!apiKey) {
|
|
168
|
-
throw new Error("OPENAI_API_KEY environment variable is required.");
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
const body = {
|
|
172
|
-
model: options.model,
|
|
173
|
-
messages: [
|
|
174
|
-
{ role: "system", content: system },
|
|
175
|
-
{ role: "user", content: user },
|
|
176
|
-
],
|
|
177
|
-
temperature: 0.55,
|
|
178
|
-
max_tokens: options.format === "json" ? 2300 : 2000,
|
|
179
|
-
};
|
|
180
|
-
|
|
181
|
-
const response = await fetch("https://api.openai.com/v1/chat/completions", {
|
|
182
|
-
method: "POST",
|
|
183
|
-
headers: {
|
|
184
|
-
"Content-Type": "application/json",
|
|
185
|
-
Authorization: `Bearer ${apiKey}`,
|
|
186
|
-
},
|
|
187
|
-
body: JSON.stringify(body),
|
|
188
|
-
});
|
|
189
|
-
|
|
190
|
-
const data: OpenAIChatResponse = await response.json();
|
|
191
|
-
|
|
192
|
-
if (!response.ok) {
|
|
193
|
-
throw new Error(data.error?.message || `OpenAI API error (${response.status})`);
|
|
194
|
-
}
|
|
195
|
-
|
|
196
|
-
const content = data.choices?.[0]?.message?.content;
|
|
197
|
-
if (!content) {
|
|
198
|
-
throw new Error("OpenAI response did not include content.");
|
|
199
|
-
}
|
|
200
|
-
|
|
201
|
-
return content.trim();
|
|
202
|
-
}
|
|
203
|
-
|
|
204
|
-
async function writeExport(path: string, content: string) {
|
|
205
|
-
ensureDir(dirname(path));
|
|
206
|
-
await Bun.write(path, content);
|
|
207
|
-
}
|
|
208
|
-
|
|
209
|
-
async function run() {
|
|
210
|
-
const options = parseOptions();
|
|
211
|
-
const { sessionStamp, skillExportsDir, skillLogsDir } = getPaths();
|
|
212
|
-
const logger = createLogger(skillLogsDir, sessionStamp);
|
|
213
|
-
|
|
214
|
-
try {
|
|
215
|
-
logger.info("Generating voiceover casting brief.");
|
|
216
|
-
logger.info(`Format: ${options.format.toUpperCase()}, Model: ${options.model}`);
|
|
217
|
-
|
|
218
|
-
const { system, user } = buildPrompt(options);
|
|
219
|
-
const content = await callOpenAI(options, system, user);
|
|
220
|
-
|
|
221
|
-
const slugBase = options.tone || options.language || "voiceover";
|
|
222
|
-
const planSlug = slugify(slugBase);
|
|
223
|
-
const extension = options.format === "json" ? "json" : "md";
|
|
224
|
-
const defaultPath = join(skillExportsDir, `voiceover-casting-${planSlug}-${sessionStamp}.${extension}`);
|
|
225
|
-
const targetPath = options.output ? options.output : defaultPath;
|
|
226
|
-
|
|
227
|
-
let finalContent = content;
|
|
228
|
-
|
|
229
|
-
if (options.format === "json") {
|
|
230
|
-
try {
|
|
231
|
-
finalContent = JSON.stringify(JSON.parse(content), null, 2);
|
|
232
|
-
} catch {
|
|
233
|
-
logger.error("Model response was not valid JSON. Wrapping raw response.");
|
|
234
|
-
finalContent = JSON.stringify({ raw: content }, null, 2);
|
|
235
|
-
}
|
|
236
|
-
}
|
|
237
|
-
|
|
238
|
-
await writeExport(targetPath, finalContent);
|
|
239
|
-
|
|
240
|
-
logger.success("Voiceover casting brief generated successfully.");
|
|
241
|
-
console.log("\n=== Casting Brief Preview ===\n");
|
|
242
|
-
console.log(finalContent.slice(0, 1500));
|
|
243
|
-
if (finalContent.length > 1500) {
|
|
244
|
-
console.log("\n… (truncated)");
|
|
245
|
-
}
|
|
246
|
-
console.log(`\nExport saved to: ${targetPath}`);
|
|
247
|
-
console.log(`Logs written to: ${skillLogsDir}`);
|
|
248
|
-
} catch (error) {
|
|
249
|
-
const message = error instanceof Error ? error.message : String(error);
|
|
250
|
-
logger.error(message);
|
|
251
|
-
process.exit(1);
|
|
252
|
-
}
|
|
253
|
-
}
|
|
254
|
-
|
|
255
|
-
run();
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import type { Command } from "commander";
|
|
2
|
-
import chalk from "chalk";
|
|
3
|
-
import { loadConfig, saveConfig, getConfigPath } from "../lib/storage.js";
|
|
4
|
-
import * as logger from "../utils/logger.js";
|
|
5
|
-
|
|
6
|
-
export function registerConfigCommand(program: Command): void {
|
|
7
|
-
const configCmd = program.command("config").description("View and edit configuration");
|
|
8
|
-
|
|
9
|
-
configCmd
|
|
10
|
-
.command("view")
|
|
11
|
-
.option("--json", "Output as JSON")
|
|
12
|
-
.action((options) => {
|
|
13
|
-
const config = loadConfig();
|
|
14
|
-
const hasApiKey = !!(config.firecrawlApiKey || process.env.FIRECRAWL_API_KEY);
|
|
15
|
-
|
|
16
|
-
if (options.json) {
|
|
17
|
-
console.log(JSON.stringify({ ...config, hasApiKey }, null, 2));
|
|
18
|
-
return;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
logger.heading("Configuration");
|
|
22
|
-
logger.table([
|
|
23
|
-
["Output directory", config.outputDir],
|
|
24
|
-
["Firecrawl API key", hasApiKey ? chalk.green("configured") : chalk.red("not set")],
|
|
25
|
-
]);
|
|
26
|
-
});
|
|
27
|
-
|
|
28
|
-
configCmd
|
|
29
|
-
.command("set <key> <value>")
|
|
30
|
-
.action((key: string, value: string) => {
|
|
31
|
-
saveConfig({ [key]: value });
|
|
32
|
-
logger.success(`Set ${key} = ${key.includes("Key") ? "***" : value}`);
|
|
33
|
-
});
|
|
34
|
-
}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import type { Command } from "commander";
|
|
2
|
-
import { crawlAndSave } from "../lib/crawler.js";
|
|
3
|
-
import * as logger from "../utils/logger.js";
|
|
4
|
-
|
|
5
|
-
export function registerCrawlCommand(program: Command): void {
|
|
6
|
-
program
|
|
7
|
-
.command("crawl <url>")
|
|
8
|
-
.description("Crawl an entire website")
|
|
9
|
-
.option("-d, --depth <number>", "Maximum crawl depth", "2")
|
|
10
|
-
.option("-l, --limit <number>", "Maximum pages to crawl", "10")
|
|
11
|
-
.option("--exclude <paths>", "Exclude paths (comma-separated)")
|
|
12
|
-
.option("--include <paths>", "Include only paths (comma-separated)")
|
|
13
|
-
.action(async (url: string, options) => {
|
|
14
|
-
try {
|
|
15
|
-
const { sessionId, result } = await crawlAndSave(url, {
|
|
16
|
-
maxDepth: parseInt(options.depth),
|
|
17
|
-
limit: parseInt(options.limit),
|
|
18
|
-
excludePaths: options.exclude?.split(","),
|
|
19
|
-
includePaths: options.include?.split(","),
|
|
20
|
-
});
|
|
21
|
-
|
|
22
|
-
logger.heading("Crawl Complete");
|
|
23
|
-
logger.table([
|
|
24
|
-
["Session ID", sessionId],
|
|
25
|
-
["URL", result.url],
|
|
26
|
-
["Pages", result.totalPages.toString()],
|
|
27
|
-
]);
|
|
28
|
-
} catch (err) {
|
|
29
|
-
logger.error(`Crawl failed: ${err}`);
|
|
30
|
-
process.exit(1);
|
|
31
|
-
}
|
|
32
|
-
});
|
|
33
|
-
}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import type { Command } from "commander";
|
|
2
|
-
import { scrapeUrl } from "../lib/crawler.js";
|
|
3
|
-
import * as logger from "../utils/logger.js";
|
|
4
|
-
|
|
5
|
-
export function registerScrapeCommand(program: Command): void {
|
|
6
|
-
program
|
|
7
|
-
.command("scrape <url>")
|
|
8
|
-
.description("Scrape a single URL")
|
|
9
|
-
.option("-f, --format <format>", "Output format: markdown, html, json", "markdown")
|
|
10
|
-
.option("--full-page", "Include full page content (not just main)")
|
|
11
|
-
.action(async (url: string, options) => {
|
|
12
|
-
try {
|
|
13
|
-
const result = await scrapeUrl(url, {
|
|
14
|
-
formats: options.format === "html" ? ["html"] : ["markdown"],
|
|
15
|
-
onlyMainContent: !options.fullPage,
|
|
16
|
-
});
|
|
17
|
-
|
|
18
|
-
if (options.format === "json") {
|
|
19
|
-
console.log(JSON.stringify(result, null, 2));
|
|
20
|
-
} else if (options.format === "html") {
|
|
21
|
-
console.log(result.html || "No HTML content");
|
|
22
|
-
} else {
|
|
23
|
-
console.log(result.markdown || "No content");
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
logger.success("Scrape complete");
|
|
27
|
-
} catch (err) {
|
|
28
|
-
logger.error(`Scrape failed: ${err}`);
|
|
29
|
-
process.exit(1);
|
|
30
|
-
}
|
|
31
|
-
});
|
|
32
|
-
}
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import type { Command } from "commander";
|
|
2
|
-
import chalk from "chalk";
|
|
3
|
-
import { listSessions } from "../lib/storage.js";
|
|
4
|
-
import * as logger from "../utils/logger.js";
|
|
5
|
-
|
|
6
|
-
export function registerSessionsCommand(program: Command): void {
|
|
7
|
-
program
|
|
8
|
-
.command("sessions")
|
|
9
|
-
.alias("ls")
|
|
10
|
-
.description("List crawl sessions")
|
|
11
|
-
.option("--json", "Output as JSON")
|
|
12
|
-
.action(async (options) => {
|
|
13
|
-
try {
|
|
14
|
-
const sessions = listSessions();
|
|
15
|
-
|
|
16
|
-
if (sessions.length === 0) {
|
|
17
|
-
logger.info("No crawl sessions yet");
|
|
18
|
-
return;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
if (options.json) {
|
|
22
|
-
console.log(JSON.stringify(sessions, null, 2));
|
|
23
|
-
return;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
logger.heading("Crawl Sessions");
|
|
27
|
-
|
|
28
|
-
for (const session of sessions) {
|
|
29
|
-
console.log(chalk.cyan(session.id));
|
|
30
|
-
console.log(` ${chalk.dim("URL:")} ${session.url}`);
|
|
31
|
-
console.log(` ${chalk.dim("Pages:")} ${session.pages}`);
|
|
32
|
-
console.log(` ${chalk.dim("Date:")} ${new Date(session.createdAt).toLocaleDateString()}`);
|
|
33
|
-
console.log();
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
logger.info(`${sessions.length} session(s)`);
|
|
37
|
-
} catch (err) {
|
|
38
|
-
logger.error(`Failed to list sessions: ${err}`);
|
|
39
|
-
process.exit(1);
|
|
40
|
-
}
|
|
41
|
-
});
|
|
42
|
-
}
|
|
@@ -1,174 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Web crawler using Firecrawl API
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
import * as logger from "../utils/logger.js";
|
|
6
|
-
import { loadConfig, createSession, saveSession } from "./storage.js";
|
|
7
|
-
import type { ScrapeOptions, CrawlOptions, ScrapeResult, CrawlResult } from "../types/index.js";
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* Get Firecrawl API key
|
|
11
|
-
*/
|
|
12
|
-
function getApiKey(): string {
|
|
13
|
-
const config = loadConfig();
|
|
14
|
-
const apiKey = config.firecrawlApiKey || process.env.FIRECRAWL_API_KEY;
|
|
15
|
-
|
|
16
|
-
if (!apiKey) {
|
|
17
|
-
throw new Error("FIRECRAWL_API_KEY not set. Set it in environment or config.");
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
return apiKey;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
/**
|
|
24
|
-
* Scrape a single URL
|
|
25
|
-
*/
|
|
26
|
-
export async function scrapeUrl(
|
|
27
|
-
url: string,
|
|
28
|
-
options: ScrapeOptions = {}
|
|
29
|
-
): Promise<ScrapeResult> {
|
|
30
|
-
const apiKey = getApiKey();
|
|
31
|
-
|
|
32
|
-
logger.info(`Scraping: ${url}`);
|
|
33
|
-
|
|
34
|
-
const response = await fetch("https://api.firecrawl.dev/v1/scrape", {
|
|
35
|
-
method: "POST",
|
|
36
|
-
headers: {
|
|
37
|
-
"Content-Type": "application/json",
|
|
38
|
-
Authorization: `Bearer ${apiKey}`,
|
|
39
|
-
},
|
|
40
|
-
body: JSON.stringify({
|
|
41
|
-
url,
|
|
42
|
-
formats: options.formats || ["markdown"],
|
|
43
|
-
onlyMainContent: options.onlyMainContent ?? true,
|
|
44
|
-
waitFor: options.waitFor,
|
|
45
|
-
}),
|
|
46
|
-
});
|
|
47
|
-
|
|
48
|
-
if (!response.ok) {
|
|
49
|
-
const error = await response.text();
|
|
50
|
-
throw new Error(`Firecrawl API error: ${error}`);
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
const data = (await response.json()) as any;
|
|
54
|
-
|
|
55
|
-
if (!data.success) {
|
|
56
|
-
throw new Error(data.error || "Scrape failed");
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
return {
|
|
60
|
-
url,
|
|
61
|
-
markdown: data.data?.markdown,
|
|
62
|
-
html: data.data?.html,
|
|
63
|
-
links: data.data?.links,
|
|
64
|
-
metadata: data.data?.metadata,
|
|
65
|
-
};
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
/**
|
|
69
|
-
* Crawl an entire website
|
|
70
|
-
*/
|
|
71
|
-
export async function crawlWebsite(
|
|
72
|
-
url: string,
|
|
73
|
-
options: CrawlOptions = {}
|
|
74
|
-
): Promise<CrawlResult> {
|
|
75
|
-
const apiKey = getApiKey();
|
|
76
|
-
|
|
77
|
-
logger.info(`Starting crawl: ${url}`);
|
|
78
|
-
logger.info(`Max depth: ${options.maxDepth || 2}, Limit: ${options.limit || 10}`);
|
|
79
|
-
|
|
80
|
-
// Start crawl job
|
|
81
|
-
const startResponse = await fetch("https://api.firecrawl.dev/v1/crawl", {
|
|
82
|
-
method: "POST",
|
|
83
|
-
headers: {
|
|
84
|
-
"Content-Type": "application/json",
|
|
85
|
-
Authorization: `Bearer ${apiKey}`,
|
|
86
|
-
},
|
|
87
|
-
body: JSON.stringify({
|
|
88
|
-
url,
|
|
89
|
-
maxDepth: options.maxDepth || 2,
|
|
90
|
-
limit: options.limit || 10,
|
|
91
|
-
excludePaths: options.excludePaths,
|
|
92
|
-
includePaths: options.includePaths,
|
|
93
|
-
scrapeOptions: {
|
|
94
|
-
formats: ["markdown"],
|
|
95
|
-
onlyMainContent: true,
|
|
96
|
-
},
|
|
97
|
-
}),
|
|
98
|
-
});
|
|
99
|
-
|
|
100
|
-
if (!startResponse.ok) {
|
|
101
|
-
const error = await startResponse.text();
|
|
102
|
-
throw new Error(`Failed to start crawl: ${error}`);
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
const startData = (await startResponse.json()) as any;
|
|
106
|
-
|
|
107
|
-
if (!startData.success) {
|
|
108
|
-
throw new Error(startData.error || "Failed to start crawl");
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
const jobId = startData.id;
|
|
112
|
-
logger.info(`Crawl job started: ${jobId}`);
|
|
113
|
-
|
|
114
|
-
// Poll for results
|
|
115
|
-
const pages: ScrapeResult[] = [];
|
|
116
|
-
let completed = false;
|
|
117
|
-
|
|
118
|
-
while (!completed) {
|
|
119
|
-
await new Promise((r) => setTimeout(r, 2000));
|
|
120
|
-
|
|
121
|
-
const statusResponse = await fetch(`https://api.firecrawl.dev/v1/crawl/${jobId}`, {
|
|
122
|
-
headers: {
|
|
123
|
-
Authorization: `Bearer ${apiKey}`,
|
|
124
|
-
},
|
|
125
|
-
});
|
|
126
|
-
|
|
127
|
-
if (!statusResponse.ok) {
|
|
128
|
-
throw new Error("Failed to check crawl status");
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
const statusData = (await statusResponse.json()) as any;
|
|
132
|
-
|
|
133
|
-
if (statusData.status === "completed") {
|
|
134
|
-
completed = true;
|
|
135
|
-
|
|
136
|
-
for (const page of statusData.data || []) {
|
|
137
|
-
pages.push({
|
|
138
|
-
url: page.url,
|
|
139
|
-
markdown: page.markdown,
|
|
140
|
-
html: page.html,
|
|
141
|
-
metadata: page.metadata,
|
|
142
|
-
});
|
|
143
|
-
}
|
|
144
|
-
} else if (statusData.status === "failed") {
|
|
145
|
-
throw new Error(statusData.error || "Crawl failed");
|
|
146
|
-
} else {
|
|
147
|
-
logger.info(`Crawling... (${statusData.completed || 0}/${statusData.total || "?"} pages)`);
|
|
148
|
-
}
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
logger.success(`Crawl complete: ${pages.length} pages`);
|
|
152
|
-
|
|
153
|
-
return {
|
|
154
|
-
url,
|
|
155
|
-
pages,
|
|
156
|
-
totalPages: pages.length,
|
|
157
|
-
};
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
/**
|
|
161
|
-
* Crawl and save to session
|
|
162
|
-
*/
|
|
163
|
-
export async function crawlAndSave(
|
|
164
|
-
url: string,
|
|
165
|
-
options: CrawlOptions = {}
|
|
166
|
-
): Promise<{ sessionId: string; result: CrawlResult }> {
|
|
167
|
-
const { sessionId, sessionDir } = createSession(url);
|
|
168
|
-
|
|
169
|
-
const result = await crawlWebsite(url, options);
|
|
170
|
-
|
|
171
|
-
saveSession(sessionDir, result);
|
|
172
|
-
|
|
173
|
-
return { sessionId, result };
|
|
174
|
-
}
|