@skillsmith/cli 0.7.1 → 0.7.3
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/CHANGELOG.md +9 -0
- package/dist/.tsbuildinfo +1 -1
- package/dist/cli.js +44039 -0
- package/package.json +21 -11
- package/dist/src/commands/__meta__/telemetry-coverage.test.d.ts +0 -20
- package/dist/src/commands/__meta__/telemetry-coverage.test.d.ts.map +0 -1
- package/dist/src/commands/__meta__/telemetry-coverage.test.js +0 -118
- package/dist/src/commands/__meta__/telemetry-coverage.test.js.map +0 -1
- package/dist/src/commands/ab-test.d.ts +0 -29
- package/dist/src/commands/ab-test.d.ts.map +0 -1
- package/dist/src/commands/ab-test.js +0 -226
- package/dist/src/commands/ab-test.js.map +0 -1
- package/dist/src/commands/ab-test.test.d.ts +0 -7
- package/dist/src/commands/ab-test.test.d.ts.map +0 -1
- package/dist/src/commands/ab-test.test.js +0 -255
- package/dist/src/commands/ab-test.test.js.map +0 -1
- package/dist/src/commands/analyze.d.ts +0 -14
- package/dist/src/commands/analyze.d.ts.map +0 -1
- package/dist/src/commands/analyze.js +0 -191
- package/dist/src/commands/analyze.js.map +0 -1
- package/dist/src/commands/audit-collisions.d.ts +0 -68
- package/dist/src/commands/audit-collisions.d.ts.map +0 -1
- package/dist/src/commands/audit-collisions.js +0 -309
- package/dist/src/commands/audit-collisions.js.map +0 -1
- package/dist/src/commands/audit-sources.action.d.ts +0 -37
- package/dist/src/commands/audit-sources.action.d.ts.map +0 -1
- package/dist/src/commands/audit-sources.action.js +0 -321
- package/dist/src/commands/audit-sources.action.js.map +0 -1
- package/dist/src/commands/audit-sources.d.ts +0 -37
- package/dist/src/commands/audit-sources.d.ts.map +0 -1
- package/dist/src/commands/audit-sources.js +0 -55
- package/dist/src/commands/audit-sources.js.map +0 -1
- package/dist/src/commands/audit-sources.test.d.ts +0 -9
- package/dist/src/commands/audit-sources.test.d.ts.map +0 -1
- package/dist/src/commands/audit-sources.test.js +0 -228
- package/dist/src/commands/audit-sources.test.js.map +0 -1
- package/dist/src/commands/audit.d.ts +0 -40
- package/dist/src/commands/audit.d.ts.map +0 -1
- package/dist/src/commands/audit.js +0 -223
- package/dist/src/commands/audit.js.map +0 -1
- package/dist/src/commands/audit.test.d.ts +0 -8
- package/dist/src/commands/audit.test.d.ts.map +0 -1
- package/dist/src/commands/audit.test.js +0 -97
- package/dist/src/commands/audit.test.js.map +0 -1
- package/dist/src/commands/author/index.d.ts +0 -17
- package/dist/src/commands/author/index.d.ts.map +0 -1
- package/dist/src/commands/author/index.js +0 -21
- package/dist/src/commands/author/index.js.map +0 -1
- package/dist/src/commands/author/init.action.d.ts +0 -29
- package/dist/src/commands/author/init.action.d.ts.map +0 -1
- package/dist/src/commands/author/init.action.js +0 -131
- package/dist/src/commands/author/init.action.js.map +0 -1
- package/dist/src/commands/author/init.d.ts +0 -36
- package/dist/src/commands/author/init.d.ts.map +0 -1
- package/dist/src/commands/author/init.helpers.d.ts +0 -80
- package/dist/src/commands/author/init.helpers.d.ts.map +0 -1
- package/dist/src/commands/author/init.helpers.js +0 -107
- package/dist/src/commands/author/init.helpers.js.map +0 -1
- package/dist/src/commands/author/init.js +0 -320
- package/dist/src/commands/author/init.js.map +0 -1
- package/dist/src/commands/author/mcp-init.d.ts +0 -21
- package/dist/src/commands/author/mcp-init.d.ts.map +0 -1
- package/dist/src/commands/author/mcp-init.js +0 -202
- package/dist/src/commands/author/mcp-init.js.map +0 -1
- package/dist/src/commands/author/subagent.d.ts +0 -23
- package/dist/src/commands/author/subagent.d.ts.map +0 -1
- package/dist/src/commands/author/subagent.js +0 -174
- package/dist/src/commands/author/subagent.js.map +0 -1
- package/dist/src/commands/author/transform.d.ts +0 -23
- package/dist/src/commands/author/transform.d.ts.map +0 -1
- package/dist/src/commands/author/transform.js +0 -149
- package/dist/src/commands/author/transform.js.map +0 -1
- package/dist/src/commands/author/utils.d.ts +0 -27
- package/dist/src/commands/author/utils.d.ts.map +0 -1
- package/dist/src/commands/author/utils.js +0 -118
- package/dist/src/commands/author/utils.js.map +0 -1
- package/dist/src/commands/config.d.ts +0 -57
- package/dist/src/commands/config.d.ts.map +0 -1
- package/dist/src/commands/config.js +0 -226
- package/dist/src/commands/config.js.map +0 -1
- package/dist/src/commands/create.d.ts +0 -43
- package/dist/src/commands/create.d.ts.map +0 -1
- package/dist/src/commands/create.js +0 -336
- package/dist/src/commands/create.js.map +0 -1
- package/dist/src/commands/diff.d.ts +0 -21
- package/dist/src/commands/diff.d.ts.map +0 -1
- package/dist/src/commands/diff.js +0 -227
- package/dist/src/commands/diff.js.map +0 -1
- package/dist/src/commands/diff.test.d.ts +0 -6
- package/dist/src/commands/diff.test.d.ts.map +0 -1
- package/dist/src/commands/diff.test.js +0 -327
- package/dist/src/commands/diff.test.js.map +0 -1
- package/dist/src/commands/import-local.d.ts +0 -28
- package/dist/src/commands/import-local.d.ts.map +0 -1
- package/dist/src/commands/import-local.helpers.d.ts +0 -28
- package/dist/src/commands/import-local.helpers.d.ts.map +0 -1
- package/dist/src/commands/import-local.helpers.js +0 -166
- package/dist/src/commands/import-local.helpers.js.map +0 -1
- package/dist/src/commands/import-local.js +0 -273
- package/dist/src/commands/import-local.js.map +0 -1
- package/dist/src/commands/import-local.types.d.ts +0 -59
- package/dist/src/commands/import-local.types.d.ts.map +0 -1
- package/dist/src/commands/import-local.types.js +0 -2
- package/dist/src/commands/import-local.types.js.map +0 -1
- package/dist/src/commands/import.d.ts +0 -47
- package/dist/src/commands/import.d.ts.map +0 -1
- package/dist/src/commands/import.js +0 -314
- package/dist/src/commands/import.js.map +0 -1
- package/dist/src/commands/index.d.ts +0 -28
- package/dist/src/commands/index.d.ts.map +0 -1
- package/dist/src/commands/index.js +0 -50
- package/dist/src/commands/index.js.map +0 -1
- package/dist/src/commands/info.d.ts +0 -19
- package/dist/src/commands/info.d.ts.map +0 -1
- package/dist/src/commands/info.js +0 -110
- package/dist/src/commands/info.js.map +0 -1
- package/dist/src/commands/install-skill.d.ts +0 -16
- package/dist/src/commands/install-skill.d.ts.map +0 -1
- package/dist/src/commands/install-skill.js +0 -155
- package/dist/src/commands/install-skill.js.map +0 -1
- package/dist/src/commands/install.d.ts +0 -34
- package/dist/src/commands/install.d.ts.map +0 -1
- package/dist/src/commands/install.js +0 -311
- package/dist/src/commands/install.js.map +0 -1
- package/dist/src/commands/inventory.action.d.ts +0 -55
- package/dist/src/commands/inventory.action.d.ts.map +0 -1
- package/dist/src/commands/inventory.action.js +0 -179
- package/dist/src/commands/inventory.action.js.map +0 -1
- package/dist/src/commands/inventory.action.test.d.ts +0 -19
- package/dist/src/commands/inventory.action.test.d.ts.map +0 -1
- package/dist/src/commands/inventory.action.test.js +0 -371
- package/dist/src/commands/inventory.action.test.js.map +0 -1
- package/dist/src/commands/inventory.d.ts +0 -21
- package/dist/src/commands/inventory.d.ts.map +0 -1
- package/dist/src/commands/inventory.js +0 -42
- package/dist/src/commands/inventory.js.map +0 -1
- package/dist/src/commands/login.d.ts +0 -7
- package/dist/src/commands/login.d.ts.map +0 -1
- package/dist/src/commands/login.js +0 -323
- package/dist/src/commands/login.js.map +0 -1
- package/dist/src/commands/login.test-helpers.d.ts +0 -7
- package/dist/src/commands/login.test-helpers.d.ts.map +0 -1
- package/dist/src/commands/login.test-helpers.js +0 -44
- package/dist/src/commands/login.test-helpers.js.map +0 -1
- package/dist/src/commands/login.test.d.ts +0 -2
- package/dist/src/commands/login.test.d.ts.map +0 -1
- package/dist/src/commands/login.test.js +0 -387
- package/dist/src/commands/login.test.js.map +0 -1
- package/dist/src/commands/logout.d.ts +0 -15
- package/dist/src/commands/logout.d.ts.map +0 -1
- package/dist/src/commands/logout.js +0 -54
- package/dist/src/commands/logout.js.map +0 -1
- package/dist/src/commands/logout.test.d.ts +0 -8
- package/dist/src/commands/logout.test.d.ts.map +0 -1
- package/dist/src/commands/logout.test.js +0 -137
- package/dist/src/commands/logout.test.js.map +0 -1
- package/dist/src/commands/manage.d.ts +0 -19
- package/dist/src/commands/manage.d.ts.map +0 -1
- package/dist/src/commands/manage.js +0 -346
- package/dist/src/commands/manage.js.map +0 -1
- package/dist/src/commands/merge.d.ts +0 -24
- package/dist/src/commands/merge.d.ts.map +0 -1
- package/dist/src/commands/merge.js +0 -168
- package/dist/src/commands/merge.js.map +0 -1
- package/dist/src/commands/pin.d.ts +0 -26
- package/dist/src/commands/pin.d.ts.map +0 -1
- package/dist/src/commands/pin.js +0 -138
- package/dist/src/commands/pin.js.map +0 -1
- package/dist/src/commands/pin.test.d.ts +0 -6
- package/dist/src/commands/pin.test.d.ts.map +0 -1
- package/dist/src/commands/pin.test.js +0 -206
- package/dist/src/commands/pin.test.js.map +0 -1
- package/dist/src/commands/recommend-scoring.d.ts +0 -29
- package/dist/src/commands/recommend-scoring.d.ts.map +0 -1
- package/dist/src/commands/recommend-scoring.js +0 -141
- package/dist/src/commands/recommend-scoring.js.map +0 -1
- package/dist/src/commands/recommend.d.ts +0 -15
- package/dist/src/commands/recommend.d.ts.map +0 -1
- package/dist/src/commands/recommend.helpers.d.ts +0 -44
- package/dist/src/commands/recommend.helpers.d.ts.map +0 -1
- package/dist/src/commands/recommend.helpers.js +0 -303
- package/dist/src/commands/recommend.helpers.js.map +0 -1
- package/dist/src/commands/recommend.js +0 -198
- package/dist/src/commands/recommend.js.map +0 -1
- package/dist/src/commands/recommend.types.d.ts +0 -66
- package/dist/src/commands/recommend.types.d.ts.map +0 -1
- package/dist/src/commands/recommend.types.js +0 -14
- package/dist/src/commands/recommend.types.js.map +0 -1
- package/dist/src/commands/run-registry-sync.d.ts +0 -31
- package/dist/src/commands/run-registry-sync.d.ts.map +0 -1
- package/dist/src/commands/run-registry-sync.js +0 -45
- package/dist/src/commands/run-registry-sync.js.map +0 -1
- package/dist/src/commands/search-formatters.d.ts +0 -36
- package/dist/src/commands/search-formatters.d.ts.map +0 -1
- package/dist/src/commands/search-formatters.js +0 -132
- package/dist/src/commands/search-formatters.js.map +0 -1
- package/dist/src/commands/search-types.d.ts +0 -46
- package/dist/src/commands/search-types.d.ts.map +0 -1
- package/dist/src/commands/search-types.js +0 -12
- package/dist/src/commands/search-types.js.map +0 -1
- package/dist/src/commands/search.action.d.ts +0 -16
- package/dist/src/commands/search.action.d.ts.map +0 -1
- package/dist/src/commands/search.action.js +0 -384
- package/dist/src/commands/search.action.js.map +0 -1
- package/dist/src/commands/search.d.ts +0 -18
- package/dist/src/commands/search.d.ts.map +0 -1
- package/dist/src/commands/search.helpers.d.ts +0 -52
- package/dist/src/commands/search.helpers.d.ts.map +0 -1
- package/dist/src/commands/search.helpers.js +0 -95
- package/dist/src/commands/search.helpers.js.map +0 -1
- package/dist/src/commands/search.js +0 -48
- package/dist/src/commands/search.js.map +0 -1
- package/dist/src/commands/search.test.d.ts +0 -10
- package/dist/src/commands/search.test.d.ts.map +0 -1
- package/dist/src/commands/search.test.js +0 -179
- package/dist/src/commands/search.test.js.map +0 -1
- package/dist/src/commands/sync.action.d.ts +0 -39
- package/dist/src/commands/sync.action.d.ts.map +0 -1
- package/dist/src/commands/sync.action.js +0 -353
- package/dist/src/commands/sync.action.js.map +0 -1
- package/dist/src/commands/sync.d.ts +0 -24
- package/dist/src/commands/sync.d.ts.map +0 -1
- package/dist/src/commands/sync.helpers.d.ts +0 -55
- package/dist/src/commands/sync.helpers.d.ts.map +0 -1
- package/dist/src/commands/sync.helpers.js +0 -90
- package/dist/src/commands/sync.helpers.js.map +0 -1
- package/dist/src/commands/sync.js +0 -101
- package/dist/src/commands/sync.js.map +0 -1
- package/dist/src/commands/telemetry.action.d.ts +0 -38
- package/dist/src/commands/telemetry.action.d.ts.map +0 -1
- package/dist/src/commands/telemetry.action.js +0 -350
- package/dist/src/commands/telemetry.action.js.map +0 -1
- package/dist/src/commands/telemetry.d.ts +0 -30
- package/dist/src/commands/telemetry.d.ts.map +0 -1
- package/dist/src/commands/telemetry.helpers.d.ts +0 -58
- package/dist/src/commands/telemetry.helpers.d.ts.map +0 -1
- package/dist/src/commands/telemetry.helpers.js +0 -173
- package/dist/src/commands/telemetry.helpers.js.map +0 -1
- package/dist/src/commands/telemetry.helpers.test.d.ts +0 -15
- package/dist/src/commands/telemetry.helpers.test.d.ts.map +0 -1
- package/dist/src/commands/telemetry.helpers.test.js +0 -240
- package/dist/src/commands/telemetry.helpers.test.js.map +0 -1
- package/dist/src/commands/telemetry.js +0 -65
- package/dist/src/commands/telemetry.js.map +0 -1
- package/dist/src/commands/telemetry.test.d.ts +0 -18
- package/dist/src/commands/telemetry.test.d.ts.map +0 -1
- package/dist/src/commands/telemetry.test.js +0 -401
- package/dist/src/commands/telemetry.test.js.map +0 -1
- package/dist/src/commands/whoami.d.ts +0 -15
- package/dist/src/commands/whoami.d.ts.map +0 -1
- package/dist/src/commands/whoami.js +0 -55
- package/dist/src/commands/whoami.js.map +0 -1
- package/dist/src/commands/whoami.test.d.ts +0 -8
- package/dist/src/commands/whoami.test.d.ts.map +0 -1
- package/dist/src/commands/whoami.test.js +0 -133
- package/dist/src/commands/whoami.test.js.map +0 -1
- package/dist/src/config.d.ts +0 -29
- package/dist/src/config.d.ts.map +0 -1
- package/dist/src/config.js +0 -34
- package/dist/src/config.js.map +0 -1
- package/dist/src/index.d.ts +0 -22
- package/dist/src/index.d.ts.map +0 -1
- package/dist/src/index.js +0 -117
- package/dist/src/index.js.map +0 -1
- package/dist/src/templates/changelog.md.template.d.ts +0 -8
- package/dist/src/templates/changelog.md.template.d.ts.map +0 -1
- package/dist/src/templates/changelog.md.template.js +0 -19
- package/dist/src/templates/changelog.md.template.js.map +0 -1
- package/dist/src/templates/index.d.ts +0 -11
- package/dist/src/templates/index.d.ts.map +0 -1
- package/dist/src/templates/index.js +0 -11
- package/dist/src/templates/index.js.map +0 -1
- package/dist/src/templates/mcp-server.template.d.ts +0 -82
- package/dist/src/templates/mcp-server.template.d.ts.map +0 -1
- package/dist/src/templates/mcp-server.template.js +0 -430
- package/dist/src/templates/mcp-server.template.js.map +0 -1
- package/dist/src/templates/mcp-server.template.snippets.d.ts +0 -51
- package/dist/src/templates/mcp-server.template.snippets.d.ts.map +0 -1
- package/dist/src/templates/mcp-server.template.snippets.js +0 -162
- package/dist/src/templates/mcp-server.template.snippets.js.map +0 -1
- package/dist/src/templates/mcp-template-handlers.d.ts +0 -33
- package/dist/src/templates/mcp-template-handlers.d.ts.map +0 -1
- package/dist/src/templates/mcp-template-handlers.js +0 -106
- package/dist/src/templates/mcp-template-handlers.js.map +0 -1
- package/dist/src/templates/mcp-template-types.d.ts +0 -48
- package/dist/src/templates/mcp-template-types.d.ts.map +0 -1
- package/dist/src/templates/mcp-template-types.js +0 -18
- package/dist/src/templates/mcp-template-types.js.map +0 -1
- package/dist/src/templates/readme.md.template.d.ts +0 -8
- package/dist/src/templates/readme.md.template.d.ts.map +0 -1
- package/dist/src/templates/readme.md.template.js +0 -86
- package/dist/src/templates/readme.md.template.js.map +0 -1
- package/dist/src/templates/skill.md.template.d.ts +0 -8
- package/dist/src/templates/skill.md.template.d.ts.map +0 -1
- package/dist/src/templates/skill.md.template.js +0 -97
- package/dist/src/templates/skill.md.template.js.map +0 -1
- package/dist/src/templates/subagent.md.template.d.ts +0 -38
- package/dist/src/templates/subagent.md.template.d.ts.map +0 -1
- package/dist/src/templates/subagent.md.template.js +0 -128
- package/dist/src/templates/subagent.md.template.js.map +0 -1
- package/dist/src/utils/errors.d.ts +0 -52
- package/dist/src/utils/errors.d.ts.map +0 -1
- package/dist/src/utils/errors.js +0 -58
- package/dist/src/utils/errors.js.map +0 -1
- package/dist/src/utils/formatters.d.ts +0 -39
- package/dist/src/utils/formatters.d.ts.map +0 -1
- package/dist/src/utils/formatters.js +0 -69
- package/dist/src/utils/formatters.js.map +0 -1
- package/dist/src/utils/license-types.d.ts +0 -88
- package/dist/src/utils/license-types.d.ts.map +0 -1
- package/dist/src/utils/license-types.js +0 -60
- package/dist/src/utils/license-types.js.map +0 -1
- package/dist/src/utils/license-validation.d.ts +0 -61
- package/dist/src/utils/license-validation.d.ts.map +0 -1
- package/dist/src/utils/license-validation.js +0 -198
- package/dist/src/utils/license-validation.js.map +0 -1
- package/dist/src/utils/license.d.ts +0 -56
- package/dist/src/utils/license.d.ts.map +0 -1
- package/dist/src/utils/license.js +0 -163
- package/dist/src/utils/license.js.map +0 -1
- package/dist/src/utils/license.test.d.ts +0 -7
- package/dist/src/utils/license.test.d.ts.map +0 -1
- package/dist/src/utils/license.test.js +0 -308
- package/dist/src/utils/license.test.js.map +0 -1
- package/dist/src/utils/manifest.d.ts +0 -121
- package/dist/src/utils/manifest.d.ts.map +0 -1
- package/dist/src/utils/manifest.js +0 -133
- package/dist/src/utils/manifest.js.map +0 -1
- package/dist/src/utils/manifest.test.d.ts +0 -20
- package/dist/src/utils/manifest.test.d.ts.map +0 -1
- package/dist/src/utils/manifest.test.js +0 -344
- package/dist/src/utils/manifest.test.js.map +0 -1
- package/dist/src/utils/node-version.d.ts +0 -41
- package/dist/src/utils/node-version.d.ts.map +0 -1
- package/dist/src/utils/node-version.js +0 -123
- package/dist/src/utils/node-version.js.map +0 -1
- package/dist/src/utils/open-database.d.ts +0 -35
- package/dist/src/utils/open-database.d.ts.map +0 -1
- package/dist/src/utils/open-database.js +0 -73
- package/dist/src/utils/open-database.js.map +0 -1
- package/dist/src/utils/require-tier.d.ts +0 -38
- package/dist/src/utils/require-tier.d.ts.map +0 -1
- package/dist/src/utils/require-tier.js +0 -74
- package/dist/src/utils/require-tier.js.map +0 -1
- package/dist/src/utils/sanitize.d.ts +0 -30
- package/dist/src/utils/sanitize.d.ts.map +0 -1
- package/dist/src/utils/sanitize.js +0 -45
- package/dist/src/utils/sanitize.js.map +0 -1
- package/dist/src/utils/skill-name.d.ts +0 -19
- package/dist/src/utils/skill-name.d.ts.map +0 -1
- package/dist/src/utils/skill-name.js +0 -26
- package/dist/src/utils/skill-name.js.map +0 -1
- package/dist/src/utils/skills-directory.d.ts +0 -95
- package/dist/src/utils/skills-directory.d.ts.map +0 -1
- package/dist/src/utils/skills-directory.js +0 -283
- package/dist/src/utils/skills-directory.js.map +0 -1
- package/dist/src/utils/startup-header-gate.d.ts +0 -29
- package/dist/src/utils/startup-header-gate.d.ts.map +0 -1
- package/dist/src/utils/startup-header-gate.js +0 -44
- package/dist/src/utils/startup-header-gate.js.map +0 -1
- package/dist/src/utils/startup-header-gate.test.d.ts +0 -2
- package/dist/src/utils/startup-header-gate.test.d.ts.map +0 -1
- package/dist/src/utils/startup-header-gate.test.js +0 -46
- package/dist/src/utils/startup-header-gate.test.js.map +0 -1
- package/dist/src/utils/tool-analyzer.d.ts +0 -54
- package/dist/src/utils/tool-analyzer.d.ts.map +0 -1
- package/dist/src/utils/tool-analyzer.js +0 -156
- package/dist/src/utils/tool-analyzer.js.map +0 -1
- package/dist/src/version.d.ts +0 -2
- package/dist/src/version.d.ts.map +0 -1
- package/dist/src/version.js +0 -24
- package/dist/src/version.js.map +0 -1
- package/dist/tests/audit-collisions.test.d.ts +0 -42
- package/dist/tests/audit-collisions.test.d.ts.map +0 -1
- package/dist/tests/audit-collisions.test.js +0 -370
- package/dist/tests/audit-collisions.test.js.map +0 -1
- package/dist/tests/audit-restructure.test.d.ts +0 -15
- package/dist/tests/audit-restructure.test.d.ts.map +0 -1
- package/dist/tests/audit-restructure.test.js +0 -151
- package/dist/tests/audit-restructure.test.js.map +0 -1
- package/dist/tests/author.test.d.ts +0 -5
- package/dist/tests/author.test.d.ts.map +0 -1
- package/dist/tests/author.test.js +0 -653
- package/dist/tests/author.test.js.map +0 -1
- package/dist/tests/config.test.d.ts +0 -33
- package/dist/tests/config.test.d.ts.map +0 -1
- package/dist/tests/config.test.js +0 -240
- package/dist/tests/config.test.js.map +0 -1
- package/dist/tests/create.test.d.ts +0 -5
- package/dist/tests/create.test.d.ts.map +0 -1
- package/dist/tests/create.test.js +0 -449
- package/dist/tests/create.test.js.map +0 -1
- package/dist/tests/e2e/audit-sources-affix.test.d.ts +0 -11
- package/dist/tests/e2e/audit-sources-affix.test.d.ts.map +0 -1
- package/dist/tests/e2e/audit-sources-affix.test.js +0 -121
- package/dist/tests/e2e/audit-sources-affix.test.js.map +0 -1
- package/dist/tests/e2e/audit-sources-apply.test.d.ts +0 -13
- package/dist/tests/e2e/audit-sources-apply.test.d.ts.map +0 -1
- package/dist/tests/e2e/audit-sources-apply.test.js +0 -166
- package/dist/tests/e2e/audit-sources-apply.test.js.map +0 -1
- package/dist/tests/e2e/audit-sources-recovery.test.d.ts +0 -15
- package/dist/tests/e2e/audit-sources-recovery.test.d.ts.map +0 -1
- package/dist/tests/e2e/audit-sources-recovery.test.js +0 -179
- package/dist/tests/e2e/audit-sources-recovery.test.js.map +0 -1
- package/dist/tests/e2e/audit-sources-roundtrip.test.d.ts +0 -23
- package/dist/tests/e2e/audit-sources-roundtrip.test.d.ts.map +0 -1
- package/dist/tests/e2e/audit-sources-roundtrip.test.js +0 -139
- package/dist/tests/e2e/audit-sources-roundtrip.test.js.map +0 -1
- package/dist/tests/e2e/author.e2e.test.d.ts +0 -9
- package/dist/tests/e2e/author.e2e.test.d.ts.map +0 -1
- package/dist/tests/e2e/author.e2e.test.js +0 -666
- package/dist/tests/e2e/author.e2e.test.js.map +0 -1
- package/dist/tests/e2e/import.e2e.test.d.ts +0 -10
- package/dist/tests/e2e/import.e2e.test.d.ts.map +0 -1
- package/dist/tests/e2e/import.e2e.test.js +0 -213
- package/dist/tests/e2e/import.e2e.test.js.map +0 -1
- package/dist/tests/e2e/manage.e2e.test.d.ts +0 -9
- package/dist/tests/e2e/manage.e2e.test.d.ts.map +0 -1
- package/dist/tests/e2e/manage.e2e.test.js +0 -277
- package/dist/tests/e2e/manage.e2e.test.js.map +0 -1
- package/dist/tests/e2e/search.e2e.test.d.ts +0 -10
- package/dist/tests/e2e/search.e2e.test.d.ts.map +0 -1
- package/dist/tests/e2e/search.e2e.test.js +0 -324
- package/dist/tests/e2e/search.e2e.test.js.map +0 -1
- package/dist/tests/e2e/test-config.d.ts +0 -39
- package/dist/tests/e2e/test-config.d.ts.map +0 -1
- package/dist/tests/e2e/test-config.js +0 -44
- package/dist/tests/e2e/test-config.js.map +0 -1
- package/dist/tests/e2e/utils/baseline-collector.d.ts +0 -107
- package/dist/tests/e2e/utils/baseline-collector.d.ts.map +0 -1
- package/dist/tests/e2e/utils/baseline-collector.js +0 -211
- package/dist/tests/e2e/utils/baseline-collector.js.map +0 -1
- package/dist/tests/e2e/utils/hardcoded-detector.d.ts +0 -46
- package/dist/tests/e2e/utils/hardcoded-detector.d.ts.map +0 -1
- package/dist/tests/e2e/utils/hardcoded-detector.js +0 -238
- package/dist/tests/e2e/utils/hardcoded-detector.js.map +0 -1
- package/dist/tests/e2e/utils/index.d.ts +0 -12
- package/dist/tests/e2e/utils/index.d.ts.map +0 -1
- package/dist/tests/e2e/utils/index.js +0 -12
- package/dist/tests/e2e/utils/index.js.map +0 -1
- package/dist/tests/e2e/utils/linear-reporter.d.ts +0 -60
- package/dist/tests/e2e/utils/linear-reporter.d.ts.map +0 -1
- package/dist/tests/e2e/utils/linear-reporter.js +0 -223
- package/dist/tests/e2e/utils/linear-reporter.js.map +0 -1
- package/dist/tests/e2e/utils/mock-github.d.ts +0 -23
- package/dist/tests/e2e/utils/mock-github.d.ts.map +0 -1
- package/dist/tests/e2e/utils/mock-github.js +0 -60
- package/dist/tests/e2e/utils/mock-github.js.map +0 -1
- package/dist/tests/e2e/utils/mock-prompts.d.ts +0 -19
- package/dist/tests/e2e/utils/mock-prompts.d.ts.map +0 -1
- package/dist/tests/e2e/utils/mock-prompts.js +0 -48
- package/dist/tests/e2e/utils/mock-prompts.js.map +0 -1
- package/dist/tests/e2e/utils/source-recovery-fixture.d.ts +0 -49
- package/dist/tests/e2e/utils/source-recovery-fixture.d.ts.map +0 -1
- package/dist/tests/e2e/utils/source-recovery-fixture.js +0 -106
- package/dist/tests/e2e/utils/source-recovery-fixture.js.map +0 -1
- package/dist/tests/embedding-probe-stdio.test.d.ts +0 -11
- package/dist/tests/embedding-probe-stdio.test.d.ts.map +0 -1
- package/dist/tests/embedding-probe-stdio.test.js +0 -58
- package/dist/tests/embedding-probe-stdio.test.js.map +0 -1
- package/dist/tests/import.test.d.ts +0 -5
- package/dist/tests/import.test.d.ts.map +0 -1
- package/dist/tests/import.test.js +0 -11
- package/dist/tests/import.test.js.map +0 -1
- package/dist/tests/init.test.d.ts +0 -30
- package/dist/tests/init.test.d.ts.map +0 -1
- package/dist/tests/init.test.js +0 -357
- package/dist/tests/init.test.js.map +0 -1
- package/dist/tests/install-multi-client.test.d.ts +0 -2
- package/dist/tests/install-multi-client.test.d.ts.map +0 -1
- package/dist/tests/install-multi-client.test.js +0 -202
- package/dist/tests/install-multi-client.test.js.map +0 -1
- package/dist/tests/install-quarantine.test.d.ts +0 -10
- package/dist/tests/install-quarantine.test.d.ts.map +0 -1
- package/dist/tests/install-quarantine.test.js +0 -86
- package/dist/tests/install-quarantine.test.js.map +0 -1
- package/dist/tests/install-skill.test.d.ts +0 -8
- package/dist/tests/install-skill.test.d.ts.map +0 -1
- package/dist/tests/install-skill.test.js +0 -414
- package/dist/tests/install-skill.test.js.map +0 -1
- package/dist/tests/integration/import-local.test.d.ts +0 -2
- package/dist/tests/integration/import-local.test.d.ts.map +0 -1
- package/dist/tests/integration/import-local.test.js +0 -158
- package/dist/tests/integration/import-local.test.js.map +0 -1
- package/dist/tests/license-validation.test.d.ts +0 -8
- package/dist/tests/license-validation.test.d.ts.map +0 -1
- package/dist/tests/license-validation.test.js +0 -186
- package/dist/tests/license-validation.test.js.map +0 -1
- package/dist/tests/manage.test.d.ts +0 -5
- package/dist/tests/manage.test.d.ts.map +0 -1
- package/dist/tests/manage.test.js +0 -495
- package/dist/tests/manage.test.js.map +0 -1
- package/dist/tests/mcp-server-template.test.d.ts +0 -7
- package/dist/tests/mcp-server-template.test.d.ts.map +0 -1
- package/dist/tests/mcp-server-template.test.js +0 -372
- package/dist/tests/mcp-server-template.test.js.map +0 -1
- package/dist/tests/node-version.test.d.ts +0 -8
- package/dist/tests/node-version.test.d.ts.map +0 -1
- package/dist/tests/node-version.test.js +0 -200
- package/dist/tests/node-version.test.js.map +0 -1
- package/dist/tests/open-database.test.d.ts +0 -2
- package/dist/tests/open-database.test.d.ts.map +0 -1
- package/dist/tests/open-database.test.js +0 -77
- package/dist/tests/open-database.test.js.map +0 -1
- package/dist/tests/recommend-helpers.test.d.ts +0 -9
- package/dist/tests/recommend-helpers.test.d.ts.map +0 -1
- package/dist/tests/recommend-helpers.test.js +0 -308
- package/dist/tests/recommend-helpers.test.js.map +0 -1
- package/dist/tests/recommend-scoring.test.d.ts +0 -8
- package/dist/tests/recommend-scoring.test.d.ts.map +0 -1
- package/dist/tests/recommend-scoring.test.js +0 -184
- package/dist/tests/recommend-scoring.test.js.map +0 -1
- package/dist/tests/recommend.errors.test.d.ts +0 -8
- package/dist/tests/recommend.errors.test.d.ts.map +0 -1
- package/dist/tests/recommend.errors.test.js +0 -232
- package/dist/tests/recommend.errors.test.js.map +0 -1
- package/dist/tests/recommend.filters.test.d.ts +0 -9
- package/dist/tests/recommend.filters.test.d.ts.map +0 -1
- package/dist/tests/recommend.filters.test.js +0 -235
- package/dist/tests/recommend.filters.test.js.map +0 -1
- package/dist/tests/recommend.test-helpers.d.ts +0 -66
- package/dist/tests/recommend.test-helpers.d.ts.map +0 -1
- package/dist/tests/recommend.test-helpers.js +0 -79
- package/dist/tests/recommend.test-helpers.js.map +0 -1
- package/dist/tests/recommend.test.d.ts +0 -11
- package/dist/tests/recommend.test.d.ts.map +0 -1
- package/dist/tests/recommend.test.js +0 -320
- package/dist/tests/recommend.test.js.map +0 -1
- package/dist/tests/search-helpers.test.d.ts +0 -2
- package/dist/tests/search-helpers.test.d.ts.map +0 -1
- package/dist/tests/search-helpers.test.js +0 -110
- package/dist/tests/search-helpers.test.js.map +0 -1
- package/dist/tests/search.test.d.ts +0 -5
- package/dist/tests/search.test.d.ts.map +0 -1
- package/dist/tests/search.test.js +0 -91
- package/dist/tests/search.test.js.map +0 -1
- package/dist/tests/skills-directory-per-harness.test.d.ts +0 -2
- package/dist/tests/skills-directory-per-harness.test.d.ts.map +0 -1
- package/dist/tests/skills-directory-per-harness.test.js +0 -116
- package/dist/tests/skills-directory-per-harness.test.js.map +0 -1
- package/dist/tests/skills-directory.test.d.ts +0 -2
- package/dist/tests/skills-directory.test.d.ts.map +0 -1
- package/dist/tests/skills-directory.test.js +0 -97
- package/dist/tests/skills-directory.test.js.map +0 -1
- package/dist/tests/sync.auth-ux.test.d.ts +0 -14
- package/dist/tests/sync.auth-ux.test.d.ts.map +0 -1
- package/dist/tests/sync.auth-ux.test.js +0 -148
- package/dist/tests/sync.auth-ux.test.js.map +0 -1
- package/dist/tests/tool-analyzer.test.d.ts +0 -8
- package/dist/tests/tool-analyzer.test.d.ts.map +0 -1
- package/dist/tests/tool-analyzer.test.js +0 -149
- package/dist/tests/tool-analyzer.test.js.map +0 -1
- package/dist/tests/unit/commands/install.test.d.ts +0 -7
- package/dist/tests/unit/commands/install.test.d.ts.map +0 -1
- package/dist/tests/unit/commands/install.test.js +0 -482
- package/dist/tests/unit/commands/install.test.js.map +0 -1
- package/dist/tests/unit/import-local.helpers.test.d.ts +0 -2
- package/dist/tests/unit/import-local.helpers.test.d.ts.map +0 -1
- package/dist/tests/unit/import-local.helpers.test.js +0 -96
- package/dist/tests/unit/import-local.helpers.test.js.map +0 -1
|
@@ -1,123 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* SMI-1629: Node version detection with helpful errors
|
|
3
|
-
*
|
|
4
|
-
* Validates the runtime Node.js version against the minimum required
|
|
5
|
-
* version specified in package.json engines field.
|
|
6
|
-
*/
|
|
7
|
-
import { readFileSync } from 'fs';
|
|
8
|
-
import { dirname, join } from 'path';
|
|
9
|
-
import { fileURLToPath } from 'url';
|
|
10
|
-
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
11
|
-
/**
|
|
12
|
-
* Reads the minimum Node.js version from package.json engines field.
|
|
13
|
-
* Falls back to '22.22.0' if not found (SMI-4489 floor).
|
|
14
|
-
*/
|
|
15
|
-
function loadMinNodeVersion() {
|
|
16
|
-
try {
|
|
17
|
-
const packageJsonPath = join(__dirname, '..', '..', 'package.json');
|
|
18
|
-
const packageJson = JSON.parse(readFileSync(packageJsonPath, 'utf-8'));
|
|
19
|
-
const engineConstraint = packageJson.engines?.node ?? '>=22.22.0';
|
|
20
|
-
// Extract version number from constraint (e.g., ">=22.22.0" -> "22.22.0")
|
|
21
|
-
return engineConstraint.replace(/[>=<^~\s]/g, '');
|
|
22
|
-
}
|
|
23
|
-
catch {
|
|
24
|
-
// Fallback if package.json can't be read
|
|
25
|
-
return '22.22.0';
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
const MIN_NODE_VERSION = loadMinNodeVersion();
|
|
29
|
-
/**
|
|
30
|
-
* Returns the minimum required Node.js version.
|
|
31
|
-
*
|
|
32
|
-
* @returns The minimum version string (e.g., "22.0.0")
|
|
33
|
-
*/
|
|
34
|
-
export function getMinNodeVersion() {
|
|
35
|
-
return MIN_NODE_VERSION;
|
|
36
|
-
}
|
|
37
|
-
/**
|
|
38
|
-
* Returns the current Node.js version without the "v" prefix.
|
|
39
|
-
*
|
|
40
|
-
* @returns The current version string (e.g., "22.5.0")
|
|
41
|
-
*/
|
|
42
|
-
export function getCurrentNodeVersion() {
|
|
43
|
-
return process.version.replace(/^v/, '');
|
|
44
|
-
}
|
|
45
|
-
/**
|
|
46
|
-
* Compares two semantic version strings.
|
|
47
|
-
*
|
|
48
|
-
* @param a - First version string (e.g., "22.5.0")
|
|
49
|
-
* @param b - Second version string (e.g., "22.0.0")
|
|
50
|
-
* @returns Positive if a > b, negative if a < b, 0 if equal
|
|
51
|
-
*/
|
|
52
|
-
export function compareVersions(a, b) {
|
|
53
|
-
const parseVersion = (v) => {
|
|
54
|
-
// Strip pre-release suffix (e.g., "22.0.0-beta.1" -> "22.0.0")
|
|
55
|
-
const cleanVersion = v.split('-')[0] ?? v;
|
|
56
|
-
const parts = cleanVersion.split('.').map((p) => parseInt(p, 10) || 0);
|
|
57
|
-
// Pad to at least 3 parts for consistent comparison
|
|
58
|
-
while (parts.length < 3) {
|
|
59
|
-
parts.push(0);
|
|
60
|
-
}
|
|
61
|
-
return parts;
|
|
62
|
-
};
|
|
63
|
-
const partsA = parseVersion(a);
|
|
64
|
-
const partsB = parseVersion(b);
|
|
65
|
-
for (let i = 0; i < Math.max(partsA.length, partsB.length); i++) {
|
|
66
|
-
const numA = partsA[i] ?? 0;
|
|
67
|
-
const numB = partsB[i] ?? 0;
|
|
68
|
-
if (numA > numB)
|
|
69
|
-
return 1;
|
|
70
|
-
if (numA < numB)
|
|
71
|
-
return -1;
|
|
72
|
-
}
|
|
73
|
-
return 0;
|
|
74
|
-
}
|
|
75
|
-
/**
|
|
76
|
-
* Formats a helpful error message when the Node.js version is incompatible.
|
|
77
|
-
*
|
|
78
|
-
* @param currentVersion - The current Node.js version
|
|
79
|
-
* @param requiredVersion - The minimum required version
|
|
80
|
-
* @returns A formatted error message with upgrade instructions
|
|
81
|
-
*/
|
|
82
|
-
export function formatVersionError(currentVersion, requiredVersion) {
|
|
83
|
-
return `
|
|
84
|
-
Node.js version mismatch detected.
|
|
85
|
-
|
|
86
|
-
Current version: v${currentVersion}
|
|
87
|
-
Required version: v${requiredVersion} or higher
|
|
88
|
-
|
|
89
|
-
Your Node.js version is too old to run this CLI.
|
|
90
|
-
|
|
91
|
-
To upgrade Node.js, use one of these methods:
|
|
92
|
-
|
|
93
|
-
Using nvm (recommended):
|
|
94
|
-
nvm install ${requiredVersion}
|
|
95
|
-
nvm use ${requiredVersion}
|
|
96
|
-
|
|
97
|
-
Using fnm:
|
|
98
|
-
fnm install ${requiredVersion}
|
|
99
|
-
fnm use ${requiredVersion}
|
|
100
|
-
|
|
101
|
-
Using volta:
|
|
102
|
-
volta install node@${requiredVersion}
|
|
103
|
-
|
|
104
|
-
Download directly:
|
|
105
|
-
https://nodejs.org/
|
|
106
|
-
|
|
107
|
-
After upgrading, verify with: node --version
|
|
108
|
-
`.trim();
|
|
109
|
-
}
|
|
110
|
-
/**
|
|
111
|
-
* Checks if the current Node.js version meets the minimum requirement.
|
|
112
|
-
*
|
|
113
|
-
* @returns null if the version is acceptable, or an error message string if not
|
|
114
|
-
*/
|
|
115
|
-
export function checkNodeVersion() {
|
|
116
|
-
const currentVersion = getCurrentNodeVersion();
|
|
117
|
-
const minVersion = getMinNodeVersion();
|
|
118
|
-
if (compareVersions(currentVersion, minVersion) >= 0) {
|
|
119
|
-
return null;
|
|
120
|
-
}
|
|
121
|
-
return formatVersionError(currentVersion, minVersion);
|
|
122
|
-
}
|
|
123
|
-
//# sourceMappingURL=node-version.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"node-version.js","sourceRoot":"","sources":["../../../src/utils/node-version.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,IAAI,CAAA;AACjC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AACpC,OAAO,EAAE,aAAa,EAAE,MAAM,KAAK,CAAA;AAEnC,MAAM,SAAS,GAAG,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAA;AAEzD;;;GAGG;AACH,SAAS,kBAAkB;IACzB,IAAI,CAAC;QACH,MAAM,eAAe,GAAG,IAAI,CAAC,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,cAAc,CAAC,CAAA;QACnE,MAAM,WAAW,GAAG,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,eAAe,EAAE,OAAO,CAAC,CAAC,CAAA;QACtE,MAAM,gBAAgB,GAAG,WAAW,CAAC,OAAO,EAAE,IAAI,IAAI,WAAW,CAAA;QACjE,0EAA0E;QAC1E,OAAO,gBAAgB,CAAC,OAAO,CAAC,YAAY,EAAE,EAAE,CAAC,CAAA;IACnD,CAAC;IAAC,MAAM,CAAC;QACP,yCAAyC;QACzC,OAAO,SAAS,CAAA;IAClB,CAAC;AACH,CAAC;AAED,MAAM,gBAAgB,GAAG,kBAAkB,EAAE,CAAA;AAE7C;;;;GAIG;AACH,MAAM,UAAU,iBAAiB;IAC/B,OAAO,gBAAgB,CAAA;AACzB,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,qBAAqB;IACnC,OAAO,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,EAAE,EAAE,CAAC,CAAA;AAC1C,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,eAAe,CAAC,CAAS,EAAE,CAAS;IAClD,MAAM,YAAY,GAAG,CAAC,CAAS,EAAY,EAAE;QAC3C,+DAA+D;QAC/D,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAA;QACzC,MAAM,KAAK,GAAG,YAAY,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,QAAQ,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,CAAC,CAAA;QACtE,oDAAoD;QACpD,OAAO,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YACxB,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;QACf,CAAC;QACD,OAAO,KAAK,CAAA;IACd,CAAC,CAAA;IAED,MAAM,MAAM,GAAG,YAAY,CAAC,CAAC,CAAC,CAAA;IAC9B,MAAM,MAAM,GAAG,YAAY,CAAC,CAAC,CAAC,CAAA;IAE9B,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;QAChE,MAAM,IAAI,GAAG,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,CAAA;QAC3B,MAAM,IAAI,GAAG,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,CAAA;QAE3B,IAAI,IAAI,GAAG,IAAI;YAAE,OAAO,CAAC,CAAA;QACzB,IAAI,IAAI,GAAG,IAAI;YAAE,OAAO,CAAC,CAAC,CAAA;IAC5B,CAAC;IAED,OAAO,CAAC,CAAA;AACV,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,kBAAkB,CAAC,cAAsB,EAAE,eAAuB;IAChF,OAAO;;;uBAGc,cAAc;uBACd,eAAe;;;;;;;kBAOpB,eAAe;cACnB,eAAe;;;kBAGX,eAAe;cACnB,eAAe;;;yBAGJ,eAAe;;;;;;CAMvC,CAAC,IAAI,EAAE,CAAA;AACR,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,gBAAgB;IAC9B,MAAM,cAAc,GAAG,qBAAqB,EAAE,CAAA;IAC9C,MAAM,UAAU,GAAG,iBAAiB,EAAE,CAAA;IAEtC,IAAI,eAAe,CAAC,cAAc,EAAE,UAAU,CAAC,IAAI,CAAC,EAAE,CAAC;QACrD,OAAO,IAAI,CAAA;IACb,CAAC;IAED,OAAO,kBAAkB,CAAC,cAAc,EAAE,UAAU,CAAC,CAAA;AACvD,CAAC"}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @fileoverview Shared CLI database opener — the single schema-safe entry point.
|
|
3
|
-
* @see SMI-4486, SMI-4917
|
|
4
|
-
*
|
|
5
|
-
* `@skillsmith/core` re-exports the BARE `createDatabaseAsync` factory
|
|
6
|
-
* (`db/createDatabase.js`) — it opens a connection but creates NO tables. Every
|
|
7
|
-
* CLI command that touches a table (`skills`, `cache`, `sync_history`, …) MUST
|
|
8
|
-
* call `initializeSchema` first, or it crashes on a fresh DB with errors like
|
|
9
|
-
* `no such table: cache`.
|
|
10
|
-
*
|
|
11
|
-
* Before this helper, each command repeated `createDatabaseAsync` +
|
|
12
|
-
* `initializeSchema` by hand; any command that forgot the second line shipped a
|
|
13
|
-
* first-time-install crash (Bug 1 of SMI-4917 — `search` did exactly this).
|
|
14
|
-
* `openCliDatabase` makes the footgun structurally impossible: it is the one
|
|
15
|
-
* unmissable way a CLI command opens a database.
|
|
16
|
-
*/
|
|
17
|
-
import { type DatabaseType } from '@skillsmith/core';
|
|
18
|
-
/**
|
|
19
|
-
* Open a CLI database with the full schema initialized and all migrations
|
|
20
|
-
* applied. Use this everywhere a CLI command needs a database — never call the
|
|
21
|
-
* bare `createDatabaseAsync` directly.
|
|
22
|
-
*
|
|
23
|
-
* @param path - Filesystem path to the SQLite database (e.g. `DEFAULT_DB_PATH`).
|
|
24
|
-
* @param options.readonly - SMI-5139: open read-only for pure-read consumers
|
|
25
|
-
* (e.g. version lookups). A read-only handle CANNOT run schema DDL, so
|
|
26
|
-
* `initializeSchema` is skipped — the caller must tolerate an absent schema
|
|
27
|
-
* (queries on a missing table throw, which read consumers already catch).
|
|
28
|
-
* This also prevents the WASM `SqlJsDatabaseAdapter` from persisting (writing)
|
|
29
|
-
* on `close()`, which would throw `EROFS` on an unwritable/absent db path.
|
|
30
|
-
* @returns A connected database. Caller owns `db.close()`.
|
|
31
|
-
*/
|
|
32
|
-
export declare function openCliDatabase(path: string, options?: {
|
|
33
|
-
readonly?: boolean;
|
|
34
|
-
}): Promise<DatabaseType>;
|
|
35
|
-
//# sourceMappingURL=open-database.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"open-database.d.ts","sourceRoot":"","sources":["../../../src/utils/open-database.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,OAAO,EAKL,KAAK,YAAY,EAClB,MAAM,kBAAkB,CAAA;AAGzB;;;;;;;;;;;;;GAaG;AACH,wBAAsB,eAAe,CACnC,IAAI,EAAE,MAAM,EACZ,OAAO,CAAC,EAAE;IAAE,QAAQ,CAAC,EAAE,OAAO,CAAA;CAAE,GAC/B,OAAO,CAAC,YAAY,CAAC,CAwCvB"}
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @fileoverview Shared CLI database opener — the single schema-safe entry point.
|
|
3
|
-
* @see SMI-4486, SMI-4917
|
|
4
|
-
*
|
|
5
|
-
* `@skillsmith/core` re-exports the BARE `createDatabaseAsync` factory
|
|
6
|
-
* (`db/createDatabase.js`) — it opens a connection but creates NO tables. Every
|
|
7
|
-
* CLI command that touches a table (`skills`, `cache`, `sync_history`, …) MUST
|
|
8
|
-
* call `initializeSchema` first, or it crashes on a fresh DB with errors like
|
|
9
|
-
* `no such table: cache`.
|
|
10
|
-
*
|
|
11
|
-
* Before this helper, each command repeated `createDatabaseAsync` +
|
|
12
|
-
* `initializeSchema` by hand; any command that forgot the second line shipped a
|
|
13
|
-
* first-time-install crash (Bug 1 of SMI-4917 — `search` did exactly this).
|
|
14
|
-
* `openCliDatabase` makes the footgun structurally impossible: it is the one
|
|
15
|
-
* unmissable way a CLI command opens a database.
|
|
16
|
-
*/
|
|
17
|
-
import { createDatabaseAsync, initializeSchema, isCorruptionError, backupCorruptDbFile, } from '@skillsmith/core';
|
|
18
|
-
import { existsSync } from 'node:fs';
|
|
19
|
-
/**
|
|
20
|
-
* Open a CLI database with the full schema initialized and all migrations
|
|
21
|
-
* applied. Use this everywhere a CLI command needs a database — never call the
|
|
22
|
-
* bare `createDatabaseAsync` directly.
|
|
23
|
-
*
|
|
24
|
-
* @param path - Filesystem path to the SQLite database (e.g. `DEFAULT_DB_PATH`).
|
|
25
|
-
* @param options.readonly - SMI-5139: open read-only for pure-read consumers
|
|
26
|
-
* (e.g. version lookups). A read-only handle CANNOT run schema DDL, so
|
|
27
|
-
* `initializeSchema` is skipped — the caller must tolerate an absent schema
|
|
28
|
-
* (queries on a missing table throw, which read consumers already catch).
|
|
29
|
-
* This also prevents the WASM `SqlJsDatabaseAdapter` from persisting (writing)
|
|
30
|
-
* on `close()`, which would throw `EROFS` on an unwritable/absent db path.
|
|
31
|
-
* @returns A connected database. Caller owns `db.close()`.
|
|
32
|
-
*/
|
|
33
|
-
export async function openCliDatabase(path, options) {
|
|
34
|
-
// SMI-5139: read-only consumers open read-only and skip schema init (DDL is
|
|
35
|
-
// impossible on a read-only handle; sql.js close() then skips persist()).
|
|
36
|
-
// The open itself may throw (native better-sqlite3 read-only-opens of an
|
|
37
|
-
// absent file throw) — that is the caller's signal to degrade gracefully.
|
|
38
|
-
if (options?.readonly) {
|
|
39
|
-
return createDatabaseAsync(path, { readonly: true });
|
|
40
|
-
}
|
|
41
|
-
let db;
|
|
42
|
-
try {
|
|
43
|
-
db = await createDatabaseAsync(path);
|
|
44
|
-
initializeSchema(db);
|
|
45
|
-
return db;
|
|
46
|
-
}
|
|
47
|
-
catch (err) {
|
|
48
|
-
// SMI-4484: backstop for corruption that surfaces during schema init (e.g.
|
|
49
|
-
// a corrupt page only read once the schema queries run). The sql.js driver
|
|
50
|
-
// self-heals on open, but a corrupt file opened by the native driver can
|
|
51
|
-
// still fail here. Back up the bad file and retry once on a fresh DB.
|
|
52
|
-
if (!isCorruptionError(err) || path === ':memory:' || !existsSync(path)) {
|
|
53
|
-
throw err;
|
|
54
|
-
}
|
|
55
|
-
// Close the handle opened before initializeSchema failed so it is not
|
|
56
|
-
// leaked before we rebuild.
|
|
57
|
-
if (db) {
|
|
58
|
-
try {
|
|
59
|
-
db.close();
|
|
60
|
-
}
|
|
61
|
-
catch {
|
|
62
|
-
// handle already unusable — nothing more to free
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
const backupPath = backupCorruptDbFile(path);
|
|
66
|
-
console.warn(`[Skillsmith] The local database at ${path} was corrupt and could not be opened. ` +
|
|
67
|
-
`It has been backed up to ${backupPath} and will be rebuilt on the next sync.`);
|
|
68
|
-
const fresh = await createDatabaseAsync(path);
|
|
69
|
-
initializeSchema(fresh);
|
|
70
|
-
return fresh;
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
//# sourceMappingURL=open-database.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"open-database.js","sourceRoot":"","sources":["../../../src/utils/open-database.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,OAAO,EACL,mBAAmB,EACnB,gBAAgB,EAChB,iBAAiB,EACjB,mBAAmB,GAEpB,MAAM,kBAAkB,CAAA;AACzB,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAA;AAEpC;;;;;;;;;;;;;GAaG;AACH,MAAM,CAAC,KAAK,UAAU,eAAe,CACnC,IAAY,EACZ,OAAgC;IAEhC,4EAA4E;IAC5E,0EAA0E;IAC1E,yEAAyE;IACzE,0EAA0E;IAC1E,IAAI,OAAO,EAAE,QAAQ,EAAE,CAAC;QACtB,OAAO,mBAAmB,CAAC,IAAI,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAA;IACtD,CAAC;IAED,IAAI,EAA4B,CAAA;IAChC,IAAI,CAAC;QACH,EAAE,GAAG,MAAM,mBAAmB,CAAC,IAAI,CAAC,CAAA;QACpC,gBAAgB,CAAC,EAAE,CAAC,CAAA;QACpB,OAAO,EAAE,CAAA;IACX,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,2EAA2E;QAC3E,2EAA2E;QAC3E,yEAAyE;QACzE,sEAAsE;QACtE,IAAI,CAAC,iBAAiB,CAAC,GAAG,CAAC,IAAI,IAAI,KAAK,UAAU,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE,CAAC;YACxE,MAAM,GAAG,CAAA;QACX,CAAC;QACD,sEAAsE;QACtE,4BAA4B;QAC5B,IAAI,EAAE,EAAE,CAAC;YACP,IAAI,CAAC;gBACH,EAAE,CAAC,KAAK,EAAE,CAAA;YACZ,CAAC;YAAC,MAAM,CAAC;gBACP,iDAAiD;YACnD,CAAC;QACH,CAAC;QACD,MAAM,UAAU,GAAG,mBAAmB,CAAC,IAAI,CAAC,CAAA;QAC5C,OAAO,CAAC,IAAI,CACV,sCAAsC,IAAI,wCAAwC;YAChF,4BAA4B,UAAU,wCAAwC,CACjF,CAAA;QACD,MAAM,KAAK,GAAG,MAAM,mBAAmB,CAAC,IAAI,CAAC,CAAA;QAC7C,gBAAgB,CAAC,KAAK,CAAC,CAAA;QACvB,OAAO,KAAK,CAAA;IACd,CAAC;AACH,CAAC"}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @fileoverview requireTier — CLI license tier gate helper
|
|
3
|
-
* @module @skillsmith/cli/utils/require-tier
|
|
4
|
-
* @see SMI-skill-version-tracking Wave 1
|
|
5
|
-
*
|
|
6
|
-
* Throws a user-friendly error when the current license tier is below
|
|
7
|
-
* the minimum required for a CLI command or flag.
|
|
8
|
-
*
|
|
9
|
-
* Security properties:
|
|
10
|
-
* - Fail-secure: key present + validation failure → block, never fall back
|
|
11
|
-
* to community to silently allow access
|
|
12
|
-
* - SKILLSMITH_SKIP_LICENSE_CHECK=true is a CI/dev escape hatch only; it
|
|
13
|
-
* must use bracket notation per TypeScript/ESLint index-signature rules
|
|
14
|
-
* - SKILLSMITH_LICENSE_KEY is read from env but never logged
|
|
15
|
-
*/
|
|
16
|
-
import type { LicenseTier } from './license-types.js';
|
|
17
|
-
/**
|
|
18
|
-
* Throw if the current license tier is below minimumTier.
|
|
19
|
-
*
|
|
20
|
-
* Call this at the top of any CLI command or action that requires a paid tier.
|
|
21
|
-
*
|
|
22
|
-
* @param minimumTier - Minimum tier required to use the feature
|
|
23
|
-
* @throws Error with an upgrade prompt when the tier requirement is not met
|
|
24
|
-
* @throws Error when a license key is present but fails validation (fail-secure)
|
|
25
|
-
*
|
|
26
|
-
* @example
|
|
27
|
-
* ```typescript
|
|
28
|
-
* export function createOutdatedCommand(): Command {
|
|
29
|
-
* return new Command('outdated')
|
|
30
|
-
* .action(async () => {
|
|
31
|
-
* await requireTier('individual')
|
|
32
|
-
* // ... rest of command
|
|
33
|
-
* })
|
|
34
|
-
* }
|
|
35
|
-
* ```
|
|
36
|
-
*/
|
|
37
|
-
export declare function requireTier(minimumTier: LicenseTier): Promise<void>;
|
|
38
|
-
//# sourceMappingURL=require-tier.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"require-tier.d.ts","sourceRoot":"","sources":["../../../src/utils/require-tier.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAGH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAA;AAkBrD;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAsB,WAAW,CAAC,WAAW,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,CA8BzE"}
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @fileoverview requireTier — CLI license tier gate helper
|
|
3
|
-
* @module @skillsmith/cli/utils/require-tier
|
|
4
|
-
* @see SMI-skill-version-tracking Wave 1
|
|
5
|
-
*
|
|
6
|
-
* Throws a user-friendly error when the current license tier is below
|
|
7
|
-
* the minimum required for a CLI command or flag.
|
|
8
|
-
*
|
|
9
|
-
* Security properties:
|
|
10
|
-
* - Fail-secure: key present + validation failure → block, never fall back
|
|
11
|
-
* to community to silently allow access
|
|
12
|
-
* - SKILLSMITH_SKIP_LICENSE_CHECK=true is a CI/dev escape hatch only; it
|
|
13
|
-
* must use bracket notation per TypeScript/ESLint index-signature rules
|
|
14
|
-
* - SKILLSMITH_LICENSE_KEY is read from env but never logged
|
|
15
|
-
*/
|
|
16
|
-
import { getLicenseStatus } from './license-validation.js';
|
|
17
|
-
/**
|
|
18
|
-
* Ordered license tiers, lowest to highest.
|
|
19
|
-
* Used for tier comparison arithmetic.
|
|
20
|
-
*/
|
|
21
|
-
const TIER_ORDER = ['community', 'individual', 'team', 'enterprise'];
|
|
22
|
-
/**
|
|
23
|
-
* Prices for use in upgrade messages
|
|
24
|
-
*/
|
|
25
|
-
const TIER_PRICING = {
|
|
26
|
-
community: '$0/month',
|
|
27
|
-
individual: '$9.99/month',
|
|
28
|
-
team: '$25/user/month',
|
|
29
|
-
enterprise: '$55/user/month',
|
|
30
|
-
};
|
|
31
|
-
/**
|
|
32
|
-
* Throw if the current license tier is below minimumTier.
|
|
33
|
-
*
|
|
34
|
-
* Call this at the top of any CLI command or action that requires a paid tier.
|
|
35
|
-
*
|
|
36
|
-
* @param minimumTier - Minimum tier required to use the feature
|
|
37
|
-
* @throws Error with an upgrade prompt when the tier requirement is not met
|
|
38
|
-
* @throws Error when a license key is present but fails validation (fail-secure)
|
|
39
|
-
*
|
|
40
|
-
* @example
|
|
41
|
-
* ```typescript
|
|
42
|
-
* export function createOutdatedCommand(): Command {
|
|
43
|
-
* return new Command('outdated')
|
|
44
|
-
* .action(async () => {
|
|
45
|
-
* await requireTier('individual')
|
|
46
|
-
* // ... rest of command
|
|
47
|
-
* })
|
|
48
|
-
* }
|
|
49
|
-
* ```
|
|
50
|
-
*/
|
|
51
|
-
export async function requireTier(minimumTier) {
|
|
52
|
-
// CI / dev escape hatch — must use bracket notation (TS index-signature rule)
|
|
53
|
-
if (process.env['SKILLSMITH_SKIP_LICENSE_CHECK'] === 'true') {
|
|
54
|
-
return;
|
|
55
|
-
}
|
|
56
|
-
const status = await getLicenseStatus();
|
|
57
|
-
// Fail-secure: key present + validation failure → block
|
|
58
|
-
// Never silently fall back to community when a key was supplied
|
|
59
|
-
const hasKey = Boolean(process.env['SKILLSMITH_LICENSE_KEY']);
|
|
60
|
-
if (hasKey && !status.valid) {
|
|
61
|
-
throw new Error(`License validation failed. ` +
|
|
62
|
-
`Please check your SKILLSMITH_LICENSE_KEY or visit https://skillsmith.app/account to manage your license.`);
|
|
63
|
-
}
|
|
64
|
-
const currentTier = (status.tier ?? 'community');
|
|
65
|
-
const currentIndex = TIER_ORDER.indexOf(currentTier);
|
|
66
|
-
const requiredIndex = TIER_ORDER.indexOf(minimumTier);
|
|
67
|
-
if (currentIndex < requiredIndex) {
|
|
68
|
-
const pricing = TIER_PRICING[minimumTier];
|
|
69
|
-
throw new Error(`This feature requires ${minimumTier} tier or higher (${pricing}). ` +
|
|
70
|
-
`You are currently on the ${currentTier} tier. ` +
|
|
71
|
-
`Upgrade at https://skillsmith.app/upgrade?tier=${minimumTier}`);
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
//# sourceMappingURL=require-tier.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"require-tier.js","sourceRoot":"","sources":["../../../src/utils/require-tier.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAA;AAG1D;;;GAGG;AACH,MAAM,UAAU,GAAkB,CAAC,WAAW,EAAE,YAAY,EAAE,MAAM,EAAE,YAAY,CAAC,CAAA;AAEnF;;GAEG;AACH,MAAM,YAAY,GAAgC;IAChD,SAAS,EAAE,UAAU;IACrB,UAAU,EAAE,aAAa;IACzB,IAAI,EAAE,gBAAgB;IACtB,UAAU,EAAE,gBAAgB;CAC7B,CAAA;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,CAAC,KAAK,UAAU,WAAW,CAAC,WAAwB;IACxD,8EAA8E;IAC9E,IAAI,OAAO,CAAC,GAAG,CAAC,+BAA+B,CAAC,KAAK,MAAM,EAAE,CAAC;QAC5D,OAAM;IACR,CAAC;IAED,MAAM,MAAM,GAAG,MAAM,gBAAgB,EAAE,CAAA;IAEvC,wDAAwD;IACxD,gEAAgE;IAChE,MAAM,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,wBAAwB,CAAC,CAAC,CAAA;IAC7D,IAAI,MAAM,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC;QAC5B,MAAM,IAAI,KAAK,CACb,6BAA6B;YAC3B,0GAA0G,CAC7G,CAAA;IACH,CAAC;IAED,MAAM,WAAW,GAAG,CAAC,MAAM,CAAC,IAAI,IAAI,WAAW,CAAgB,CAAA;IAC/D,MAAM,YAAY,GAAG,UAAU,CAAC,OAAO,CAAC,WAAW,CAAC,CAAA;IACpD,MAAM,aAAa,GAAG,UAAU,CAAC,OAAO,CAAC,WAAW,CAAC,CAAA;IAErD,IAAI,YAAY,GAAG,aAAa,EAAE,CAAC;QACjC,MAAM,OAAO,GAAG,YAAY,CAAC,WAAW,CAAC,CAAA;QACzC,MAAM,IAAI,KAAK,CACb,yBAAyB,WAAW,oBAAoB,OAAO,KAAK;YAClE,4BAA4B,WAAW,SAAS;YAChD,kDAAkD,WAAW,EAAE,CAClE,CAAA;IACH,CAAC;AACH,CAAC"}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Error output sanitization utilities
|
|
3
|
-
*
|
|
4
|
-
* Removes user-specific paths from error messages to prevent exposing
|
|
5
|
-
* home directory paths in CLI output (prevents E2E hardcoded value detection).
|
|
6
|
-
*/
|
|
7
|
-
/**
|
|
8
|
-
* Sanitize error messages to remove user-specific paths
|
|
9
|
-
*
|
|
10
|
-
* Replaces home directory paths with ~ for macOS/Linux/Windows systems.
|
|
11
|
-
* Handles multiple path formats:
|
|
12
|
-
* - Unix/Linux: /home/username/
|
|
13
|
-
* - macOS: /Users/username/
|
|
14
|
-
* - Windows: C:\Users\username\
|
|
15
|
-
*
|
|
16
|
-
* @param error - The error to sanitize (Error object or string)
|
|
17
|
-
* @returns Sanitized error message without user-specific paths
|
|
18
|
-
*/
|
|
19
|
-
export declare function sanitizeError(error: unknown): string;
|
|
20
|
-
/**
|
|
21
|
-
* Log error with sanitization
|
|
22
|
-
*
|
|
23
|
-
* Convenience function to log errors with automatic sanitization.
|
|
24
|
-
* Useful for consistent error logging across the CLI.
|
|
25
|
-
*
|
|
26
|
-
* @param prefix - Prefix text before the error (e.g., "Import failed:")
|
|
27
|
-
* @param error - The error to log
|
|
28
|
-
*/
|
|
29
|
-
export declare function logSanitizedError(prefix: string, error: unknown): void;
|
|
30
|
-
//# sourceMappingURL=sanitize.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"sanitize.d.ts","sourceRoot":"","sources":["../../../src/utils/sanitize.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH;;;;;;;;;;;GAWG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAgBpD;AAED;;;;;;;;GAQG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,GAAG,IAAI,CAEtE"}
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Error output sanitization utilities
|
|
3
|
-
*
|
|
4
|
-
* Removes user-specific paths from error messages to prevent exposing
|
|
5
|
-
* home directory paths in CLI output (prevents E2E hardcoded value detection).
|
|
6
|
-
*/
|
|
7
|
-
import { homedir } from 'os';
|
|
8
|
-
/**
|
|
9
|
-
* Sanitize error messages to remove user-specific paths
|
|
10
|
-
*
|
|
11
|
-
* Replaces home directory paths with ~ for macOS/Linux/Windows systems.
|
|
12
|
-
* Handles multiple path formats:
|
|
13
|
-
* - Unix/Linux: /home/username/
|
|
14
|
-
* - macOS: /Users/username/
|
|
15
|
-
* - Windows: C:\Users\username\
|
|
16
|
-
*
|
|
17
|
-
* @param error - The error to sanitize (Error object or string)
|
|
18
|
-
* @returns Sanitized error message without user-specific paths
|
|
19
|
-
*/
|
|
20
|
-
export function sanitizeError(error) {
|
|
21
|
-
const message = error instanceof Error ? error.message : String(error);
|
|
22
|
-
const home = homedir();
|
|
23
|
-
// Escape special regex characters in the home path
|
|
24
|
-
const escapedHome = home.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
|
|
25
|
-
// Replace home directory path with ~ (Unix-like systems)
|
|
26
|
-
let sanitized = message.replace(new RegExp(escapedHome, 'g'), '~');
|
|
27
|
-
// Also handle generic patterns for other systems if not already caught
|
|
28
|
-
sanitized = sanitized.replace(/\/Users\/[^/]+\//g, '~/');
|
|
29
|
-
sanitized = sanitized.replace(/\/home\/[^/]+\//g, '~/');
|
|
30
|
-
sanitized = sanitized.replace(/C:\\Users\\[^\\]+\\/gi, '~\\');
|
|
31
|
-
return sanitized;
|
|
32
|
-
}
|
|
33
|
-
/**
|
|
34
|
-
* Log error with sanitization
|
|
35
|
-
*
|
|
36
|
-
* Convenience function to log errors with automatic sanitization.
|
|
37
|
-
* Useful for consistent error logging across the CLI.
|
|
38
|
-
*
|
|
39
|
-
* @param prefix - Prefix text before the error (e.g., "Import failed:")
|
|
40
|
-
* @param error - The error to log
|
|
41
|
-
*/
|
|
42
|
-
export function logSanitizedError(prefix, error) {
|
|
43
|
-
console.error(prefix, sanitizeError(error));
|
|
44
|
-
}
|
|
45
|
-
//# sourceMappingURL=sanitize.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"sanitize.js","sourceRoot":"","sources":["../../../src/utils/sanitize.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,IAAI,CAAA;AAE5B;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,aAAa,CAAC,KAAc;IAC1C,MAAM,OAAO,GAAG,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAA;IACtE,MAAM,IAAI,GAAG,OAAO,EAAE,CAAA;IAEtB,mDAAmD;IACnD,MAAM,WAAW,GAAG,IAAI,CAAC,OAAO,CAAC,qBAAqB,EAAE,MAAM,CAAC,CAAA;IAE/D,yDAAyD;IACzD,IAAI,SAAS,GAAG,OAAO,CAAC,OAAO,CAAC,IAAI,MAAM,CAAC,WAAW,EAAE,GAAG,CAAC,EAAE,GAAG,CAAC,CAAA;IAElE,uEAAuE;IACvE,SAAS,GAAG,SAAS,CAAC,OAAO,CAAC,mBAAmB,EAAE,IAAI,CAAC,CAAA;IACxD,SAAS,GAAG,SAAS,CAAC,OAAO,CAAC,kBAAkB,EAAE,IAAI,CAAC,CAAA;IACvD,SAAS,GAAG,SAAS,CAAC,OAAO,CAAC,uBAAuB,EAAE,KAAK,CAAC,CAAA;IAE7D,OAAO,SAAS,CAAA;AAClB,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,UAAU,iBAAiB,CAAC,MAAc,EAAE,KAAc;IAC9D,OAAO,CAAC,KAAK,CAAC,MAAM,EAAE,aAAa,CAAC,KAAK,CAAC,CAAC,CAAA;AAC7C,CAAC"}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Shared skill name validation utilities.
|
|
3
|
-
*
|
|
4
|
-
* Used by both `skillsmith author init` and `skillsmith create` to enforce
|
|
5
|
-
* a consistent, registry-safe naming convention across all scaffolding paths.
|
|
6
|
-
*/
|
|
7
|
-
/**
|
|
8
|
-
* Valid skill names: lowercase letters, digits, and hyphens only.
|
|
9
|
-
* Must start with a lowercase letter.
|
|
10
|
-
* Matches the Skillsmith registry slug format.
|
|
11
|
-
*/
|
|
12
|
-
export declare const VALID_SKILL_NAME_RE: RegExp;
|
|
13
|
-
/**
|
|
14
|
-
* Validate a skill name against the canonical Skillsmith naming convention.
|
|
15
|
-
*
|
|
16
|
-
* @returns `true` if valid, or a string error message if invalid.
|
|
17
|
-
*/
|
|
18
|
-
export declare function validateSkillName(name: string): true | string;
|
|
19
|
-
//# sourceMappingURL=skill-name.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"skill-name.d.ts","sourceRoot":"","sources":["../../../src/utils/skill-name.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH;;;;GAIG;AACH,eAAO,MAAM,mBAAmB,QAAsB,CAAA;AAEtD;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,GAAG,MAAM,CAM7D"}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Shared skill name validation utilities.
|
|
3
|
-
*
|
|
4
|
-
* Used by both `skillsmith author init` and `skillsmith create` to enforce
|
|
5
|
-
* a consistent, registry-safe naming convention across all scaffolding paths.
|
|
6
|
-
*/
|
|
7
|
-
/**
|
|
8
|
-
* Valid skill names: lowercase letters, digits, and hyphens only.
|
|
9
|
-
* Must start with a lowercase letter.
|
|
10
|
-
* Matches the Skillsmith registry slug format.
|
|
11
|
-
*/
|
|
12
|
-
export const VALID_SKILL_NAME_RE = /^[a-z][a-z0-9-]*$/;
|
|
13
|
-
/**
|
|
14
|
-
* Validate a skill name against the canonical Skillsmith naming convention.
|
|
15
|
-
*
|
|
16
|
-
* @returns `true` if valid, or a string error message if invalid.
|
|
17
|
-
*/
|
|
18
|
-
export function validateSkillName(name) {
|
|
19
|
-
if (!name.trim())
|
|
20
|
-
return 'Skill name is required';
|
|
21
|
-
if (!VALID_SKILL_NAME_RE.test(name)) {
|
|
22
|
-
return 'Skill name must start with a lowercase letter and contain only lowercase letters, digits, and hyphens (e.g. my-skill)';
|
|
23
|
-
}
|
|
24
|
-
return true;
|
|
25
|
-
}
|
|
26
|
-
//# sourceMappingURL=skill-name.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"skill-name.js","sourceRoot":"","sources":["../../../src/utils/skill-name.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH;;;;GAIG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,mBAAmB,CAAA;AAEtD;;;;GAIG;AACH,MAAM,UAAU,iBAAiB,CAAC,IAAY;IAC5C,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE;QAAE,OAAO,wBAAwB,CAAA;IACjD,IAAI,CAAC,mBAAmB,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;QACpC,OAAO,uHAAuH,CAAA;IAChI,CAAC;IACD,OAAO,IAAI,CAAA;AACb,CAAC"}
|
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* SMI-2713: Extracted from manage.ts — helpers for reading installed skills
|
|
3
|
-
* from the global and local ~/.claude/skills directories.
|
|
4
|
-
*/
|
|
5
|
-
import { type TrustTier } from '@skillsmith/core';
|
|
6
|
-
import { type ClientId } from '@skillsmith/core/install';
|
|
7
|
-
export interface InstalledSkill {
|
|
8
|
-
name: string;
|
|
9
|
-
path: string;
|
|
10
|
-
version: string | null;
|
|
11
|
-
trustTier: TrustTier;
|
|
12
|
-
installDate: string;
|
|
13
|
-
hasUpdates: boolean;
|
|
14
|
-
/**
|
|
15
|
-
* SMI-4578: which client's directory this skill was discovered under.
|
|
16
|
-
* `'local'` = repo-local `./.claude/skills`. Other values are
|
|
17
|
-
* `ClientId` from the multi-client install table.
|
|
18
|
-
*/
|
|
19
|
-
installedVia: ClientId | 'local';
|
|
20
|
-
}
|
|
21
|
-
/**
|
|
22
|
-
* Get skills from a specific directory.
|
|
23
|
-
*
|
|
24
|
-
* When dbPath is provided, opens the skill_versions table to determine
|
|
25
|
-
* whether a newer content hash has been recorded since the skill was installed.
|
|
26
|
-
* Falls back to hasUpdates: false when the database is unavailable.
|
|
27
|
-
*
|
|
28
|
-
* @param skillsDir Directory to scan for installed skills
|
|
29
|
-
* @param dbPath Optional path to the Skillsmith SQLite database
|
|
30
|
-
* @param installedVia SMI-4578: which client (or `'local'`) this directory
|
|
31
|
-
* represents — propagated onto each returned skill so
|
|
32
|
-
* callers can render "installed via Cursor" badges.
|
|
33
|
-
*/
|
|
34
|
-
export declare function getSkillsFromDirectory(skillsDir: string, dbPath?: string, installedVia?: ClientId | 'local'): Promise<InstalledSkill[]>;
|
|
35
|
-
/**
|
|
36
|
-
* Per-harness/skill entry produced by {@link getInstalledSkillsPerHarness}.
|
|
37
|
-
* Feeds the cross-harness inventory builder (SMI-5390).
|
|
38
|
-
*
|
|
39
|
-
* `contentHash` is the sha256 hex digest of the skill's raw SKILL.md
|
|
40
|
-
* content — used by the inventory service for registry drift detection.
|
|
41
|
-
* It is `null` when SKILL.md is absent or unreadable.
|
|
42
|
-
*/
|
|
43
|
-
export interface HarnessSkillEntry {
|
|
44
|
-
/** Which harness directory the skill was found under. */
|
|
45
|
-
harness: ClientId | 'local';
|
|
46
|
-
/**
|
|
47
|
-
* Skill identifier: the `id` front-matter field when present (conventionally
|
|
48
|
-
* `author/name`), falling back to the `name` field, then the directory name.
|
|
49
|
-
*/
|
|
50
|
-
skillId: string;
|
|
51
|
-
/** Installed version string, or `null` if absent. */
|
|
52
|
-
version: string | null;
|
|
53
|
-
/** sha256 hex digest of SKILL.md content; `null` if unreadable. */
|
|
54
|
-
contentHash: string | null;
|
|
55
|
-
/** Absolute path to the skill directory. */
|
|
56
|
-
path: string;
|
|
57
|
-
}
|
|
58
|
-
/**
|
|
59
|
-
* Returns one {@link HarnessSkillEntry} per (harness × skill) observed on
|
|
60
|
-
* disk, deduplicated by realpath only.
|
|
61
|
-
*
|
|
62
|
-
* Unlike {@link getInstalledSkills}, this function:
|
|
63
|
-
* - Does **not** deduplicate by skill name — the same skill present under two
|
|
64
|
-
* distinct harness directories appears as two rows (different `path`).
|
|
65
|
-
* - Does deduplicate by realpath — a symlinked alias such as
|
|
66
|
-
* `~/.agents/skills/foo` → `~/.claude/skills/foo` collapses to one row.
|
|
67
|
-
* - Enriches each surviving entry with a sha256 `contentHash` computed from
|
|
68
|
-
* the SKILL.md content, for registry drift detection.
|
|
69
|
-
*
|
|
70
|
-
* Precedence order (first realpath wins when a symlink is detected): local
|
|
71
|
-
* (repo) > claude-code > cursor > copilot > windsurf > agents. Inherits the
|
|
72
|
-
* SMI-4578 ordering so local overrides are still respected.
|
|
73
|
-
*
|
|
74
|
-
* @see SMI-5390
|
|
75
|
-
*/
|
|
76
|
-
export declare function getInstalledSkillsPerHarness(): Promise<HarnessSkillEntry[]>;
|
|
77
|
-
/**
|
|
78
|
-
* Get list of installed skills across every client directory.
|
|
79
|
-
*
|
|
80
|
-
* SMI-4578: scans the union of `CLIENT_NATIVE_PATHS` (claude-code,
|
|
81
|
-
* cursor, copilot, windsurf, agents) plus repo-local
|
|
82
|
-
* `./.claude/skills`. Results are deduplicated by `realpath` so a
|
|
83
|
-
* symlinked `~/.agents/skills/foo` pointing at `~/.claude/skills/foo`
|
|
84
|
-
* is reported once. Each entry carries `installedVia` so the caller
|
|
85
|
-
* can render "installed via Cursor" badges.
|
|
86
|
-
*
|
|
87
|
-
* Precedence (first wins after dedup): local (repo) > claude-code >
|
|
88
|
-
* cursor > copilot > windsurf > agents. This keeps the SMI-1630
|
|
89
|
-
* promise that repo-local overrides global.
|
|
90
|
-
*
|
|
91
|
-
* @param dbPath Optional path to the Skillsmith SQLite database for
|
|
92
|
-
* update detection.
|
|
93
|
-
*/
|
|
94
|
-
export declare function getInstalledSkills(dbPath?: string): Promise<InstalledSkill[]>;
|
|
95
|
-
//# sourceMappingURL=skills-directory.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"skills-directory.d.ts","sourceRoot":"","sources":["../../../src/utils/skills-directory.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAKH,OAAO,EAIL,KAAK,SAAS,EACf,MAAM,kBAAkB,CAAA;AAEzB,OAAO,EAIL,KAAK,QAAQ,EACd,MAAM,0BAA0B,CAAA;AAGjC,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,MAAM,CAAA;IACZ,OAAO,EAAE,MAAM,GAAG,IAAI,CAAA;IACtB,SAAS,EAAE,SAAS,CAAA;IACpB,WAAW,EAAE,MAAM,CAAA;IACnB,UAAU,EAAE,OAAO,CAAA;IACnB;;;;OAIG;IACH,YAAY,EAAE,QAAQ,GAAG,OAAO,CAAA;CACjC;AAiBD;;;;;;;;;;;;GAYG;AACH,wBAAsB,sBAAsB,CAC1C,SAAS,EAAE,MAAM,EACjB,MAAM,CAAC,EAAE,MAAM,EACf,YAAY,GAAE,QAAQ,GAAG,OAA0B,GAClD,OAAO,CAAC,cAAc,EAAE,CAAC,CAsG3B;AAgBD;;;;;;;GAOG;AACH,MAAM,WAAW,iBAAiB;IAChC,yDAAyD;IACzD,OAAO,EAAE,QAAQ,GAAG,OAAO,CAAA;IAC3B;;;OAGG;IACH,OAAO,EAAE,MAAM,CAAA;IACf,qDAAqD;IACrD,OAAO,EAAE,MAAM,GAAG,IAAI,CAAA;IACtB,mEAAmE;IACnE,WAAW,EAAE,MAAM,GAAG,IAAI,CAAA;IAC1B,4CAA4C;IAC5C,IAAI,EAAE,MAAM,CAAA;CACb;AAuBD;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAsB,4BAA4B,IAAI,OAAO,CAAC,iBAAiB,EAAE,CAAC,CAyCjF;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAsB,kBAAkB,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,EAAE,CAAC,CAwCnF"}
|