@eui/mcp 1.5.0 → 1.5.2
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/dist/main.js +539 -208
- package/package.json +9 -6
- package/dist/config/__tests__/schema.property.test.d.ts +0 -2
- package/dist/config/__tests__/schema.property.test.d.ts.map +0 -1
- package/dist/config/__tests__/schema.property.test.js +0 -203
- package/dist/config/__tests__/schema.property.test.js.map +0 -1
- package/dist/config/__tests__/schema.test.d.ts +0 -2
- package/dist/config/__tests__/schema.test.d.ts.map +0 -1
- package/dist/config/__tests__/schema.test.js +0 -454
- package/dist/config/__tests__/schema.test.js.map +0 -1
- package/dist/config/index.d.ts +0 -6
- package/dist/config/index.d.ts.map +0 -1
- package/dist/config/index.js +0 -6
- package/dist/config/index.js.map +0 -1
- package/dist/config/loader.d.ts +0 -27
- package/dist/config/loader.d.ts.map +0 -1
- package/dist/config/loader.js +0 -224
- package/dist/config/loader.js.map +0 -1
- package/dist/config/schema.d.ts +0 -171
- package/dist/config/schema.d.ts.map +0 -1
- package/dist/config/schema.js +0 -100
- package/dist/config/schema.js.map +0 -1
- package/dist/index.d.ts +0 -3
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js +0 -45
- package/dist/index.js.map +0 -1
- package/dist/loader/__tests__/cache-manager.property.test.d.ts +0 -2
- package/dist/loader/__tests__/cache-manager.property.test.d.ts.map +0 -1
- package/dist/loader/__tests__/cache-manager.property.test.js +0 -245
- package/dist/loader/__tests__/cache-manager.property.test.js.map +0 -1
- package/dist/loader/__tests__/cache-manager.test.d.ts +0 -2
- package/dist/loader/__tests__/cache-manager.test.d.ts.map +0 -1
- package/dist/loader/__tests__/cache-manager.test.js +0 -256
- package/dist/loader/__tests__/cache-manager.test.js.map +0 -1
- package/dist/loader/__tests__/documentation-loader.integration.test.d.ts +0 -2
- package/dist/loader/__tests__/documentation-loader.integration.test.d.ts.map +0 -1
- package/dist/loader/__tests__/documentation-loader.integration.test.js +0 -498
- package/dist/loader/__tests__/documentation-loader.integration.test.js.map +0 -1
- package/dist/loader/__tests__/documentation-loader.property.test.d.ts +0 -2
- package/dist/loader/__tests__/documentation-loader.property.test.d.ts.map +0 -1
- package/dist/loader/__tests__/documentation-loader.property.test.js +0 -258
- package/dist/loader/__tests__/documentation-loader.property.test.js.map +0 -1
- package/dist/loader/__tests__/errors.test.d.ts +0 -2
- package/dist/loader/__tests__/errors.test.d.ts.map +0 -1
- package/dist/loader/__tests__/errors.test.js +0 -132
- package/dist/loader/__tests__/errors.test.js.map +0 -1
- package/dist/loader/__tests__/http-client.property.test.d.ts +0 -2
- package/dist/loader/__tests__/http-client.property.test.d.ts.map +0 -1
- package/dist/loader/__tests__/http-client.property.test.js +0 -288
- package/dist/loader/__tests__/http-client.property.test.js.map +0 -1
- package/dist/loader/__tests__/http-client.test.d.ts +0 -2
- package/dist/loader/__tests__/http-client.test.d.ts.map +0 -1
- package/dist/loader/__tests__/http-client.test.js +0 -497
- package/dist/loader/__tests__/http-client.test.js.map +0 -1
- package/dist/loader/__tests__/local-documentation-source.property.test.d.ts +0 -2
- package/dist/loader/__tests__/local-documentation-source.property.test.d.ts.map +0 -1
- package/dist/loader/__tests__/local-documentation-source.property.test.js +0 -373
- package/dist/loader/__tests__/local-documentation-source.property.test.js.map +0 -1
- package/dist/loader/__tests__/local-documentation-source.test.d.ts +0 -2
- package/dist/loader/__tests__/local-documentation-source.test.d.ts.map +0 -1
- package/dist/loader/__tests__/local-documentation-source.test.js +0 -544
- package/dist/loader/__tests__/local-documentation-source.test.js.map +0 -1
- package/dist/loader/__tests__/path-type-detector.property.test.d.ts +0 -2
- package/dist/loader/__tests__/path-type-detector.property.test.d.ts.map +0 -1
- package/dist/loader/__tests__/path-type-detector.property.test.js +0 -245
- package/dist/loader/__tests__/path-type-detector.property.test.js.map +0 -1
- package/dist/loader/__tests__/path-type-detector.test.d.ts +0 -2
- package/dist/loader/__tests__/path-type-detector.test.d.ts.map +0 -1
- package/dist/loader/__tests__/path-type-detector.test.js +0 -390
- package/dist/loader/__tests__/path-type-detector.test.js.map +0 -1
- package/dist/loader/__tests__/remote-documentation-source.property.test.d.ts +0 -2
- package/dist/loader/__tests__/remote-documentation-source.property.test.d.ts.map +0 -1
- package/dist/loader/__tests__/remote-documentation-source.property.test.js +0 -462
- package/dist/loader/__tests__/remote-documentation-source.property.test.js.map +0 -1
- package/dist/loader/__tests__/remote-documentation-source.test.d.ts +0 -2
- package/dist/loader/__tests__/remote-documentation-source.test.d.ts.map +0 -1
- package/dist/loader/__tests__/remote-documentation-source.test.js +0 -707
- package/dist/loader/__tests__/remote-documentation-source.test.js.map +0 -1
- package/dist/loader/cache-manager.d.ts +0 -74
- package/dist/loader/cache-manager.d.ts.map +0 -1
- package/dist/loader/cache-manager.js +0 -107
- package/dist/loader/cache-manager.js.map +0 -1
- package/dist/loader/documentation-loader.d.ts +0 -57
- package/dist/loader/documentation-loader.d.ts.map +0 -1
- package/dist/loader/documentation-loader.js +0 -81
- package/dist/loader/documentation-loader.js.map +0 -1
- package/dist/loader/documentation-source.d.ts +0 -37
- package/dist/loader/documentation-source.d.ts.map +0 -1
- package/dist/loader/documentation-source.js +0 -2
- package/dist/loader/documentation-source.js.map +0 -1
- package/dist/loader/errors.d.ts +0 -34
- package/dist/loader/errors.d.ts.map +0 -1
- package/dist/loader/errors.js +0 -65
- package/dist/loader/errors.js.map +0 -1
- package/dist/loader/http-client.d.ts +0 -43
- package/dist/loader/http-client.d.ts.map +0 -1
- package/dist/loader/http-client.js +0 -144
- package/dist/loader/http-client.js.map +0 -1
- package/dist/loader/index.d.ts +0 -6
- package/dist/loader/index.d.ts.map +0 -1
- package/dist/loader/index.js +0 -5
- package/dist/loader/index.js.map +0 -1
- package/dist/loader/local-documentation-source.d.ts +0 -62
- package/dist/loader/local-documentation-source.d.ts.map +0 -1
- package/dist/loader/local-documentation-source.js +0 -190
- package/dist/loader/local-documentation-source.js.map +0 -1
- package/dist/loader/path-type-detector.d.ts +0 -34
- package/dist/loader/path-type-detector.d.ts.map +0 -1
- package/dist/loader/path-type-detector.js +0 -78
- package/dist/loader/path-type-detector.js.map +0 -1
- package/dist/loader/remote-documentation-source.d.ts +0 -108
- package/dist/loader/remote-documentation-source.d.ts.map +0 -1
- package/dist/loader/remote-documentation-source.js +0 -249
- package/dist/loader/remote-documentation-source.js.map +0 -1
- package/dist/main.d.ts +0 -3
- package/dist/main.d.ts.map +0 -1
- package/dist/main.js.map +0 -1
- package/dist/mcp/__tests__/server.property.test.d.ts +0 -2
- package/dist/mcp/__tests__/server.property.test.d.ts.map +0 -1
- package/dist/mcp/__tests__/server.property.test.js +0 -286
- package/dist/mcp/__tests__/server.property.test.js.map +0 -1
- package/dist/mcp/__tests__/server.test.d.ts +0 -2
- package/dist/mcp/__tests__/server.test.d.ts.map +0 -1
- package/dist/mcp/__tests__/server.test.js +0 -101
- package/dist/mcp/__tests__/server.test.js.map +0 -1
- package/dist/mcp/index.d.ts +0 -5
- package/dist/mcp/index.d.ts.map +0 -1
- package/dist/mcp/index.js +0 -5
- package/dist/mcp/index.js.map +0 -1
- package/dist/mcp/server.d.ts +0 -65
- package/dist/mcp/server.d.ts.map +0 -1
- package/dist/mcp/server.js +0 -242
- package/dist/mcp/server.js.map +0 -1
- package/dist/publish/__tests__/publish-utils.test.d.ts +0 -5
- package/dist/publish/__tests__/publish-utils.test.d.ts.map +0 -1
- package/dist/publish/__tests__/publish-utils.test.js +0 -189
- package/dist/publish/__tests__/publish-utils.test.js.map +0 -1
- package/dist/publish/index.d.ts +0 -8
- package/dist/publish/index.d.ts.map +0 -1
- package/dist/publish/index.js +0 -8
- package/dist/publish/index.js.map +0 -1
- package/dist/publish/publish-utils.d.ts +0 -74
- package/dist/publish/publish-utils.d.ts.map +0 -1
- package/dist/publish/publish-utils.js +0 -170
- package/dist/publish/publish-utils.js.map +0 -1
- package/dist/query/__tests__/deprecation-parser.test.d.ts +0 -2
- package/dist/query/__tests__/deprecation-parser.test.d.ts.map +0 -1
- package/dist/query/__tests__/deprecation-parser.test.js +0 -154
- package/dist/query/__tests__/deprecation-parser.test.js.map +0 -1
- package/dist/query/__tests__/deprecation-query.test.d.ts +0 -2
- package/dist/query/__tests__/deprecation-query.test.d.ts.map +0 -1
- package/dist/query/__tests__/deprecation-query.test.js +0 -199
- package/dist/query/__tests__/deprecation-query.test.js.map +0 -1
- package/dist/query/__tests__/index-builder-debug.test.d.ts +0 -2
- package/dist/query/__tests__/index-builder-debug.test.d.ts.map +0 -1
- package/dist/query/__tests__/index-builder-debug.test.js +0 -34
- package/dist/query/__tests__/index-builder-debug.test.js.map +0 -1
- package/dist/query/__tests__/index-builder.property.test.d.ts +0 -2
- package/dist/query/__tests__/index-builder.property.test.d.ts.map +0 -1
- package/dist/query/__tests__/index-builder.property.test.js +0 -422
- package/dist/query/__tests__/index-builder.property.test.js.map +0 -1
- package/dist/query/__tests__/index-builder.test.d.ts +0 -2
- package/dist/query/__tests__/index-builder.test.d.ts.map +0 -1
- package/dist/query/__tests__/index-builder.test.js +0 -55
- package/dist/query/__tests__/index-builder.test.js.map +0 -1
- package/dist/query/__tests__/result-formatter-deprecation.test.d.ts +0 -2
- package/dist/query/__tests__/result-formatter-deprecation.test.d.ts.map +0 -1
- package/dist/query/__tests__/result-formatter-deprecation.test.js +0 -159
- package/dist/query/__tests__/result-formatter-deprecation.test.js.map +0 -1
- package/dist/query/__tests__/result-formatter.integration.test.d.ts +0 -2
- package/dist/query/__tests__/result-formatter.integration.test.d.ts.map +0 -1
- package/dist/query/__tests__/result-formatter.integration.test.js +0 -140
- package/dist/query/__tests__/result-formatter.integration.test.js.map +0 -1
- package/dist/query/__tests__/result-formatter.property.test.d.ts +0 -2
- package/dist/query/__tests__/result-formatter.property.test.d.ts.map +0 -1
- package/dist/query/__tests__/result-formatter.property.test.js +0 -163
- package/dist/query/__tests__/result-formatter.property.test.js.map +0 -1
- package/dist/query/__tests__/result-formatter.test.d.ts +0 -2
- package/dist/query/__tests__/result-formatter.test.d.ts.map +0 -1
- package/dist/query/__tests__/result-formatter.test.js +0 -85
- package/dist/query/__tests__/result-formatter.test.js.map +0 -1
- package/dist/query/__tests__/search-engine.property.test.d.ts +0 -2
- package/dist/query/__tests__/search-engine.property.test.d.ts.map +0 -1
- package/dist/query/__tests__/search-engine.property.test.js +0 -389
- package/dist/query/__tests__/search-engine.property.test.js.map +0 -1
- package/dist/query/component-query.d.ts +0 -33
- package/dist/query/component-query.d.ts.map +0 -1
- package/dist/query/component-query.js +0 -63
- package/dist/query/component-query.js.map +0 -1
- package/dist/query/deprecation-parser.d.ts +0 -46
- package/dist/query/deprecation-parser.d.ts.map +0 -1
- package/dist/query/deprecation-parser.js +0 -81
- package/dist/query/deprecation-parser.js.map +0 -1
- package/dist/query/deprecation-query.d.ts +0 -19
- package/dist/query/deprecation-query.d.ts.map +0 -1
- package/dist/query/deprecation-query.js +0 -73
- package/dist/query/deprecation-query.js.map +0 -1
- package/dist/query/index-builder.d.ts +0 -79
- package/dist/query/index-builder.d.ts.map +0 -1
- package/dist/query/index-builder.js +0 -217
- package/dist/query/index-builder.js.map +0 -1
- package/dist/query/index.d.ts +0 -5
- package/dist/query/index.d.ts.map +0 -1
- package/dist/query/index.js +0 -6
- package/dist/query/index.js.map +0 -1
- package/dist/query/result-formatter.d.ts +0 -135
- package/dist/query/result-formatter.d.ts.map +0 -1
- package/dist/query/result-formatter.js +0 -224
- package/dist/query/result-formatter.js.map +0 -1
- package/dist/query/search-engine.d.ts +0 -54
- package/dist/query/search-engine.d.ts.map +0 -1
- package/dist/query/search-engine.js +0 -178
- package/dist/query/search-engine.js.map +0 -1
- package/dist/tools/__tests__/deprecation-tools.test.d.ts +0 -2
- package/dist/tools/__tests__/deprecation-tools.test.d.ts.map +0 -1
- package/dist/tools/__tests__/deprecation-tools.test.js +0 -178
- package/dist/tools/__tests__/deprecation-tools.test.js.map +0 -1
- package/dist/tools/__tests__/get-component-docs.property.test.d.ts +0 -2
- package/dist/tools/__tests__/get-component-docs.property.test.d.ts.map +0 -1
- package/dist/tools/__tests__/get-component-docs.property.test.js +0 -594
- package/dist/tools/__tests__/get-component-docs.property.test.js.map +0 -1
- package/dist/tools/__tests__/get-component-docs.test.d.ts +0 -2
- package/dist/tools/__tests__/get-component-docs.test.d.ts.map +0 -1
- package/dist/tools/__tests__/get-component-docs.test.js +0 -137
- package/dist/tools/__tests__/get-component-docs.test.js.map +0 -1
- package/dist/tools/__tests__/get-component-examples.property.test.d.ts +0 -2
- package/dist/tools/__tests__/get-component-examples.property.test.d.ts.map +0 -1
- package/dist/tools/__tests__/get-component-examples.property.test.js +0 -245
- package/dist/tools/__tests__/get-component-examples.property.test.js.map +0 -1
- package/dist/tools/__tests__/get-component-examples.test.d.ts +0 -2
- package/dist/tools/__tests__/get-component-examples.test.d.ts.map +0 -1
- package/dist/tools/__tests__/get-component-examples.test.js +0 -128
- package/dist/tools/__tests__/get-component-examples.test.js.map +0 -1
- package/dist/tools/__tests__/get-component-inputs.property.test.d.ts +0 -2
- package/dist/tools/__tests__/get-component-inputs.property.test.d.ts.map +0 -1
- package/dist/tools/__tests__/get-component-inputs.property.test.js +0 -310
- package/dist/tools/__tests__/get-component-inputs.property.test.js.map +0 -1
- package/dist/tools/__tests__/get-component-inputs.test.d.ts +0 -2
- package/dist/tools/__tests__/get-component-inputs.test.d.ts.map +0 -1
- package/dist/tools/__tests__/get-component-inputs.test.js +0 -245
- package/dist/tools/__tests__/get-component-inputs.test.js.map +0 -1
- package/dist/tools/__tests__/get-component-outputs.property.test.d.ts +0 -2
- package/dist/tools/__tests__/get-component-outputs.property.test.d.ts.map +0 -1
- package/dist/tools/__tests__/get-component-outputs.property.test.js +0 -227
- package/dist/tools/__tests__/get-component-outputs.property.test.js.map +0 -1
- package/dist/tools/__tests__/get-component-outputs.test.d.ts +0 -2
- package/dist/tools/__tests__/get-component-outputs.test.d.ts.map +0 -1
- package/dist/tools/__tests__/get-component-outputs.test.js +0 -189
- package/dist/tools/__tests__/get-component-outputs.test.js.map +0 -1
- package/dist/tools/__tests__/get-library-version.property.test.d.ts +0 -2
- package/dist/tools/__tests__/get-library-version.property.test.d.ts.map +0 -1
- package/dist/tools/__tests__/get-library-version.property.test.js +0 -115
- package/dist/tools/__tests__/get-library-version.property.test.js.map +0 -1
- package/dist/tools/__tests__/get-library-version.test.d.ts +0 -2
- package/dist/tools/__tests__/get-library-version.test.d.ts.map +0 -1
- package/dist/tools/__tests__/get-library-version.test.js +0 -97
- package/dist/tools/__tests__/get-library-version.test.js.map +0 -1
- package/dist/tools/__tests__/list-components.property.test.d.ts +0 -2
- package/dist/tools/__tests__/list-components.property.test.d.ts.map +0 -1
- package/dist/tools/__tests__/list-components.property.test.js +0 -241
- package/dist/tools/__tests__/list-components.property.test.js.map +0 -1
- package/dist/tools/__tests__/list-components.test.d.ts +0 -2
- package/dist/tools/__tests__/list-components.test.d.ts.map +0 -1
- package/dist/tools/__tests__/list-components.test.js +0 -170
- package/dist/tools/__tests__/list-components.test.js.map +0 -1
- package/dist/tools/__tests__/search-components.test.d.ts +0 -2
- package/dist/tools/__tests__/search-components.test.d.ts.map +0 -1
- package/dist/tools/__tests__/search-components.test.js +0 -239
- package/dist/tools/__tests__/search-components.test.js.map +0 -1
- package/dist/tools/get-component-docs.d.ts +0 -43
- package/dist/tools/get-component-docs.d.ts.map +0 -1
- package/dist/tools/get-component-docs.js +0 -55
- package/dist/tools/get-component-docs.js.map +0 -1
- package/dist/tools/get-component-examples.d.ts +0 -45
- package/dist/tools/get-component-examples.d.ts.map +0 -1
- package/dist/tools/get-component-examples.js +0 -56
- package/dist/tools/get-component-examples.js.map +0 -1
- package/dist/tools/get-component-inputs.d.ts +0 -44
- package/dist/tools/get-component-inputs.d.ts.map +0 -1
- package/dist/tools/get-component-inputs.js +0 -55
- package/dist/tools/get-component-inputs.js.map +0 -1
- package/dist/tools/get-component-outputs.d.ts +0 -44
- package/dist/tools/get-component-outputs.d.ts.map +0 -1
- package/dist/tools/get-component-outputs.js +0 -55
- package/dist/tools/get-component-outputs.js.map +0 -1
- package/dist/tools/get-deprecation-info.d.ts +0 -42
- package/dist/tools/get-deprecation-info.d.ts.map +0 -1
- package/dist/tools/get-deprecation-info.js +0 -55
- package/dist/tools/get-deprecation-info.js.map +0 -1
- package/dist/tools/get-eui-cli-guide.d.ts +0 -32
- package/dist/tools/get-eui-cli-guide.d.ts.map +0 -1
- package/dist/tools/get-eui-cli-guide.js +0 -160
- package/dist/tools/get-eui-cli-guide.js.map +0 -1
- package/dist/tools/get-eui-cli-instructions.d.ts +0 -32
- package/dist/tools/get-eui-cli-instructions.d.ts.map +0 -1
- package/dist/tools/get-eui-cli-instructions.js +0 -375
- package/dist/tools/get-eui-cli-instructions.js.map +0 -1
- package/dist/tools/get-library-version.d.ts +0 -33
- package/dist/tools/get-library-version.d.ts.map +0 -1
- package/dist/tools/get-library-version.js +0 -62
- package/dist/tools/get-library-version.js.map +0 -1
- package/dist/tools/index.d.ts +0 -12
- package/dist/tools/index.d.ts.map +0 -1
- package/dist/tools/index.js +0 -13
- package/dist/tools/index.js.map +0 -1
- package/dist/tools/list-components.d.ts +0 -69
- package/dist/tools/list-components.d.ts.map +0 -1
- package/dist/tools/list-components.js +0 -84
- package/dist/tools/list-components.js.map +0 -1
- package/dist/tools/list-deprecated.d.ts +0 -47
- package/dist/tools/list-deprecated.d.ts.map +0 -1
- package/dist/tools/list-deprecated.js +0 -56
- package/dist/tools/list-deprecated.js.map +0 -1
- package/dist/tools/search-components.d.ts +0 -69
- package/dist/tools/search-components.d.ts.map +0 -1
- package/dist/tools/search-components.js +0 -98
- package/dist/tools/search-components.js.map +0 -1
- package/dist/types/compodoc.d.ts +0 -262
- package/dist/types/compodoc.d.ts.map +0 -1
- package/dist/types/compodoc.js +0 -5
- package/dist/types/compodoc.js.map +0 -1
- package/dist/types/deprecation.d.ts +0 -33
- package/dist/types/deprecation.d.ts.map +0 -1
- package/dist/types/deprecation.js +0 -5
- package/dist/types/deprecation.js.map +0 -1
- package/dist/types/index.d.ts +0 -5
- package/dist/types/index.d.ts.map +0 -1
- package/dist/types/index.js +0 -5
- package/dist/types/index.js.map +0 -1
- package/dist/utils/__tests__/credential-masking.property.test.d.ts +0 -2
- package/dist/utils/__tests__/credential-masking.property.test.d.ts.map +0 -1
- package/dist/utils/__tests__/credential-masking.property.test.js +0 -145
- package/dist/utils/__tests__/credential-masking.property.test.js.map +0 -1
- package/dist/utils/__tests__/credential-masking.test.d.ts +0 -2
- package/dist/utils/__tests__/credential-masking.test.d.ts.map +0 -1
- package/dist/utils/__tests__/credential-masking.test.js +0 -188
- package/dist/utils/__tests__/credential-masking.test.js.map +0 -1
- package/dist/utils/__tests__/errors.test.d.ts +0 -2
- package/dist/utils/__tests__/errors.test.d.ts.map +0 -1
- package/dist/utils/__tests__/errors.test.js +0 -110
- package/dist/utils/__tests__/errors.test.js.map +0 -1
- package/dist/utils/__tests__/integration.test.d.ts +0 -2
- package/dist/utils/__tests__/integration.test.d.ts.map +0 -1
- package/dist/utils/__tests__/integration.test.js +0 -142
- package/dist/utils/__tests__/integration.test.js.map +0 -1
- package/dist/utils/__tests__/logger.test.d.ts +0 -2
- package/dist/utils/__tests__/logger.test.d.ts.map +0 -1
- package/dist/utils/__tests__/logger.test.js +0 -119
- package/dist/utils/__tests__/logger.test.js.map +0 -1
- package/dist/utils/__tests__/retry.test.d.ts +0 -2
- package/dist/utils/__tests__/retry.test.d.ts.map +0 -1
- package/dist/utils/__tests__/retry.test.js +0 -84
- package/dist/utils/__tests__/retry.test.js.map +0 -1
- package/dist/utils/circuit-breaker.d.ts +0 -91
- package/dist/utils/circuit-breaker.d.ts.map +0 -1
- package/dist/utils/circuit-breaker.js +0 -186
- package/dist/utils/circuit-breaker.js.map +0 -1
- package/dist/utils/credential-masking.d.ts +0 -90
- package/dist/utils/credential-masking.d.ts.map +0 -1
- package/dist/utils/credential-masking.js +0 -202
- package/dist/utils/credential-masking.js.map +0 -1
- package/dist/utils/error-handler.d.ts +0 -68
- package/dist/utils/error-handler.d.ts.map +0 -1
- package/dist/utils/error-handler.js +0 -184
- package/dist/utils/error-handler.js.map +0 -1
- package/dist/utils/errors.d.ts +0 -156
- package/dist/utils/errors.d.ts.map +0 -1
- package/dist/utils/errors.js +0 -242
- package/dist/utils/errors.js.map +0 -1
- package/dist/utils/index.d.ts +0 -10
- package/dist/utils/index.d.ts.map +0 -1
- package/dist/utils/index.js +0 -16
- package/dist/utils/index.js.map +0 -1
- package/dist/utils/logger.d.ts +0 -76
- package/dist/utils/logger.d.ts.map +0 -1
- package/dist/utils/logger.js +0 -150
- package/dist/utils/logger.js.map +0 -1
- package/dist/utils/retry.d.ts +0 -19
- package/dist/utils/retry.d.ts.map +0 -1
- package/dist/utils/retry.js +0 -81
- package/dist/utils/retry.js.map +0 -1
- package/dist/version/__tests__/changelog-commit-grouping.property.test.d.ts +0 -2
- package/dist/version/__tests__/changelog-commit-grouping.property.test.d.ts.map +0 -1
- package/dist/version/__tests__/changelog-commit-grouping.property.test.js +0 -297
- package/dist/version/__tests__/changelog-commit-grouping.property.test.js.map +0 -1
- package/dist/version/__tests__/changelog-commit-parsing.property.test.d.ts +0 -2
- package/dist/version/__tests__/changelog-commit-parsing.property.test.d.ts.map +0 -1
- package/dist/version/__tests__/changelog-commit-parsing.property.test.js +0 -396
- package/dist/version/__tests__/changelog-commit-parsing.property.test.js.map +0 -1
- package/dist/version/__tests__/changelog-file-updates.property.test.d.ts +0 -11
- package/dist/version/__tests__/changelog-file-updates.property.test.d.ts.map +0 -1
- package/dist/version/__tests__/changelog-file-updates.property.test.js +0 -452
- package/dist/version/__tests__/changelog-file-updates.property.test.js.map +0 -1
- package/dist/version/__tests__/dry-run-action.property.test.d.ts +0 -8
- package/dist/version/__tests__/dry-run-action.property.test.d.ts.map +0 -1
- package/dist/version/__tests__/dry-run-action.property.test.js +0 -50
- package/dist/version/__tests__/dry-run-action.property.test.js.map +0 -1
- package/dist/version/__tests__/dry-run-changelog.property.test.d.ts +0 -8
- package/dist/version/__tests__/dry-run-changelog.property.test.d.ts.map +0 -1
- package/dist/version/__tests__/dry-run-changelog.property.test.js +0 -53
- package/dist/version/__tests__/dry-run-changelog.property.test.js.map +0 -1
- package/dist/version/__tests__/dry-run-utils.test.d.ts +0 -7
- package/dist/version/__tests__/dry-run-utils.test.d.ts.map +0 -1
- package/dist/version/__tests__/dry-run-utils.test.js +0 -205
- package/dist/version/__tests__/dry-run-utils.test.js.map +0 -1
- package/dist/version/__tests__/dry-run-version.property.test.d.ts +0 -8
- package/dist/version/__tests__/dry-run-version.property.test.d.ts.map +0 -1
- package/dist/version/__tests__/dry-run-version.property.test.js +0 -59
- package/dist/version/__tests__/dry-run-version.property.test.js.map +0 -1
- package/dist/version/__tests__/git-tag-annotation.property.test.d.ts +0 -11
- package/dist/version/__tests__/git-tag-annotation.property.test.d.ts.map +0 -1
- package/dist/version/__tests__/git-tag-annotation.property.test.js +0 -271
- package/dist/version/__tests__/git-tag-annotation.property.test.js.map +0 -1
- package/dist/version/__tests__/git-tag-format.property.test.d.ts +0 -11
- package/dist/version/__tests__/git-tag-format.property.test.d.ts.map +0 -1
- package/dist/version/__tests__/git-tag-format.property.test.js +0 -411
- package/dist/version/__tests__/git-tag-format.property.test.js.map +0 -1
- package/dist/version/__tests__/git-tag-utils.test.d.ts +0 -2
- package/dist/version/__tests__/git-tag-utils.test.d.ts.map +0 -1
- package/dist/version/__tests__/git-tag-utils.test.js +0 -142
- package/dist/version/__tests__/git-tag-utils.test.js.map +0 -1
- package/dist/version/__tests__/npm-tag-selection.property.test.d.ts +0 -2
- package/dist/version/__tests__/npm-tag-selection.property.test.d.ts.map +0 -1
- package/dist/version/__tests__/npm-tag-selection.property.test.js +0 -79
- package/dist/version/__tests__/npm-tag-selection.property.test.js.map +0 -1
- package/dist/version/__tests__/release-title-format.property.test.d.ts +0 -11
- package/dist/version/__tests__/release-title-format.property.test.d.ts.map +0 -1
- package/dist/version/__tests__/release-title-format.property.test.js +0 -422
- package/dist/version/__tests__/release-title-format.property.test.js.map +0 -1
- package/dist/version/__tests__/release-utils.test.d.ts +0 -7
- package/dist/version/__tests__/release-utils.test.d.ts.map +0 -1
- package/dist/version/__tests__/release-utils.test.js +0 -176
- package/dist/version/__tests__/release-utils.test.js.map +0 -1
- package/dist/version/__tests__/rollback-changelog.property.test.d.ts +0 -8
- package/dist/version/__tests__/rollback-changelog.property.test.d.ts.map +0 -1
- package/dist/version/__tests__/rollback-changelog.property.test.js +0 -61
- package/dist/version/__tests__/rollback-changelog.property.test.js.map +0 -1
- package/dist/version/__tests__/rollback-utils.test.d.ts +0 -7
- package/dist/version/__tests__/rollback-utils.test.d.ts.map +0 -1
- package/dist/version/__tests__/rollback-utils.test.js +0 -74
- package/dist/version/__tests__/rollback-utils.test.js.map +0 -1
- package/dist/version/__tests__/version-manager.property.test.d.ts +0 -2
- package/dist/version/__tests__/version-manager.property.test.d.ts.map +0 -1
- package/dist/version/__tests__/version-manager.property.test.js +0 -143
- package/dist/version/__tests__/version-manager.property.test.js.map +0 -1
- package/dist/version/__tests__/version-manager.test.d.ts +0 -2
- package/dist/version/__tests__/version-manager.test.d.ts.map +0 -1
- package/dist/version/__tests__/version-manager.test.js +0 -203
- package/dist/version/__tests__/version-manager.test.js.map +0 -1
- package/dist/version/changelog-file-utils.d.ts +0 -69
- package/dist/version/changelog-file-utils.d.ts.map +0 -1
- package/dist/version/changelog-file-utils.js +0 -161
- package/dist/version/changelog-file-utils.js.map +0 -1
- package/dist/version/changelog-utils.d.ts +0 -98
- package/dist/version/changelog-utils.d.ts.map +0 -1
- package/dist/version/changelog-utils.js +0 -198
- package/dist/version/changelog-utils.js.map +0 -1
- package/dist/version/dry-run-utils.d.ts +0 -108
- package/dist/version/dry-run-utils.d.ts.map +0 -1
- package/dist/version/dry-run-utils.js +0 -126
- package/dist/version/dry-run-utils.js.map +0 -1
- package/dist/version/git-tag-utils.d.ts +0 -50
- package/dist/version/git-tag-utils.d.ts.map +0 -1
- package/dist/version/git-tag-utils.js +0 -66
- package/dist/version/git-tag-utils.js.map +0 -1
- package/dist/version/index.d.ts +0 -11
- package/dist/version/index.d.ts.map +0 -1
- package/dist/version/index.js +0 -11
- package/dist/version/index.js.map +0 -1
- package/dist/version/release-utils.d.ts +0 -94
- package/dist/version/release-utils.d.ts.map +0 -1
- package/dist/version/release-utils.js +0 -170
- package/dist/version/release-utils.js.map +0 -1
- package/dist/version/rollback-utils.d.ts +0 -47
- package/dist/version/rollback-utils.d.ts.map +0 -1
- package/dist/version/rollback-utils.js +0 -73
- package/dist/version/rollback-utils.js.map +0 -1
- package/dist/version/version-manager.d.ts +0 -98
- package/dist/version/version-manager.d.ts.map +0 -1
- package/dist/version/version-manager.js +0 -154
- package/dist/version/version-manager.js.map +0 -1
|
@@ -1,101 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Unit tests for CompodocMcpServer
|
|
3
|
-
*/
|
|
4
|
-
import { describe, it, expect } from '@jest/globals';
|
|
5
|
-
import { CompodocMcpServer } from '../server.js';
|
|
6
|
-
import { IndexBuilder } from '../../query/index-builder.js';
|
|
7
|
-
describe('CompodocMcpServer', () => {
|
|
8
|
-
function createMinimalDocumentation() {
|
|
9
|
-
return {
|
|
10
|
-
pipes: [],
|
|
11
|
-
components: [],
|
|
12
|
-
directives: [],
|
|
13
|
-
injectables: [],
|
|
14
|
-
interfaces: [],
|
|
15
|
-
classes: [],
|
|
16
|
-
modules: [],
|
|
17
|
-
};
|
|
18
|
-
}
|
|
19
|
-
describe('constructor', () => {
|
|
20
|
-
it('should create a server instance', () => {
|
|
21
|
-
const documentation = createMinimalDocumentation();
|
|
22
|
-
const builder = new IndexBuilder();
|
|
23
|
-
const index = builder.build(documentation);
|
|
24
|
-
const server = new CompodocMcpServer({
|
|
25
|
-
name: 'test-server',
|
|
26
|
-
version: '1.0.0',
|
|
27
|
-
}, index);
|
|
28
|
-
expect(server).toBeDefined();
|
|
29
|
-
});
|
|
30
|
-
});
|
|
31
|
-
describe('lifecycle management', () => {
|
|
32
|
-
it('should report not healthy before starting', () => {
|
|
33
|
-
const documentation = createMinimalDocumentation();
|
|
34
|
-
const builder = new IndexBuilder();
|
|
35
|
-
const index = builder.build(documentation);
|
|
36
|
-
const server = new CompodocMcpServer({
|
|
37
|
-
name: 'test-server',
|
|
38
|
-
version: '1.0.0',
|
|
39
|
-
}, index);
|
|
40
|
-
expect(server.isHealthy()).toBe(false);
|
|
41
|
-
});
|
|
42
|
-
it('should provide server statistics', () => {
|
|
43
|
-
const documentation = createMinimalDocumentation();
|
|
44
|
-
const builder = new IndexBuilder();
|
|
45
|
-
const index = builder.build(documentation);
|
|
46
|
-
const server = new CompodocMcpServer({
|
|
47
|
-
name: 'test-server',
|
|
48
|
-
version: '1.0.0',
|
|
49
|
-
}, index);
|
|
50
|
-
const stats = server.getStats();
|
|
51
|
-
expect(stats).toBeDefined();
|
|
52
|
-
expect(stats.isRunning).toBe(false);
|
|
53
|
-
expect(stats.toolCount).toBe(11); // 11 tools registered (including get-library-version, list-deprecated, get-deprecation-info, get-eui-cli-guide, get-eui-cli-instructions)
|
|
54
|
-
expect(stats.indexStats).toBeDefined();
|
|
55
|
-
expect(stats.indexStats.totalComponents).toBe(0);
|
|
56
|
-
});
|
|
57
|
-
});
|
|
58
|
-
describe('index updates', () => {
|
|
59
|
-
it('should allow updating the index', () => {
|
|
60
|
-
const documentation = createMinimalDocumentation();
|
|
61
|
-
const builder = new IndexBuilder();
|
|
62
|
-
const index = builder.build(documentation);
|
|
63
|
-
const server = new CompodocMcpServer({
|
|
64
|
-
name: 'test-server',
|
|
65
|
-
version: '1.0.0',
|
|
66
|
-
}, index);
|
|
67
|
-
// Create a new index with a component
|
|
68
|
-
const newDocumentation = {
|
|
69
|
-
...createMinimalDocumentation(),
|
|
70
|
-
components: [
|
|
71
|
-
{
|
|
72
|
-
name: 'TestComponent',
|
|
73
|
-
id: 'test-1',
|
|
74
|
-
file: 'test.ts',
|
|
75
|
-
type: 'component',
|
|
76
|
-
selector: 'app-test',
|
|
77
|
-
deprecated: false,
|
|
78
|
-
},
|
|
79
|
-
],
|
|
80
|
-
};
|
|
81
|
-
const newIndex = builder.build(newDocumentation);
|
|
82
|
-
server.updateIndex(newIndex);
|
|
83
|
-
const stats = server.getStats();
|
|
84
|
-
expect(stats.indexStats.totalComponents).toBe(1);
|
|
85
|
-
});
|
|
86
|
-
});
|
|
87
|
-
describe('stop', () => {
|
|
88
|
-
it('should allow stopping when not started', async () => {
|
|
89
|
-
const documentation = createMinimalDocumentation();
|
|
90
|
-
const builder = new IndexBuilder();
|
|
91
|
-
const index = builder.build(documentation);
|
|
92
|
-
const server = new CompodocMcpServer({
|
|
93
|
-
name: 'test-server',
|
|
94
|
-
version: '1.0.0',
|
|
95
|
-
}, index);
|
|
96
|
-
// Should not throw
|
|
97
|
-
await expect(server.stop()).resolves.toBeUndefined();
|
|
98
|
-
});
|
|
99
|
-
});
|
|
100
|
-
});
|
|
101
|
-
//# sourceMappingURL=server.test.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"server.test.js","sourceRoot":"","sources":["../../../src/mcp/__tests__/server.test.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AACrD,OAAO,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AACjD,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAG5D,QAAQ,CAAC,mBAAmB,EAAE,GAAG,EAAE;IACjC,SAAS,0BAA0B;QACjC,OAAO;YACL,KAAK,EAAE,EAAE;YACT,UAAU,EAAE,EAAE;YACd,UAAU,EAAE,EAAE;YACd,WAAW,EAAE,EAAE;YACf,UAAU,EAAE,EAAE;YACd,OAAO,EAAE,EAAE;YACX,OAAO,EAAE,EAAE;SACZ,CAAC;IACJ,CAAC;IAED,QAAQ,CAAC,aAAa,EAAE,GAAG,EAAE;QAC3B,EAAE,CAAC,iCAAiC,EAAE,GAAG,EAA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AAG,MAAM,CAAC,QAAQ,EAAE,CAAC;YAChC,MAAM,CAAC,KAAK,CAAC,UAAU,CAAC,eAAe,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QACnD,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,QAAQ,CAAC,MAAM,EAAE,GAAG,EAAE;QACpB,EAAE,CAAC,wCAAwC,EAAE,KAAK,IAAI,EAAE;YACtD,MAAM,aAAa,GAAG,0BAA0B,EAAE,CAAC;YACnD,MAAM,OAAO,GAAG,IAAI,YAAY,EAAE,CAAC;YACnC,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC;YAE3C,MAAM,MAAM,GAAG,IAAI,iBAAiB,CAClC;gBACE,IAAI,EAAE,aAAa;gBACnB,OAAO,EAAE,OAAO;aACjB,EACD,KAAK,CACN,CAAC;YAEF,mBAAmB;YACnB,MAAM,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC,CAAC,QAAQ,CAAC,aAAa,EAAE,CAAC;QACvD,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
package/dist/mcp/index.d.ts
DELETED
package/dist/mcp/index.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/mcp/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,iBAAiB,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC"}
|
package/dist/mcp/index.js
DELETED
package/dist/mcp/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/mcp/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,iBAAiB,EAAiC,MAAM,aAAa,CAAC"}
|
package/dist/mcp/server.d.ts
DELETED
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
import { ComponentIndex } from '../query/index-builder.js';
|
|
2
|
-
export interface McpServerConfig {
|
|
3
|
-
name: string;
|
|
4
|
-
version: string;
|
|
5
|
-
}
|
|
6
|
-
export interface ToolResponse {
|
|
7
|
-
content: Array<{
|
|
8
|
-
type: 'text';
|
|
9
|
-
text: string;
|
|
10
|
-
}>;
|
|
11
|
-
}
|
|
12
|
-
/**
|
|
13
|
-
* CompodocMcpServer class
|
|
14
|
-
* Manages the MCP server lifecycle and tool registration
|
|
15
|
-
*/
|
|
16
|
-
export declare class CompodocMcpServer {
|
|
17
|
-
private server;
|
|
18
|
-
private index;
|
|
19
|
-
private query;
|
|
20
|
-
private searchEngine;
|
|
21
|
-
private formatter;
|
|
22
|
-
private tools;
|
|
23
|
-
private isRunning;
|
|
24
|
-
constructor(config: McpServerConfig, index: ComponentIndex);
|
|
25
|
-
/**
|
|
26
|
-
* Register all available tools
|
|
27
|
-
*/
|
|
28
|
-
private registerTools;
|
|
29
|
-
/**
|
|
30
|
-
* Set up MCP request handlers
|
|
31
|
-
*/
|
|
32
|
-
private setupHandlers;
|
|
33
|
-
/**
|
|
34
|
-
* Categorize errors for appropriate error codes
|
|
35
|
-
*/
|
|
36
|
-
private categorizeError;
|
|
37
|
-
/**
|
|
38
|
-
* Start the MCP server
|
|
39
|
-
*/
|
|
40
|
-
start(): Promise<void>;
|
|
41
|
-
/**
|
|
42
|
-
* Stop the MCP server
|
|
43
|
-
*/
|
|
44
|
-
stop(): Promise<void>;
|
|
45
|
-
/**
|
|
46
|
-
* Check if server is running
|
|
47
|
-
*/
|
|
48
|
-
isHealthy(): boolean;
|
|
49
|
-
/**
|
|
50
|
-
* Get server statistics
|
|
51
|
-
*/
|
|
52
|
-
getStats(): {
|
|
53
|
-
isRunning: boolean;
|
|
54
|
-
toolCount: number;
|
|
55
|
-
indexStats: {
|
|
56
|
-
totalComponents: number;
|
|
57
|
-
lastUpdated: Date;
|
|
58
|
-
};
|
|
59
|
-
};
|
|
60
|
-
/**
|
|
61
|
-
* Update the index (for hot reloading)
|
|
62
|
-
*/
|
|
63
|
-
updateIndex(newIndex: ComponentIndex): void;
|
|
64
|
-
}
|
|
65
|
-
//# sourceMappingURL=server.d.ts.map
|
package/dist/mcp/server.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../src/mcp/server.ts"],"names":[],"mappings":"AAWA,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAkB3D,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,YAAY;IAC3B,OAAO,EAAE,KAAK,CAAC;QACb,IAAI,EAAE,MAAM,CAAC;QACb,IAAI,EAAE,MAAM,CAAC;KACd,CAAC,CAAC;CACJ;AAED;;;GAGG;AACH,qBAAa,iBAAiB;IAC5B,OAAO,CAAC,MAAM,CAAS;IACvB,OAAO,CAAC,KAAK,CAAiB;IAC9B,OAAO,CAAC,KAAK,CAAiB;IAC9B,OAAO,CAAC,YAAY,CAAe;IACnC,OAAO,CAAC,SAAS,CAAkB;IAEnC,OAAO,CAAC,KAAK,CAAmB;IAChC,OAAO,CAAC,SAAS,CAAkB;gBAEvB,MAAM,EAAE,eAAe,EAAE,KAAK,EAAE,cAAc;IA2B1D;;OAEG;IACH,OAAO,CAAC,aAAa;IA4BrB;;OAEG;IACH,OAAO,CAAC,aAAa;IAqGrB;;OAEG;IACH,OAAO,CAAC,eAAe;IAwBvB;;OAEG;IACG,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAU5B;;OAEG;IACG,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;IAS3B;;OAEG;IACH,SAAS,IAAI,OAAO;IAIpB;;OAEG;IACH,QAAQ;;;;;;;;IAWR;;OAEG;IACH,WAAW,CAAC,QAAQ,EAAE,cAAc,GAAG,IAAI;CAQ5C"}
|
package/dist/mcp/server.js
DELETED
|
@@ -1,242 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* CompodocMcpServer - Main MCP server implementation
|
|
3
|
-
* Handles tool registration, request routing, and error handling
|
|
4
|
-
*/
|
|
5
|
-
import { Server } from '@modelcontextprotocol/sdk/server/index.js';
|
|
6
|
-
import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
|
|
7
|
-
import { CallToolRequestSchema, ListToolsRequestSchema, } from '@modelcontextprotocol/sdk/types.js';
|
|
8
|
-
import { ComponentQuery } from '../query/component-query.js';
|
|
9
|
-
import { SearchEngine } from '../query/search-engine.js';
|
|
10
|
-
import { ResultFormatter } from '../query/result-formatter.js';
|
|
11
|
-
import { ListComponentsTool, GetComponentDocsTool, SearchComponentsTool, GetComponentInputsTool, GetComponentOutputsTool, GetComponentExamplesTool, GetLibraryVersionTool, ListDeprecatedTool, GetDeprecationInfoTool, GetEuiCliGuideTool, GetEuiCliInstructionsTool, } from '../tools/index.js';
|
|
12
|
-
/**
|
|
13
|
-
* CompodocMcpServer class
|
|
14
|
-
* Manages the MCP server lifecycle and tool registration
|
|
15
|
-
*/
|
|
16
|
-
export class CompodocMcpServer {
|
|
17
|
-
server;
|
|
18
|
-
index;
|
|
19
|
-
query;
|
|
20
|
-
searchEngine;
|
|
21
|
-
formatter;
|
|
22
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
23
|
-
tools;
|
|
24
|
-
isRunning = false;
|
|
25
|
-
constructor(config, index) {
|
|
26
|
-
this.index = index;
|
|
27
|
-
this.query = new ComponentQuery(index);
|
|
28
|
-
this.searchEngine = new SearchEngine(index);
|
|
29
|
-
this.formatter = new ResultFormatter();
|
|
30
|
-
this.tools = new Map();
|
|
31
|
-
// Initialize MCP server
|
|
32
|
-
this.server = new Server({
|
|
33
|
-
name: config.name,
|
|
34
|
-
version: config.version,
|
|
35
|
-
}, {
|
|
36
|
-
capabilities: {
|
|
37
|
-
tools: {},
|
|
38
|
-
},
|
|
39
|
-
});
|
|
40
|
-
// Register tools
|
|
41
|
-
this.registerTools();
|
|
42
|
-
// Set up request handlers
|
|
43
|
-
this.setupHandlers();
|
|
44
|
-
}
|
|
45
|
-
/**
|
|
46
|
-
* Register all available tools
|
|
47
|
-
*/
|
|
48
|
-
registerTools() {
|
|
49
|
-
// Create tool instances
|
|
50
|
-
const listComponentsTool = new ListComponentsTool(this.query, this.formatter);
|
|
51
|
-
const getComponentDocsTool = new GetComponentDocsTool(this.query, this.formatter);
|
|
52
|
-
const searchComponentsTool = new SearchComponentsTool(this.searchEngine, this.formatter);
|
|
53
|
-
const getComponentInputsTool = new GetComponentInputsTool(this.query, this.formatter);
|
|
54
|
-
const getComponentOutputsTool = new GetComponentOutputsTool(this.query, this.formatter);
|
|
55
|
-
const getComponentExamplesTool = new GetComponentExamplesTool(this.query, this.formatter);
|
|
56
|
-
const getLibraryVersionTool = new GetLibraryVersionTool();
|
|
57
|
-
const listDeprecatedTool = new ListDeprecatedTool(this.index, this.formatter);
|
|
58
|
-
const getDeprecationInfoTool = new GetDeprecationInfoTool(this.index, this.formatter);
|
|
59
|
-
const getEuiCliGuideTool = new GetEuiCliGuideTool();
|
|
60
|
-
const getEuiCliInstructionsTool = new GetEuiCliInstructionsTool();
|
|
61
|
-
// Store tool instances
|
|
62
|
-
this.tools.set('list-components', listComponentsTool);
|
|
63
|
-
this.tools.set('get-component-docs', getComponentDocsTool);
|
|
64
|
-
this.tools.set('search-components', searchComponentsTool);
|
|
65
|
-
this.tools.set('get-component-inputs', getComponentInputsTool);
|
|
66
|
-
this.tools.set('get-component-outputs', getComponentOutputsTool);
|
|
67
|
-
this.tools.set('get-component-examples', getComponentExamplesTool);
|
|
68
|
-
this.tools.set('get-library-version', getLibraryVersionTool);
|
|
69
|
-
this.tools.set('list-deprecated', listDeprecatedTool);
|
|
70
|
-
this.tools.set('get-deprecation-info', getDeprecationInfoTool);
|
|
71
|
-
this.tools.set('get-eui-cli-guide', getEuiCliGuideTool);
|
|
72
|
-
this.tools.set('get-eui-cli-instructions', getEuiCliInstructionsTool);
|
|
73
|
-
}
|
|
74
|
-
/**
|
|
75
|
-
* Set up MCP request handlers
|
|
76
|
-
*/
|
|
77
|
-
setupHandlers() {
|
|
78
|
-
// Handle list tools request
|
|
79
|
-
this.server.setRequestHandler(ListToolsRequestSchema, () => {
|
|
80
|
-
const toolDefinitions = [
|
|
81
|
-
ListComponentsTool.getToolDefinition(),
|
|
82
|
-
GetComponentDocsTool.getToolDefinition(),
|
|
83
|
-
SearchComponentsTool.getToolDefinition(),
|
|
84
|
-
GetComponentInputsTool.getToolDefinition(),
|
|
85
|
-
GetComponentOutputsTool.getToolDefinition(),
|
|
86
|
-
GetComponentExamplesTool.getToolDefinition(),
|
|
87
|
-
GetLibraryVersionTool.getToolDefinition(),
|
|
88
|
-
ListDeprecatedTool.getToolDefinition(),
|
|
89
|
-
GetDeprecationInfoTool.getToolDefinition(),
|
|
90
|
-
GetEuiCliGuideTool.getToolDefinition(),
|
|
91
|
-
GetEuiCliInstructionsTool.getToolDefinition(),
|
|
92
|
-
];
|
|
93
|
-
return {
|
|
94
|
-
tools: toolDefinitions,
|
|
95
|
-
};
|
|
96
|
-
});
|
|
97
|
-
// Handle call tool request
|
|
98
|
-
this.server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
99
|
-
const { name, arguments: args } = request.params;
|
|
100
|
-
try {
|
|
101
|
-
// Validate tool exists
|
|
102
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
|
103
|
-
const tool = this.tools.get(name);
|
|
104
|
-
if (!tool) {
|
|
105
|
-
return {
|
|
106
|
-
content: [
|
|
107
|
-
{
|
|
108
|
-
type: 'text',
|
|
109
|
-
text: JSON.stringify({
|
|
110
|
-
error: {
|
|
111
|
-
code: 'TOOL_NOT_FOUND',
|
|
112
|
-
message: `Tool '${name}' does not exist. Available tools: ${Array.from(this.tools.keys()).join(', ')}`,
|
|
113
|
-
},
|
|
114
|
-
}),
|
|
115
|
-
},
|
|
116
|
-
],
|
|
117
|
-
isError: true,
|
|
118
|
-
};
|
|
119
|
-
}
|
|
120
|
-
// Validate parameters (basic check - tools will do detailed validation)
|
|
121
|
-
if (args === undefined || args === null) {
|
|
122
|
-
return {
|
|
123
|
-
content: [
|
|
124
|
-
{
|
|
125
|
-
type: 'text',
|
|
126
|
-
text: JSON.stringify({
|
|
127
|
-
error: {
|
|
128
|
-
code: 'INVALID_PARAMETERS',
|
|
129
|
-
message: 'Tool parameters are required',
|
|
130
|
-
},
|
|
131
|
-
}),
|
|
132
|
-
},
|
|
133
|
-
],
|
|
134
|
-
isError: true,
|
|
135
|
-
};
|
|
136
|
-
}
|
|
137
|
-
// Execute tool
|
|
138
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-call, @typescript-eslint/no-unsafe-member-access
|
|
139
|
-
const result = await tool.execute(args ?? {});
|
|
140
|
-
// Format response
|
|
141
|
-
return {
|
|
142
|
-
content: [
|
|
143
|
-
{
|
|
144
|
-
type: 'text',
|
|
145
|
-
text: JSON.stringify(result, null, 2),
|
|
146
|
-
},
|
|
147
|
-
],
|
|
148
|
-
};
|
|
149
|
-
}
|
|
150
|
-
catch (error) {
|
|
151
|
-
// Handle errors gracefully
|
|
152
|
-
const errorMessage = error instanceof Error ? error.message : 'Unknown error occurred';
|
|
153
|
-
const errorCode = this.categorizeError(error);
|
|
154
|
-
return {
|
|
155
|
-
content: [
|
|
156
|
-
{
|
|
157
|
-
type: 'text',
|
|
158
|
-
text: JSON.stringify({
|
|
159
|
-
error: {
|
|
160
|
-
code: errorCode,
|
|
161
|
-
message: errorMessage,
|
|
162
|
-
},
|
|
163
|
-
}),
|
|
164
|
-
},
|
|
165
|
-
],
|
|
166
|
-
isError: true,
|
|
167
|
-
};
|
|
168
|
-
}
|
|
169
|
-
});
|
|
170
|
-
}
|
|
171
|
-
/**
|
|
172
|
-
* Categorize errors for appropriate error codes
|
|
173
|
-
*/
|
|
174
|
-
categorizeError(error) {
|
|
175
|
-
if (error instanceof Error) {
|
|
176
|
-
const message = error.message.toLowerCase();
|
|
177
|
-
if (message.includes('not found') || message.includes('does not exist')) {
|
|
178
|
-
return 'NOT_FOUND';
|
|
179
|
-
}
|
|
180
|
-
if (message.includes('invalid') ||
|
|
181
|
-
message.includes('must be') ||
|
|
182
|
-
message.includes('required')) {
|
|
183
|
-
return 'INVALID_PARAMETERS';
|
|
184
|
-
}
|
|
185
|
-
if (message.includes('limit') || message.includes('offset')) {
|
|
186
|
-
return 'INVALID_PARAMETERS';
|
|
187
|
-
}
|
|
188
|
-
}
|
|
189
|
-
return 'INTERNAL_ERROR';
|
|
190
|
-
}
|
|
191
|
-
/**
|
|
192
|
-
* Start the MCP server
|
|
193
|
-
*/
|
|
194
|
-
async start() {
|
|
195
|
-
if (this.isRunning) {
|
|
196
|
-
throw new Error('Server is already running');
|
|
197
|
-
}
|
|
198
|
-
const transport = new StdioServerTransport();
|
|
199
|
-
await this.server.connect(transport);
|
|
200
|
-
this.isRunning = true;
|
|
201
|
-
}
|
|
202
|
-
/**
|
|
203
|
-
* Stop the MCP server
|
|
204
|
-
*/
|
|
205
|
-
async stop() {
|
|
206
|
-
if (!this.isRunning) {
|
|
207
|
-
return;
|
|
208
|
-
}
|
|
209
|
-
await this.server.close();
|
|
210
|
-
this.isRunning = false;
|
|
211
|
-
}
|
|
212
|
-
/**
|
|
213
|
-
* Check if server is running
|
|
214
|
-
*/
|
|
215
|
-
isHealthy() {
|
|
216
|
-
return this.isRunning;
|
|
217
|
-
}
|
|
218
|
-
/**
|
|
219
|
-
* Get server statistics
|
|
220
|
-
*/
|
|
221
|
-
getStats() {
|
|
222
|
-
return {
|
|
223
|
-
isRunning: this.isRunning,
|
|
224
|
-
toolCount: this.tools.size,
|
|
225
|
-
indexStats: {
|
|
226
|
-
totalComponents: this.index.totalCount,
|
|
227
|
-
lastUpdated: this.index.lastUpdated,
|
|
228
|
-
},
|
|
229
|
-
};
|
|
230
|
-
}
|
|
231
|
-
/**
|
|
232
|
-
* Update the index (for hot reloading)
|
|
233
|
-
*/
|
|
234
|
-
updateIndex(newIndex) {
|
|
235
|
-
this.index = newIndex;
|
|
236
|
-
this.query = new ComponentQuery(newIndex);
|
|
237
|
-
this.searchEngine = new SearchEngine(newIndex);
|
|
238
|
-
// Re-register tools with new index
|
|
239
|
-
this.registerTools();
|
|
240
|
-
}
|
|
241
|
-
}
|
|
242
|
-
//# sourceMappingURL=server.js.map
|
package/dist/mcp/server.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"server.js","sourceRoot":"","sources":["../../src/mcp/server.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;AACnE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EACL,qBAAqB,EACrB,sBAAsB,GAEvB,MAAM,oCAAoC,CAAC;AAE5C,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAC7D,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAC/D,OAAO,EACL,kBAAkB,EAClB,oBAAoB,EACpB,oBAAoB,EACpB,sBAAsB,EACtB,uBAAuB,EACvB,wBAAwB,EACxB,qBAAqB,EACrB,kBAAkB,EAClB,sBAAsB,EACtB,kBAAkB,EAClB,yBAAyB,GAC1B,MAAM,mBAAmB,CAAC;AAc3B;;;GAGG;AACH,MAAM,OAAO,iBAAiB;IACpB,MAAM,CAAS;IACf,KAAK,CAAiB;IACtB,KAAK,CAAiB;IACtB,YAAY,CAAe;IAC3B,SAAS,CAAkB;IACnC,8DAA8D;IACtD,KAAK,CAAmB;IACxB,SAAS,GAAY,KAAK,CAAC;IAEnC,YAAY,MAAuB,EAAE,KAAqB;QACxD,IAAI,CAAC,KAAK,GAAG,KAA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IACzB,CAAC;IAED;;OAEG;IACH,SAAS;QACP,OAAO,IAAI,CAAC,SAAS,CAAC;IACxB,CAAC;IAED;;OAEG;IACH,QAAQ;QACN,OAAO;YACL,SAAS,EAAE,IAAI,CAAC,SAAS;YACzB,SAAS,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI;YAC1B,UAAU,EAAE;gBACV,eAAe,EAAE,IAAI,CAAC,KAAK,CAAC,UAAU;gBACtC,WAAW,EAAE,IAAI,CAAC,KAAK,CAAC,WAAW;aACpC;SACF,CAAC;IACJ,CAAC;IAED;;OAEG;IACH,WAAW,CAAC,QAAwB;QAClC,IAAI,CAAC,KAAK,GAAG,QAAQ,CAAC;QACtB,IAAI,CAAC,KAAK,GAAG,IAAI,cAAc,CAAC,QAAQ,CAAC,CAAC;QAC1C,IAAI,CAAC,YAAY,GAAG,IAAI,YAAY,CAAC,QAAQ,CAAC,CAAC;QAE/C,mCAAmC;QACnC,IAAI,CAAC,aAAa,EAAE,CAAC;IACvB,CAAC;CACF"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"publish-utils.test.d.ts","sourceRoot":"","sources":["../../../src/publish/__tests__/publish-utils.test.ts"],"names":[],"mappings":"AAAA;;GAEG"}
|
|
@@ -1,189 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Unit tests for publish utilities
|
|
3
|
-
*/
|
|
4
|
-
import { describe, it, expect } from '@jest/globals';
|
|
5
|
-
import { validateNpmToken, sanitizeErrorMessage, isAuthenticationError, isVersionConflictError, extractVersionFromError, createAuthenticationErrorMessage, createVersionConflictErrorMessage, createPublishErrorMessage, } from '../publish-utils';
|
|
6
|
-
describe('validateNpmToken', () => {
|
|
7
|
-
it('should return true for valid non-empty token', () => {
|
|
8
|
-
expect(validateNpmToken('npm_abc123xyz')).toBe(true);
|
|
9
|
-
expect(validateNpmToken('valid-token')).toBe(true);
|
|
10
|
-
});
|
|
11
|
-
it('should return false for undefined token', () => {
|
|
12
|
-
expect(validateNpmToken(undefined)).toBe(false);
|
|
13
|
-
});
|
|
14
|
-
it('should return false for empty string', () => {
|
|
15
|
-
expect(validateNpmToken('')).toBe(false);
|
|
16
|
-
});
|
|
17
|
-
it('should return false for whitespace-only string', () => {
|
|
18
|
-
expect(validateNpmToken(' ')).toBe(false);
|
|
19
|
-
expect(validateNpmToken('\t\n')).toBe(false);
|
|
20
|
-
});
|
|
21
|
-
});
|
|
22
|
-
describe('sanitizeErrorMessage', () => {
|
|
23
|
-
it('should mask npm tokens in message', () => {
|
|
24
|
-
const message = 'Authentication failed with token npm_abc123def456ghi789jkl012mno345pq';
|
|
25
|
-
const result = sanitizeErrorMessage(message);
|
|
26
|
-
expect(result).toContain('***REDACTED***');
|
|
27
|
-
expect(result).not.toContain('npm_abc123');
|
|
28
|
-
});
|
|
29
|
-
it('should mask multiple occurrences of credentials', () => {
|
|
30
|
-
const message = 'Token npm_abc123def456ghi789jkl012mno345pq failed. Please check npm_abc123def456ghi789jkl012mno345pq is valid.';
|
|
31
|
-
const result = sanitizeErrorMessage(message);
|
|
32
|
-
expect(result).toContain('***REDACTED***');
|
|
33
|
-
expect(result).not.toContain('npm_abc123');
|
|
34
|
-
});
|
|
35
|
-
it('should mask Bearer tokens', () => {
|
|
36
|
-
const message = 'Failed with Bearer abc123def456ghi789';
|
|
37
|
-
const result = sanitizeErrorMessage(message);
|
|
38
|
-
expect(result).toContain('***REDACTED***');
|
|
39
|
-
expect(result).not.toContain('Bearer abc123');
|
|
40
|
-
});
|
|
41
|
-
it('should handle messages without credentials', () => {
|
|
42
|
-
const message = 'Some error message';
|
|
43
|
-
const result = sanitizeErrorMessage(message);
|
|
44
|
-
expect(result).toBe('Some error message');
|
|
45
|
-
});
|
|
46
|
-
it('should mask GitLab tokens', () => {
|
|
47
|
-
const message = 'Failed with token glpat-abcdefghij1234567890';
|
|
48
|
-
const result = sanitizeErrorMessage(message);
|
|
49
|
-
expect(result).toContain('***REDACTED***');
|
|
50
|
-
expect(result).not.toContain('glpat-');
|
|
51
|
-
});
|
|
52
|
-
});
|
|
53
|
-
describe('isAuthenticationError', () => {
|
|
54
|
-
it('should detect 401 unauthorized errors', () => {
|
|
55
|
-
expect(isAuthenticationError('401 Unauthorized')).toBe(true);
|
|
56
|
-
expect(isAuthenticationError(new Error('401 Unauthorized'))).toBe(true);
|
|
57
|
-
});
|
|
58
|
-
it('should detect 403 forbidden errors', () => {
|
|
59
|
-
expect(isAuthenticationError('403 Forbidden')).toBe(true);
|
|
60
|
-
expect(isAuthenticationError(new Error('403 Forbidden'))).toBe(true);
|
|
61
|
-
});
|
|
62
|
-
it('should detect authentication keyword', () => {
|
|
63
|
-
expect(isAuthenticationError('Authentication failed')).toBe(true);
|
|
64
|
-
expect(isAuthenticationError('authentication required')).toBe(true);
|
|
65
|
-
});
|
|
66
|
-
it('should detect token-related errors', () => {
|
|
67
|
-
expect(isAuthenticationError('Invalid token provided')).toBe(true);
|
|
68
|
-
expect(isAuthenticationError('Token expired')).toBe(true);
|
|
69
|
-
});
|
|
70
|
-
it('should detect permission errors', () => {
|
|
71
|
-
expect(isAuthenticationError('Permission denied')).toBe(true);
|
|
72
|
-
expect(isAuthenticationError('Access denied')).toBe(true);
|
|
73
|
-
expect(isAuthenticationError('Not authorized')).toBe(true);
|
|
74
|
-
});
|
|
75
|
-
it('should be case-insensitive', () => {
|
|
76
|
-
expect(isAuthenticationError('AUTHENTICATION FAILED')).toBe(true);
|
|
77
|
-
expect(isAuthenticationError('Unauthorized')).toBe(true);
|
|
78
|
-
});
|
|
79
|
-
it('should return false for non-auth errors', () => {
|
|
80
|
-
expect(isAuthenticationError('Network timeout')).toBe(false);
|
|
81
|
-
expect(isAuthenticationError('Package not found')).toBe(false);
|
|
82
|
-
expect(isAuthenticationError('Version conflict')).toBe(false);
|
|
83
|
-
});
|
|
84
|
-
});
|
|
85
|
-
describe('isVersionConflictError', () => {
|
|
86
|
-
it('should detect version already exists errors', () => {
|
|
87
|
-
expect(isVersionConflictError('version already exists')).toBe(true);
|
|
88
|
-
expect(isVersionConflictError('Version 1.2.3 already exists')).toBe(true);
|
|
89
|
-
});
|
|
90
|
-
it('should detect cannot publish over errors', () => {
|
|
91
|
-
expect(isVersionConflictError('cannot publish over existing version')).toBe(true);
|
|
92
|
-
});
|
|
93
|
-
it('should detect already published errors', () => {
|
|
94
|
-
expect(isVersionConflictError('already published')).toBe(true);
|
|
95
|
-
expect(isVersionConflictError('Package already published')).toBe(true);
|
|
96
|
-
});
|
|
97
|
-
it('should detect version conflict errors', () => {
|
|
98
|
-
expect(isVersionConflictError('version conflict detected')).toBe(true);
|
|
99
|
-
});
|
|
100
|
-
it('should be case-insensitive', () => {
|
|
101
|
-
expect(isVersionConflictError('VERSION ALREADY EXISTS')).toBe(true);
|
|
102
|
-
expect(isVersionConflictError('Already Published')).toBe(true);
|
|
103
|
-
});
|
|
104
|
-
it('should return false for non-conflict errors', () => {
|
|
105
|
-
expect(isVersionConflictError('Authentication failed')).toBe(false);
|
|
106
|
-
expect(isVersionConflictError('Network timeout')).toBe(false);
|
|
107
|
-
expect(isVersionConflictError('Invalid package.json')).toBe(false);
|
|
108
|
-
});
|
|
109
|
-
});
|
|
110
|
-
describe('extractVersionFromError', () => {
|
|
111
|
-
it('should extract version from error message', () => {
|
|
112
|
-
expect(extractVersionFromError('version 1.2.3 already exists')).toBe('1.2.3');
|
|
113
|
-
expect(extractVersionFromError('Version 2.0.0 has been published')).toBe('2.0.0');
|
|
114
|
-
});
|
|
115
|
-
it('should extract version with v prefix', () => {
|
|
116
|
-
expect(extractVersionFromError('tag v1.2.3 already exists')).toBe('1.2.3');
|
|
117
|
-
expect(extractVersionFromError('Cannot create v2.0.0')).toBe('2.0.0');
|
|
118
|
-
});
|
|
119
|
-
it('should extract version from npm error messages', () => {
|
|
120
|
-
const npmError = 'npm ERR! 403 Forbidden - You cannot publish over version 1.5.0';
|
|
121
|
-
expect(extractVersionFromError(npmError)).toBe('1.5.0');
|
|
122
|
-
});
|
|
123
|
-
it('should return null when no version found', () => {
|
|
124
|
-
expect(extractVersionFromError('Authentication failed')).toBeNull();
|
|
125
|
-
expect(extractVersionFromError('Network timeout')).toBeNull();
|
|
126
|
-
expect(extractVersionFromError('Invalid package')).toBeNull();
|
|
127
|
-
});
|
|
128
|
-
it('should extract first version when multiple present', () => {
|
|
129
|
-
expect(extractVersionFromError('Cannot publish 1.2.3 because 1.2.2 exists')).toBe('1.2.3');
|
|
130
|
-
});
|
|
131
|
-
it('should handle Error objects', () => {
|
|
132
|
-
const error = new Error('version 3.0.0 already exists');
|
|
133
|
-
expect(extractVersionFromError(error)).toBe('3.0.0');
|
|
134
|
-
});
|
|
135
|
-
it('should handle edge case versions', () => {
|
|
136
|
-
expect(extractVersionFromError('version 0.0.0 exists')).toBe('0.0.0');
|
|
137
|
-
expect(extractVersionFromError('version 999.888.777 exists')).toBe('999.888.777');
|
|
138
|
-
});
|
|
139
|
-
});
|
|
140
|
-
describe('createAuthenticationErrorMessage', () => {
|
|
141
|
-
it('should create formatted error message', () => {
|
|
142
|
-
const message = createAuthenticationErrorMessage();
|
|
143
|
-
expect(message).toContain('ERROR: npm authentication failed');
|
|
144
|
-
expect(message).toContain('Invalid or expired NPM_TOKEN');
|
|
145
|
-
expect(message).toContain('To resolve:');
|
|
146
|
-
});
|
|
147
|
-
it('should not contain any credentials', () => {
|
|
148
|
-
const message = createAuthenticationErrorMessage();
|
|
149
|
-
expect(message).not.toMatch(/npm_[a-zA-Z0-9]+/);
|
|
150
|
-
expect(message).not.toContain('***MASKED***');
|
|
151
|
-
});
|
|
152
|
-
});
|
|
153
|
-
describe('createVersionConflictErrorMessage', () => {
|
|
154
|
-
it('should include version in error message', () => {
|
|
155
|
-
const message = createVersionConflictErrorMessage('1.2.3');
|
|
156
|
-
expect(message).toContain('Version 1.2.3');
|
|
157
|
-
expect(message).toContain('already been published');
|
|
158
|
-
});
|
|
159
|
-
it('should provide resolution steps', () => {
|
|
160
|
-
const message = createVersionConflictErrorMessage('2.0.0');
|
|
161
|
-
expect(message).toContain('To resolve:');
|
|
162
|
-
expect(message).toContain('Bump to the next version');
|
|
163
|
-
});
|
|
164
|
-
});
|
|
165
|
-
describe('createPublishErrorMessage', () => {
|
|
166
|
-
it('should sanitize npm token from error message', () => {
|
|
167
|
-
const error = new Error('Failed with token npm_abc123def456ghi789jkl012mno345pq');
|
|
168
|
-
const message = createPublishErrorMessage(error);
|
|
169
|
-
expect(message).toContain('***REDACTED***');
|
|
170
|
-
expect(message).not.toContain('npm_abc123');
|
|
171
|
-
});
|
|
172
|
-
it('should handle string errors', () => {
|
|
173
|
-
const message = createPublishErrorMessage('Network timeout occurred');
|
|
174
|
-
expect(message).toContain('Network timeout occurred');
|
|
175
|
-
expect(message).toContain('ERROR: Failed to publish package');
|
|
176
|
-
});
|
|
177
|
-
it('should automatically mask credentials', () => {
|
|
178
|
-
const error = new Error('Auth failed with Bearer abc123def456ghi789');
|
|
179
|
-
const message = createPublishErrorMessage(error);
|
|
180
|
-
expect(message).toContain('***REDACTED***');
|
|
181
|
-
expect(message).not.toContain('Bearer abc123');
|
|
182
|
-
});
|
|
183
|
-
it('should provide troubleshooting guidance', () => {
|
|
184
|
-
const message = createPublishErrorMessage(new Error('Test error'));
|
|
185
|
-
expect(message).toContain('This could be due to:');
|
|
186
|
-
expect(message).toContain('Network connectivity issues');
|
|
187
|
-
});
|
|
188
|
-
});
|
|
189
|
-
//# sourceMappingURL=publish-utils.test.js.map
|