@hasna/skills 0.1.62 → 0.1.64
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/README.md +38 -12
- package/bin/index.js +15743 -21709
- package/bin/mcp.js +3866 -11522
- package/bin/migrate.js +281 -35
- package/bin/server.js +5805 -2682
- package/bin/worker.js +5280 -2388
- package/dist/cli/commands/publish.d.ts +2 -0
- package/dist/cli/commands/registry-reconcile.d.ts +2 -0
- package/dist/cli/components/App.d.ts +2 -1
- package/dist/cli/components/CategorySelect.d.ts +2 -1
- package/dist/cli/components/Header.d.ts +2 -1
- package/dist/cli/components/InstallProgress.d.ts +2 -1
- package/dist/cli/components/SearchView.d.ts +2 -1
- package/dist/cli/components/SkillSelect.d.ts +2 -1
- package/dist/index.d.ts +5 -2
- package/dist/index.js +5386 -13739
- package/dist/lib/agent-sync.d.ts +61 -6
- package/dist/lib/auth-store.d.ts +37 -0
- package/dist/lib/config.d.ts +51 -0
- package/dist/lib/home-adoption.d.ts +91 -0
- package/dist/lib/home-census.d.ts +26 -0
- package/dist/lib/home-migration.d.ts +60 -0
- package/dist/lib/native-storage.d.ts +1 -1
- package/dist/lib/portable-skills-files.d.ts +21 -1
- package/dist/lib/portable-skills-types.d.ts +46 -0
- package/dist/lib/portable-skills.d.ts +35 -6
- package/dist/lib/pull.d.ts +97 -0
- package/dist/lib/registry-reconcile.d.ts +114 -0
- package/dist/lib/registry.d.ts +7 -4
- package/dist/lib/remote-client.d.ts +124 -1
- package/dist/lib/remote-registry.d.ts +26 -0
- package/dist/lib/revision.d.ts +29 -0
- package/dist/lib/run-state.d.ts +5 -0
- package/dist/lib/skill-bundles.d.ts +54 -0
- package/dist/lib/skill-contract.d.ts +35 -0
- package/dist/lib/skill-hash.d.ts +77 -0
- package/dist/sdk/cancel.d.ts +30 -0
- package/dist/sdk/dispatcher.d.ts +40 -0
- package/dist/sdk/event-sink.d.ts +2 -0
- package/dist/sdk/events.d.ts +79 -0
- package/dist/sdk/execution/admission.d.ts +44 -0
- package/dist/sdk/execution/dispatchers/e2b.d.ts +17 -0
- package/dist/sdk/execution/dispatchers/ecs.d.ts +151 -0
- package/dist/sdk/execution/image-profile.d.ts +73 -0
- package/dist/sdk/execution/index.d.ts +15 -0
- package/dist/sdk/execution/receipts.d.ts +44 -0
- package/dist/sdk/execution/state-machine.d.ts +38 -0
- package/dist/sdk/execution/storage.d.ts +158 -0
- package/dist/sdk/execution/types.d.ts +130 -0
- package/dist/sdk/executor.d.ts +17 -0
- package/dist/sdk/governance-store.d.ts +156 -0
- package/dist/sdk/governance.d.ts +92 -0
- package/dist/sdk/index.d.ts +26 -0
- package/dist/sdk/index.js +49728 -0
- package/dist/sdk/offline.d.ts +16 -0
- package/dist/sdk/outputs.d.ts +71 -0
- package/dist/sdk/registry.d.ts +28 -0
- package/dist/sdk/runs.d.ts +229 -0
- package/dist/sdk/server.d.ts +35 -0
- package/dist/sdk/spend.d.ts +36 -0
- package/dist/sdk/storage.d.ts +25 -0
- package/dist/server/app.d.ts +42 -0
- package/dist/server/artifact-storage.d.ts +102 -0
- package/dist/server/auth.d.ts +5 -0
- package/dist/server/config.d.ts +50 -0
- package/dist/server/database-url.d.ts +42 -0
- package/dist/server/handlers.d.ts +3 -0
- package/dist/server/index.d.ts +2 -0
- package/dist/server/migrate.d.ts +13 -0
- package/dist/server/migrations-dir.d.ts +18 -0
- package/dist/server/redaction.d.ts +1 -0
- package/dist/server/registry.d.ts +5 -0
- package/dist/server/rows.d.ts +24 -0
- package/dist/server/skills-api.d.ts +170 -0
- package/dist/server/sqlite-store.d.ts +131 -0
- package/dist/server/store-fixtures.d.ts +25 -0
- package/dist/server/store.d.ts +170 -0
- package/dist/server/types.d.ts +337 -0
- package/dist/server/worker.d.ts +4 -0
- package/dist/storage.js +39 -2
- package/docs/skill-standard.md +211 -39
- package/migrations/postgres/0003_run_outputs_governance.sql +83 -0
- package/migrations/postgres/0004_hosted_pins.sql +28 -0
- package/migrations/postgres/0005_revision_tombstone_registry.sql +37 -0
- package/migrations/postgres/0005_tag_projection.sql +36 -0
- package/migrations/sqlite/0003_run_outputs_governance.sql +58 -0
- package/migrations/sqlite/0004_hosted_pins.sql +21 -0
- package/migrations/sqlite/0005_revision_tombstone_registry.sql +18 -0
- package/migrations/sqlite/0005_tag_projection.sql +25 -0
- package/package.json +12 -8
- package/schemas/skill.schema.json +181 -0
- package/agent-skills/README.md +0 -41
- package/agent-skills/fleet-package-rollout/SKILL.md +0 -169
- package/agent-skills/inbox/SKILL.md +0 -25
- package/agent-skills/inbox/scripts/inbox +0 -109
- package/agent-skills/inbox/tests/test_registered_sender_id.sh +0 -92
- package/agent-skills/inbox-monitor/SKILL.md +0 -41
- package/agent-skills/inbox-monitor/scripts/inbox_monitor.sh +0 -91
- package/agent-skills/inbox-monitor/scripts/test_inbox_monitor.sh +0 -71
- package/agent-skills/merge-pr/SKILL.md +0 -85
- package/agent-skills/merge-pr/references/merge-safety.md +0 -82
- package/agent-skills/merge-pr/scripts/merge_pr_guard.py +0 -694
- package/agent-skills/merge-pr/scripts/test_merge_pr_guard.py +0 -647
- package/agent-skills/merge-pr/tests/fixtures/multi-commit-synthesized.json +0 -28
- package/agent-skills/merge-pr/tests/fixtures/trailer-free-provider.json +0 -28
- package/agent-skills/skill-goal-execute/SKILL.md +0 -115
- package/agent-skills/skill-login/SKILL.md +0 -109
- package/agent-skills/skill-project-create/SKILL.md +0 -91
- package/agent-skills/skill-publish/SKILL.md +0 -254
- package/agent-skills/skill-publish/scripts/capture_registry.js +0 -47
- package/agent-skills/skill-publish/scripts/publish_with_git_head.sh +0 -143
- package/agent-skills/skill-publish/scripts/test_publish_with_git_head.sh +0 -231
- package/skills/_common/auth.ts +0 -45
- package/skills/_common/http-client.ts +0 -143
- package/skills/_common/index.ts +0 -26
- package/skills/_common/install.sh +0 -7
- package/skills/_common/installer.ts +0 -72
- package/skills/_common/skill-install.ts +0 -37
- package/skills/_common/vision.ts +0 -374
- package/skills/ad-creative-pack/SKILL.md +0 -55
- package/skills/ad-creative-pack/package.json +0 -10
- package/skills/analyze-data/CLAUDE.md +0 -16
- package/skills/analyze-data/SKILL.md +0 -112
- package/skills/analyze-data/package.json +0 -23
- package/skills/analyze-data/src/analysis.ts +0 -401
- package/skills/analyze-data/src/cli.ts +0 -66
- package/skills/analyze-data/src/formatters.ts +0 -235
- package/skills/analyze-data/src/index.ts +0 -74
- package/skills/analyze-data/src/logger.ts +0 -36
- package/skills/analyze-data/src/parsers.ts +0 -57
- package/skills/analyze-data/src/stats.ts +0 -151
- package/skills/analyze-data/src/types.ts +0 -85
- package/skills/analyze-data/tsconfig.json +0 -19
- package/skills/api-docs-portal/SKILL.md +0 -84
- package/skills/api-docs-portal/package.json +0 -35
- package/skills/api-docs-portal/src/index.ts +0 -919
- package/skills/api-docs-portal/tsconfig.json +0 -17
- package/skills/api-test-suite/CLAUDE.md +0 -19
- package/skills/api-test-suite/package.json +0 -27
- package/skills/api-test-suite/src/index.ts +0 -381
- package/skills/api-test-suite/tsconfig.json +0 -10
- package/skills/audio-extract/CLAUDE.md +0 -9
- package/skills/audio-extract/SKILL.md +0 -73
- package/skills/audio-extract/package.json +0 -23
- package/skills/audio-extract/src/index.ts +0 -323
- package/skills/audio-extract/tsconfig.json +0 -11
- package/skills/bio-sequence-tool/CLAUDE.md +0 -19
- package/skills/bio-sequence-tool/package.json +0 -27
- package/skills/bio-sequence-tool/src/index.ts +0 -85
- package/skills/bio-sequence-tool/tsconfig.json +0 -10
- package/skills/blog-article/CLAUDE.md +0 -12
- package/skills/blog-article/SKILL.md +0 -55
- package/skills/blog-article/package.json +0 -10
- package/skills/blog-article/tsconfig.json +0 -10
- package/skills/brand-assets/SKILL.md +0 -118
- package/skills/brand-assets/package.json +0 -35
- package/skills/brand-assets/src/cli.ts +0 -155
- package/skills/brand-assets/src/constants.ts +0 -8
- package/skills/brand-assets/src/extract.ts +0 -236
- package/skills/brand-assets/src/index.ts +0 -668
- package/skills/brand-assets/src/types.ts +0 -59
- package/skills/brand-assets/tsconfig.json +0 -17
- package/skills/brand-kit/SKILL.md +0 -54
- package/skills/brand-kit/package.json +0 -10
- package/skills/businessactivity/CLAUDE.md +0 -176
- package/skills/businessactivity/LICENSE +0 -192
- package/skills/businessactivity/README.md +0 -287
- package/skills/businessactivity/package.json +0 -25
- package/skills/businessactivity/scripts/publish.ts +0 -210
- package/skills/businessactivity/src/commands/activity.ts +0 -211
- package/skills/businessactivity/src/commands/function.ts +0 -227
- package/skills/businessactivity/src/commands/owner.ts +0 -193
- package/skills/businessactivity/src/commands/profile.ts +0 -121
- package/skills/businessactivity/src/commands/responsibility.ts +0 -264
- package/skills/businessactivity/src/commands/team.ts +0 -244
- package/skills/businessactivity/src/commands/workflow.ts +0 -359
- package/skills/businessactivity/src/index.ts +0 -3
- package/skills/businessactivity/src/lib/config.ts +0 -167
- package/skills/businessactivity/src/lib/output.ts +0 -76
- package/skills/businessactivity/src/lib/paths.ts +0 -79
- package/skills/businessactivity/src/lib/storage.ts +0 -95
- package/skills/businessactivity/src/types/index.ts +0 -86
- package/skills/businessactivity/tsconfig.json +0 -29
- package/skills/codefix/LICENSE +0 -192
- package/skills/codefix/README.md +0 -232
- package/skills/codefix/SKILL.md +0 -94
- package/skills/codefix/package.json +0 -21
- package/skills/codefix/src/fixers/batch.ts +0 -213
- package/skills/codefix/src/fixers/detector.ts +0 -160
- package/skills/codefix/src/fixers/index.ts +0 -7
- package/skills/codefix/src/fixers/runner.ts +0 -522
- package/skills/codefix/src/index-local.ts +0 -431
- package/skills/codefix/src/index.ts +0 -4
- package/skills/codefix/src/types.ts +0 -211
- package/skills/codefix/tsconfig.json +0 -15
- package/skills/commitpush/SKILL.md +0 -57
- package/skills/commitpush/package.json +0 -33
- package/skills/commitpush/src/index.ts +0 -34
- package/skills/commitpush/tsconfig.json +0 -17
- package/skills/commitpushpr/SKILL.md +0 -55
- package/skills/commitpushpr/package.json +0 -33
- package/skills/commitpushpr/src/index.ts +0 -34
- package/skills/commitpushpr/tsconfig.json +0 -17
- package/skills/compress-video/CLAUDE.md +0 -9
- package/skills/compress-video/SKILL.md +0 -79
- package/skills/compress-video/package.json +0 -23
- package/skills/compress-video/src/index.ts +0 -473
- package/skills/compress-video/tsconfig.json +0 -11
- package/skills/contract-review-report/SKILL.md +0 -52
- package/skills/contract-review-report/package.json +0 -10
- package/skills/customer-feedback-report/SKILL.md +0 -52
- package/skills/customer-feedback-report/package.json +0 -10
- package/skills/dashboard-builder/CLAUDE.md +0 -19
- package/skills/dashboard-builder/package.json +0 -29
- package/skills/dashboard-builder/src/index.ts +0 -150
- package/skills/dashboard-builder/tsconfig.json +0 -10
- package/skills/data-anonymizer/CLAUDE.md +0 -19
- package/skills/data-anonymizer/package.json +0 -27
- package/skills/data-anonymizer/src/index.ts +0 -183
- package/skills/data-anonymizer/tsconfig.json +0 -10
- package/skills/database-explorer/CLAUDE.md +0 -19
- package/skills/database-explorer/package.json +0 -29
- package/skills/database-explorer/src/index.ts +0 -95
- package/skills/database-explorer/tsconfig.json +0 -10
- package/skills/diff-viewer/CLAUDE.md +0 -19
- package/skills/diff-viewer/package.json +0 -30
- package/skills/diff-viewer/src/index.ts +0 -164
- package/skills/diff-viewer/tsconfig.json +0 -10
- package/skills/doc-read/SKILL.md +0 -45
- package/skills/doc-read/package.json +0 -29
- package/skills/doc-read/src/index.ts +0 -324
- package/skills/doc-read/tsconfig.json +0 -8
- package/skills/domainpurchase/LICENSE +0 -192
- package/skills/domainpurchase/SKILL.md +0 -29
- package/skills/domainpurchase/package.json +0 -30
- package/skills/domainpurchase/src/index.ts +0 -3
- package/skills/domainpurchase/tsconfig.json +0 -21
- package/skills/email-sequence/SKILL.md +0 -53
- package/skills/email-sequence/package.json +0 -10
- package/skills/experiment-power-calculator/CLAUDE.md +0 -19
- package/skills/experiment-power-calculator/package.json +0 -29
- package/skills/experiment-power-calculator/src/index.ts +0 -86
- package/skills/experiment-power-calculator/tsconfig.json +0 -10
- package/skills/extract-frames/CLAUDE.md +0 -19
- package/skills/extract-frames/package.json +0 -27
- package/skills/extract-frames/src/index.ts +0 -616
- package/skills/extract-frames/tsconfig.json +0 -10
- package/skills/file-organizer/CLAUDE.md +0 -19
- package/skills/file-organizer/package.json +0 -27
- package/skills/file-organizer/src/index.ts +0 -91
- package/skills/file-organizer/tsconfig.json +0 -10
- package/skills/folder-tree/CLAUDE.md +0 -19
- package/skills/folder-tree/package.json +0 -29
- package/skills/folder-tree/src/index.ts +0 -568
- package/skills/folder-tree/tsconfig.json +0 -10
- package/skills/form-filler/CLAUDE.md +0 -19
- package/skills/form-filler/package.json +0 -29
- package/skills/form-filler/src/index.ts +0 -81
- package/skills/form-filler/tsconfig.json +0 -10
- package/skills/generate-api-client/CLAUDE.md +0 -19
- package/skills/generate-api-client/package.json +0 -29
- package/skills/generate-api-client/src/generator.ts +0 -47
- package/skills/generate-api-client/src/index.ts +0 -92
- package/skills/generate-api-client/src/logger.ts +0 -34
- package/skills/generate-api-client/src/python-generator.ts +0 -245
- package/skills/generate-api-client/src/spec-loader.ts +0 -48
- package/skills/generate-api-client/src/type-mappers.ts +0 -79
- package/skills/generate-api-client/src/types.ts +0 -76
- package/skills/generate-api-client/src/typescript-generator.ts +0 -247
- package/skills/generate-api-client/tsconfig.json +0 -10
- package/skills/generate-chart/CLAUDE.md +0 -19
- package/skills/generate-chart/package.json +0 -27
- package/skills/generate-chart/src/index.ts +0 -510
- package/skills/generate-chart/tsconfig.json +0 -10
- package/skills/generate-dockerfile/CLAUDE.md +0 -19
- package/skills/generate-dockerfile/package.json +0 -27
- package/skills/generate-dockerfile/src/cli.ts +0 -78
- package/skills/generate-dockerfile/src/dockerfile-templates.ts +0 -392
- package/skills/generate-dockerfile/src/index.ts +0 -81
- package/skills/generate-dockerfile/src/logger.ts +0 -30
- package/skills/generate-dockerfile/src/project-detection.ts +0 -68
- package/skills/generate-dockerfile/src/support-files.ts +0 -171
- package/skills/generate-dockerfile/src/types.ts +0 -29
- package/skills/generate-dockerfile/tsconfig.json +0 -10
- package/skills/generate-env/CLAUDE.md +0 -19
- package/skills/generate-env/package.json +0 -29
- package/skills/generate-env/src/cli.ts +0 -85
- package/skills/generate-env/src/detection.ts +0 -161
- package/skills/generate-env/src/env-data.ts +0 -66
- package/skills/generate-env/src/generators.ts +0 -240
- package/skills/generate-env/src/index.ts +0 -120
- package/skills/generate-env/src/runtime.ts +0 -30
- package/skills/generate-env/src/types.ts +0 -32
- package/skills/generate-env/tsconfig.json +0 -10
- package/skills/generate-favicon/CLAUDE.md +0 -19
- package/skills/generate-favicon/package.json +0 -29
- package/skills/generate-favicon/src/index.ts +0 -421
- package/skills/generate-favicon/tsconfig.json +0 -10
- package/skills/generate-qrcode/CLAUDE.md +0 -19
- package/skills/generate-qrcode/package.json +0 -30
- package/skills/generate-qrcode/src/index.ts +0 -584
- package/skills/generate-qrcode/tsconfig.json +0 -10
- package/skills/generate-resume/CLAUDE.md +0 -19
- package/skills/generate-resume/package.json +0 -27
- package/skills/generate-resume/src/cli.ts +0 -157
- package/skills/generate-resume/src/index.ts +0 -178
- package/skills/generate-resume/src/parsers.ts +0 -95
- package/skills/generate-resume/src/renderers.ts +0 -538
- package/skills/generate-resume/src/security.ts +0 -39
- package/skills/generate-resume/src/types.ts +0 -86
- package/skills/generate-resume/tsconfig.json +0 -10
- package/skills/generate-sitemap/CLAUDE.md +0 -19
- package/skills/generate-sitemap/package.json +0 -27
- package/skills/generate-sitemap/src/index.ts +0 -626
- package/skills/generate-sitemap/tsconfig.json +0 -10
- package/skills/gif-maker/CLAUDE.md +0 -19
- package/skills/gif-maker/package.json +0 -30
- package/skills/gif-maker/src/index.ts +0 -600
- package/skills/gif-maker/tsconfig.json +0 -10
- package/skills/hook/LICENSE +0 -192
- package/skills/hook/README.md +0 -74
- package/skills/hook/SKILL.md +0 -85
- package/skills/hook/bunfig.toml +0 -5
- package/skills/hook/package.json +0 -28
- package/skills/hook/src/commands/create.ts +0 -112
- package/skills/hook/src/commands/events.ts +0 -37
- package/skills/hook/src/commands/validate.ts +0 -117
- package/skills/hook/src/index.ts +0 -118
- package/skills/hook/src/templates/root.ts +0 -196
- package/skills/hook/src/templates/source.ts +0 -647
- package/skills/hook/tsconfig.json +0 -18
- package/skills/http-server/CLAUDE.md +0 -19
- package/skills/http-server/package.json +0 -29
- package/skills/http-server/src/index.ts +0 -51
- package/skills/http-server/tsconfig.json +0 -10
- package/skills/implementation/LICENSE +0 -192
- package/skills/implementation/README.md +0 -53
- package/skills/implementation/SKILL.md +0 -57
- package/skills/implementation/bunfig.toml +0 -5
- package/skills/implementation/package.json +0 -28
- package/skills/implementation/src/commands/create.ts +0 -187
- package/skills/implementation/src/index.ts +0 -62
- package/skills/implementation/tsconfig.json +0 -18
- package/skills/implementation-plan/CLAUDE.md +0 -19
- package/skills/implementation-plan/package.json +0 -29
- package/skills/implementation-plan/src/index.ts +0 -520
- package/skills/implementation-plan/tsconfig.json +0 -10
- package/skills/implementation-todo/CLAUDE.md +0 -19
- package/skills/implementation-todo/package.json +0 -29
- package/skills/implementation-todo/src/index.ts +0 -429
- package/skills/implementation-todo/tsconfig.json +0 -10
- package/skills/invoice/.env.example +0 -3
- package/skills/invoice/CLAUDE.md +0 -31
- package/skills/invoice/LICENSE +0 -192
- package/skills/invoice/README.md +0 -70
- package/skills/invoice/package.json +0 -26
- package/skills/invoice/src/commands/companies.ts +0 -202
- package/skills/invoice/src/commands/config.ts +0 -132
- package/skills/invoice/src/commands/generate.ts +0 -177
- package/skills/invoice/src/commands/invoices.ts +0 -218
- package/skills/invoice/src/index.ts +0 -3
- package/skills/invoice/src/lib/api.ts +0 -124
- package/skills/invoice/src/lib/storage.ts +0 -171
- package/skills/invoice/src/types/index.ts +0 -86
- package/skills/invoice/src/utils/logger.ts +0 -33
- package/skills/invoice/src/utils/paths.ts +0 -25
- package/skills/invoice/tsconfig.json +0 -23
- package/skills/invoice-reconciliation/SKILL.md +0 -98
- package/skills/invoice-reconciliation/package.json +0 -36
- package/skills/invoice-reconciliation/src/index.ts +0 -743
- package/skills/invoice-reconciliation/tsconfig.json +0 -17
- package/skills/landing-page-pack/SKILL.md +0 -55
- package/skills/landing-page-pack/package.json +0 -10
- package/skills/latex-table-generator/CLAUDE.md +0 -19
- package/skills/latex-table-generator/package.json +0 -29
- package/skills/latex-table-generator/src/index.ts +0 -113
- package/skills/latex-table-generator/tsconfig.json +0 -10
- package/skills/logo-design/SKILL.md +0 -94
- package/skills/logo-design/package.json +0 -35
- package/skills/logo-design/src/cli.ts +0 -132
- package/skills/logo-design/src/constants.ts +0 -5
- package/skills/logo-design/src/docs.ts +0 -102
- package/skills/logo-design/src/geometry.ts +0 -324
- package/skills/logo-design/src/index.ts +0 -212
- package/skills/logo-design/src/palette.ts +0 -258
- package/skills/logo-design/src/types.ts +0 -50
- package/skills/logo-design/tsconfig.json +0 -17
- package/skills/lorem-generator/CLAUDE.md +0 -19
- package/skills/lorem-generator/package.json +0 -29
- package/skills/lorem-generator/src/index.ts +0 -59
- package/skills/lorem-generator/tsconfig.json +0 -10
- package/skills/managemcp/CLAUDE.md +0 -14
- package/skills/managemcp/README.md +0 -24
- package/skills/managemcp/package.json +0 -16
- package/skills/managemcp/src/index.ts +0 -3
- package/skills/managemcp/tsconfig.json +0 -27
- package/skills/markdown-validator/CLAUDE.md +0 -19
- package/skills/markdown-validator/package.json +0 -29
- package/skills/markdown-validator/src/index.ts +0 -92
- package/skills/markdown-validator/tsconfig.json +0 -10
- package/skills/market-research-report/SKILL.md +0 -51
- package/skills/market-research-report/package.json +0 -10
- package/skills/meeting-pack/SKILL.md +0 -52
- package/skills/meeting-pack/package.json +0 -10
- package/skills/merge-pdfs/CLAUDE.md +0 -19
- package/skills/merge-pdfs/package.json +0 -31
- package/skills/merge-pdfs/src/index.ts +0 -427
- package/skills/merge-pdfs/tsconfig.json +0 -10
- package/skills/migration-plan-pack/SKILL.md +0 -56
- package/skills/migration-plan-pack/package.json +0 -10
- package/skills/monitor/SKILL.md +0 -69
- package/skills/monitor/package.json +0 -33
- package/skills/monitor/src/index.ts +0 -34
- package/skills/monitor/tsconfig.json +0 -17
- package/skills/one-page-website/SKILL.md +0 -128
- package/skills/one-page-website/package.json +0 -34
- package/skills/one-page-website/src/design.ts +0 -336
- package/skills/one-page-website/src/docs.ts +0 -159
- package/skills/one-page-website/src/index.ts +0 -357
- package/skills/one-page-website/src/page.ts +0 -340
- package/skills/one-page-website/src/styles.ts +0 -508
- package/skills/one-page-website/src/types.ts +0 -78
- package/skills/one-page-website/tsconfig.json +0 -17
- package/skills/pdf-generate/CLAUDE.md +0 -19
- package/skills/pdf-generate/SKILL.md +0 -86
- package/skills/pdf-generate/package.json +0 -21
- package/skills/pdf-generate/src/cli.ts +0 -162
- package/skills/pdf-generate/src/html.ts +0 -84
- package/skills/pdf-generate/src/index.ts +0 -62
- package/skills/pdf-generate/src/markdown.ts +0 -27
- package/skills/pdf-generate/src/pdf-writer.ts +0 -78
- package/skills/pdf-generate/src/runtime.ts +0 -34
- package/skills/pdf-generate/src/security.ts +0 -37
- package/skills/pdf-generate/src/templates.ts +0 -311
- package/skills/pdf-generate/src/types.ts +0 -28
- package/skills/pdf-generate/tsconfig.json +0 -16
- package/skills/pdf-to-dataset/SKILL.md +0 -88
- package/skills/pdf-to-dataset/package.json +0 -37
- package/skills/pdf-to-dataset/src/index.ts +0 -790
- package/skills/pdf-to-dataset/tsconfig.json +0 -17
- package/skills/pdf-to-markdown/SKILL.md +0 -81
- package/skills/pdf-to-markdown/package.json +0 -35
- package/skills/pdf-to-markdown/src/index.ts +0 -694
- package/skills/pdf-to-markdown/tsconfig.json +0 -17
- package/skills/performance-audit-report/SKILL.md +0 -49
- package/skills/performance-audit-report/package.json +0 -10
- package/skills/pitch-deck/SKILL.md +0 -51
- package/skills/pitch-deck/package.json +0 -10
- package/skills/product-mockup/SKILL.md +0 -107
- package/skills/product-mockup/package.json +0 -32
- package/skills/product-mockup/src/cli.ts +0 -150
- package/skills/product-mockup/src/design.ts +0 -151
- package/skills/product-mockup/src/docs.ts +0 -134
- package/skills/product-mockup/src/index.ts +0 -182
- package/skills/product-mockup/src/render.ts +0 -407
- package/skills/product-mockup/src/types.ts +0 -66
- package/skills/product-mockup/tsconfig.json +0 -17
- package/skills/proposal-pack/SKILL.md +0 -53
- package/skills/proposal-pack/package.json +0 -10
- package/skills/read-csv/SKILL.md +0 -62
- package/skills/read-csv/package.json +0 -37
- package/skills/read-csv/src/index.ts +0 -356
- package/skills/read-csv/tsconfig.json +0 -17
- package/skills/read-excel/SKILL.md +0 -64
- package/skills/read-excel/package.json +0 -36
- package/skills/read-excel/src/index.ts +0 -266
- package/skills/read-excel/tsconfig.json +0 -17
- package/skills/regex-tester/CLAUDE.md +0 -19
- package/skills/regex-tester/package.json +0 -27
- package/skills/regex-tester/src/index.ts +0 -183
- package/skills/regex-tester/tsconfig.json +0 -10
- package/skills/repo-onboarding-report/SKILL.md +0 -52
- package/skills/repo-onboarding-report/package.json +0 -10
- package/skills/scancommitpr/SKILL.md +0 -178
- package/skills/scancommitpr/package.json +0 -34
- package/skills/scancommitpr/src/index.ts +0 -44
- package/skills/scancommitpr/tsconfig.json +0 -13
- package/skills/scancommitpush/SKILL.md +0 -174
- package/skills/scancommitpush/package.json +0 -32
- package/skills/scancommitpush/src/index.ts +0 -44
- package/skills/scancommitpush/tsconfig.json +0 -13
- package/skills/scientific-figure-check/CLAUDE.md +0 -19
- package/skills/scientific-figure-check/package.json +0 -29
- package/skills/scientific-figure-check/src/index.ts +0 -83
- package/skills/scientific-figure-check/tsconfig.json +0 -10
- package/skills/security-audit/CLAUDE.md +0 -19
- package/skills/security-audit/package.json +0 -27
- package/skills/security-audit/src/index.ts +0 -145
- package/skills/security-audit/tsconfig.json +0 -10
- package/skills/security-audit-report/SKILL.md +0 -52
- package/skills/security-audit-report/package.json +0 -10
- package/skills/seo-content-pack/SKILL.md +0 -54
- package/skills/seo-content-pack/package.json +0 -10
- package/skills/siteanalyze/SKILL.md +0 -25
- package/skills/siteanalyze/package.json +0 -27
- package/skills/siteanalyze/src/index.ts +0 -592
- package/skills/slide-deck-generator/SKILL.md +0 -93
- package/skills/slide-deck-generator/package.json +0 -38
- package/skills/slide-deck-generator/src/cli.ts +0 -133
- package/skills/slide-deck-generator/src/index.ts +0 -148
- package/skills/slide-deck-generator/src/model.ts +0 -307
- package/skills/slide-deck-generator/src/pptx.ts +0 -143
- package/skills/slide-deck-generator/src/render.ts +0 -248
- package/skills/slide-deck-generator/src/types.ts +0 -114
- package/skills/slide-deck-generator/src/utils.ts +0 -53
- package/skills/slide-deck-generator/tsconfig.json +0 -17
- package/skills/social-content-calendar/SKILL.md +0 -54
- package/skills/social-content-calendar/package.json +0 -10
- package/skills/split-pdf/CLAUDE.md +0 -19
- package/skills/split-pdf/package.json +0 -30
- package/skills/split-pdf/src/index.ts +0 -301
- package/skills/split-pdf/tsconfig.json +0 -10
- package/skills/statistical-test-selector/CLAUDE.md +0 -19
- package/skills/statistical-test-selector/package.json +0 -27
- package/skills/statistical-test-selector/src/index.ts +0 -75
- package/skills/statistical-test-selector/tsconfig.json +0 -10
- package/skills/test-suite-generator/SKILL.md +0 -51
- package/skills/test-suite-generator/package.json +0 -10
- package/skills/tmux-session/SKILL.md +0 -109
- package/skills/tmux-session/package.json +0 -33
- package/skills/tmux-session/src/index.ts +0 -34
- package/skills/tmux-session/tsconfig.json +0 -17
- package/skills/todos-plan/SKILL.md +0 -363
- package/skills/todos-plan/agents/openai.yaml +0 -4
- package/skills/todos-plan/package.json +0 -9
- package/skills/todos-plan/src/index.ts +0 -68
- package/skills/tsconfig.base.json +0 -12
- package/skills/validate-config/CLAUDE.md +0 -19
- package/skills/validate-config/package.json +0 -29
- package/skills/validate-config/src/index.ts +0 -56
- package/skills/validate-config/tsconfig.json +0 -10
- package/skills/video-downloader/CLAUDE.md +0 -19
- package/skills/video-downloader/package.json +0 -29
- package/skills/video-downloader/src/index.ts +0 -561
- package/skills/video-downloader/tsconfig.json +0 -10
- package/skills/video-highlight-pack/SKILL.md +0 -54
- package/skills/video-highlight-pack/package.json +0 -10
- package/skills/watermark/CLAUDE.md +0 -19
- package/skills/watermark/package.json +0 -32
- package/skills/watermark/src/index.ts +0 -587
- package/skills/watermark/tsconfig.json +0 -10
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "gif-maker",
|
|
3
|
-
"version": "0.1.0",
|
|
4
|
-
"description": "Gif Maker skill",
|
|
5
|
-
"type": "module",
|
|
6
|
-
"bin": {
|
|
7
|
-
"gif-maker": "./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
|
-
"minimist": "^1.2.8",
|
|
16
|
-
"glob": "^11.1.0"
|
|
17
|
-
},
|
|
18
|
-
"devDependencies": {
|
|
19
|
-
"@types/bun": "latest",
|
|
20
|
-
"typescript": "^5.7.0"
|
|
21
|
-
},
|
|
22
|
-
"publishConfig": {
|
|
23
|
-
"access": "restricted",
|
|
24
|
-
"registry": "https://registry.npmjs.org/"
|
|
25
|
-
},
|
|
26
|
-
"files": [
|
|
27
|
-
"src",
|
|
28
|
-
"tsconfig.json"
|
|
29
|
-
]
|
|
30
|
-
}
|
|
@@ -1,600 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env bun
|
|
2
|
-
|
|
3
|
-
import { execFileSync, spawnSync } from "child_process";
|
|
4
|
-
import * as fs from "fs";
|
|
5
|
-
import * as path from "path";
|
|
6
|
-
import minimist from "minimist";
|
|
7
|
-
import { globSync } from "glob";
|
|
8
|
-
|
|
9
|
-
// Path validation to prevent command injection
|
|
10
|
-
const DANGEROUS_PATH_CHARS = /[;&|`$(){}[\]<>\\!*?'"]/;
|
|
11
|
-
|
|
12
|
-
function validatePath(inputPath: string): void {
|
|
13
|
-
if (DANGEROUS_PATH_CHARS.test(inputPath)) {
|
|
14
|
-
throw new Error(`Invalid characters in path: ${inputPath}. Paths cannot contain shell metacharacters.`);
|
|
15
|
-
}
|
|
16
|
-
// Resolve to absolute path and check for path traversal
|
|
17
|
-
const resolved = path.resolve(inputPath);
|
|
18
|
-
if (resolved.includes("..")) {
|
|
19
|
-
throw new Error(`Path traversal detected in: ${inputPath}`);
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
// Types
|
|
24
|
-
interface GifOptions {
|
|
25
|
-
output: string;
|
|
26
|
-
start: number;
|
|
27
|
-
duration: number | null;
|
|
28
|
-
end: number | null;
|
|
29
|
-
fps: number;
|
|
30
|
-
width: number | null;
|
|
31
|
-
height: number | null;
|
|
32
|
-
scale: number;
|
|
33
|
-
quality: "low" | "medium" | "high";
|
|
34
|
-
loop: number;
|
|
35
|
-
speed: number;
|
|
36
|
-
reverse: boolean;
|
|
37
|
-
bounce: boolean;
|
|
38
|
-
delay: number | null;
|
|
39
|
-
optimize: "none" | "balanced" | "aggressive";
|
|
40
|
-
dither: string;
|
|
41
|
-
colors: number;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
// Quality presets
|
|
45
|
-
const QUALITY_PRESETS = {
|
|
46
|
-
low: { fps: 8, colors: 64, dither: "none" },
|
|
47
|
-
medium: { fps: 12, colors: 128, dither: "sierra2_4a" },
|
|
48
|
-
high: { fps: 20, colors: 256, dither: "floyd_steinberg" },
|
|
49
|
-
};
|
|
50
|
-
|
|
51
|
-
// Parse command line arguments
|
|
52
|
-
const args = minimist(process.argv.slice(2), {
|
|
53
|
-
string: ["output", "quality", "optimize", "dither"],
|
|
54
|
-
boolean: ["reverse", "bounce", "help"],
|
|
55
|
-
default: {
|
|
56
|
-
output: "output.gif",
|
|
57
|
-
start: 0,
|
|
58
|
-
fps: 10,
|
|
59
|
-
scale: 1.0,
|
|
60
|
-
quality: "medium",
|
|
61
|
-
loop: 0,
|
|
62
|
-
speed: 1.0,
|
|
63
|
-
reverse: false,
|
|
64
|
-
bounce: false,
|
|
65
|
-
optimize: "balanced",
|
|
66
|
-
dither: "sierra2_4a",
|
|
67
|
-
colors: 256,
|
|
68
|
-
},
|
|
69
|
-
alias: {
|
|
70
|
-
o: "output",
|
|
71
|
-
q: "quality",
|
|
72
|
-
h: "help",
|
|
73
|
-
},
|
|
74
|
-
});
|
|
75
|
-
|
|
76
|
-
// Show help
|
|
77
|
-
if (args.help || args._.length === 0) {
|
|
78
|
-
console.log(`
|
|
79
|
-
GIF Maker - Create animated GIFs from videos or images
|
|
80
|
-
|
|
81
|
-
Usage:
|
|
82
|
-
skills run gif-maker -- <input> [options]
|
|
83
|
-
skills run gif-maker -- video.mp4 -o output.gif
|
|
84
|
-
skills run gif-maker -- *.png -o animation.gif
|
|
85
|
-
|
|
86
|
-
Options:
|
|
87
|
-
-o, --output <file> Output file path (default: output.gif)
|
|
88
|
-
--start <seconds> Start time for video (default: 0)
|
|
89
|
-
--duration <seconds> Duration to capture
|
|
90
|
-
--end <seconds> End time for video
|
|
91
|
-
--fps <number> Frames per second (default: 10)
|
|
92
|
-
--width <pixels> Output width (auto-scales height)
|
|
93
|
-
--height <pixels> Output height (auto-scales width)
|
|
94
|
-
--scale <factor> Scale factor (default: 1.0)
|
|
95
|
-
-q, --quality <preset> Quality: low, medium, high (default: medium)
|
|
96
|
-
--loop <count> Loop count, 0 = infinite (default: 0)
|
|
97
|
-
--speed <factor> Playback speed (default: 1.0)
|
|
98
|
-
--reverse Reverse playback
|
|
99
|
-
--bounce Play forward then reverse
|
|
100
|
-
--delay <ms> Frame delay in ms (images only)
|
|
101
|
-
--optimize <level> Optimization: none, balanced, aggressive
|
|
102
|
-
--dither <algorithm> Dithering: none, bayer, sierra2_4a, floyd_steinberg
|
|
103
|
-
--colors <number> Max colors 2-256 (default: 256)
|
|
104
|
-
-h, --help Show this help message
|
|
105
|
-
|
|
106
|
-
Examples:
|
|
107
|
-
skills run gif-maker -- video.mp4 -o demo.gif
|
|
108
|
-
skills run gif-maker -- video.mp4 --start 5 --duration 3 -o clip.gif
|
|
109
|
-
skills run gif-maker -- "frames/*.png" --fps 24 -o animation.gif
|
|
110
|
-
`);
|
|
111
|
-
process.exit(0);
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
// Check for FFmpeg
|
|
115
|
-
function checkFFmpeg(): boolean {
|
|
116
|
-
try {
|
|
117
|
-
execFileSync("ffmpeg", ["-version"], { stdio: "pipe" });
|
|
118
|
-
return true;
|
|
119
|
-
} catch {
|
|
120
|
-
return false;
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
if (!checkFFmpeg()) {
|
|
125
|
-
console.error("Error: FFmpeg is not installed or not in PATH");
|
|
126
|
-
console.error("Install FFmpeg:");
|
|
127
|
-
console.error(" macOS: brew install ffmpeg");
|
|
128
|
-
console.error(" Ubuntu: sudo apt install ffmpeg");
|
|
129
|
-
console.error(" Windows: winget install ffmpeg");
|
|
130
|
-
process.exit(1);
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
// Parse options
|
|
134
|
-
const options: GifOptions = {
|
|
135
|
-
output: args.output,
|
|
136
|
-
start: parseFloat(args.start) || 0,
|
|
137
|
-
duration: args.duration ? parseFloat(args.duration) : null,
|
|
138
|
-
end: args.end ? parseFloat(args.end) : null,
|
|
139
|
-
fps: parseInt(args.fps) || 10,
|
|
140
|
-
width: args.width ? parseInt(args.width) : null,
|
|
141
|
-
height: args.height ? parseInt(args.height) : null,
|
|
142
|
-
scale: parseFloat(args.scale) || 1.0,
|
|
143
|
-
quality: args.quality as GifOptions["quality"],
|
|
144
|
-
loop: parseInt(args.loop) ?? 0,
|
|
145
|
-
speed: parseFloat(args.speed) || 1.0,
|
|
146
|
-
reverse: args.reverse,
|
|
147
|
-
bounce: args.bounce,
|
|
148
|
-
delay: args.delay ? parseInt(args.delay) : null,
|
|
149
|
-
optimize: args.optimize as GifOptions["optimize"],
|
|
150
|
-
dither: args.dither,
|
|
151
|
-
colors: Math.min(256, Math.max(2, parseInt(args.colors) || 256)),
|
|
152
|
-
};
|
|
153
|
-
|
|
154
|
-
// Apply quality preset
|
|
155
|
-
if (options.quality && QUALITY_PRESETS[options.quality]) {
|
|
156
|
-
const preset = QUALITY_PRESETS[options.quality];
|
|
157
|
-
if (!args.fps) options.fps = preset.fps;
|
|
158
|
-
if (!args.colors) options.colors = preset.colors;
|
|
159
|
-
if (!args.dither) options.dither = preset.dither;
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
// Get input files
|
|
163
|
-
function getInputFiles(patterns: string[]): string[] {
|
|
164
|
-
const files: string[] = [];
|
|
165
|
-
|
|
166
|
-
for (const pattern of patterns) {
|
|
167
|
-
// Validate input pattern for dangerous characters before processing
|
|
168
|
-
// Allow glob wildcards in patterns but validate the base path
|
|
169
|
-
const hasGlob = pattern.includes("*") || pattern.includes("?");
|
|
170
|
-
|
|
171
|
-
// If it contains dangerous characters (other than glob wildcards), validate strictly
|
|
172
|
-
if (!hasGlob) {
|
|
173
|
-
validatePath(pattern);
|
|
174
|
-
} else {
|
|
175
|
-
// For glob patterns, check for command injection chars but allow * and ?
|
|
176
|
-
const DANGEROUS_CHARS_GLOB = /[;&|`$(){}[\]<>\\!'"]/;
|
|
177
|
-
if (DANGEROUS_CHARS_GLOB.test(pattern)) {
|
|
178
|
-
throw new Error(`Invalid characters in path: ${pattern}. Paths cannot contain shell metacharacters.`);
|
|
179
|
-
}
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
const matches = globSync(pattern);
|
|
183
|
-
if (matches.length > 0) {
|
|
184
|
-
// Validate all matched files
|
|
185
|
-
for (const match of matches) {
|
|
186
|
-
validatePath(match);
|
|
187
|
-
}
|
|
188
|
-
files.push(...matches);
|
|
189
|
-
} else if (fs.existsSync(pattern)) {
|
|
190
|
-
files.push(pattern);
|
|
191
|
-
}
|
|
192
|
-
}
|
|
193
|
-
|
|
194
|
-
return files.sort();
|
|
195
|
-
}
|
|
196
|
-
|
|
197
|
-
// Check if input is video or images
|
|
198
|
-
function isVideo(file: string): boolean {
|
|
199
|
-
const videoExtensions = [".mp4", ".mov", ".avi", ".mkv", ".webm", ".m4v", ".flv"];
|
|
200
|
-
return videoExtensions.includes(path.extname(file).toLowerCase());
|
|
201
|
-
}
|
|
202
|
-
|
|
203
|
-
// Get video duration (using execFileSync with array args for safety)
|
|
204
|
-
function getVideoDuration(file: string): number {
|
|
205
|
-
try {
|
|
206
|
-
const result = execFileSync("ffprobe", [
|
|
207
|
-
"-v", "error",
|
|
208
|
-
"-show_entries", "format=duration",
|
|
209
|
-
"-of", "default=noprint_wrappers=1:nokey=1",
|
|
210
|
-
file
|
|
211
|
-
], { encoding: "utf-8" });
|
|
212
|
-
return parseFloat(result.trim());
|
|
213
|
-
} catch {
|
|
214
|
-
return 0;
|
|
215
|
-
}
|
|
216
|
-
}
|
|
217
|
-
|
|
218
|
-
// Get video dimensions (using execFileSync with array args for safety)
|
|
219
|
-
function getVideoDimensions(file: string): { width: number; height: number } {
|
|
220
|
-
try {
|
|
221
|
-
const result = execFileSync("ffprobe", [
|
|
222
|
-
"-v", "error",
|
|
223
|
-
"-select_streams", "v:0",
|
|
224
|
-
"-show_entries", "stream=width,height",
|
|
225
|
-
"-of", "csv=s=x:p=0",
|
|
226
|
-
file
|
|
227
|
-
], { encoding: "utf-8" });
|
|
228
|
-
const [width, height] = result.trim().split("x").map(Number);
|
|
229
|
-
return { width, height };
|
|
230
|
-
} catch {
|
|
231
|
-
return { width: 0, height: 0 };
|
|
232
|
-
}
|
|
233
|
-
}
|
|
234
|
-
|
|
235
|
-
// Build FFmpeg filter for scaling
|
|
236
|
-
function buildScaleFilter(options: GifOptions, inputWidth: number, inputHeight: number): string {
|
|
237
|
-
let width = inputWidth;
|
|
238
|
-
let height = inputHeight;
|
|
239
|
-
|
|
240
|
-
if (options.width && options.height) {
|
|
241
|
-
width = options.width;
|
|
242
|
-
height = options.height;
|
|
243
|
-
} else if (options.width) {
|
|
244
|
-
width = options.width;
|
|
245
|
-
height = -1; // Auto
|
|
246
|
-
} else if (options.height) {
|
|
247
|
-
width = -1; // Auto
|
|
248
|
-
height = options.height;
|
|
249
|
-
} else if (options.scale !== 1.0) {
|
|
250
|
-
width = Math.round(inputWidth * options.scale);
|
|
251
|
-
height = Math.round(inputHeight * options.scale);
|
|
252
|
-
}
|
|
253
|
-
|
|
254
|
-
// Ensure even dimensions
|
|
255
|
-
if (width > 0) width = width % 2 === 0 ? width : width - 1;
|
|
256
|
-
if (height > 0) height = height % 2 === 0 ? height : height - 1;
|
|
257
|
-
|
|
258
|
-
return `scale=${width}:${height}:flags=lanczos`;
|
|
259
|
-
}
|
|
260
|
-
|
|
261
|
-
// Create GIF from video
|
|
262
|
-
async function createGifFromVideo(inputFile: string): Promise<void> {
|
|
263
|
-
console.log(`\nProcessing video: ${inputFile}`);
|
|
264
|
-
|
|
265
|
-
const duration = getVideoDuration(inputFile);
|
|
266
|
-
const { width: inputWidth, height: inputHeight } = getVideoDimensions(inputFile);
|
|
267
|
-
|
|
268
|
-
console.log(` - Duration: ${duration.toFixed(1)}s`);
|
|
269
|
-
console.log(` - Dimensions: ${inputWidth}x${inputHeight}`);
|
|
270
|
-
|
|
271
|
-
// Calculate actual duration to process
|
|
272
|
-
let startTime = options.start;
|
|
273
|
-
let endTime = options.end !== null ? options.end : duration;
|
|
274
|
-
let clipDuration = options.duration !== null ? options.duration : endTime - startTime;
|
|
275
|
-
|
|
276
|
-
if (startTime >= duration) {
|
|
277
|
-
console.error("Error: Start time exceeds video duration");
|
|
278
|
-
process.exit(1);
|
|
279
|
-
}
|
|
280
|
-
|
|
281
|
-
clipDuration = Math.min(clipDuration, duration - startTime);
|
|
282
|
-
|
|
283
|
-
console.log(` - Extracting: ${startTime}s to ${(startTime + clipDuration).toFixed(1)}s`);
|
|
284
|
-
|
|
285
|
-
// Build filter chain
|
|
286
|
-
const filters: string[] = [];
|
|
287
|
-
|
|
288
|
-
// Time trimming
|
|
289
|
-
const inputArgs: string[] = [];
|
|
290
|
-
if (startTime > 0) {
|
|
291
|
-
inputArgs.push("-ss", startTime.toString());
|
|
292
|
-
}
|
|
293
|
-
if (clipDuration) {
|
|
294
|
-
inputArgs.push("-t", clipDuration.toString());
|
|
295
|
-
}
|
|
296
|
-
|
|
297
|
-
// Speed adjustment
|
|
298
|
-
if (options.speed !== 1.0) {
|
|
299
|
-
const speedFactor = 1 / options.speed;
|
|
300
|
-
filters.push(`setpts=${speedFactor}*PTS`);
|
|
301
|
-
}
|
|
302
|
-
|
|
303
|
-
// Scale filter
|
|
304
|
-
const scaleFilter = buildScaleFilter(options, inputWidth, inputHeight);
|
|
305
|
-
filters.push(scaleFilter);
|
|
306
|
-
|
|
307
|
-
// FPS filter
|
|
308
|
-
filters.push(`fps=${options.fps}`);
|
|
309
|
-
|
|
310
|
-
// Reverse filter
|
|
311
|
-
if (options.reverse) {
|
|
312
|
-
filters.push("reverse");
|
|
313
|
-
}
|
|
314
|
-
|
|
315
|
-
// Create temp directory
|
|
316
|
-
const tempDir = process.env.SKILLS_OUTPUT_DIR || "/tmp";
|
|
317
|
-
const paletteFile = path.join(tempDir, `palette_${Date.now()}.png`);
|
|
318
|
-
|
|
319
|
-
// Build filter string
|
|
320
|
-
const filterString = filters.join(",");
|
|
321
|
-
|
|
322
|
-
// Two-pass encoding for better quality
|
|
323
|
-
console.log("\nGenerating optimized palette...");
|
|
324
|
-
|
|
325
|
-
// Pass 1: Generate palette (using spawnSync with array args for safety)
|
|
326
|
-
const paletteArgs = [
|
|
327
|
-
"-y",
|
|
328
|
-
...inputArgs,
|
|
329
|
-
"-i", inputFile,
|
|
330
|
-
"-vf", `${filterString},palettegen=max_colors=${options.colors}:stats_mode=diff`,
|
|
331
|
-
paletteFile,
|
|
332
|
-
];
|
|
333
|
-
|
|
334
|
-
try {
|
|
335
|
-
const result = spawnSync("ffmpeg", paletteArgs, { stdio: "pipe" });
|
|
336
|
-
if (result.error) throw result.error;
|
|
337
|
-
} catch (error: any) {
|
|
338
|
-
console.error("Error generating palette:", error.message);
|
|
339
|
-
process.exit(1);
|
|
340
|
-
}
|
|
341
|
-
|
|
342
|
-
console.log("Creating GIF...");
|
|
343
|
-
|
|
344
|
-
// Pass 2: Create GIF with palette (using spawnSync with array args for safety)
|
|
345
|
-
const ditherOption = options.dither === "none" ? "" : `:dither=${options.dither}`;
|
|
346
|
-
const gifArgs = [
|
|
347
|
-
"-y",
|
|
348
|
-
...inputArgs,
|
|
349
|
-
"-i", inputFile,
|
|
350
|
-
"-i", paletteFile,
|
|
351
|
-
"-lavfi", `${filterString} [x]; [x][1:v] paletteuse${ditherOption}`,
|
|
352
|
-
"-loop", options.loop.toString(),
|
|
353
|
-
options.output,
|
|
354
|
-
];
|
|
355
|
-
|
|
356
|
-
try {
|
|
357
|
-
const result = spawnSync("ffmpeg", gifArgs, { stdio: "pipe" });
|
|
358
|
-
if (result.error) throw result.error;
|
|
359
|
-
} catch (error: any) {
|
|
360
|
-
console.error("Error creating GIF:", error.message);
|
|
361
|
-
// Clean up palette
|
|
362
|
-
if (fs.existsSync(paletteFile)) fs.unlinkSync(paletteFile);
|
|
363
|
-
process.exit(1);
|
|
364
|
-
}
|
|
365
|
-
|
|
366
|
-
// Clean up palette
|
|
367
|
-
if (fs.existsSync(paletteFile)) fs.unlinkSync(paletteFile);
|
|
368
|
-
|
|
369
|
-
// Handle bounce effect (append reversed version)
|
|
370
|
-
if (options.bounce) {
|
|
371
|
-
console.log("Applying bounce effect...");
|
|
372
|
-
const tempGif = path.join(tempDir, `temp_bounce_${Date.now()}.gif`);
|
|
373
|
-
fs.renameSync(options.output, tempGif);
|
|
374
|
-
|
|
375
|
-
// Using spawnSync with array args for safety
|
|
376
|
-
const bounceArgs = [
|
|
377
|
-
"-y",
|
|
378
|
-
"-i", tempGif,
|
|
379
|
-
"-filter_complex", "[0:v]reverse[r];[0:v][r]concat=n=2:v=1:a=0",
|
|
380
|
-
"-loop", options.loop.toString(),
|
|
381
|
-
options.output,
|
|
382
|
-
];
|
|
383
|
-
|
|
384
|
-
try {
|
|
385
|
-
const result = spawnSync("ffmpeg", bounceArgs, { stdio: "pipe" });
|
|
386
|
-
if (result.error) throw result.error;
|
|
387
|
-
} catch {
|
|
388
|
-
// Restore original if bounce fails
|
|
389
|
-
fs.renameSync(tempGif, options.output);
|
|
390
|
-
}
|
|
391
|
-
|
|
392
|
-
if (fs.existsSync(tempGif)) fs.unlinkSync(tempGif);
|
|
393
|
-
}
|
|
394
|
-
|
|
395
|
-
// Optimize if requested (using spawnSync with array args for safety)
|
|
396
|
-
if (options.optimize === "aggressive") {
|
|
397
|
-
console.log("Optimizing...");
|
|
398
|
-
try {
|
|
399
|
-
// Try gifsicle if available
|
|
400
|
-
const result = spawnSync("gifsicle", [
|
|
401
|
-
"-O3",
|
|
402
|
-
"--colors", options.colors.toString(),
|
|
403
|
-
"-o", options.output,
|
|
404
|
-
options.output
|
|
405
|
-
], { stdio: "pipe" });
|
|
406
|
-
if (result.error) throw result.error;
|
|
407
|
-
} catch {
|
|
408
|
-
// gifsicle not available, skip
|
|
409
|
-
}
|
|
410
|
-
}
|
|
411
|
-
|
|
412
|
-
printSummary();
|
|
413
|
-
}
|
|
414
|
-
|
|
415
|
-
// Create GIF from images
|
|
416
|
-
async function createGifFromImages(imageFiles: string[]): Promise<void> {
|
|
417
|
-
console.log(`\nProcessing ${imageFiles.length} images...`);
|
|
418
|
-
|
|
419
|
-
// Get dimensions from first image
|
|
420
|
-
const firstImage = imageFiles[0];
|
|
421
|
-
const { width: inputWidth, height: inputHeight } = getVideoDimensions(firstImage);
|
|
422
|
-
|
|
423
|
-
// Calculate frame delay
|
|
424
|
-
const frameDelay = options.delay !== null ? options.delay / 1000 : 1 / options.fps;
|
|
425
|
-
|
|
426
|
-
// Create temp directory for ordered images
|
|
427
|
-
const tempDir = process.env.SKILLS_OUTPUT_DIR || "/tmp";
|
|
428
|
-
const listFile = path.join(tempDir, `filelist_${Date.now()}.txt`);
|
|
429
|
-
|
|
430
|
-
// Handle reverse
|
|
431
|
-
let orderedFiles = [...imageFiles];
|
|
432
|
-
if (options.reverse) {
|
|
433
|
-
orderedFiles.reverse();
|
|
434
|
-
}
|
|
435
|
-
|
|
436
|
-
// Handle bounce
|
|
437
|
-
if (options.bounce) {
|
|
438
|
-
const reversed = [...orderedFiles].reverse().slice(1, -1);
|
|
439
|
-
orderedFiles = [...orderedFiles, ...reversed];
|
|
440
|
-
}
|
|
441
|
-
|
|
442
|
-
// Create file list for FFmpeg
|
|
443
|
-
const fileListContent = orderedFiles
|
|
444
|
-
.map((f) => `file '${path.resolve(f)}'\nduration ${frameDelay}`)
|
|
445
|
-
.join("\n");
|
|
446
|
-
fs.writeFileSync(listFile, fileListContent);
|
|
447
|
-
|
|
448
|
-
// Build filter chain
|
|
449
|
-
const filters: string[] = [];
|
|
450
|
-
const scaleFilter = buildScaleFilter(options, inputWidth || 640, inputHeight || 480);
|
|
451
|
-
filters.push(scaleFilter);
|
|
452
|
-
filters.push(`fps=${options.fps}`);
|
|
453
|
-
|
|
454
|
-
const filterString = filters.join(",");
|
|
455
|
-
|
|
456
|
-
// Generate palette (using spawnSync with array args for safety)
|
|
457
|
-
console.log("Generating palette...");
|
|
458
|
-
const paletteFile = path.join(tempDir, `palette_${Date.now()}.png`);
|
|
459
|
-
|
|
460
|
-
const paletteArgs = [
|
|
461
|
-
"-y",
|
|
462
|
-
"-f", "concat",
|
|
463
|
-
"-safe", "0",
|
|
464
|
-
"-i", listFile,
|
|
465
|
-
"-vf", `${filterString},palettegen=max_colors=${options.colors}`,
|
|
466
|
-
paletteFile,
|
|
467
|
-
];
|
|
468
|
-
|
|
469
|
-
try {
|
|
470
|
-
const result = spawnSync("ffmpeg", paletteArgs, { stdio: "pipe" });
|
|
471
|
-
if (result.error) throw result.error;
|
|
472
|
-
} catch (error: any) {
|
|
473
|
-
console.error("Error generating palette");
|
|
474
|
-
fs.unlinkSync(listFile);
|
|
475
|
-
process.exit(1);
|
|
476
|
-
}
|
|
477
|
-
|
|
478
|
-
// Create GIF (using spawnSync with array args for safety)
|
|
479
|
-
console.log("Creating GIF...");
|
|
480
|
-
const ditherOption = options.dither === "none" ? "" : `:dither=${options.dither}`;
|
|
481
|
-
const gifArgs = [
|
|
482
|
-
"-y",
|
|
483
|
-
"-f", "concat",
|
|
484
|
-
"-safe", "0",
|
|
485
|
-
"-i", listFile,
|
|
486
|
-
"-i", paletteFile,
|
|
487
|
-
"-lavfi", `${filterString} [x]; [x][1:v] paletteuse${ditherOption}`,
|
|
488
|
-
"-loop", options.loop.toString(),
|
|
489
|
-
options.output,
|
|
490
|
-
];
|
|
491
|
-
|
|
492
|
-
try {
|
|
493
|
-
const result = spawnSync("ffmpeg", gifArgs, { stdio: "pipe" });
|
|
494
|
-
if (result.error) throw result.error;
|
|
495
|
-
} catch (error: any) {
|
|
496
|
-
console.error("Error creating GIF");
|
|
497
|
-
}
|
|
498
|
-
|
|
499
|
-
// Clean up
|
|
500
|
-
fs.unlinkSync(listFile);
|
|
501
|
-
if (fs.existsSync(paletteFile)) fs.unlinkSync(paletteFile);
|
|
502
|
-
|
|
503
|
-
printSummary();
|
|
504
|
-
}
|
|
505
|
-
|
|
506
|
-
// Print summary
|
|
507
|
-
function printSummary(): void {
|
|
508
|
-
if (!fs.existsSync(options.output)) {
|
|
509
|
-
console.error("\nError: Failed to create GIF");
|
|
510
|
-
process.exit(1);
|
|
511
|
-
}
|
|
512
|
-
|
|
513
|
-
const stats = fs.statSync(options.output);
|
|
514
|
-
const sizeMB = (stats.size / 1024 / 1024).toFixed(2);
|
|
515
|
-
|
|
516
|
-
// Get GIF info (using execFileSync with array args for safety)
|
|
517
|
-
let dimensions = "unknown";
|
|
518
|
-
let frames = "unknown";
|
|
519
|
-
try {
|
|
520
|
-
const info = execFileSync("ffprobe", [
|
|
521
|
-
"-v", "error",
|
|
522
|
-
"-select_streams", "v:0",
|
|
523
|
-
"-show_entries", "stream=width,height,nb_frames",
|
|
524
|
-
"-of", "csv=p=0",
|
|
525
|
-
options.output
|
|
526
|
-
], { encoding: "utf-8" });
|
|
527
|
-
const [width, height, frameCount] = info.trim().split(",");
|
|
528
|
-
dimensions = `${width}x${height}`;
|
|
529
|
-
frames = frameCount || "unknown";
|
|
530
|
-
} catch {
|
|
531
|
-
// Ignore
|
|
532
|
-
}
|
|
533
|
-
|
|
534
|
-
console.log(`\n${"=".repeat(50)}`);
|
|
535
|
-
console.log(`Created: ${options.output}`);
|
|
536
|
-
console.log("=".repeat(50));
|
|
537
|
-
console.log(` - Size: ${sizeMB} MB`);
|
|
538
|
-
console.log(` - Dimensions: ${dimensions}`);
|
|
539
|
-
console.log(` - Frames: ${frames}`);
|
|
540
|
-
console.log(` - FPS: ${options.fps}`);
|
|
541
|
-
console.log(` - Colors: ${options.colors}`);
|
|
542
|
-
console.log(` - Loop: ${options.loop === 0 ? "infinite" : options.loop}`);
|
|
543
|
-
console.log("");
|
|
544
|
-
}
|
|
545
|
-
|
|
546
|
-
// Main execution
|
|
547
|
-
async function main(): Promise<void> {
|
|
548
|
-
try {
|
|
549
|
-
// Validate output path first (before any processing)
|
|
550
|
-
try {
|
|
551
|
-
validatePath(options.output);
|
|
552
|
-
} catch (error: any) {
|
|
553
|
-
console.error(`Error: ${error.message}`);
|
|
554
|
-
process.exit(1);
|
|
555
|
-
}
|
|
556
|
-
|
|
557
|
-
// Get input files (includes validation inside)
|
|
558
|
-
let inputFiles: string[];
|
|
559
|
-
try {
|
|
560
|
-
inputFiles = getInputFiles(args._ as string[]);
|
|
561
|
-
} catch (error: any) {
|
|
562
|
-
console.error(`Error: ${error.message}`);
|
|
563
|
-
process.exit(1);
|
|
564
|
-
}
|
|
565
|
-
|
|
566
|
-
if (inputFiles.length === 0) {
|
|
567
|
-
console.error("Error: No input files found");
|
|
568
|
-
process.exit(1);
|
|
569
|
-
}
|
|
570
|
-
|
|
571
|
-
// Ensure output directory exists
|
|
572
|
-
const outputDir = path.dirname(options.output);
|
|
573
|
-
if (outputDir && !fs.existsSync(outputDir)) {
|
|
574
|
-
fs.mkdirSync(outputDir, { recursive: true });
|
|
575
|
-
}
|
|
576
|
-
|
|
577
|
-
// Determine if video or images
|
|
578
|
-
if (inputFiles.length === 1 && isVideo(inputFiles[0])) {
|
|
579
|
-
await createGifFromVideo(inputFiles[0]);
|
|
580
|
-
} else {
|
|
581
|
-
// Filter to only image files
|
|
582
|
-
const imageFiles = inputFiles.filter((f) => {
|
|
583
|
-
const ext = path.extname(f).toLowerCase();
|
|
584
|
-
return [".png", ".jpg", ".jpeg", ".webp", ".bmp", ".tiff"].includes(ext);
|
|
585
|
-
});
|
|
586
|
-
|
|
587
|
-
if (imageFiles.length === 0) {
|
|
588
|
-
console.error("Error: No valid image files found");
|
|
589
|
-
process.exit(1);
|
|
590
|
-
}
|
|
591
|
-
|
|
592
|
-
await createGifFromImages(imageFiles);
|
|
593
|
-
}
|
|
594
|
-
} catch (error: any) {
|
|
595
|
-
console.error(`Error: ${error.message}`);
|
|
596
|
-
process.exit(1);
|
|
597
|
-
}
|
|
598
|
-
}
|
|
599
|
-
|
|
600
|
-
main();
|