@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,206 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env bun
|
|
2
|
-
|
|
3
|
-
import { writeFile } from 'fs/promises';
|
|
4
|
-
import { resolve, dirname } from 'path';
|
|
5
|
-
import { mkdir } from 'fs/promises';
|
|
6
|
-
import type { GenerateOptions, ImageProvider } from './types';
|
|
7
|
-
import { MinimaxProvider } from './providers/minimax';
|
|
8
|
-
import { OpenAIProvider } from './providers/openai';
|
|
9
|
-
import { GoogleProvider } from './providers/google';
|
|
10
|
-
import { XAIProvider } from './providers/xai';
|
|
11
|
-
import { handleInstallCommand } from '../../_common';
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
// Handle install/uninstall commands
|
|
15
|
-
const SKILL_META = {
|
|
16
|
-
name: 'image',
|
|
17
|
-
description: 'Generate images using AI providers (OpenAI, Google Gemini 3.0, xAI Aurora)',
|
|
18
|
-
version: '1.0.0',
|
|
19
|
-
commands: `Use: image --help`,
|
|
20
|
-
requiredEnvVars: ['SKILL_API_KEY'],
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
if (await handleInstallCommand(SKILL_META, process.argv.slice(2))) {
|
|
24
|
-
process.exit(0);
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
function parseArgs(): GenerateOptions | null {
|
|
28
|
-
const args = process.argv.slice(2);
|
|
29
|
-
|
|
30
|
-
if (args.length === 0 || args[0] === '--help' || args[0] === '-h') {
|
|
31
|
-
printHelp();
|
|
32
|
-
return null;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
if (args[0] !== 'generate') {
|
|
36
|
-
console.error(`Unknown command: ${args[0]}`);
|
|
37
|
-
console.error('Run with --help for usage information');
|
|
38
|
-
process.exit(1);
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
const options: Partial<GenerateOptions> = {};
|
|
42
|
-
|
|
43
|
-
for (let i = 1; i < args.length; i++) {
|
|
44
|
-
const arg = args[i];
|
|
45
|
-
|
|
46
|
-
switch (arg) {
|
|
47
|
-
case '--provider':
|
|
48
|
-
case '-p':
|
|
49
|
-
options.provider = args[++i] as GenerateOptions['provider'];
|
|
50
|
-
break;
|
|
51
|
-
case '--prompt':
|
|
52
|
-
options.prompt = args[++i];
|
|
53
|
-
break;
|
|
54
|
-
case '--output':
|
|
55
|
-
case '-o':
|
|
56
|
-
options.output = args[++i];
|
|
57
|
-
break;
|
|
58
|
-
case '--model':
|
|
59
|
-
case '-m':
|
|
60
|
-
options.model = args[++i];
|
|
61
|
-
break;
|
|
62
|
-
case '--size':
|
|
63
|
-
case '-s':
|
|
64
|
-
options.size = args[++i];
|
|
65
|
-
break;
|
|
66
|
-
default:
|
|
67
|
-
console.error(`Unknown option: ${arg}`);
|
|
68
|
-
process.exit(1);
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
// Validate required options
|
|
73
|
-
if (!options.provider) {
|
|
74
|
-
options.provider = 'minimax';
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
if (!options.prompt) {
|
|
78
|
-
console.error('Error: --prompt is required');
|
|
79
|
-
process.exit(1);
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
if (!options.output) {
|
|
83
|
-
console.error('Error: --output is required');
|
|
84
|
-
process.exit(1);
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
// Validate provider
|
|
88
|
-
const validProviders = ['minimax', 'openai', 'google', 'xai'];
|
|
89
|
-
if (!validProviders.includes(options.provider)) {
|
|
90
|
-
console.error(
|
|
91
|
-
`Error: Invalid provider. Choose from: ${validProviders.join(', ')}`
|
|
92
|
-
);
|
|
93
|
-
process.exit(1);
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
return options as GenerateOptions;
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
function printHelp() {
|
|
100
|
-
console.log(`
|
|
101
|
-
Image Generation Skill
|
|
102
|
-
|
|
103
|
-
Generate images using AI providers (OpenAI, Google Imagen, xAI Aurora)
|
|
104
|
-
|
|
105
|
-
USAGE:
|
|
106
|
-
bun run src/index.ts generate [OPTIONS]
|
|
107
|
-
|
|
108
|
-
OPTIONS:
|
|
109
|
-
--provider, -p <provider> Provider to use (openai, google, xai) [required]
|
|
110
|
-
--prompt <text> Text prompt for image generation [required]
|
|
111
|
-
--output, -o <path> Output file path [required]
|
|
112
|
-
--model, -m <model> Specific model to use (optional)
|
|
113
|
-
--size, -s <size> Image size (provider-specific, optional)
|
|
114
|
-
|
|
115
|
-
EXAMPLES:
|
|
116
|
-
# OpenAI DALL-E 3
|
|
117
|
-
bun run src/index.ts generate --provider openai --prompt "a cat" --output ./cat.png
|
|
118
|
-
|
|
119
|
-
# OpenAI with custom size
|
|
120
|
-
bun run src/index.ts generate -p openai --prompt "a landscape" -o ./landscape.png --size 1792x1024
|
|
121
|
-
|
|
122
|
-
# Google Imagen 3
|
|
123
|
-
bun run src/index.ts generate --provider google --prompt "a dog" --output ./dog.png
|
|
124
|
-
|
|
125
|
-
# xAI Aurora
|
|
126
|
-
bun run src/index.ts generate --provider xai --prompt "a bird" --output ./bird.png
|
|
127
|
-
|
|
128
|
-
ENVIRONMENT VARIABLES:
|
|
129
|
-
OPENAI_API_KEY API key for OpenAI
|
|
130
|
-
GEMINI_API_KEY API key for Google Gemini
|
|
131
|
-
GOOGLE_PROJECT_ID Google Cloud project ID
|
|
132
|
-
XAI_API_KEY API key for xAI
|
|
133
|
-
|
|
134
|
-
PROVIDER-SPECIFIC OPTIONS:
|
|
135
|
-
|
|
136
|
-
OpenAI:
|
|
137
|
-
Models: dall-e-3 (default), gpt-image-1
|
|
138
|
-
Sizes: 1024x1024 (default), 1792x1024, 1024x1792
|
|
139
|
-
|
|
140
|
-
Google Imagen 3:
|
|
141
|
-
Models: imagen-3.0-generate-001 (default)
|
|
142
|
-
Sizes: 1:1 (default), 3:4, 4:3, 9:16, 16:9
|
|
143
|
-
|
|
144
|
-
xAI Grok-2 Image:
|
|
145
|
-
Models: grok-2-image-1212 (default)
|
|
146
|
-
Sizes: Provider-specific
|
|
147
|
-
`);
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
function getProvider(provider: string): ImageProvider {
|
|
151
|
-
switch (provider) {
|
|
152
|
-
case 'minimax':
|
|
153
|
-
return new MinimaxProvider();
|
|
154
|
-
case 'openai':
|
|
155
|
-
return new OpenAIProvider();
|
|
156
|
-
case 'google':
|
|
157
|
-
return new GoogleProvider();
|
|
158
|
-
case 'xai':
|
|
159
|
-
return new XAIProvider();
|
|
160
|
-
default:
|
|
161
|
-
throw new Error(`Unknown provider: ${provider}`);
|
|
162
|
-
}
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
async function ensureDirectory(filePath: string): Promise<void> {
|
|
166
|
-
const dir = dirname(filePath);
|
|
167
|
-
try {
|
|
168
|
-
await mkdir(dir, { recursive: true });
|
|
169
|
-
} catch (error) {
|
|
170
|
-
// Directory might already exist, ignore error
|
|
171
|
-
}
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
async function main() {
|
|
175
|
-
const options = parseArgs();
|
|
176
|
-
|
|
177
|
-
if (!options) {
|
|
178
|
-
return;
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
try {
|
|
182
|
-
console.log('\n=== Image Generation ===\n');
|
|
183
|
-
|
|
184
|
-
const provider = getProvider(options.provider);
|
|
185
|
-
|
|
186
|
-
const imageBuffer = await provider.generate(options.prompt, {
|
|
187
|
-
model: options.model,
|
|
188
|
-
size: options.size,
|
|
189
|
-
});
|
|
190
|
-
|
|
191
|
-
// Ensure output directory exists
|
|
192
|
-
const outputPath = resolve(options.output);
|
|
193
|
-
await ensureDirectory(outputPath);
|
|
194
|
-
|
|
195
|
-
// Write image to file
|
|
196
|
-
await writeFile(outputPath, imageBuffer);
|
|
197
|
-
|
|
198
|
-
console.log(`\nImage saved to: ${outputPath}`);
|
|
199
|
-
console.log('\nDone!\n');
|
|
200
|
-
} catch (error) {
|
|
201
|
-
console.error('\nError:', error instanceof Error ? error.message : error);
|
|
202
|
-
process.exit(1);
|
|
203
|
-
}
|
|
204
|
-
}
|
|
205
|
-
|
|
206
|
-
main();
|
|
@@ -1,96 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env bun
|
|
2
|
-
|
|
3
|
-
import { executeAndSave, executeSkill, handleInstallCommand } from "../../_common";
|
|
4
|
-
|
|
5
|
-
const SKILL = "image";
|
|
6
|
-
|
|
7
|
-
const SKILL_META = {
|
|
8
|
-
name: "image",
|
|
9
|
-
description: "Generate images using provider-cost AI backends",
|
|
10
|
-
version: "1.0.0",
|
|
11
|
-
commands: "image generate --provider <provider> --prompt <prompt> --output <file>",
|
|
12
|
-
requiredEnvVars: ["SKILL_API_KEY"],
|
|
13
|
-
};
|
|
14
|
-
|
|
15
|
-
if (await handleInstallCommand(SKILL_META, process.argv.slice(2))) {
|
|
16
|
-
process.exit(0);
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
function parseArgs(): Record<string, string | boolean> {
|
|
20
|
-
const parsed: Record<string, string | boolean> = {};
|
|
21
|
-
const args = process.argv.slice(2);
|
|
22
|
-
for (let i = 0; i < args.length; i++) {
|
|
23
|
-
const arg = args[i];
|
|
24
|
-
if (arg.startsWith("--")) {
|
|
25
|
-
const key = arg.slice(2);
|
|
26
|
-
const next = args[i + 1];
|
|
27
|
-
if (next && !next.startsWith("--")) {
|
|
28
|
-
parsed[key] = next;
|
|
29
|
-
i++;
|
|
30
|
-
} else {
|
|
31
|
-
parsed[key] = true;
|
|
32
|
-
}
|
|
33
|
-
} else if (!parsed.command) {
|
|
34
|
-
parsed.command = arg;
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
return parsed;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
function printHelp() {
|
|
41
|
-
console.log(`Skill Image CLI
|
|
42
|
-
|
|
43
|
-
USAGE:
|
|
44
|
-
image generate --provider <provider> --prompt <prompt> [options]
|
|
45
|
-
|
|
46
|
-
PROVIDERS:
|
|
47
|
-
openai gpt-image-1.5, dall-e-3
|
|
48
|
-
minimax image-01
|
|
49
|
-
gemini imagen-4.0-generate-001, imagen-4.0-fast-generate-001, imagen-4.0-ultra-generate-001, gemini-2.5-flash-image
|
|
50
|
-
|
|
51
|
-
OPTIONS:
|
|
52
|
-
--model <model> Provider model override
|
|
53
|
-
--prompt <prompt> Text prompt
|
|
54
|
-
--size <size> Provider-specific size or aspect ratio
|
|
55
|
-
--count <count> Number of images
|
|
56
|
-
--output <path> Save generated image
|
|
57
|
-
|
|
58
|
-
EXAMPLES:
|
|
59
|
-
image generate --provider openai --prompt "a cat" --output ./output.png
|
|
60
|
-
image generate --provider minimax --prompt "a dog" --output ./output.png
|
|
61
|
-
image generate --provider gemini --model imagen-4.0-fast-generate-001 --prompt "a bird" --output ./output.png`);
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
async function main() {
|
|
65
|
-
const args = parseArgs();
|
|
66
|
-
const command = (args.command as string) || "help";
|
|
67
|
-
|
|
68
|
-
if (command === "help" || args.help) {
|
|
69
|
-
printHelp();
|
|
70
|
-
return;
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
const { command: _command, ...params } = args;
|
|
74
|
-
if (params.output) {
|
|
75
|
-
const success = await executeAndSave({ skill: SKILL, command, ...params });
|
|
76
|
-
process.exit(success ? 0 : 1);
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
const result = await executeSkill({ skill: SKILL, command, ...params });
|
|
80
|
-
if (result instanceof Blob) {
|
|
81
|
-
console.error("Unexpected binary response. Pass --output to save image output.");
|
|
82
|
-
process.exit(1);
|
|
83
|
-
}
|
|
84
|
-
if (result.success && result.output) {
|
|
85
|
-
console.log(result.output);
|
|
86
|
-
return;
|
|
87
|
-
}
|
|
88
|
-
console.error(`Error: ${result.error || "Image generation failed"}`);
|
|
89
|
-
if (result.details) console.error(result.details);
|
|
90
|
-
process.exit(1);
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
main().catch((error) => {
|
|
94
|
-
console.error(`Fatal error: ${(error as Error).message}`);
|
|
95
|
-
process.exit(1);
|
|
96
|
-
});
|
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
import type { ImageProvider, GoogleImagenResponse } from '../types';
|
|
2
|
-
|
|
3
|
-
export class GoogleProvider implements ImageProvider {
|
|
4
|
-
private apiKey: string;
|
|
5
|
-
private projectId: string;
|
|
6
|
-
private location = 'us-central1';
|
|
7
|
-
|
|
8
|
-
constructor(apiKey?: string, projectId?: string) {
|
|
9
|
-
this.apiKey = apiKey || process.env.GEMINI_API_KEY || '';
|
|
10
|
-
this.projectId = projectId || process.env.GOOGLE_PROJECT_ID || '';
|
|
11
|
-
|
|
12
|
-
if (!this.apiKey) {
|
|
13
|
-
throw new Error('GEMINI_API_KEY environment variable is required');
|
|
14
|
-
}
|
|
15
|
-
if (!this.projectId) {
|
|
16
|
-
throw new Error('GOOGLE_PROJECT_ID environment variable is required');
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
async generate(
|
|
21
|
-
prompt: string,
|
|
22
|
-
options?: {
|
|
23
|
-
model?: string;
|
|
24
|
-
size?: string;
|
|
25
|
-
}
|
|
26
|
-
): Promise<Buffer> {
|
|
27
|
-
// Gemini 3.0 (Nano Banana) - Google's latest image generation model
|
|
28
|
-
const model = options?.model || 'gemini-3.0-generate-001';
|
|
29
|
-
|
|
30
|
-
console.log(`Generating image with Google Gemini 3.0 (${model})...`);
|
|
31
|
-
console.log(`Prompt: ${prompt}`);
|
|
32
|
-
|
|
33
|
-
// Construct the Vertex AI endpoint
|
|
34
|
-
const endpoint = `https://${this.location}-aiplatform.googleapis.com/v1/projects/${this.projectId}/locations/${this.location}/publishers/google/models/${model}:predict`;
|
|
35
|
-
|
|
36
|
-
const requestBody = {
|
|
37
|
-
instances: [
|
|
38
|
-
{
|
|
39
|
-
prompt,
|
|
40
|
-
},
|
|
41
|
-
],
|
|
42
|
-
parameters: {
|
|
43
|
-
sampleCount: 1,
|
|
44
|
-
aspectRatio: '1:1', // Options: 1:1, 3:4, 4:3, 9:16, 16:9
|
|
45
|
-
...(options?.size && { aspectRatio: options.size }),
|
|
46
|
-
},
|
|
47
|
-
};
|
|
48
|
-
|
|
49
|
-
const response = await fetch(endpoint, {
|
|
50
|
-
method: 'POST',
|
|
51
|
-
headers: {
|
|
52
|
-
'Content-Type': 'application/json',
|
|
53
|
-
Authorization: `Bearer ${this.apiKey}`,
|
|
54
|
-
},
|
|
55
|
-
body: JSON.stringify(requestBody),
|
|
56
|
-
});
|
|
57
|
-
|
|
58
|
-
if (!response.ok) {
|
|
59
|
-
const error = await response.text();
|
|
60
|
-
throw new Error(`Google Imagen API error: ${response.status} - ${error}`);
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
const data: GoogleImagenResponse = await response.json();
|
|
64
|
-
|
|
65
|
-
if (
|
|
66
|
-
!data.predictions ||
|
|
67
|
-
data.predictions.length === 0 ||
|
|
68
|
-
!data.predictions[0].bytesBase64Encoded
|
|
69
|
-
) {
|
|
70
|
-
throw new Error('No image data returned from Google Imagen API');
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
console.log('Image generated successfully!');
|
|
74
|
-
|
|
75
|
-
// Decode base64 image
|
|
76
|
-
const base64Image = data.predictions[0].bytesBase64Encoded;
|
|
77
|
-
return Buffer.from(base64Image, 'base64');
|
|
78
|
-
}
|
|
79
|
-
}
|
|
@@ -1,94 +0,0 @@
|
|
|
1
|
-
import type { ImageProvider } from '../types';
|
|
2
|
-
|
|
3
|
-
export class MinimaxProvider implements ImageProvider {
|
|
4
|
-
private apiKey: string;
|
|
5
|
-
private baseUrl = 'https://api.minimax.chat/v1';
|
|
6
|
-
|
|
7
|
-
constructor(apiKey?: string) {
|
|
8
|
-
this.apiKey = apiKey || process.env.MINIMAX_API_KEY || '';
|
|
9
|
-
if (!this.apiKey) {
|
|
10
|
-
throw new Error('MINIMAX_API_KEY environment variable is required');
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
async generate(
|
|
15
|
-
prompt: string,
|
|
16
|
-
options?: { model?: string; size?: string }
|
|
17
|
-
): Promise<Buffer> {
|
|
18
|
-
const aspectRatio = this.sizeToAspectRatio(options?.size);
|
|
19
|
-
|
|
20
|
-
console.log(`Generating image with Minimax image-01...`);
|
|
21
|
-
console.log(`Prompt: ${prompt}`);
|
|
22
|
-
console.log(`Aspect ratio: ${aspectRatio}`);
|
|
23
|
-
|
|
24
|
-
const response = await fetch(`${this.baseUrl}/image_generation`, {
|
|
25
|
-
method: 'POST',
|
|
26
|
-
headers: {
|
|
27
|
-
'Content-Type': 'application/json',
|
|
28
|
-
'Authorization': `Bearer ${this.apiKey}`,
|
|
29
|
-
},
|
|
30
|
-
body: JSON.stringify({
|
|
31
|
-
model: options?.model || 'image-01',
|
|
32
|
-
prompt,
|
|
33
|
-
aspect_ratio: aspectRatio,
|
|
34
|
-
n: 1,
|
|
35
|
-
prompt_optimizer: true,
|
|
36
|
-
}),
|
|
37
|
-
});
|
|
38
|
-
|
|
39
|
-
if (!response.ok) {
|
|
40
|
-
const err = await response.text();
|
|
41
|
-
throw new Error(`Minimax API error: ${response.status} - ${err}`);
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
const data = await response.json() as { task_id: string };
|
|
45
|
-
|
|
46
|
-
for (let i = 0; i < 60; i++) {
|
|
47
|
-
await new Promise(r => setTimeout(r, 3000));
|
|
48
|
-
|
|
49
|
-
const statusRes = await fetch(
|
|
50
|
-
`${this.baseUrl}/query/image_generation?task_id=${data.task_id}`,
|
|
51
|
-
{ headers: { 'Authorization': `Bearer ${this.apiKey}` } }
|
|
52
|
-
);
|
|
53
|
-
const status = await statusRes.json() as {
|
|
54
|
-
status: string;
|
|
55
|
-
file_id?: string;
|
|
56
|
-
base_resp?: { status_msg: string };
|
|
57
|
-
};
|
|
58
|
-
|
|
59
|
-
if (status.status === 'Success' && status.file_id) {
|
|
60
|
-
const fileRes = await fetch(
|
|
61
|
-
`${this.baseUrl}/files/retrieve?file_id=${status.file_id}`,
|
|
62
|
-
{ headers: { 'Authorization': `Bearer ${this.apiKey}` } }
|
|
63
|
-
);
|
|
64
|
-
const fileData = await fileRes.json() as { file: { download_url: string } };
|
|
65
|
-
|
|
66
|
-
console.log('Image generated. Downloading...');
|
|
67
|
-
const imgRes = await fetch(fileData.file.download_url);
|
|
68
|
-
if (!imgRes.ok) throw new Error(`Download failed: ${imgRes.status}`);
|
|
69
|
-
return Buffer.from(await imgRes.arrayBuffer());
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
if (status.status === 'Fail') {
|
|
73
|
-
throw new Error(`Image generation failed: ${status.base_resp?.status_msg || 'Unknown'}`);
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
throw new Error('Image generation timed out');
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
private sizeToAspectRatio(size?: string): string {
|
|
81
|
-
if (!size) return '1:1';
|
|
82
|
-
const map: Record<string, string> = {
|
|
83
|
-
'1024x1024': '1:1',
|
|
84
|
-
'1792x1024': '16:9',
|
|
85
|
-
'1024x1792': '9:16',
|
|
86
|
-
'1:1': '1:1',
|
|
87
|
-
'16:9': '16:9',
|
|
88
|
-
'9:16': '9:16',
|
|
89
|
-
'4:3': '4:3',
|
|
90
|
-
'3:4': '3:4',
|
|
91
|
-
};
|
|
92
|
-
return map[size] || '1:1';
|
|
93
|
-
}
|
|
94
|
-
}
|
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
import type { ImageProvider, OpenAIImageResponse } from '../types';
|
|
2
|
-
|
|
3
|
-
export class OpenAIProvider implements ImageProvider {
|
|
4
|
-
private apiKey: string;
|
|
5
|
-
private baseUrl = 'https://api.openai.com/v1';
|
|
6
|
-
|
|
7
|
-
constructor(apiKey?: string) {
|
|
8
|
-
this.apiKey = apiKey || process.env.OPENAI_API_KEY || '';
|
|
9
|
-
if (!this.apiKey) {
|
|
10
|
-
throw new Error('OPENAI_API_KEY environment variable is required');
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
async generate(
|
|
15
|
-
prompt: string,
|
|
16
|
-
options?: {
|
|
17
|
-
model?: string;
|
|
18
|
-
size?: string;
|
|
19
|
-
}
|
|
20
|
-
): Promise<Buffer> {
|
|
21
|
-
const model = options?.model || 'dall-e-3';
|
|
22
|
-
const size = options?.size || '1024x1024';
|
|
23
|
-
|
|
24
|
-
// Validate size for DALL-E 3
|
|
25
|
-
const validSizes = ['1024x1024', '1792x1024', '1024x1792'];
|
|
26
|
-
if (!validSizes.includes(size)) {
|
|
27
|
-
throw new Error(
|
|
28
|
-
`Invalid size for DALL-E 3. Valid sizes: ${validSizes.join(', ')}`
|
|
29
|
-
);
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
console.log(`Generating image with OpenAI ${model}...`);
|
|
33
|
-
console.log(`Prompt: ${prompt}`);
|
|
34
|
-
console.log(`Size: ${size}`);
|
|
35
|
-
|
|
36
|
-
const response = await fetch(`${this.baseUrl}/images/generations`, {
|
|
37
|
-
method: 'POST',
|
|
38
|
-
headers: {
|
|
39
|
-
'Content-Type': 'application/json',
|
|
40
|
-
Authorization: `Bearer ${this.apiKey}`,
|
|
41
|
-
},
|
|
42
|
-
body: JSON.stringify({
|
|
43
|
-
model,
|
|
44
|
-
prompt,
|
|
45
|
-
n: 1,
|
|
46
|
-
size,
|
|
47
|
-
response_format: 'url',
|
|
48
|
-
}),
|
|
49
|
-
});
|
|
50
|
-
|
|
51
|
-
if (!response.ok) {
|
|
52
|
-
const error = await response.text();
|
|
53
|
-
throw new Error(`OpenAI API error: ${response.status} - ${error}`);
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
const data: OpenAIImageResponse = await response.json();
|
|
57
|
-
|
|
58
|
-
if (!data.data || data.data.length === 0 || !data.data[0].url) {
|
|
59
|
-
throw new Error('No image URL returned from OpenAI API');
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
const imageUrl = data.data[0].url;
|
|
63
|
-
console.log(`Image generated successfully!`);
|
|
64
|
-
|
|
65
|
-
if (data.data[0].revised_prompt) {
|
|
66
|
-
console.log(`Revised prompt: ${data.data[0].revised_prompt}`);
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
// Download the image
|
|
70
|
-
console.log('Downloading image...');
|
|
71
|
-
const imageResponse = await fetch(imageUrl);
|
|
72
|
-
|
|
73
|
-
if (!imageResponse.ok) {
|
|
74
|
-
throw new Error(`Failed to download image: ${imageResponse.status}`);
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
const arrayBuffer = await imageResponse.arrayBuffer();
|
|
78
|
-
return Buffer.from(arrayBuffer);
|
|
79
|
-
}
|
|
80
|
-
}
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
import type { ImageProvider, XAIImageResponse } from '../types';
|
|
2
|
-
|
|
3
|
-
export class XAIProvider implements ImageProvider {
|
|
4
|
-
private apiKey: string;
|
|
5
|
-
private baseUrl = 'https://api.x.ai/v1';
|
|
6
|
-
|
|
7
|
-
constructor(apiKey?: string) {
|
|
8
|
-
this.apiKey = apiKey || process.env.XAI_API_KEY || '';
|
|
9
|
-
if (!this.apiKey) {
|
|
10
|
-
throw new Error('XAI_API_KEY environment variable is required');
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
async generate(
|
|
15
|
-
prompt: string,
|
|
16
|
-
options?: {
|
|
17
|
-
model?: string;
|
|
18
|
-
size?: string;
|
|
19
|
-
}
|
|
20
|
-
): Promise<Buffer> {
|
|
21
|
-
const model = options?.model || 'grok-2-image-1212';
|
|
22
|
-
|
|
23
|
-
console.log(`Generating image with xAI ${model}...`);
|
|
24
|
-
console.log(`Prompt: ${prompt}`);
|
|
25
|
-
|
|
26
|
-
// xAI Grok-2 Image API endpoint (following OpenAI-compatible format)
|
|
27
|
-
const response = await fetch(`${this.baseUrl}/images/generations`, {
|
|
28
|
-
method: 'POST',
|
|
29
|
-
headers: {
|
|
30
|
-
'Content-Type': 'application/json',
|
|
31
|
-
Authorization: `Bearer ${this.apiKey}`,
|
|
32
|
-
},
|
|
33
|
-
body: JSON.stringify({
|
|
34
|
-
model,
|
|
35
|
-
prompt,
|
|
36
|
-
n: 1,
|
|
37
|
-
...(options?.size && { size: options.size }),
|
|
38
|
-
response_format: 'url',
|
|
39
|
-
}),
|
|
40
|
-
});
|
|
41
|
-
|
|
42
|
-
if (!response.ok) {
|
|
43
|
-
const error = await response.text();
|
|
44
|
-
throw new Error(`xAI API error: ${response.status} - ${error}`);
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
const data: XAIImageResponse = await response.json();
|
|
48
|
-
|
|
49
|
-
if (!data.data || data.data.length === 0) {
|
|
50
|
-
throw new Error('No image data returned from xAI API');
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
console.log('Image generated successfully!');
|
|
54
|
-
|
|
55
|
-
// Handle both URL and base64 responses
|
|
56
|
-
if (data.data[0].url) {
|
|
57
|
-
const imageUrl = data.data[0].url;
|
|
58
|
-
console.log('Downloading image...');
|
|
59
|
-
|
|
60
|
-
const imageResponse = await fetch(imageUrl);
|
|
61
|
-
if (!imageResponse.ok) {
|
|
62
|
-
throw new Error(`Failed to download image: ${imageResponse.status}`);
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
const arrayBuffer = await imageResponse.arrayBuffer();
|
|
66
|
-
return Buffer.from(arrayBuffer);
|
|
67
|
-
} else if (data.data[0].b64_json) {
|
|
68
|
-
return Buffer.from(data.data[0].b64_json, 'base64');
|
|
69
|
-
} else {
|
|
70
|
-
throw new Error('No image URL or base64 data in response');
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
}
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
export interface GenerateOptions {
|
|
2
|
-
provider: 'minimax' | 'openai' | 'google' | 'xai';
|
|
3
|
-
prompt: string;
|
|
4
|
-
output: string;
|
|
5
|
-
model?: string;
|
|
6
|
-
size?: string;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
export interface ImageProvider {
|
|
10
|
-
generate(prompt: string, options?: {
|
|
11
|
-
model?: string;
|
|
12
|
-
size?: string;
|
|
13
|
-
}): Promise<Buffer>;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
export interface OpenAIImageResponse {
|
|
17
|
-
created: number;
|
|
18
|
-
data: Array<{
|
|
19
|
-
url?: string;
|
|
20
|
-
b64_json?: string;
|
|
21
|
-
revised_prompt?: string;
|
|
22
|
-
}>;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
export interface GoogleImagenResponse {
|
|
26
|
-
predictions: Array<{
|
|
27
|
-
bytesBase64Encoded: string;
|
|
28
|
-
mimeType: string;
|
|
29
|
-
}>;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
export interface XAIImageResponse {
|
|
33
|
-
data: Array<{
|
|
34
|
-
url?: string;
|
|
35
|
-
b64_json?: string;
|
|
36
|
-
}>;
|
|
37
|
-
}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
# logo-design
|
|
2
|
-
|
|
3
|
-
AI logo design generator using the connectors REST API.
|
|
4
|
-
|
|
5
|
-
## Tech Stack
|
|
6
|
-
|
|
7
|
-
- Runtime: Bun
|
|
8
|
-
- Language: TypeScript
|
|
9
|
-
- CLI: Commander.js
|
|
10
|
-
- Backend: connectors REST API (plain fetch, no SDK dependency)
|
|
11
|
-
|
|
12
|
-
## CLI
|
|
13
|
-
|
|
14
|
-
```bash
|
|
15
|
-
logo-design generate <prompt> [options]
|
|
16
|
-
logo-design providers
|
|
17
|
-
logo-design tips
|
|
18
|
-
```
|
|
19
|
-
|
|
20
|
-
## Architecture
|
|
21
|
-
|
|
22
|
-
Calls the connectors REST API directly via `fetch()`:
|
|
23
|
-
- `POST /api/connectors/openai/operations/run` → `images generate` (gpt-image-1)
|
|
24
|
-
- `POST /api/connectors/googlegemini/operations/run` → `image generate` (Nano Banana)
|
|
25
|
-
|
|
26
|
-
The connectors server must be running on port 19426 (default).
|
|
27
|
-
|
|
28
|
-
## Environment
|
|
29
|
-
|
|
30
|
-
No direct API keys needed — keys are managed by the connectors server.
|