@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
package/dist/lib/pull.d.ts
CHANGED
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
import { type PortableSkillOptions } from "./portable-skills.js";
|
|
2
|
+
import { type SkillBundleEntry } from "./skill-bundle.js";
|
|
2
3
|
import type { SkillKind } from "./registry-types.js";
|
|
4
|
+
/** Header carrying the canonical content digest of the served bundle. */
|
|
5
|
+
export declare const BUNDLE_DIGEST_HEADER = "X-Skill-Bundle-Sha256";
|
|
6
|
+
/** Header carrying the HMAC signature of the served bundle, when the server can sign. */
|
|
7
|
+
export declare const BUNDLE_SIGNATURE_HEADER = "X-Skill-Bundle-Signature";
|
|
8
|
+
/** Header carrying the immutable revision identity of the served row (todos d061fcda). */
|
|
9
|
+
export declare const BUNDLE_REVISION_ID_HEADER = "X-Skill-Revision-Id";
|
|
10
|
+
/** Header carrying the per-slug write counter of the served row. */
|
|
11
|
+
export declare const BUNDLE_REVISION_NUMBER_HEADER = "X-Skill-Revision-Number";
|
|
12
|
+
/** Marker file written inside each corpus skill directory recording pull provenance. */
|
|
13
|
+
export declare const PULL_MARKER_FILE = ".hasna-skills.json";
|
|
3
14
|
/**
|
|
4
15
|
* The slice of RemoteSkillsClient that `pullSkills` needs. Narrowed to an interface so a
|
|
5
16
|
* test can inject a fake and the real HTTP client (which satisfies it structurally) is
|
|
@@ -9,6 +20,12 @@ export interface SkillPullClient {
|
|
|
9
20
|
listSkills(): Promise<unknown[]>;
|
|
10
21
|
getSkill(slug: string): Promise<unknown>;
|
|
11
22
|
getSkillMd(slug: string): Promise<string | null>;
|
|
23
|
+
/**
|
|
24
|
+
* The skill's bundle, headers intact, or null when the instance serves none.
|
|
25
|
+
* `Response` is the natural transport type here: verification reads the
|
|
26
|
+
* X-Skill-Bundle-Sha256 / X-Skill-Bundle-Signature headers off it.
|
|
27
|
+
*/
|
|
28
|
+
getBundle(slug: string): Promise<Response | null>;
|
|
12
29
|
}
|
|
13
30
|
export interface PullSkillsOptions extends PortableSkillOptions {
|
|
14
31
|
/** Explicit skill names to pull. Ignored when `all` is set. */
|
|
@@ -20,6 +37,8 @@ export interface PullSkillsOptions extends PortableSkillOptions {
|
|
|
20
37
|
* `null` models "no credential available" so the null-handling path stays testable.
|
|
21
38
|
*/
|
|
22
39
|
client?: SkillPullClient | null;
|
|
40
|
+
/** HMAC signing key for bundle signature verification. Defaults to $SKILLS_SIGNING_KEY. */
|
|
41
|
+
signingKey?: string;
|
|
23
42
|
}
|
|
24
43
|
export interface PulledSkillResult {
|
|
25
44
|
name: string;
|
|
@@ -27,8 +46,32 @@ export interface PulledSkillResult {
|
|
|
27
46
|
path?: string;
|
|
28
47
|
kind?: SkillKind;
|
|
29
48
|
version?: string;
|
|
49
|
+
/** Canonical content hash of the installed bundle, when one was verified. */
|
|
50
|
+
contentHash?: string;
|
|
51
|
+
/** Source commit recorded on the bundle, when the instance reported one. */
|
|
52
|
+
sourceCommit?: string;
|
|
30
53
|
/** True when the pull created the corpus entry, false when it updated an existing one. */
|
|
31
54
|
created?: boolean;
|
|
55
|
+
/**
|
|
56
|
+
* The revision id (todos d061fcda) this pull installed, when the instance reported one.
|
|
57
|
+
* Recorded in the marker so a later pull can detect that the remote moved on.
|
|
58
|
+
*/
|
|
59
|
+
revisionId?: string;
|
|
60
|
+
/** True when the instance answered 410: the slug was deleted and pull reconciled. */
|
|
61
|
+
tombstoned?: boolean;
|
|
62
|
+
/** With `tombstoned`: true when a local corpus entry existed and was removed. */
|
|
63
|
+
removed?: boolean;
|
|
64
|
+
/**
|
|
65
|
+
* With `tombstoned`: true when the local corpus entry was NOT pull-managed (no pull
|
|
66
|
+
* marker), so it was left in place — a remote 410 never deletes a user-created skill.
|
|
67
|
+
*/
|
|
68
|
+
leftInPlace?: boolean;
|
|
69
|
+
/**
|
|
70
|
+
* True when the instance no longer serves a published revision under this slug (its
|
|
71
|
+
* tombstone window expired) but the local copy is a revision-marked published install.
|
|
72
|
+
* Reported instead of silently swapping in a bundled skill of the same name.
|
|
73
|
+
*/
|
|
74
|
+
purged?: boolean;
|
|
32
75
|
error?: string;
|
|
33
76
|
}
|
|
34
77
|
export interface PullSkillsResult {
|
|
@@ -38,4 +81,58 @@ export declare class PullSkillError extends Error {
|
|
|
38
81
|
readonly detail?: string[] | undefined;
|
|
39
82
|
constructor(message: string, detail?: string[] | undefined);
|
|
40
83
|
}
|
|
84
|
+
export interface VerifiedBundle {
|
|
85
|
+
/** The received bundle bytes, owned by this process. */
|
|
86
|
+
bytes: Uint8Array;
|
|
87
|
+
/** Canonical sha256 of `bytes`. */
|
|
88
|
+
contentHash: string;
|
|
89
|
+
/** The server-declared digest, when the header was present. */
|
|
90
|
+
serverHash?: string;
|
|
91
|
+
/** The server-declared signature, when the header was present. */
|
|
92
|
+
signature?: string;
|
|
93
|
+
/** The server-declared revision id, when the header was present and well-formed. */
|
|
94
|
+
revisionId?: string;
|
|
95
|
+
/** The server-declared per-slug write counter, when the header was present. */
|
|
96
|
+
revisionNumber?: number;
|
|
97
|
+
}
|
|
41
98
|
export declare function pullSkills(options?: PullSkillsOptions): Promise<PullSkillsResult>;
|
|
99
|
+
/**
|
|
100
|
+
* The verification core, synchronous over already-buffered bytes: the digest header
|
|
101
|
+
* (when present) must equal the canonical sha256 of the received bytes, and the
|
|
102
|
+
* signature header (when present) must verify against the signing key when one is
|
|
103
|
+
* available — otherwise it is recorded with a warning, because a pull cannot check a
|
|
104
|
+
* signature it has no key for.
|
|
105
|
+
*/
|
|
106
|
+
export declare function verifyBundleResponseBytes(buffer: ArrayBuffer, response: Response, verify?: {
|
|
107
|
+
signingKey?: string;
|
|
108
|
+
}): VerifiedBundle;
|
|
109
|
+
/**
|
|
110
|
+
* Atomically replace the corpus entry for a verified bundle: stage every entry in a
|
|
111
|
+
* sibling directory, then rename into place (the existing entry is moved aside first
|
|
112
|
+
* and removed only after the staged tree is in position). A failure at any point leaves
|
|
113
|
+
* either the old entry or nothing — never a partial skill.
|
|
114
|
+
*/
|
|
115
|
+
export declare function installBundleAtomically(name: string, entries: SkillBundleEntry[], options?: PortableSkillOptions, marker?: {
|
|
116
|
+
version?: string;
|
|
117
|
+
contentHash?: string;
|
|
118
|
+
sourceCommit?: string;
|
|
119
|
+
signature?: string;
|
|
120
|
+
revisionId?: string;
|
|
121
|
+
}): {
|
|
122
|
+
path: string;
|
|
123
|
+
created: boolean;
|
|
124
|
+
};
|
|
125
|
+
/**
|
|
126
|
+
* Record what a pull installed. Version/hash/source-commit are the provenance a later
|
|
127
|
+
* `skills sync --check` or drift census needs; the signature is recorded when one was
|
|
128
|
+
* present so an audit can tell "verified" from "declared".
|
|
129
|
+
*/
|
|
130
|
+
export declare function writePullMarker(dir: string, record: {
|
|
131
|
+
skill: string;
|
|
132
|
+
version?: string;
|
|
133
|
+
contentHash?: string;
|
|
134
|
+
sourceCommit?: string;
|
|
135
|
+
signature?: string;
|
|
136
|
+
revisionId?: string;
|
|
137
|
+
source?: "pull" | "sync";
|
|
138
|
+
}): void;
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import { type PortableSkillOptions } from "./portable-skills.js";
|
|
2
|
+
import { RemoteSkillsClient } from "./remote-client.js";
|
|
3
|
+
export type ReconcileConflictPolicy = "local" | "remote" | "skip";
|
|
4
|
+
/**
|
|
5
|
+
* The default policy, named exactly as the plan specifies: when the digests are identical
|
|
6
|
+
* the local state wins by construction (nothing to resolve); every other divergence is
|
|
7
|
+
* skipped and reported unless --conflict says otherwise.
|
|
8
|
+
*/
|
|
9
|
+
export declare const DEFAULT_CONFLICT_POLICY: "local-wins-on-identical-digest-else-skip-and-report";
|
|
10
|
+
export declare const CONFLICT_POLICIES: readonly ReconcileConflictPolicy[];
|
|
11
|
+
/** Corpus-root cursor recording the last sync run. */
|
|
12
|
+
export declare const SYNC_CURSOR_FILE = ".sync-cursor.json";
|
|
13
|
+
export declare const SYNC_CURSOR_SCHEMA_VERSION: 1;
|
|
14
|
+
export interface ReconcileRegistryOptions extends PortableSkillOptions {
|
|
15
|
+
/** Push local-only, changed-locally, and conflicts won by local. */
|
|
16
|
+
push?: boolean;
|
|
17
|
+
/** Pull remote-only, changed-remotely, and conflicts won by remote. */
|
|
18
|
+
pull?: boolean;
|
|
19
|
+
/** Both directions (the default when neither --push nor --pull is given). */
|
|
20
|
+
all?: boolean;
|
|
21
|
+
/** Plan and report without writing anything. */
|
|
22
|
+
dryRun?: boolean;
|
|
23
|
+
/** Conflict resolution policy. */
|
|
24
|
+
conflict?: ReconcileConflictPolicy;
|
|
25
|
+
/** Client override. `undefined` resolves one from configuration; `null` models "no credential". */
|
|
26
|
+
client?: RemoteSkillsClient | null;
|
|
27
|
+
/** HMAC signing key for bundle signature verification. Defaults to $SKILLS_SIGNING_KEY. */
|
|
28
|
+
signingKey?: string;
|
|
29
|
+
}
|
|
30
|
+
export type ReconcileSkillState = "local-only" | "remote-only" | "changed-locally" | "changed-remotely" | "conflict" | "in-sync";
|
|
31
|
+
export type ReconcileAction = "push" | "pull" | "skip" | "none";
|
|
32
|
+
export interface ReconcileSkillEntry {
|
|
33
|
+
slug: string;
|
|
34
|
+
state: ReconcileSkillState;
|
|
35
|
+
action: ReconcileAction;
|
|
36
|
+
localVersion?: string;
|
|
37
|
+
remoteVersion?: string;
|
|
38
|
+
localSha256?: string;
|
|
39
|
+
remoteSha256?: string;
|
|
40
|
+
/** Why the entry was classified or skipped this way. */
|
|
41
|
+
reason?: string;
|
|
42
|
+
/** Present only for executed (non-dry-run) actions. */
|
|
43
|
+
result?: {
|
|
44
|
+
ok: boolean;
|
|
45
|
+
detail?: string;
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
export interface ReconcileSummary {
|
|
49
|
+
/** Skills found in the local corpus. */
|
|
50
|
+
local: number;
|
|
51
|
+
/** Skills the registry serves (published plus bundled). */
|
|
52
|
+
remote: number;
|
|
53
|
+
inSync: number;
|
|
54
|
+
pushed: number;
|
|
55
|
+
pulled: number;
|
|
56
|
+
/** Divergences the conflict policy had to resolve (or decline to resolve). */
|
|
57
|
+
conflicts: number;
|
|
58
|
+
/** Divergences skipped under the policy. */
|
|
59
|
+
skipped: number;
|
|
60
|
+
errors: number;
|
|
61
|
+
}
|
|
62
|
+
export interface ReconcileCursor {
|
|
63
|
+
schemaVersion: typeof SYNC_CURSOR_SCHEMA_VERSION;
|
|
64
|
+
managedBy: string;
|
|
65
|
+
lastSyncedAt: string;
|
|
66
|
+
runCount: number;
|
|
67
|
+
summary: ReconcileSummary;
|
|
68
|
+
}
|
|
69
|
+
export interface ReconcileRegistryResult {
|
|
70
|
+
corpusRoot: string;
|
|
71
|
+
/** True when a real run would first migrate the legacy corpus layout into place. */
|
|
72
|
+
migrationPending: boolean;
|
|
73
|
+
direction: "push" | "pull" | "all";
|
|
74
|
+
dryRun: boolean;
|
|
75
|
+
conflictPolicy: ReconcileConflictPolicy;
|
|
76
|
+
/** The full declared policy label; identical to conflictPolicy for local/remote. */
|
|
77
|
+
conflictPolicyDescription: string;
|
|
78
|
+
summary: ReconcileSummary;
|
|
79
|
+
skills: ReconcileSkillEntry[];
|
|
80
|
+
/** Present only when the run was real and completed without errors. */
|
|
81
|
+
cursor?: Pick<ReconcileCursor, "lastSyncedAt" | "runCount">;
|
|
82
|
+
}
|
|
83
|
+
export declare class ReconcileRegistryError extends Error {
|
|
84
|
+
readonly detail?: string[] | undefined;
|
|
85
|
+
constructor(message: string, detail?: string[] | undefined);
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* Re-check the local side of one pull candidate, immediately before the pull batch.
|
|
89
|
+
*
|
|
90
|
+
* Packs FIRST, then samples existence: a directory that appeared between the plan and
|
|
91
|
+
* the pack is provably on disk when the sample runs. Sampling before the pack let a
|
|
92
|
+
* concurrent editor's partial tree read as "still absent" — the pack then threw on it
|
|
93
|
+
* while the stale sample stayed false, so localMoved was false and the pull replaced
|
|
94
|
+
* the newly created directory (review P1). The ops seam exists so a test can pin that
|
|
95
|
+
* ordering deterministically: pack throws on the partial tree, the post-pack sample
|
|
96
|
+
* sees it, and the candidate counts as moved.
|
|
97
|
+
*
|
|
98
|
+
* Returns true when the local side moved since the plan: a digest different from the
|
|
99
|
+
* planned one, or a directory present where the plan saw none (a concurrent editor).
|
|
100
|
+
*/
|
|
101
|
+
export declare function recheckLocalSide(plannedLocal: string | undefined, localDir: string, ops?: {
|
|
102
|
+
pack: (dir: string) => string;
|
|
103
|
+
exists: (dir: string) => boolean;
|
|
104
|
+
}): boolean;
|
|
105
|
+
/**
|
|
106
|
+
* Run one sync pass.
|
|
107
|
+
*
|
|
108
|
+
* The plan (classification + per-skill action) is computed in full before anything is
|
|
109
|
+
* executed, and a dry run stops at the plan: no publish, no pull, no marker, no cursor —
|
|
110
|
+
* proven by readback in the tests. Every executed mutation re-checks both sides first
|
|
111
|
+
* (see the module header); a side that moved since the plan skips that skill and reports
|
|
112
|
+
* it rather than overwriting state the plan did not see.
|
|
113
|
+
*/
|
|
114
|
+
export declare function reconcileRegistry(options?: ReconcileRegistryOptions): Promise<ReconcileRegistryResult>;
|
package/dist/lib/registry.d.ts
CHANGED
|
@@ -9,12 +9,15 @@ export declare function isBasicSkillName(name: string): boolean;
|
|
|
9
9
|
export declare function findExtensionSkillPath(name: string): string | null;
|
|
10
10
|
/**
|
|
11
11
|
* Load the full registry: official skills merged with a configured private
|
|
12
|
-
* extension checkout and global custom skills from
|
|
13
|
-
*
|
|
12
|
+
* extension checkout and global custom skills from the canonical local corpus
|
|
13
|
+
* — <app folder>/installed/<name>/ before the owner-layout migration, <app
|
|
14
|
+
* folder>/skills/<name>/ after it (resolveCorpusRoot(), the one resolution
|
|
15
|
+
* every discovery path shares) — plus the legacy ~/.hasna/skills/custom/<name>/
|
|
16
|
+
* migration safety net.
|
|
14
17
|
*
|
|
15
18
|
* Custom skills take precedence over extensions, which take precedence over
|
|
16
|
-
* official skills. Extension skills are read in place and never copied into
|
|
17
|
-
* Results are cached for 5 seconds.
|
|
19
|
+
* official skills. Extension skills are read in place and never copied into the
|
|
20
|
+
* corpus. Results are cached for 5 seconds.
|
|
18
21
|
*/
|
|
19
22
|
export declare function loadRegistry(cwd?: string): SkillMeta[];
|
|
20
23
|
export declare function loadBasicRegistry(cwd?: string): SkillMeta[];
|
|
@@ -1,12 +1,83 @@
|
|
|
1
1
|
import { type RemoteSkillRunContract } from "./remote-run-contract.js";
|
|
2
|
+
/**
|
|
3
|
+
* A server that predates this client's pin/tag/incremental-sync routes answered
|
|
4
|
+
* 404/405 for them. The caller must never mistake that for "no pins" or "empty
|
|
5
|
+
* listing" — a silently-empty sync would look like success and drop nothing on
|
|
6
|
+
* the next push. This error is how the version-skew surfaces fail-closed.
|
|
7
|
+
*/
|
|
8
|
+
export declare class RemoteRouteUnsupportedError extends Error {
|
|
9
|
+
readonly path: string;
|
|
10
|
+
readonly status: number;
|
|
11
|
+
readonly instance: string;
|
|
12
|
+
constructor(path: string, status: number, instance: string);
|
|
13
|
+
}
|
|
14
|
+
/** Any other non-ok response on the new-route methods, with the status attached. */
|
|
15
|
+
export declare class RemoteRequestError extends Error {
|
|
16
|
+
readonly path: string;
|
|
17
|
+
readonly status: number;
|
|
18
|
+
constructor(path: string, status: number, statusText: string);
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* A remote pin on a skill, matching the hosted-pins wire shape
|
|
22
|
+
* (`{ slug, pinnedAt, metadata }`). `pinnedAt`/`metadata` are server-reported
|
|
23
|
+
* and may be absent.
|
|
24
|
+
*/
|
|
25
|
+
export interface RemotePin {
|
|
26
|
+
slug: string;
|
|
27
|
+
pinnedAt?: string;
|
|
28
|
+
metadata?: Record<string, unknown>;
|
|
29
|
+
}
|
|
30
|
+
/** The minimal per-skill row the pin/tag/updated-since routes serve. */
|
|
31
|
+
export interface RemoteSkillSummary {
|
|
32
|
+
slug: string;
|
|
33
|
+
name?: string;
|
|
34
|
+
version?: string;
|
|
35
|
+
updatedAt?: string;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* One page of an incremental listing. `nextCursor` is an opaque continuation
|
|
39
|
+
* token; null (or an absent field) means the listing is complete.
|
|
40
|
+
*/
|
|
41
|
+
export interface UpdatedSincePage {
|
|
42
|
+
skills: RemoteSkillSummary[];
|
|
43
|
+
nextCursor: string | null;
|
|
44
|
+
}
|
|
2
45
|
export declare class RemoteSkillsClient {
|
|
3
46
|
private apiUrl;
|
|
4
47
|
private apiKey;
|
|
5
48
|
constructor(apiKey: string, apiUrl?: string);
|
|
6
49
|
private request;
|
|
50
|
+
/**
|
|
51
|
+
* Fail-closed version-skew guard for the pin/tag/updated-since routes.
|
|
52
|
+
*
|
|
53
|
+
* A server that predates these routes answers 404 (unmatched path) or 405
|
|
54
|
+
* (unmatched method). Both are surfaced as `RemoteRouteUnsupportedError` —
|
|
55
|
+
* never as an empty listing, which would read as "no pins / no changes" and
|
|
56
|
+
* silently desynchronize the caller. Every other non-ok response becomes a
|
|
57
|
+
* `RemoteRequestError` carrying the status.
|
|
58
|
+
*
|
|
59
|
+
* `domainNotFoundCodes` is the one deliberate exception: a route the server
|
|
60
|
+
* DOES have can 404 for a domain reason (the hosted-pins DELETE answers
|
|
61
|
+
* `{ code: "PIN_NOT_FOUND" }` when no pin exists). A 404 whose JSON body
|
|
62
|
+
* carries one of those codes is returned to the caller (status intact) so it
|
|
63
|
+
* can apply domain semantics instead of misreporting version skew. Every
|
|
64
|
+
* other 404 — including the dispatcher's `{ code: "NOT_FOUND" }` on a route
|
|
65
|
+
* the server lacks — still throws `RemoteRouteUnsupportedError`.
|
|
66
|
+
*/
|
|
67
|
+
private requestNewRoute;
|
|
7
68
|
listSkills(): Promise<any[]>;
|
|
8
69
|
getSkillMd(slug: string): Promise<string | null>;
|
|
9
70
|
getSkill(slug: string): Promise<any | null>;
|
|
71
|
+
/**
|
|
72
|
+
* Raw GET for one skill, with the HTTP status surfaced. Used by the reconcile
|
|
73
|
+
* re-check (registry-reconcile.ts) so it can distinguish "no such skill" (404) from
|
|
74
|
+
* "the registry failed to answer" (any other non-success status) instead of treating
|
|
75
|
+
* both as absent.
|
|
76
|
+
*/
|
|
77
|
+
getSkillStatus(slug: string): Promise<{
|
|
78
|
+
status: number;
|
|
79
|
+
body: unknown;
|
|
80
|
+
}>;
|
|
10
81
|
submitRun(slug: string, input?: Record<string, unknown>, args?: string[]): Promise<RemoteSkillRunContract>;
|
|
11
82
|
getRun(runId: string): Promise<RemoteSkillRunContract | null>;
|
|
12
83
|
getRunLogs(runId: string): Promise<any[]>;
|
|
@@ -24,9 +95,61 @@ export declare class RemoteSkillsClient {
|
|
|
24
95
|
* Note the deliberate absence of `request()`: that helper pins
|
|
25
96
|
* `Content-Type: application/json`, and a multipart body whose Content-Type does not
|
|
26
97
|
* carry the generated boundary is unparseable at the other end.
|
|
98
|
+
*
|
|
99
|
+
* Optimistic concurrency (todos d061fcda): pass the revision id this client last read
|
|
100
|
+
* for the slug (from getSkill().revisionId) as `ifMatch`. The instance refuses a
|
|
101
|
+
* publish against a live slug that does not name its current revision with 409 — this
|
|
102
|
+
* is how a push never silently overwrites a newer remote revision.
|
|
27
103
|
*/
|
|
28
|
-
publishSkill(manifest: Record<string, unknown>, bundle?: Uint8Array): Promise<Response>;
|
|
104
|
+
publishSkill(manifest: Record<string, unknown>, bundle?: Uint8Array, ifMatch?: string): Promise<Response>;
|
|
29
105
|
deleteSkill(slug: string): Promise<Response>;
|
|
30
106
|
downloadSkillBundle(slug: string): Promise<Response>;
|
|
107
|
+
/**
|
|
108
|
+
* Bundle fetch for the verified-pull path. Returns the raw Response so the caller can
|
|
109
|
+
* read the X-Skill-Bundle-Sha256 / X-Skill-Bundle-Signature headers, or null when the
|
|
110
|
+
* instance serves no bundle for this skill (the metadata-only fallback path).
|
|
111
|
+
*/
|
|
112
|
+
getBundle(slug: string): Promise<Response | null>;
|
|
113
|
+
/** List the pins the instance holds for this principal. */
|
|
114
|
+
listPins(): Promise<RemotePin[]>;
|
|
115
|
+
/**
|
|
116
|
+
* Pin a skill on the instance (upsert — pinning again refreshes it). The
|
|
117
|
+
* wire contract matches the hosted-pins routes: a PUT with an optional
|
|
118
|
+
* `{ metadata }` body, answered with the stored pin (`slug`, `pinnedAt`,
|
|
119
|
+
* `metadata`).
|
|
120
|
+
*/
|
|
121
|
+
pin(slug: string, metadata?: Record<string, unknown>): Promise<RemotePin>;
|
|
122
|
+
/**
|
|
123
|
+
* Unpin a skill on the instance. Resolves true when a pin existed and was
|
|
124
|
+
* deleted; false when the instance has no pin for this slug (its 404
|
|
125
|
+
* carries `code: "PIN_NOT_FOUND"` — a domain answer, not version skew). A
|
|
126
|
+
* bare 404 (route not deployed) still throws `RemoteRouteUnsupportedError`.
|
|
127
|
+
*/
|
|
128
|
+
unpin(slug: string): Promise<boolean>;
|
|
129
|
+
/** List the tag names the instance serves. */
|
|
130
|
+
listTags(): Promise<string[]>;
|
|
131
|
+
/** List the skills carrying a tag on the instance. */
|
|
132
|
+
skillsByTag(tag: string): Promise<RemoteSkillSummary[]>;
|
|
133
|
+
/**
|
|
134
|
+
* Cursor-based incremental listing of skills updated after `since` (ISO 8601).
|
|
135
|
+
* Each page carries an opaque `nextCursor`; null means the listing is complete.
|
|
136
|
+
* This is the feed T9's sync reconciliation verb consumes.
|
|
137
|
+
*/
|
|
138
|
+
listUpdatedSince(since: string, options?: {
|
|
139
|
+
cursor?: string;
|
|
140
|
+
limit?: number;
|
|
141
|
+
}): Promise<UpdatedSincePage>;
|
|
31
142
|
}
|
|
32
143
|
export declare function createRemoteSkillsClient(): RemoteSkillsClient | null;
|
|
144
|
+
/**
|
|
145
|
+
* Write-free client resolution for read-only paths (e.g. `sync --dry-run`).
|
|
146
|
+
*
|
|
147
|
+
* createRemoteSkillsClient() resolves the stored credential through
|
|
148
|
+
* getAuthFilePath() and the stored origin through loadConfig() — both route
|
|
149
|
+
* through getDataDir(), which WRITES (mkdirs the app dir, merges legacy ~/.skills
|
|
150
|
+
* content, copies the legacy config). A dry run must resolve the same client a
|
|
151
|
+
* real run would without performing any of that: the credential and the origin
|
|
152
|
+
* are read from the same files at the same computed paths, and the MissingApiUrl
|
|
153
|
+
* failure mode is preserved (a key with no origin still fails loudly).
|
|
154
|
+
*/
|
|
155
|
+
export declare function createRemoteSkillsClientReadOnly(): RemoteSkillsClient | null;
|
|
@@ -19,4 +19,30 @@ export declare function buildSkillsApiUrl(apiUrl: string, endpoint?: string): st
|
|
|
19
19
|
export declare function parseRemoteRegistryPayload(payload: unknown): SkillMeta[];
|
|
20
20
|
export declare function parseRemoteSkillPayload(payload: unknown): SkillMeta;
|
|
21
21
|
export declare function loadRemoteRegistry(options?: RemoteRegistryOptions): Promise<SkillMeta[]>;
|
|
22
|
+
/**
|
|
23
|
+
* Merge the authenticated remote registry into a local listing, whenever the
|
|
24
|
+
* install is pointed at a hosted instance.
|
|
25
|
+
*
|
|
26
|
+
* This is the fail-closed (R1) default-read merge: a client configured with an
|
|
27
|
+
* origin sees the folder UNION cloud in the plain `list`/`search` path, while
|
|
28
|
+
* every other install keeps today's exact local behavior.
|
|
29
|
+
*
|
|
30
|
+
* - No origin configured -> the local list is returned unchanged and no
|
|
31
|
+
* request is attempted. An unconfigured install must stay byte-identical
|
|
32
|
+
* to the pre-merge output.
|
|
33
|
+
* - Origin configured but no credential -> the local list is returned
|
|
34
|
+
* unchanged and nothing throws. Auth-missing must never crash a read.
|
|
35
|
+
* - Origin + credential -> the remote registry is fetched and merged under
|
|
36
|
+
* the precedence in registry-merge.ts (custom > extension > private >
|
|
37
|
+
* private-hosted > remote > upstream > official), remote rows tagged
|
|
38
|
+
* `source: "remote"`.
|
|
39
|
+
* - A configured, authenticated read that FAILS (auth rejection, HTTP
|
|
40
|
+
* error, network failure) throws a clear error rather than silently
|
|
41
|
+
* returning the local half — a silent partial listing would report
|
|
42
|
+
* success for a union the caller asked to include.
|
|
43
|
+
*
|
|
44
|
+
* The explicit `--remote` path stays on loadRemoteRegistry(): an explicit
|
|
45
|
+
* request has always been fatal on failure, and that contract is unchanged.
|
|
46
|
+
*/
|
|
47
|
+
export declare function mergeRemoteRegistry(local: SkillMeta[], options?: RemoteRegistryOptions): Promise<SkillMeta[]>;
|
|
22
48
|
export declare function loadRemoteSkill(name: string, options?: RemoteRegistryOptions): Promise<SkillMeta>;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/** The row's content-addressed revision identity: a lowercase hex sha-256. */
|
|
2
|
+
export declare const REVISION_ID_PATTERN: RegExp;
|
|
3
|
+
export interface RevisionContent {
|
|
4
|
+
slug: string;
|
|
5
|
+
displayName: string;
|
|
6
|
+
description: string;
|
|
7
|
+
category: string;
|
|
8
|
+
tags: string[];
|
|
9
|
+
source: string;
|
|
10
|
+
kind: "executable" | "instruction";
|
|
11
|
+
version?: string;
|
|
12
|
+
skillMd?: string;
|
|
13
|
+
bundleSha256?: string;
|
|
14
|
+
bundleByteSize?: number;
|
|
15
|
+
}
|
|
16
|
+
export declare function revisionIdOf(content: RevisionContent): string;
|
|
17
|
+
export declare function revisionIdOfRecord(record: RevisionContent): string;
|
|
18
|
+
/**
|
|
19
|
+
* The legacy-row marker the 0004 migration leaves behind.
|
|
20
|
+
*
|
|
21
|
+
* Migration 0004 adds revision_id with DEFAULT '', so rows written before the migration
|
|
22
|
+
* carry an empty id. An empty id would make the If-Match guard vacuous for those rows:
|
|
23
|
+
* two clients that both read '' would both "match" and both land, silently overwriting
|
|
24
|
+
* each other. The stores replace the marker with a real content sha on first open
|
|
25
|
+
* (idempotent: new code always writes a full id, so the marker never reappears).
|
|
26
|
+
*/
|
|
27
|
+
export declare const LEGACY_REVISION_ID = "";
|
|
28
|
+
/** True when a revision id is the empty legacy marker (needs backfill). */
|
|
29
|
+
export declare function isLegacyRevisionId(value: string): boolean;
|
package/dist/lib/run-state.d.ts
CHANGED
|
@@ -19,6 +19,10 @@ export interface SkillRunRecord {
|
|
|
19
19
|
args: string[];
|
|
20
20
|
startedAt: string;
|
|
21
21
|
completedAt?: string;
|
|
22
|
+
/** Exit code of the skill child process, when one was observed. */
|
|
23
|
+
exitCode?: number;
|
|
24
|
+
/** Wall time between startedAt and completedAt, in milliseconds. */
|
|
25
|
+
durationMs?: number;
|
|
22
26
|
remote: boolean;
|
|
23
27
|
remoteRunId?: string;
|
|
24
28
|
costCents?: number;
|
|
@@ -51,6 +55,7 @@ export declare function completeSkillRun(context: SkillRunContext, patch: {
|
|
|
51
55
|
error?: string;
|
|
52
56
|
remoteRunId?: string;
|
|
53
57
|
costCents?: number;
|
|
58
|
+
exitCode?: number;
|
|
54
59
|
}): SkillRunRecord;
|
|
55
60
|
export declare function updateSkillRun(context: SkillRunContext, patch: Partial<SkillRunRecord>): SkillRunRecord;
|
|
56
61
|
export declare function writeRunLogs(context: SkillRunContext, stdout?: string, stderr?: string): void;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { type PackedSkillBundle } from "./skill-bundle.js";
|
|
2
|
+
/** Environment variable holding the HMAC signing key. Never logged, never printed. */
|
|
3
|
+
export declare const SKILLS_SIGNING_KEY_ENV = "SKILLS_SIGNING_KEY";
|
|
4
|
+
/** Environment variable naming the source commit the bundle was built from. */
|
|
5
|
+
export declare const SKILLS_SOURCE_COMMIT_ENV = "SKILLS_SOURCE_COMMIT";
|
|
6
|
+
/** Prefix of the signature string. The remainder is lowercase hex. */
|
|
7
|
+
export declare const SIGNATURE_PREFIX = "hmac-sha256:";
|
|
8
|
+
export interface SkillBundleManifest {
|
|
9
|
+
name: string;
|
|
10
|
+
version: string;
|
|
11
|
+
source_commit: string;
|
|
12
|
+
/** Canonical sha256 of the bundle bytes (the skill's content address). */
|
|
13
|
+
content_hash: string;
|
|
14
|
+
/** `hmac-sha256:<hex>` over the bundle bytes. Omitted when no key is available. */
|
|
15
|
+
signature?: string;
|
|
16
|
+
published_at: string;
|
|
17
|
+
}
|
|
18
|
+
export interface BuildSkillBundleOptions {
|
|
19
|
+
name: string;
|
|
20
|
+
/** The skill directory to pack. */
|
|
21
|
+
dir: string;
|
|
22
|
+
version: string;
|
|
23
|
+
/** Source commit the skill came from. `unknown` when the provenance is unavailable. */
|
|
24
|
+
sourceCommit: string;
|
|
25
|
+
/** Signing key. Defaults to reading process.env[SKILLS_SIGNING_KEY_ENV]. */
|
|
26
|
+
signingKey?: string;
|
|
27
|
+
/** Explicit published_at. Defaults to now. Tests only. */
|
|
28
|
+
publishedAt?: string;
|
|
29
|
+
}
|
|
30
|
+
export interface BuiltSkillBundle {
|
|
31
|
+
bundle: PackedSkillBundle;
|
|
32
|
+
manifest: SkillBundleManifest;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Resolve the signing key from the environment. Returns null when unset, and the
|
|
36
|
+
* caller decides how to behave (omit the signature, warn, or refuse) — this function
|
|
37
|
+
* never touches stdout, so nothing about the key can leak through it.
|
|
38
|
+
*/
|
|
39
|
+
export declare function resolveSigningKey(env?: Record<string, string | undefined>): string | null;
|
|
40
|
+
/** Sign canonical bundle bytes with an HMAC key. Returns `hmac-sha256:<hex>`. */
|
|
41
|
+
export declare function signBundleBytes(bytes: Uint8Array, key: string): string;
|
|
42
|
+
/**
|
|
43
|
+
* Verify a signature string against bundle bytes and a key. Returns true only for a
|
|
44
|
+
* well-formed `hmac-sha256:<hex>` signature computed over exactly these bytes.
|
|
45
|
+
* timingSafeEqual keeps the comparison from leaking a byte-at-a-time signal; the
|
|
46
|
+
* length check is a format check (a hex digest is a fixed length), not a leak.
|
|
47
|
+
*/
|
|
48
|
+
export declare function verifyBundleSignature(bytes: Uint8Array, signature: string, key: string): boolean;
|
|
49
|
+
/**
|
|
50
|
+
* Pack a skill directory and build its signed manifest in one call — the unit the CI
|
|
51
|
+
* bundle script, push, and pull all share, so a bundle built by CI and one pushed by
|
|
52
|
+
* a machine agree on the canonical content_hash by construction.
|
|
53
|
+
*/
|
|
54
|
+
export declare function buildSkillBundle(options: BuildSkillBundleOptions): BuiltSkillBundle;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { type PortableSkillManifest } from "./portable-skills-types.js";
|
|
2
|
+
import type { SkillValidationMessage } from "./skill-validation.js";
|
|
3
|
+
/**
|
|
4
|
+
* Field-level validator implementing the hasna.skill.v1 JSON Schema
|
|
5
|
+
* (schemas/skill.schema.json). Checks the portable manifest against the
|
|
6
|
+
* contract and verifies the self-referencing content_hash when a skill
|
|
7
|
+
* folder is available. Returns exact field errors with `contract.*` codes.
|
|
8
|
+
*
|
|
9
|
+
* The parity test (skill-contract.test.ts) asserts this validator and the
|
|
10
|
+
* schema file agree on required fields, runtime/sandbox enums, and the
|
|
11
|
+
* system-deps allowlist, so the two cannot drift apart silently.
|
|
12
|
+
*/
|
|
13
|
+
export declare const SEMVER_PATTERN = "^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(?:-((?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$";
|
|
14
|
+
export declare const CONTENT_HASH_PATTERN = "^[a-f0-9]{64}$";
|
|
15
|
+
export declare const ENV_REFERENCE_PATTERN = "^[A-Z0-9_]+$";
|
|
16
|
+
export declare const MAX_RUNTIME_TIMEOUT_SECONDS = 900;
|
|
17
|
+
export declare const DEFAULT_RUNTIME_TIMEOUT_SECONDS = 900;
|
|
18
|
+
export interface PortableContractOptions {
|
|
19
|
+
/**
|
|
20
|
+
* Whether the manifest is the full portable contract (a skill.json exists).
|
|
21
|
+
* When true, the runtime contract and content_hash are required; a manifest
|
|
22
|
+
* present without its integrity field is not portable. SKILL.md-only legacy
|
|
23
|
+
* skills stay under the relaxed rule.
|
|
24
|
+
*/
|
|
25
|
+
strict?: boolean;
|
|
26
|
+
/** Skill folder for content_hash verification. */
|
|
27
|
+
skillPath?: string;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Validate the portable manifest against the hasna.skill.v1 contract.
|
|
31
|
+
* Returns issues only; callers combine with existing directory validation.
|
|
32
|
+
*/
|
|
33
|
+
export declare function validatePortableManifestContract(manifest: PortableSkillManifest | undefined, options?: PortableContractOptions): SkillValidationMessage[];
|
|
34
|
+
/** Read a skill.json from disk and parse it, tolerating absence. */
|
|
35
|
+
export declare function readRawSkillJson(skillPath: string): Record<string, unknown> | undefined;
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import type { PortableSkillManifest } from "./portable-skills-types.js";
|
|
2
|
+
/**
|
|
3
|
+
* Canonical content hashing for the hasna.skill.v1 portable bundle.
|
|
4
|
+
*
|
|
5
|
+
* The hash covers the normalized skill bundle: skill.json (blank-canonicalized —
|
|
6
|
+
* its own `content_hash` field removed, keys sorted, line endings normalized)
|
|
7
|
+
* plus SKILL.md and every file under src/, scripts/, assets/, and references/,
|
|
8
|
+
* plus AGENTS.md, package.json, and tsconfig.json. Entries are sorted by
|
|
9
|
+
* relative path and hash-stable across platforms (posix separators, LF
|
|
10
|
+
* endings, sorted keys), so two checkouts of the same skill produce the same
|
|
11
|
+
* hash regardless of OS or editor.
|
|
12
|
+
*
|
|
13
|
+
* Excluded, mirroring the port/copy rules: node_modules, .git, dist, build,
|
|
14
|
+
* .turbo, dot-entries, and symlinks (symlinks are validation errors anyway).
|
|
15
|
+
*/
|
|
16
|
+
export declare const CONTENT_HASH_ALGORITHM = "sha256";
|
|
17
|
+
export declare const CONTENT_HASH_HEX_LENGTH = 64;
|
|
18
|
+
/** Normalize CRLF/CR to LF for hash stability across platforms. */
|
|
19
|
+
export declare function normalizeLineEndings(content: string): string;
|
|
20
|
+
/**
|
|
21
|
+
* Blank-canonicalize a skill.json manifest for hashing: parse it, drop the
|
|
22
|
+
* self-referencing `content_hash` field, and re-serialize with sorted keys so
|
|
23
|
+
* key order and the hash's own presence never change the digest.
|
|
24
|
+
*/
|
|
25
|
+
export declare function canonicalizeManifest(raw: string): string;
|
|
26
|
+
export interface BundleFile {
|
|
27
|
+
/** Posix relative path from the skill root, e.g. `scripts/setup.sh`. */
|
|
28
|
+
rel: string;
|
|
29
|
+
/** Normalized text content for text files; raw buffer for binary files. */
|
|
30
|
+
content: Uint8Array;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Collect the normalized bundle files for a skill folder, sorted by relative
|
|
34
|
+
* path. Only the documented coverage set is included.
|
|
35
|
+
*/
|
|
36
|
+
export declare function collectBundleFiles(skillPath: string): BundleFile[];
|
|
37
|
+
/**
|
|
38
|
+
* Compute the canonical content hash of a skill folder. Stable across
|
|
39
|
+
* platforms: sorted posix paths, LF line endings, canonicalized manifest.
|
|
40
|
+
*/
|
|
41
|
+
export declare function computeContentHash(skillPath: string): string;
|
|
42
|
+
export interface ContentHashVerification {
|
|
43
|
+
/** Whether the skill declares a content_hash at all. */
|
|
44
|
+
declared: boolean;
|
|
45
|
+
/** Whether the declared hash is present, well-formed, and matches the bundle. */
|
|
46
|
+
valid: boolean;
|
|
47
|
+
/** The declared value, if any. */
|
|
48
|
+
declaredHash?: string;
|
|
49
|
+
/** The recomputed hash over the current bundle. */
|
|
50
|
+
computedHash?: string;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Verify a skill folder's declared content_hash against the recomputed
|
|
54
|
+
* canonical hash of the current bundle. A missing declaration or a mismatch
|
|
55
|
+
* fails; a malformed declaration fails.
|
|
56
|
+
*/
|
|
57
|
+
export declare function verifyContentHash(skillPath: string, manifest?: PortableSkillManifest): ContentHashVerification;
|
|
58
|
+
/** Path sanity helper used by the contract validator: the skill folder exists. */
|
|
59
|
+
export declare function skillFolderExists(skillPath: string): boolean;
|
|
60
|
+
/**
|
|
61
|
+
* Canonical SKILL.md document hash for home-vs-corpus comparison.
|
|
62
|
+
*
|
|
63
|
+
* The bundle-wide hash above covers a whole skill folder; agent home
|
|
64
|
+
* directories carry only a SKILL.md, so the home comparison hashes exactly
|
|
65
|
+
* that one document. The normalization is the canonical one: LF line endings
|
|
66
|
+
* (LF-invariant, so the same document hashes identically across platforms),
|
|
67
|
+
* with the single agent-adaptation delta removed — `user_invocable` frontmatter
|
|
68
|
+
* lines, which `sync` injects for Claude and strips for every other agent.
|
|
69
|
+
* Two copies that differ only in those two ways hash identically, so an
|
|
70
|
+
* unmarked home copy that matches the canonical SKILL.md modulo adaptation is
|
|
71
|
+
* recognised as an exact match.
|
|
72
|
+
*/
|
|
73
|
+
export declare function canonicalAgentSkillMarkdown(content: string): string;
|
|
74
|
+
/** Canonical hash of a SKILL.md document (modulo LF endings and user_invocable). */
|
|
75
|
+
export declare function hashSkillMarkdown(content: string): string;
|
|
76
|
+
/** Canonical hash of the SKILL.md at `path`. */
|
|
77
|
+
export declare function hashSkillMarkdownFile(path: string): string;
|