@skillsmith/cli 0.7.2 → 0.7.4
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 +44014 -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 -285
- 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 -108
- 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,653 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* SMI-746: Skill Authoring Commands Tests
|
|
3
|
-
*/
|
|
4
|
-
import { describe, it, expect, vi, beforeEach, afterEach } from 'vitest';
|
|
5
|
-
import { Command } from 'commander';
|
|
6
|
-
// Mock file system
|
|
7
|
-
vi.mock('fs/promises', () => ({
|
|
8
|
-
mkdir: vi.fn(),
|
|
9
|
-
writeFile: vi.fn(),
|
|
10
|
-
readFile: vi.fn(),
|
|
11
|
-
stat: vi.fn(),
|
|
12
|
-
access: vi.fn(),
|
|
13
|
-
}));
|
|
14
|
-
// Mock inquirer
|
|
15
|
-
vi.mock('@inquirer/prompts', () => ({
|
|
16
|
-
input: vi.fn(),
|
|
17
|
-
confirm: vi.fn(),
|
|
18
|
-
select: vi.fn(),
|
|
19
|
-
}));
|
|
20
|
-
// Mock ora
|
|
21
|
-
vi.mock('ora', () => ({
|
|
22
|
-
default: vi.fn(() => ({
|
|
23
|
-
start: vi.fn().mockReturnThis(),
|
|
24
|
-
stop: vi.fn().mockReturnThis(),
|
|
25
|
-
succeed: vi.fn().mockReturnThis(),
|
|
26
|
-
fail: vi.fn().mockReturnThis(),
|
|
27
|
-
warn: vi.fn().mockReturnThis(),
|
|
28
|
-
text: '',
|
|
29
|
-
})),
|
|
30
|
-
}));
|
|
31
|
-
// Mock core
|
|
32
|
-
vi.mock('@skillsmith/core', () => ({
|
|
33
|
-
SkillParser: vi.fn(() => ({
|
|
34
|
-
parse: vi.fn(),
|
|
35
|
-
parseWithValidation: vi.fn(() => ({
|
|
36
|
-
metadata: null,
|
|
37
|
-
validation: { valid: false, errors: ['Test error'], warnings: [] },
|
|
38
|
-
frontmatter: null,
|
|
39
|
-
})),
|
|
40
|
-
inferTrustTier: vi.fn(() => 'unknown'),
|
|
41
|
-
})),
|
|
42
|
-
}));
|
|
43
|
-
describe('SMI-746: Skill Authoring Commands', () => {
|
|
44
|
-
beforeEach(() => {
|
|
45
|
-
vi.clearAllMocks();
|
|
46
|
-
});
|
|
47
|
-
afterEach(() => {
|
|
48
|
-
vi.restoreAllMocks();
|
|
49
|
-
});
|
|
50
|
-
describe('createInitCommand', () => {
|
|
51
|
-
it('creates a command with correct name', async () => {
|
|
52
|
-
const { createInitCommand } = await import('../src/commands/author/index.js');
|
|
53
|
-
const cmd = createInitCommand();
|
|
54
|
-
expect(cmd).toBeInstanceOf(Command);
|
|
55
|
-
expect(cmd.name()).toBe('init');
|
|
56
|
-
});
|
|
57
|
-
it('has path option with default', async () => {
|
|
58
|
-
const { createInitCommand } = await import('../src/commands/author/index.js');
|
|
59
|
-
const cmd = createInitCommand();
|
|
60
|
-
const pathOpt = cmd.options.find((o) => o.short === '-p');
|
|
61
|
-
expect(pathOpt).toBeDefined();
|
|
62
|
-
expect(pathOpt?.defaultValue).toBe('.');
|
|
63
|
-
});
|
|
64
|
-
it('accepts optional name argument', async () => {
|
|
65
|
-
const { createInitCommand } = await import('../src/commands/author/index.js');
|
|
66
|
-
const cmd = createInitCommand();
|
|
67
|
-
// Has one optional argument for name
|
|
68
|
-
expect(cmd.registeredArguments.length).toBeGreaterThanOrEqual(0);
|
|
69
|
-
});
|
|
70
|
-
});
|
|
71
|
-
describe('createValidateCommand', () => {
|
|
72
|
-
it('creates a command with correct name', async () => {
|
|
73
|
-
const { createValidateCommand } = await import('../src/commands/author/index.js');
|
|
74
|
-
const cmd = createValidateCommand();
|
|
75
|
-
expect(cmd).toBeInstanceOf(Command);
|
|
76
|
-
expect(cmd.name()).toBe('validate');
|
|
77
|
-
});
|
|
78
|
-
it('accepts optional path argument with default', async () => {
|
|
79
|
-
const { createValidateCommand } = await import('../src/commands/author/index.js');
|
|
80
|
-
const cmd = createValidateCommand();
|
|
81
|
-
expect(cmd.registeredArguments.length).toBe(1);
|
|
82
|
-
expect(cmd.registeredArguments[0]?.defaultValue).toBe('.');
|
|
83
|
-
});
|
|
84
|
-
});
|
|
85
|
-
describe('createPublishCommand', () => {
|
|
86
|
-
it('creates a command with correct name', async () => {
|
|
87
|
-
const { createPublishCommand } = await import('../src/commands/author/index.js');
|
|
88
|
-
const cmd = createPublishCommand();
|
|
89
|
-
expect(cmd).toBeInstanceOf(Command);
|
|
90
|
-
expect(cmd.name()).toBe('publish');
|
|
91
|
-
});
|
|
92
|
-
it('accepts optional path argument with default', async () => {
|
|
93
|
-
const { createPublishCommand } = await import('../src/commands/author/index.js');
|
|
94
|
-
const cmd = createPublishCommand();
|
|
95
|
-
expect(cmd.registeredArguments.length).toBe(1);
|
|
96
|
-
expect(cmd.registeredArguments[0]?.defaultValue).toBe('.');
|
|
97
|
-
});
|
|
98
|
-
});
|
|
99
|
-
describe('Exported Functions', () => {
|
|
100
|
-
it('exports initSkill function', async () => {
|
|
101
|
-
const module = await import('../src/commands/author/index.js');
|
|
102
|
-
expect(typeof module.initSkill).toBe('function');
|
|
103
|
-
});
|
|
104
|
-
it('exports validateSkill function', async () => {
|
|
105
|
-
const module = await import('../src/commands/author/index.js');
|
|
106
|
-
expect(typeof module.validateSkill).toBe('function');
|
|
107
|
-
});
|
|
108
|
-
it('exports publishSkill function', async () => {
|
|
109
|
-
const module = await import('../src/commands/author/index.js');
|
|
110
|
-
expect(typeof module.publishSkill).toBe('function');
|
|
111
|
-
});
|
|
112
|
-
it('exports generateSubagent function', async () => {
|
|
113
|
-
const module = await import('../src/commands/author/index.js');
|
|
114
|
-
expect(typeof module.generateSubagent).toBe('function');
|
|
115
|
-
});
|
|
116
|
-
it('exports transformSkill function', async () => {
|
|
117
|
-
const module = await import('../src/commands/author/index.js');
|
|
118
|
-
expect(typeof module.transformSkill).toBe('function');
|
|
119
|
-
});
|
|
120
|
-
});
|
|
121
|
-
// SMI-1389: Subagent Command Tests
|
|
122
|
-
describe('createSubagentCommand', () => {
|
|
123
|
-
it('creates a command with correct name', async () => {
|
|
124
|
-
const { createSubagentCommand } = await import('../src/commands/author/index.js');
|
|
125
|
-
const cmd = createSubagentCommand();
|
|
126
|
-
expect(cmd).toBeInstanceOf(Command);
|
|
127
|
-
expect(cmd.name()).toBe('subagent');
|
|
128
|
-
});
|
|
129
|
-
it('has output option with default', async () => {
|
|
130
|
-
const { createSubagentCommand } = await import('../src/commands/author/index.js');
|
|
131
|
-
const cmd = createSubagentCommand();
|
|
132
|
-
const outputOpt = cmd.options.find((o) => o.short === '-o');
|
|
133
|
-
expect(outputOpt).toBeDefined();
|
|
134
|
-
expect(outputOpt?.defaultValue).toBe('~/.claude/agents');
|
|
135
|
-
});
|
|
136
|
-
it('has tools option', async () => {
|
|
137
|
-
const { createSubagentCommand } = await import('../src/commands/author/index.js');
|
|
138
|
-
const cmd = createSubagentCommand();
|
|
139
|
-
const toolsOpt = cmd.options.find((o) => o.long === '--tools');
|
|
140
|
-
expect(toolsOpt).toBeDefined();
|
|
141
|
-
});
|
|
142
|
-
it('has model option with sonnet default', async () => {
|
|
143
|
-
const { createSubagentCommand } = await import('../src/commands/author/index.js');
|
|
144
|
-
const cmd = createSubagentCommand();
|
|
145
|
-
const modelOpt = cmd.options.find((o) => o.long === '--model');
|
|
146
|
-
expect(modelOpt).toBeDefined();
|
|
147
|
-
expect(modelOpt?.defaultValue).toBe('sonnet');
|
|
148
|
-
});
|
|
149
|
-
it('has skip-claude-md option', async () => {
|
|
150
|
-
const { createSubagentCommand } = await import('../src/commands/author/index.js');
|
|
151
|
-
const cmd = createSubagentCommand();
|
|
152
|
-
const skipOpt = cmd.options.find((o) => o.long === '--skip-claude-md');
|
|
153
|
-
expect(skipOpt).toBeDefined();
|
|
154
|
-
});
|
|
155
|
-
it('accepts optional path argument with default', async () => {
|
|
156
|
-
const { createSubagentCommand } = await import('../src/commands/author/index.js');
|
|
157
|
-
const cmd = createSubagentCommand();
|
|
158
|
-
expect(cmd.registeredArguments.length).toBe(1);
|
|
159
|
-
expect(cmd.registeredArguments[0]?.defaultValue).toBe('.');
|
|
160
|
-
});
|
|
161
|
-
});
|
|
162
|
-
// SMI-1390: Transform Command Tests
|
|
163
|
-
describe('createTransformCommand', () => {
|
|
164
|
-
it('creates a command with correct name', async () => {
|
|
165
|
-
const { createTransformCommand } = await import('../src/commands/author/index.js');
|
|
166
|
-
const cmd = createTransformCommand();
|
|
167
|
-
expect(cmd).toBeInstanceOf(Command);
|
|
168
|
-
expect(cmd.name()).toBe('transform');
|
|
169
|
-
});
|
|
170
|
-
it('has dry-run option', async () => {
|
|
171
|
-
const { createTransformCommand } = await import('../src/commands/author/index.js');
|
|
172
|
-
const cmd = createTransformCommand();
|
|
173
|
-
const dryRunOpt = cmd.options.find((o) => o.long === '--dry-run');
|
|
174
|
-
expect(dryRunOpt).toBeDefined();
|
|
175
|
-
});
|
|
176
|
-
it('has force option', async () => {
|
|
177
|
-
const { createTransformCommand } = await import('../src/commands/author/index.js');
|
|
178
|
-
const cmd = createTransformCommand();
|
|
179
|
-
const forceOpt = cmd.options.find((o) => o.long === '--force');
|
|
180
|
-
expect(forceOpt).toBeDefined();
|
|
181
|
-
});
|
|
182
|
-
it('has batch option', async () => {
|
|
183
|
-
const { createTransformCommand } = await import('../src/commands/author/index.js');
|
|
184
|
-
const cmd = createTransformCommand();
|
|
185
|
-
const batchOpt = cmd.options.find((o) => o.long === '--batch');
|
|
186
|
-
expect(batchOpt).toBeDefined();
|
|
187
|
-
});
|
|
188
|
-
it('accepts optional path argument with default', async () => {
|
|
189
|
-
const { createTransformCommand } = await import('../src/commands/author/index.js');
|
|
190
|
-
const cmd = createTransformCommand();
|
|
191
|
-
expect(cmd.registeredArguments.length).toBe(1);
|
|
192
|
-
expect(cmd.registeredArguments[0]?.defaultValue).toBe('.');
|
|
193
|
-
});
|
|
194
|
-
});
|
|
195
|
-
});
|
|
196
|
-
describe('SMI-1389: Subagent Command', () => {
|
|
197
|
-
describe('createSubagentCommand', () => {
|
|
198
|
-
it('creates a command with correct name', async () => {
|
|
199
|
-
const { createSubagentCommand } = await import('../src/commands/author/index.js');
|
|
200
|
-
const cmd = createSubagentCommand();
|
|
201
|
-
expect(cmd).toBeInstanceOf(Command);
|
|
202
|
-
expect(cmd.name()).toBe('subagent');
|
|
203
|
-
});
|
|
204
|
-
it('has output option with default', async () => {
|
|
205
|
-
const { createSubagentCommand } = await import('../src/commands/author/index.js');
|
|
206
|
-
const cmd = createSubagentCommand();
|
|
207
|
-
const outputOpt = cmd.options.find((o) => o.short === '-o');
|
|
208
|
-
expect(outputOpt).toBeDefined();
|
|
209
|
-
expect(outputOpt?.defaultValue).toBe('~/.claude/agents');
|
|
210
|
-
});
|
|
211
|
-
it('has model option with default sonnet', async () => {
|
|
212
|
-
const { createSubagentCommand } = await import('../src/commands/author/index.js');
|
|
213
|
-
const cmd = createSubagentCommand();
|
|
214
|
-
const modelOpt = cmd.options.find((o) => o.long === '--model');
|
|
215
|
-
expect(modelOpt).toBeDefined();
|
|
216
|
-
expect(modelOpt?.defaultValue).toBe('sonnet');
|
|
217
|
-
});
|
|
218
|
-
it('has force flag', async () => {
|
|
219
|
-
const { createSubagentCommand } = await import('../src/commands/author/index.js');
|
|
220
|
-
const cmd = createSubagentCommand();
|
|
221
|
-
const forceOpt = cmd.options.find((o) => o.long === '--force');
|
|
222
|
-
expect(forceOpt).toBeDefined();
|
|
223
|
-
});
|
|
224
|
-
it('has skip-claude-md flag', async () => {
|
|
225
|
-
const { createSubagentCommand } = await import('../src/commands/author/index.js');
|
|
226
|
-
const cmd = createSubagentCommand();
|
|
227
|
-
const skipOpt = cmd.options.find((o) => o.long === '--skip-claude-md');
|
|
228
|
-
expect(skipOpt).toBeDefined();
|
|
229
|
-
});
|
|
230
|
-
});
|
|
231
|
-
});
|
|
232
|
-
describe('SMI-1390: Transform Command', () => {
|
|
233
|
-
describe('createTransformCommand', () => {
|
|
234
|
-
it('creates a command with correct name', async () => {
|
|
235
|
-
const { createTransformCommand } = await import('../src/commands/author/index.js');
|
|
236
|
-
const cmd = createTransformCommand();
|
|
237
|
-
expect(cmd).toBeInstanceOf(Command);
|
|
238
|
-
expect(cmd.name()).toBe('transform');
|
|
239
|
-
});
|
|
240
|
-
it('has dry-run flag', async () => {
|
|
241
|
-
const { createTransformCommand } = await import('../src/commands/author/index.js');
|
|
242
|
-
const cmd = createTransformCommand();
|
|
243
|
-
const dryRunOpt = cmd.options.find((o) => o.long === '--dry-run');
|
|
244
|
-
expect(dryRunOpt).toBeDefined();
|
|
245
|
-
});
|
|
246
|
-
it('has batch flag', async () => {
|
|
247
|
-
const { createTransformCommand } = await import('../src/commands/author/index.js');
|
|
248
|
-
const cmd = createTransformCommand();
|
|
249
|
-
const batchOpt = cmd.options.find((o) => o.long === '--batch');
|
|
250
|
-
expect(batchOpt).toBeDefined();
|
|
251
|
-
});
|
|
252
|
-
it('has force flag', async () => {
|
|
253
|
-
const { createTransformCommand } = await import('../src/commands/author/index.js');
|
|
254
|
-
const cmd = createTransformCommand();
|
|
255
|
-
const forceOpt = cmd.options.find((o) => o.long === '--force');
|
|
256
|
-
expect(forceOpt).toBeDefined();
|
|
257
|
-
});
|
|
258
|
-
});
|
|
259
|
-
describe('Exported Functions', () => {
|
|
260
|
-
it('exports generateSubagent function', async () => {
|
|
261
|
-
const module = await import('../src/commands/author/index.js');
|
|
262
|
-
expect(typeof module.generateSubagent).toBe('function');
|
|
263
|
-
});
|
|
264
|
-
it('exports transformSkill function', async () => {
|
|
265
|
-
const module = await import('../src/commands/author/index.js');
|
|
266
|
-
expect(typeof module.transformSkill).toBe('function');
|
|
267
|
-
});
|
|
268
|
-
});
|
|
269
|
-
});
|
|
270
|
-
describe('Templates', () => {
|
|
271
|
-
describe('SKILL_MD_TEMPLATE', () => {
|
|
272
|
-
it('is exported from templates', async () => {
|
|
273
|
-
const { SKILL_MD_TEMPLATE } = await import('../src/templates/index.js');
|
|
274
|
-
expect(typeof SKILL_MD_TEMPLATE).toBe('string');
|
|
275
|
-
});
|
|
276
|
-
it('contains required placeholders', async () => {
|
|
277
|
-
const { SKILL_MD_TEMPLATE } = await import('../src/templates/index.js');
|
|
278
|
-
expect(SKILL_MD_TEMPLATE).toContain('{{name}}');
|
|
279
|
-
expect(SKILL_MD_TEMPLATE).toContain('{{description}}');
|
|
280
|
-
expect(SKILL_MD_TEMPLATE).toContain('{{author}}');
|
|
281
|
-
expect(SKILL_MD_TEMPLATE).toContain('{{category}}');
|
|
282
|
-
expect(SKILL_MD_TEMPLATE).toContain('{{date}}');
|
|
283
|
-
});
|
|
284
|
-
it('contains YAML frontmatter delimiters', async () => {
|
|
285
|
-
const { SKILL_MD_TEMPLATE } = await import('../src/templates/index.js');
|
|
286
|
-
expect(SKILL_MD_TEMPLATE).toMatch(/^---/);
|
|
287
|
-
expect(SKILL_MD_TEMPLATE).toContain('---\n\n#');
|
|
288
|
-
});
|
|
289
|
-
});
|
|
290
|
-
describe('README_MD_TEMPLATE', () => {
|
|
291
|
-
it('is exported from templates', async () => {
|
|
292
|
-
const { README_MD_TEMPLATE } = await import('../src/templates/index.js');
|
|
293
|
-
expect(typeof README_MD_TEMPLATE).toBe('string');
|
|
294
|
-
});
|
|
295
|
-
it('contains required placeholders', async () => {
|
|
296
|
-
const { README_MD_TEMPLATE } = await import('../src/templates/index.js');
|
|
297
|
-
expect(README_MD_TEMPLATE).toContain('{{name}}');
|
|
298
|
-
expect(README_MD_TEMPLATE).toContain('{{description}}');
|
|
299
|
-
});
|
|
300
|
-
it('includes installation instructions', async () => {
|
|
301
|
-
const { README_MD_TEMPLATE } = await import('../src/templates/index.js');
|
|
302
|
-
expect(README_MD_TEMPLATE).toContain('skillsmith install');
|
|
303
|
-
expect(README_MD_TEMPLATE).toContain('~/.claude/skills/');
|
|
304
|
-
});
|
|
305
|
-
});
|
|
306
|
-
describe('SUBAGENT_MD_TEMPLATE', () => {
|
|
307
|
-
it('is exported from templates', async () => {
|
|
308
|
-
const { SUBAGENT_MD_TEMPLATE } = await import('../src/templates/index.js');
|
|
309
|
-
expect(typeof SUBAGENT_MD_TEMPLATE).toBe('string');
|
|
310
|
-
});
|
|
311
|
-
it('contains required placeholders', async () => {
|
|
312
|
-
const { SUBAGENT_MD_TEMPLATE } = await import('../src/templates/index.js');
|
|
313
|
-
expect(SUBAGENT_MD_TEMPLATE).toContain('{{skillName}}');
|
|
314
|
-
expect(SUBAGENT_MD_TEMPLATE).toContain('{{description}}');
|
|
315
|
-
expect(SUBAGENT_MD_TEMPLATE).toContain('{{tools}}');
|
|
316
|
-
expect(SUBAGENT_MD_TEMPLATE).toContain('{{model}}');
|
|
317
|
-
});
|
|
318
|
-
it('contains YAML frontmatter delimiters', async () => {
|
|
319
|
-
const { SUBAGENT_MD_TEMPLATE } = await import('../src/templates/index.js');
|
|
320
|
-
expect(SUBAGENT_MD_TEMPLATE).toMatch(/^---/);
|
|
321
|
-
expect(SUBAGENT_MD_TEMPLATE).toContain('---\n\n##');
|
|
322
|
-
});
|
|
323
|
-
it('contains Operating Protocol section', async () => {
|
|
324
|
-
const { SUBAGENT_MD_TEMPLATE } = await import('../src/templates/index.js');
|
|
325
|
-
expect(SUBAGENT_MD_TEMPLATE).toContain('## Operating Protocol');
|
|
326
|
-
});
|
|
327
|
-
it('contains Output Format section', async () => {
|
|
328
|
-
const { SUBAGENT_MD_TEMPLATE } = await import('../src/templates/index.js');
|
|
329
|
-
expect(SUBAGENT_MD_TEMPLATE).toContain('## Output Format');
|
|
330
|
-
});
|
|
331
|
-
});
|
|
332
|
-
describe('renderSubagentTemplate', () => {
|
|
333
|
-
it('renders template with provided data', async () => {
|
|
334
|
-
const { renderSubagentTemplate } = await import('../src/templates/index.js');
|
|
335
|
-
const result = renderSubagentTemplate({
|
|
336
|
-
skillName: 'test-skill',
|
|
337
|
-
description: 'A test skill',
|
|
338
|
-
triggerPhrases: ['run test', 'execute test'],
|
|
339
|
-
tools: ['Read', 'Bash'],
|
|
340
|
-
model: 'sonnet',
|
|
341
|
-
});
|
|
342
|
-
expect(result).toContain('name: test-skill-specialist');
|
|
343
|
-
expect(result).toContain('A test skill');
|
|
344
|
-
expect(result).toContain('Read, Bash');
|
|
345
|
-
expect(result).toContain('model: sonnet');
|
|
346
|
-
});
|
|
347
|
-
it('formats trigger phrases correctly', async () => {
|
|
348
|
-
const { renderSubagentTemplate } = await import('../src/templates/index.js');
|
|
349
|
-
const result = renderSubagentTemplate({
|
|
350
|
-
skillName: 'my-skill',
|
|
351
|
-
description: 'Description',
|
|
352
|
-
triggerPhrases: ['phrase one', 'phrase two'],
|
|
353
|
-
tools: ['Read'],
|
|
354
|
-
model: 'haiku',
|
|
355
|
-
});
|
|
356
|
-
expect(result).toContain('"phrase one"');
|
|
357
|
-
expect(result).toContain('"phrase two"');
|
|
358
|
-
});
|
|
359
|
-
});
|
|
360
|
-
describe('renderClaudeMdSnippet', () => {
|
|
361
|
-
it('renders CLAUDE.md snippet', async () => {
|
|
362
|
-
const { renderClaudeMdSnippet } = await import('../src/templates/index.js');
|
|
363
|
-
const result = renderClaudeMdSnippet({
|
|
364
|
-
skillName: 'my-skill',
|
|
365
|
-
description: 'A cool skill',
|
|
366
|
-
triggerPhrases: ['do something'],
|
|
367
|
-
tools: ['Read', 'Write'],
|
|
368
|
-
model: 'opus',
|
|
369
|
-
});
|
|
370
|
-
expect(result).toContain('Subagent Delegation: my-skill');
|
|
371
|
-
expect(result).toContain('my-skill-specialist');
|
|
372
|
-
expect(result).toContain('do something');
|
|
373
|
-
});
|
|
374
|
-
});
|
|
375
|
-
});
|
|
376
|
-
describe('Tool Analyzer', () => {
|
|
377
|
-
describe('analyzeToolRequirements', () => {
|
|
378
|
-
it('always includes Read tool', async () => {
|
|
379
|
-
const { analyzeToolRequirements } = await import('../src/utils/tool-analyzer.js');
|
|
380
|
-
const result = analyzeToolRequirements('Some basic content');
|
|
381
|
-
expect(result.requiredTools).toContain('Read');
|
|
382
|
-
});
|
|
383
|
-
it('detects Write tool from content', async () => {
|
|
384
|
-
const { analyzeToolRequirements } = await import('../src/utils/tool-analyzer.js');
|
|
385
|
-
const result = analyzeToolRequirements('This skill will write files');
|
|
386
|
-
expect(result.requiredTools).toContain('Write');
|
|
387
|
-
});
|
|
388
|
-
it('detects Bash tool from npm commands', async () => {
|
|
389
|
-
const { analyzeToolRequirements } = await import('../src/utils/tool-analyzer.js');
|
|
390
|
-
const result = analyzeToolRequirements('Run npm install to set up');
|
|
391
|
-
expect(result.requiredTools).toContain('Bash');
|
|
392
|
-
});
|
|
393
|
-
it('detects Grep tool from search patterns', async () => {
|
|
394
|
-
const { analyzeToolRequirements } = await import('../src/utils/tool-analyzer.js');
|
|
395
|
-
const result = analyzeToolRequirements('Search for text in files');
|
|
396
|
-
expect(result.requiredTools).toContain('Grep');
|
|
397
|
-
});
|
|
398
|
-
it('detects WebFetch from URL mentions', async () => {
|
|
399
|
-
const { analyzeToolRequirements } = await import('../src/utils/tool-analyzer.js');
|
|
400
|
-
const result = analyzeToolRequirements('Fetch data from the API using http requests');
|
|
401
|
-
expect(result.requiredTools).toContain('WebFetch');
|
|
402
|
-
});
|
|
403
|
-
it('returns high confidence for many matches', async () => {
|
|
404
|
-
const { analyzeToolRequirements } = await import('../src/utils/tool-analyzer.js');
|
|
405
|
-
const result = analyzeToolRequirements('Write files, run bash commands, search text, and fetch URLs');
|
|
406
|
-
expect(result.confidence).toBe('high');
|
|
407
|
-
});
|
|
408
|
-
it('returns low confidence for no matches', async () => {
|
|
409
|
-
const { analyzeToolRequirements } = await import('../src/utils/tool-analyzer.js');
|
|
410
|
-
const result = analyzeToolRequirements('Simple description with no tool keywords');
|
|
411
|
-
expect(result.confidence).toBe('low');
|
|
412
|
-
});
|
|
413
|
-
});
|
|
414
|
-
describe('formatToolList', () => {
|
|
415
|
-
it('formats tool array to comma-separated string', async () => {
|
|
416
|
-
const { formatToolList } = await import('../src/utils/tool-analyzer.js');
|
|
417
|
-
const result = formatToolList(['Read', 'Write', 'Bash']);
|
|
418
|
-
expect(result).toBe('Read, Write, Bash');
|
|
419
|
-
});
|
|
420
|
-
it('returns Read for empty array', async () => {
|
|
421
|
-
const { formatToolList } = await import('../src/utils/tool-analyzer.js');
|
|
422
|
-
const result = formatToolList([]);
|
|
423
|
-
expect(result).toBe('Read');
|
|
424
|
-
});
|
|
425
|
-
});
|
|
426
|
-
describe('parseToolsString', () => {
|
|
427
|
-
it('parses comma-separated tools', async () => {
|
|
428
|
-
const { parseToolsString } = await import('../src/utils/tool-analyzer.js');
|
|
429
|
-
const result = parseToolsString('Read, Write, Bash');
|
|
430
|
-
expect(result).toEqual(['Read', 'Write', 'Bash']);
|
|
431
|
-
});
|
|
432
|
-
it('trims whitespace', async () => {
|
|
433
|
-
const { parseToolsString } = await import('../src/utils/tool-analyzer.js');
|
|
434
|
-
const result = parseToolsString(' Read , Write ');
|
|
435
|
-
expect(result).toEqual(['Read', 'Write']);
|
|
436
|
-
});
|
|
437
|
-
});
|
|
438
|
-
describe('validateTools', () => {
|
|
439
|
-
it('validates known tools', async () => {
|
|
440
|
-
const { validateTools } = await import('../src/utils/tool-analyzer.js');
|
|
441
|
-
const result = validateTools(['Read', 'Write', 'Bash']);
|
|
442
|
-
expect(result.valid).toBe(true);
|
|
443
|
-
expect(result.unrecognized).toEqual([]);
|
|
444
|
-
});
|
|
445
|
-
it('identifies unrecognized tools', async () => {
|
|
446
|
-
const { validateTools } = await import('../src/utils/tool-analyzer.js');
|
|
447
|
-
const result = validateTools(['Read', 'UnknownTool']);
|
|
448
|
-
expect(result.valid).toBe(false);
|
|
449
|
-
expect(result.unrecognized).toContain('UnknownTool');
|
|
450
|
-
});
|
|
451
|
-
});
|
|
452
|
-
});
|
|
453
|
-
describe('SMI-1433: MCP Server Scaffolding Command', () => {
|
|
454
|
-
beforeEach(() => {
|
|
455
|
-
vi.clearAllMocks();
|
|
456
|
-
});
|
|
457
|
-
describe('initMcpServer Integration', () => {
|
|
458
|
-
it('creates all 8 files when directory does not exist', async () => {
|
|
459
|
-
const { stat, mkdir, writeFile } = await import('fs/promises');
|
|
460
|
-
const { input, confirm } = await import('@inquirer/prompts');
|
|
461
|
-
// Directory doesn't exist
|
|
462
|
-
vi.mocked(stat).mockRejectedValue(new Error('ENOENT'));
|
|
463
|
-
vi.mocked(mkdir).mockResolvedValue(undefined);
|
|
464
|
-
vi.mocked(writeFile).mockResolvedValue(undefined);
|
|
465
|
-
// Prompt responses
|
|
466
|
-
vi.mocked(input)
|
|
467
|
-
.mockResolvedValueOnce('test-server') // name
|
|
468
|
-
.mockResolvedValueOnce('Test description') // description
|
|
469
|
-
.mockResolvedValueOnce('test-author'); // author
|
|
470
|
-
vi.mocked(confirm).mockResolvedValue(false); // don't add tools interactively
|
|
471
|
-
// Dynamically import to get fresh mocks
|
|
472
|
-
const { initMcpServer } = await import('../src/commands/author/index.js');
|
|
473
|
-
await initMcpServer(undefined, {});
|
|
474
|
-
// Verify all 8 files are written
|
|
475
|
-
expect(vi.mocked(writeFile)).toHaveBeenCalledTimes(8);
|
|
476
|
-
// Verify expected file paths
|
|
477
|
-
const writeCalls = vi.mocked(writeFile).mock.calls;
|
|
478
|
-
const writtenPaths = writeCalls.map((call) => {
|
|
479
|
-
const path = call[0];
|
|
480
|
-
// Extract relative path from the full path
|
|
481
|
-
const parts = path.split('/test-server/');
|
|
482
|
-
return parts[1] || path.split('/').pop();
|
|
483
|
-
});
|
|
484
|
-
expect(writtenPaths).toContain('package.json');
|
|
485
|
-
expect(writtenPaths).toContain('tsconfig.json');
|
|
486
|
-
expect(writtenPaths).toContain('README.md');
|
|
487
|
-
expect(writtenPaths).toContain('.gitignore');
|
|
488
|
-
});
|
|
489
|
-
it('includes tool definitions when --tools option is used', async () => {
|
|
490
|
-
const { stat, mkdir, writeFile } = await import('fs/promises');
|
|
491
|
-
const { input } = await import('@inquirer/prompts');
|
|
492
|
-
// Directory doesn't exist
|
|
493
|
-
vi.mocked(stat).mockRejectedValue(new Error('ENOENT'));
|
|
494
|
-
vi.mocked(mkdir).mockResolvedValue(undefined);
|
|
495
|
-
vi.mocked(writeFile).mockResolvedValue(undefined);
|
|
496
|
-
// Prompt responses
|
|
497
|
-
vi.mocked(input)
|
|
498
|
-
.mockResolvedValueOnce('tool-server') // name
|
|
499
|
-
.mockResolvedValueOnce('Server with tools') // description
|
|
500
|
-
.mockResolvedValueOnce('author'); // author
|
|
501
|
-
const { initMcpServer } = await import('../src/commands/author/index.js');
|
|
502
|
-
await initMcpServer(undefined, { tools: 'fetch-data,process-item' });
|
|
503
|
-
// Verify writeFile was called
|
|
504
|
-
expect(vi.mocked(writeFile)).toHaveBeenCalled();
|
|
505
|
-
// Find the tools/index.ts file content
|
|
506
|
-
const writeCalls = vi.mocked(writeFile).mock.calls;
|
|
507
|
-
const toolsIndexCall = writeCalls.find((call) => {
|
|
508
|
-
const path = call[0];
|
|
509
|
-
return path.includes('tools/index.ts');
|
|
510
|
-
});
|
|
511
|
-
expect(toolsIndexCall).toBeDefined();
|
|
512
|
-
if (toolsIndexCall) {
|
|
513
|
-
const content = toolsIndexCall[1];
|
|
514
|
-
expect(content).toContain('fetch-data');
|
|
515
|
-
expect(content).toContain('process-item');
|
|
516
|
-
}
|
|
517
|
-
});
|
|
518
|
-
it('calls spinner.fail when mkdir throws an error', async () => {
|
|
519
|
-
const { stat, mkdir } = await import('fs/promises');
|
|
520
|
-
const { input, confirm } = await import('@inquirer/prompts');
|
|
521
|
-
const ora = await import('ora');
|
|
522
|
-
// Track spinner.fail calls
|
|
523
|
-
const failMock = vi.fn().mockReturnThis();
|
|
524
|
-
vi.mocked(ora.default).mockReturnValue({
|
|
525
|
-
start: vi.fn().mockReturnThis(),
|
|
526
|
-
stop: vi.fn().mockReturnThis(),
|
|
527
|
-
succeed: vi.fn().mockReturnThis(),
|
|
528
|
-
fail: failMock,
|
|
529
|
-
warn: vi.fn().mockReturnThis(),
|
|
530
|
-
text: '',
|
|
531
|
-
});
|
|
532
|
-
// Directory doesn't exist, but mkdir fails
|
|
533
|
-
vi.mocked(stat).mockRejectedValue(new Error('ENOENT'));
|
|
534
|
-
vi.mocked(mkdir).mockRejectedValue(new Error('Permission denied'));
|
|
535
|
-
// Prompt responses
|
|
536
|
-
vi.mocked(input)
|
|
537
|
-
.mockResolvedValueOnce('fail-server') // name
|
|
538
|
-
.mockResolvedValueOnce('Will fail') // description
|
|
539
|
-
.mockResolvedValueOnce('author'); // author
|
|
540
|
-
vi.mocked(confirm).mockResolvedValue(false);
|
|
541
|
-
const { initMcpServer } = await import('../src/commands/author/index.js');
|
|
542
|
-
await expect(initMcpServer(undefined, {})).rejects.toThrow();
|
|
543
|
-
expect(failMock).toHaveBeenCalled();
|
|
544
|
-
const failMessage = failMock.mock.calls[0]?.[0];
|
|
545
|
-
expect(failMessage).toContain('Failed to create MCP server');
|
|
546
|
-
});
|
|
547
|
-
it('writes files when --force is used with existing directory', async () => {
|
|
548
|
-
const { stat, mkdir, writeFile } = await import('fs/promises');
|
|
549
|
-
const { input, confirm } = await import('@inquirer/prompts');
|
|
550
|
-
// Directory exists
|
|
551
|
-
vi.mocked(stat).mockResolvedValue({ isDirectory: () => true });
|
|
552
|
-
vi.mocked(mkdir).mockResolvedValue(undefined);
|
|
553
|
-
vi.mocked(writeFile).mockResolvedValue(undefined);
|
|
554
|
-
// Prompt responses
|
|
555
|
-
vi.mocked(input)
|
|
556
|
-
.mockResolvedValueOnce('force-server') // name
|
|
557
|
-
.mockResolvedValueOnce('Force overwrite') // description
|
|
558
|
-
.mockResolvedValueOnce('author'); // author
|
|
559
|
-
vi.mocked(confirm).mockResolvedValue(false); // don't add tools (not asked about overwrite due to --force)
|
|
560
|
-
const { initMcpServer } = await import('../src/commands/author/index.js');
|
|
561
|
-
await initMcpServer(undefined, { force: true });
|
|
562
|
-
// Verify files are written despite directory existing
|
|
563
|
-
expect(vi.mocked(writeFile)).toHaveBeenCalledTimes(8);
|
|
564
|
-
});
|
|
565
|
-
it('does not write files when user declines overwrite prompt', async () => {
|
|
566
|
-
const { stat, mkdir, writeFile } = await import('fs/promises');
|
|
567
|
-
const { input, confirm } = await import('@inquirer/prompts');
|
|
568
|
-
// Directory exists
|
|
569
|
-
vi.mocked(stat).mockResolvedValue({ isDirectory: () => true });
|
|
570
|
-
vi.mocked(mkdir).mockResolvedValue(undefined);
|
|
571
|
-
vi.mocked(writeFile).mockResolvedValue(undefined);
|
|
572
|
-
// Prompt responses
|
|
573
|
-
vi.mocked(input)
|
|
574
|
-
.mockResolvedValueOnce('existing-server') // name
|
|
575
|
-
.mockResolvedValueOnce('Exists already') // description
|
|
576
|
-
.mockResolvedValueOnce('author'); // author
|
|
577
|
-
vi.mocked(confirm)
|
|
578
|
-
.mockResolvedValueOnce(false) // don't add tools
|
|
579
|
-
.mockResolvedValueOnce(false); // decline overwrite
|
|
580
|
-
const { initMcpServer } = await import('../src/commands/author/index.js');
|
|
581
|
-
await initMcpServer(undefined, {});
|
|
582
|
-
// Verify no files are written
|
|
583
|
-
expect(vi.mocked(writeFile)).not.toHaveBeenCalled();
|
|
584
|
-
});
|
|
585
|
-
});
|
|
586
|
-
describe('createMcpInitCommand', () => {
|
|
587
|
-
it('creates a command with correct name', async () => {
|
|
588
|
-
const { createMcpInitCommand } = await import('../src/commands/author/index.js');
|
|
589
|
-
const cmd = createMcpInitCommand();
|
|
590
|
-
expect(cmd).toBeInstanceOf(Command);
|
|
591
|
-
expect(cmd.name()).toBe('mcp-init');
|
|
592
|
-
});
|
|
593
|
-
it('has correct description', async () => {
|
|
594
|
-
const { createMcpInitCommand } = await import('../src/commands/author/index.js');
|
|
595
|
-
const cmd = createMcpInitCommand();
|
|
596
|
-
expect(cmd.description()).toContain('Scaffold');
|
|
597
|
-
expect(cmd.description()).toContain('MCP server');
|
|
598
|
-
});
|
|
599
|
-
it('accepts optional name argument', async () => {
|
|
600
|
-
const { createMcpInitCommand } = await import('../src/commands/author/index.js');
|
|
601
|
-
const cmd = createMcpInitCommand();
|
|
602
|
-
expect(cmd.registeredArguments.length).toBeGreaterThanOrEqual(0);
|
|
603
|
-
});
|
|
604
|
-
it('has output option', async () => {
|
|
605
|
-
const { createMcpInitCommand } = await import('../src/commands/author/index.js');
|
|
606
|
-
const cmd = createMcpInitCommand();
|
|
607
|
-
const outputOpt = cmd.options.find((o) => o.short === '-o');
|
|
608
|
-
expect(outputOpt).toBeDefined();
|
|
609
|
-
expect(outputOpt?.long).toBe('--output');
|
|
610
|
-
});
|
|
611
|
-
it('has tools option', async () => {
|
|
612
|
-
const { createMcpInitCommand } = await import('../src/commands/author/index.js');
|
|
613
|
-
const cmd = createMcpInitCommand();
|
|
614
|
-
const toolsOpt = cmd.options.find((o) => o.long === '--tools');
|
|
615
|
-
expect(toolsOpt).toBeDefined();
|
|
616
|
-
});
|
|
617
|
-
it('has force option', async () => {
|
|
618
|
-
const { createMcpInitCommand } = await import('../src/commands/author/index.js');
|
|
619
|
-
const cmd = createMcpInitCommand();
|
|
620
|
-
const forceOpt = cmd.options.find((o) => o.long === '--force');
|
|
621
|
-
expect(forceOpt).toBeDefined();
|
|
622
|
-
});
|
|
623
|
-
});
|
|
624
|
-
describe('MCP Server Template Integration', () => {
|
|
625
|
-
it('exports renderMcpServerTemplates', async () => {
|
|
626
|
-
const { renderMcpServerTemplates } = await import('../src/templates/index.js');
|
|
627
|
-
expect(typeof renderMcpServerTemplates).toBe('function');
|
|
628
|
-
});
|
|
629
|
-
it('template generates valid JSON for package.json', async () => {
|
|
630
|
-
const { renderMcpServerTemplates } = await import('../src/templates/index.js');
|
|
631
|
-
const files = renderMcpServerTemplates({
|
|
632
|
-
name: 'test-server',
|
|
633
|
-
description: 'Test server',
|
|
634
|
-
author: 'test',
|
|
635
|
-
tools: [],
|
|
636
|
-
});
|
|
637
|
-
const packageJson = files.get('package.json');
|
|
638
|
-
expect(() => JSON.parse(packageJson || '')).not.toThrow();
|
|
639
|
-
});
|
|
640
|
-
it('template generates valid JSON for tsconfig.json', async () => {
|
|
641
|
-
const { renderMcpServerTemplates } = await import('../src/templates/index.js');
|
|
642
|
-
const files = renderMcpServerTemplates({
|
|
643
|
-
name: 'test-server',
|
|
644
|
-
description: 'Test server',
|
|
645
|
-
author: 'test',
|
|
646
|
-
tools: [],
|
|
647
|
-
});
|
|
648
|
-
const tsconfig = files.get('tsconfig.json');
|
|
649
|
-
expect(() => JSON.parse(tsconfig || '')).not.toThrow();
|
|
650
|
-
});
|
|
651
|
-
});
|
|
652
|
-
});
|
|
653
|
-
//# sourceMappingURL=author.test.js.map
|