@eui/mcp 1.5.1 → 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 +540 -209
- package/package.json +3 -2
- 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 -27
- 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 -85
- 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 -192
- 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 -250
- package/dist/loader/remote-documentation-source.js.map +0 -1
- package/dist/main.d.ts +0 -2
- 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 -226
- 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 -33
- 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 -33
- 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 -34
- 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 -136
- 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 -90
- 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 -201
- 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 -24
- package/dist/utils/logger.d.ts.map +0 -1
- package/dist/utils/logger.js +0 -55
- 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 -195
- 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 -200
- 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 -128
- 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
package/dist/main.js
CHANGED
|
@@ -1,211 +1,542 @@
|
|
|
1
|
-
|
|
2
|
-
*
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
loader = new DocumentationLoader({
|
|
46
|
-
path: config.documentation.path,
|
|
47
|
-
watchForChanges: config.documentation.watchForChanges,
|
|
48
|
-
reloadDebounce: config.documentation.reloadDebounce,
|
|
49
|
-
onReload: handleDocumentationReload,
|
|
50
|
-
onError: handleDocumentationError,
|
|
51
|
-
});
|
|
52
|
-
const loadResult = await loader.load();
|
|
53
|
-
if (!loadResult.success || !loadResult.data) {
|
|
54
|
-
logger.error('Failed to load documentation', undefined, {
|
|
55
|
-
error: loadResult.error,
|
|
56
|
-
});
|
|
57
|
-
process.exit(1);
|
|
58
|
-
}
|
|
59
|
-
logger.info('Documentation loaded successfully', {
|
|
60
|
-
path: config.documentation.path,
|
|
61
|
-
});
|
|
62
|
-
// Build index
|
|
63
|
-
logger.info('Building component index...');
|
|
64
|
-
const indexBuilder = new IndexBuilder();
|
|
65
|
-
let index;
|
|
66
|
-
try {
|
|
67
|
-
index = indexBuilder.build(loadResult.data);
|
|
68
|
-
const stats = indexBuilder.getStatistics(index);
|
|
69
|
-
logger.info('Index built successfully', {
|
|
70
|
-
totalCount: stats.totalCount,
|
|
71
|
-
components: stats.componentCount,
|
|
72
|
-
directives: stats.directiveCount,
|
|
73
|
-
pipes: stats.pipeCount,
|
|
74
|
-
services: stats.serviceCount,
|
|
75
|
-
});
|
|
76
|
-
}
|
|
77
|
-
catch (error) {
|
|
78
|
-
logger.error('Failed to build index', error instanceof Error ? error : new Error(String(error)));
|
|
79
|
-
process.exit(1);
|
|
80
|
-
}
|
|
81
|
-
// Initialize MCP server
|
|
82
|
-
logger.info('Initializing MCP server...');
|
|
83
|
-
server = new CompodocMcpServer({
|
|
84
|
-
name: config.server.name,
|
|
85
|
-
version: config.server.version,
|
|
86
|
-
}, index);
|
|
87
|
-
// Start server
|
|
88
|
-
logger.info('Starting MCP server...');
|
|
89
|
-
await server.start();
|
|
90
|
-
logger.info('MCP server started successfully', {
|
|
91
|
-
name: config.server.name,
|
|
92
|
-
version: config.server.version,
|
|
93
|
-
watchForChanges: config.documentation.watchForChanges,
|
|
94
|
-
});
|
|
95
|
-
// Health check
|
|
96
|
-
if (server.isHealthy()) {
|
|
97
|
-
logger.info('Health check passed');
|
|
98
|
-
}
|
|
99
|
-
else {
|
|
100
|
-
logger.warn('Health check failed - server may not be fully operational');
|
|
101
|
-
}
|
|
102
|
-
// Log server statistics
|
|
103
|
-
const stats = server.getStats();
|
|
104
|
-
logger.debug('Server statistics', stats);
|
|
105
|
-
// Server is now running and will handle requests via stdio
|
|
106
|
-
logger.info('Server is ready to accept requests');
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{z as l}from"zod";var g=class{static detect(e){let t=e.trim();return this.isRemoteUrl(t)?{type:new URL(t).protocol==="https:"?"https_url":"http_url",originalPath:e,normalizedPath:t}:{type:"local",originalPath:e,normalizedPath:t}}static isValidUrl(e){try{return new URL(e.trim()).protocol.length>0}catch{return!1}}static isRemoteUrl(e){try{let t=e.trim();if(!t.startsWith("http://")&&!t.startsWith("https://"))return!1;let r=new URL(t);return!(r.protocol!=="http:"&&r.protocol!=="https:"||!r.hostname||r.hostname.length===0)}catch{return!1}}};var me=l.object({name:l.string().default("eui-compodoc-mcp"),version:l.string().default("1.0.0")}),de=l.object({path:l.string().min(1,"Documentation path cannot be empty").refine(i=>i.trim().length>0,{message:"Documentation path cannot be only whitespace"}).refine(i=>{let e=i.trim();return e.startsWith("http://")||e.startsWith("https://")?g.isRemoteUrl(e):!0},{message:"Path must be a valid local file path or HTTP/HTTPS URL"}),watchForChanges:l.boolean().default(!0),reloadDebounce:l.number().min(0).default(1e3),timeout:l.number().min(1e3).default(1e4),maxRetries:l.number().min(0).max(10).default(3),pollingInterval:l.number().min(5e3).default(6e4)}),fe=l.object({maxResults:l.number().min(1).max(1e3).default(50),minQueryLength:l.number().min(1).default(2)}),ge=l.object({level:l.enum(["debug","info","warn","error"]).default("info"),format:l.enum(["json","text"]).default("text")}),oe=l.object({server:me.default({}),documentation:de,search:fe.default({}),logging:ge.default({})}),X={server:{name:"eui-compodoc-mcp",version:"1.0.0"},documentation:{path:"./documentation.json",watchForChanges:!0,reloadDebounce:1e3,timeout:1e4,maxRetries:3,pollingInterval:6e4},search:{maxResults:50,minQueryLength:2},logging:{level:"info",format:"text"}};function ee(i){return oe.safeParse(i)}import*as $ from"fs";import*as ie from"path";function se(){let i={};return process.env.COMPODOC_MCP_DOC_PATH&&(i.documentation={path:process.env.COMPODOC_MCP_DOC_PATH}),process.env.COMPODOC_MCP_LOG_LEVEL&&(i.logging={level:process.env.COMPODOC_MCP_LOG_LEVEL}),process.env.COMPODOC_MCP_WATCH!==void 0&&(i.documentation||(i.documentation={path:""}),i.documentation.watchForChanges=process.env.COMPODOC_MCP_WATCH==="true"),i}function ae(i){let e={};for(let t=0;t<i.length;t++)switch(i[t]){case"--doc-path":case"--documentation-path":e.documentation||(e.documentation={path:""}),e.documentation.path=i[++t];break;case"--watch":e.documentation||(e.documentation={path:""}),e.documentation.watchForChanges=!0;break;case"--no-watch":e.documentation||(e.documentation={path:""}),e.documentation.watchForChanges=!1;break;case"--log-level":e.logging={level:i[++t]};break;case"--max-results":e.search={maxResults:parseInt(i[++t],10)};break;case"--help":case"-h":ye(),process.exit(0);break}return e}function ce(i){try{if(!$.existsSync(i))return process.stderr.write(`Configuration file not found: ${i}
|
|
3
|
+
`),{};let e=$.readFileSync(i,"utf-8"),t=ie.extname(i).toLowerCase();return t===".json"?JSON.parse(e):(process.stderr.write(`Unsupported configuration file format: ${t}
|
|
4
|
+
`),{})}catch(e){let t=e instanceof Error?e.message:"Unknown error occurred";return process.stderr.write(`Failed to load config file ${i}: ${t}
|
|
5
|
+
`),{}}}function _(i,e){let t={...i};for(let r in e)if(Object.prototype.hasOwnProperty.call(e,r)){let n=e[r],o=t[r];n&&typeof n=="object"&&!Array.isArray(n)&&o&&typeof o=="object"&&!Array.isArray(o)?t[r]=_(o,n):n!==void 0&&(t[r]=n)}return t}function te(i=process.argv.slice(2)){try{let e=i.indexOf("--config"),t=e>=0?i[e+1]:void 0,r=t?ce(t):{},n=se(),o=ae(i),s={...X};s=_(s,r),s=_(s,n),s=_(s,o);let a=ee(s);if(!a.success){let p=he(a.error);return process.stderr.write(`Configuration validation failed:
|
|
6
|
+
`),p.forEach(u=>process.stderr.write(` - ${u}
|
|
7
|
+
`)),{success:!1,errors:p}}return{success:!0,config:a.data}}catch(e){return{success:!1,errors:[`Failed to load configuration: ${e instanceof Error?e.message:"Configuration error"}`]}}}function he(i){return i.errors.map(e=>`${e.path.join(".")}: ${e.message}`)}function ye(){process.stderr.write(`
|
|
8
|
+
EUI Compodoc MCP Server - Model Context Protocol server for Angular component documentation
|
|
9
|
+
|
|
10
|
+
Usage:
|
|
11
|
+
eui-compodoc-mcp [options]
|
|
12
|
+
|
|
13
|
+
Options:
|
|
14
|
+
--doc-path <path> Path to documentation.json file (required)
|
|
15
|
+
--watch Watch for changes to documentation.json (default: true)
|
|
16
|
+
--no-watch Disable file watching
|
|
17
|
+
--log-level <level> Logging level: debug, info, warn, error (default: info)
|
|
18
|
+
--max-results <number> Maximum search results (default: 50)
|
|
19
|
+
--config <file> Load configuration from JSON file
|
|
20
|
+
--help, -h Show this help message
|
|
21
|
+
|
|
22
|
+
Environment Variables:
|
|
23
|
+
COMPODOC_MCP_DOC_PATH Path to documentation.json file
|
|
24
|
+
COMPODOC_MCP_LOG_LEVEL Logging level
|
|
25
|
+
COMPODOC_MCP_WATCH Enable/disable file watching (true/false)
|
|
26
|
+
|
|
27
|
+
Configuration File Format (JSON):
|
|
28
|
+
{
|
|
29
|
+
"server": {
|
|
30
|
+
"name": "eui-compodoc-mcp",
|
|
31
|
+
"version": "1.0.0"
|
|
32
|
+
},
|
|
33
|
+
"documentation": {
|
|
34
|
+
"path": "./documentation.json",
|
|
35
|
+
"watchForChanges": true,
|
|
36
|
+
"reloadDebounce": 1000
|
|
37
|
+
},
|
|
38
|
+
"search": {
|
|
39
|
+
"maxResults": 50,
|
|
40
|
+
"minQueryLength": 2
|
|
41
|
+
},
|
|
42
|
+
"logging": {
|
|
43
|
+
"level": "info",
|
|
44
|
+
"format": "text"
|
|
107
45
|
}
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
function handleDocumentationReload(data) {
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
Examples:
|
|
49
|
+
eui-compodoc-mcp --doc-path ./documentation.json
|
|
50
|
+
eui-compodoc-mcp --doc-path ./docs/documentation.json --log-level debug
|
|
51
|
+
eui-compodoc-mcp --config ./config.json
|
|
52
|
+
COMPODOC_MCP_DOC_PATH=./documentation.json eui-compodoc-mcp
|
|
53
|
+
|
|
54
|
+
For more information, visit: https://github.com/your-org/eui-compodoc-mcp
|
|
55
|
+
`)}import*as V from"fs";import*as ue from"path";import{watch as we}from"chokidar";import pe from"pino";var O=class i{pino;context;constructor(e){this.context=e.context,this.pino=pe({level:e.level},pe.destination({dest:2,sync:!0}))}child(e){let t=new i({level:this.pino.level,format:"json",context:this.context?`${this.context}:${e}`:e});return t.pino=this.pino.child({context:e}),t}setLevel(e){this.pino.level=e}debug(e,t){this.pino.debug(t||{},e)}info(e,t){this.pino.info(t||{},e)}warn(e,t){this.pino.warn(t||{},e)}error(e,t,r){let n=r&&typeof r=="object"?r:{};this.pino.error({err:t,...n},e)}},P=null;function re(i){return P=new O(i),P}function c(){return P||(P=new O({level:"info",format:"text"})),P}var ve={failureThreshold:5,successThreshold:2,timeout:1e4,resetTimeout:6e4},G=class{state="CLOSED";failureCount=0;successCount=0;nextAttempt=Date.now();options;name;constructor(e,t={}){this.name=e,this.options={...ve,...t}}getState(){return this.state}getStats(){return{state:this.state,failureCount:this.failureCount,successCount:this.successCount,nextAttempt:this.nextAttempt}}async execute(e){let t=c();if(this.state==="OPEN"){if(Date.now()<this.nextAttempt){let r=new Error(`Circuit breaker '${this.name}' is OPEN. Next attempt at ${new Date(this.nextAttempt).toISOString()}`);throw t.warn("Circuit breaker is open",{name:this.name,nextAttempt:this.nextAttempt}),r}this.state="HALF_OPEN",this.successCount=0,t.info("Circuit breaker transitioning to HALF_OPEN",{name:this.name})}try{let r=await this.executeWithTimeout(e);return this.onSuccess(),r}catch(r){throw this.onFailure(),r}}async executeWithTimeout(e){return Promise.race([e(),new Promise((t,r)=>setTimeout(()=>r(new Error(`Operation timed out after ${this.options.timeout}ms`)),this.options.timeout))])}onSuccess(){let e=c();this.failureCount=0,this.state==="HALF_OPEN"&&(this.successCount++,e.debug("Circuit breaker success in HALF_OPEN",{name:this.name,successCount:this.successCount,threshold:this.options.successThreshold}),this.successCount>=this.options.successThreshold&&(this.state="CLOSED",this.successCount=0,e.info("Circuit breaker closed",{name:this.name})))}onFailure(){let e=c();this.failureCount++,e.debug("Circuit breaker failure",{name:this.name,failureCount:this.failureCount,threshold:this.options.failureThreshold,state:this.state}),(this.state==="HALF_OPEN"||this.failureCount>=this.options.failureThreshold)&&(this.state="OPEN",this.nextAttempt=Date.now()+this.options.resetTimeout,e.warn("Circuit breaker opened",{name:this.name,failureCount:this.failureCount,nextAttempt:this.nextAttempt}))}reset(){let e=c();this.state="CLOSED",this.failureCount=0,this.successCount=0,this.nextAttempt=Date.now(),e.info("Circuit breaker manually reset",{name:this.name})}},H=class{breakers=new Map;get(e,t){return this.breakers.has(e)||this.breakers.set(e,new G(e,t)),this.breakers.get(e)}getAll(){return new Map(this.breakers)}resetAll(){this.breakers.forEach(e=>{e.reset()})}getAllStats(){let e={};return this.breakers.forEach((t,r)=>{e[r]=t.getStats()}),e}},Ce=new H;var q=class{filePath;watchForChanges;reloadDebounce;watcher;reloadTimer;onReloadCallback;onErrorCallback;currentData;constructor(e){this.filePath=ue.resolve(e.path),this.watchForChanges=e.watchForChanges,this.reloadDebounce=e.reloadDebounce,this.onReloadCallback=e.onReload,this.onErrorCallback=e.onError}async load(){try{if(!V.existsSync(this.filePath))return{success:!1,error:`Documentation file not found: ${this.filePath}`};let e=await V.promises.readFile(this.filePath,"utf-8"),t;try{t=JSON.parse(e)}catch(n){return{success:!1,error:`Failed to parse JSON: ${n instanceof Error?n.message:String(n)}`}}let r=this.validateStructure(t);return r?{success:!1,error:r}:(this.currentData=t,this.watchForChanges&&!this.watcher&&this.startMonitoring(),{success:!0,data:t})}catch(e){return{success:!1,error:`Failed to load documentation: ${e instanceof Error?e.message:String(e)}`}}}startMonitoring(){!this.watchForChanges||this.watcher||this.startWatching()}async stopMonitoring(){this.reloadTimer&&(clearTimeout(this.reloadTimer),this.reloadTimer=void 0),this.watcher&&(await this.watcher.close(),this.watcher=void 0,c().info("Stopped watching documentation file"))}getCurrentData(){return this.currentData}async dispose(){await this.stopMonitoring(),this.currentData=void 0,this.onReloadCallback=void 0,this.onErrorCallback=void 0}validateStructure(e){if(!e||typeof e!="object")return"Documentation must be an object";let t=e,r=["pipes","components","directives","injectables","interfaces","classes","modules"];for(let n of r){let o=t[n];if(o!==void 0&&!Array.isArray(o))return`${n} must be an array`}return null}startWatching(){this.watcher||(this.watcher=we(this.filePath,{persistent:!0,ignoreInitial:!0}),this.watcher.on("change",()=>{this.scheduleReload()}),this.watcher.on("error",e=>{let t=e instanceof Error?e:new Error(String(e));c().error("File watcher error",t),this.onErrorCallback&&this.onErrorCallback(t)}),c().info(`Watching for changes: ${this.filePath}`))}scheduleReload(){this.reloadTimer&&clearTimeout(this.reloadTimer),this.reloadTimer=setTimeout(()=>{this.reload()},this.reloadDebounce)}async reload(){c().info("Reloading documentation...");let e=await this.load();e.success&&e.data?(c().info("Documentation reloaded successfully"),this.onReloadCallback&&this.onReloadCallback(e.data)):(c().error("Failed to reload documentation",new Error(e.error)),this.onErrorCallback&&this.onErrorCallback(new Error(e.error)))}};var B=class{options;constructor(e){this.options=e}async fetch(e,t){let r;for(let n=0;n<=this.options.maxRetries;n++)try{let o=await this.fetchOnce(e,t);if(!this.isRetryableError(void 0,o.status)||n>=this.options.maxRetries)return o;let s=this.calculateBackoff(n);await this.sleep(s)}catch(o){if(r=o instanceof Error?o:new Error(String(o)),n<this.options.maxRetries&&this.isRetryableError(r)){let s=this.calculateBackoff(n);await this.sleep(s);continue}throw r}throw r||new Error("Unknown error during fetch")}async fetchOnce(e,t){let r=new AbortController,n=setTimeout(()=>r.abort(),this.options.timeout);try{let o={Accept:"application/json","User-Agent":this.options.userAgent||"DocumentationLoader/1.0"};t&&t.forEach((u,m)=>{o[m]=u});let s=await fetch(e,{signal:r.signal,headers:o});clearTimeout(n);let a=new Map;s.headers.forEach((u,m)=>{a.set(m,u)});let p=await s.text();return{status:s.status,statusText:s.statusText,data:p,headers:a}}catch(o){throw clearTimeout(n),o instanceof Error&&o.name==="AbortError"?new Error(`Request timeout after ${this.options.timeout}ms`):o}}isRetryableError(e,t){if(t!==void 0){if(t>=200&&t<400)return!1;if(t>=500||t===408||t===429)return!0;if(t>=400&&t<500)return!1}if(e){let r=e.message.toLowerCase();if(r.includes("timeout")||r.includes("network")||r.includes("econnrefused")||r.includes("enotfound")||r.includes("econnreset"))return!0}return!0}calculateBackoff(e){return this.options.retryDelay*Math.pow(2,e)}sleep(e){return new Promise(t=>setTimeout(t,e))}};var z=class{cache;constructor(){this.cache=new Map}set(e,t,r){let n={data:t,timestamp:Date.now()},o=this.getHeaderCaseInsensitive(r,"etag");o&&(n.etag=o);let s=this.getHeaderCaseInsensitive(r,"last-modified");s&&(n.lastModified=s),this.cache.set(e,n)}get(e){return this.cache.get(e)}getConditionalHeaders(e){let t=new Map,r=this.cache.get(e);return r&&(r.etag&&t.set("If-None-Match",r.etag),r.lastModified&&t.set("If-Modified-Since",r.lastModified)),t}clear(e){this.cache.delete(e)}clearAll(){this.cache.clear()}getHeaderCaseInsensitive(e,t){let r=t.toLowerCase();for(let[n,o]of e.entries())if(n.toLowerCase()===r)return o}};var ne=class i extends Error{constructor(t,r,n){super(t);this.url=r;this.cause=n;this.name="NetworkError",Error.captureStackTrace&&Error.captureStackTrace(this,i)}};var k=class i extends ne{constructor(t,r,n,o){super(t,r);this.statusCode=n;this.statusText=o;this.name="HttpError",Error.captureStackTrace&&Error.captureStackTrace(this,i)}},L=class i extends Error{constructor(t,r){super(t);this.content=r;this.name="ParseError",Error.captureStackTrace&&Error.captureStackTrace(this,i)}};var W=class{url;httpClient;cacheManager;pollingTimer;currentData;pollingInterval;onReloadCallback;onErrorCallback;constructor(e){this.url=e.url,this.pollingInterval=e.pollingInterval,this.onReloadCallback=e.onReload,this.onErrorCallback=e.onError;let t={timeout:e.timeout,maxRetries:e.maxRetries,retryDelay:1e3,userAgent:"DocumentationLoader/1.0"};this.httpClient=new B(t),this.cacheManager=new z}async load(){return this.fetchDocumentation()}startMonitoring(){this.pollingTimer||(this.pollingTimer=setInterval(()=>{this.poll()},this.pollingInterval),c().info(`Started polling ${this.url} every ${this.pollingInterval}ms`))}async stopMonitoring(){this.pollingTimer&&(clearInterval(this.pollingTimer),this.pollingTimer=void 0,c().info(`Stopped polling ${this.url}`))}getCurrentData(){return this.currentData}async dispose(){await this.stopMonitoring(),this.cacheManager.clear(this.url),this.currentData=void 0,this.onReloadCallback=void 0,this.onErrorCallback=void 0}async poll(){try{c().debug(`Polling ${this.url} for updates...`);let e=this.cacheManager.getConditionalHeaders(this.url),t=await this.httpClient.fetch(this.url,e);if(t.status===304){c().debug("No changes detected (304 Not Modified)");return}if(t.status===200){let r=this.parseJson(t.data),n=this.validateStructure(r);if(n)throw new L(n,t.data);this.cacheManager.set(this.url,r,t.headers),this.currentData=r,c().info(`Documentation updated from ${this.url}`),this.onReloadCallback&&this.onReloadCallback(r);return}throw new k(`HTTP ${t.status}: ${t.statusText}`,this.url,t.status,t.statusText)}catch(e){let t=e instanceof Error?e.message:String(e);c().error(`Polling error for ${this.url}`,e instanceof Error?e:new Error(t)),this.onErrorCallback&&this.onErrorCallback(e instanceof Error?e:new Error(t))}}async fetchDocumentation(){try{let e=this.cacheManager.get(this.url),t=e?this.cacheManager.getConditionalHeaders(this.url):void 0,r=await this.httpClient.fetch(this.url,t);if(r.status===304&&e)return c().debug("Using cached documentation (304 Not Modified)"),this.currentData=e.data,{success:!0,data:e.data};if(r.status!==200)return{success:!1,error:`${new k(`HTTP ${r.status}: ${r.statusText}`,this.url,r.status,r.statusText).message} (URL: ${this.url})`};let n=this.parseJson(r.data),o=this.validateStructure(n);return o?{success:!1,error:o}:(this.cacheManager.set(this.url,n,r.headers),this.currentData=n,{success:!0,data:n})}catch(e){let t=e instanceof Error?e.message:String(e);return{success:!1,error:`Failed to fetch documentation from ${this.url}: ${t}`}}}parseJson(e){try{return JSON.parse(e)}catch(t){let r=t instanceof Error?t.message:String(t);throw new L(`Failed to parse JSON: ${r}`,e)}}validateStructure(e){if(!e||typeof e!="object")return"Documentation must be an object";let t=e,r=["pipes","components","directives","injectables","interfaces","classes","modules"];for(let n of r){let o=t[n];if(o!==void 0&&!Array.isArray(o))return`${n} must be an array`}return null}};var M=class{source;constructor(e){this.source=this.createSource(e)}async load(){let e=await this.source.load();return e.success&&this.source.startMonitoring(),e}getCurrentData(){return this.source.getCurrentData()}async stopWatching(){await this.source.stopMonitoring()}async dispose(){await this.source.dispose()}createSource(e){let t=g.detect(e.path);return t.type==="local"?new q({path:t.normalizedPath,watchForChanges:e.watchForChanges??!0,reloadDebounce:e.reloadDebounce??1e3,onReload:e.onReload,onError:e.onError}):new W({url:t.normalizedPath,timeout:e.timeout??1e4,maxRetries:e.maxRetries??3,pollingInterval:e.pollingInterval??6e4,onReload:e.onReload,onError:e.onError})}};var A=class{build(e){let t={byName:new Map,bySelector:new Map,searchIndex:new Map,components:[],directives:[],pipes:[],services:[],lastUpdated:new Date,totalCount:0},r=new Map;if(e.components)for(let n of e.components){if(r.has(n.name))throw new Error(`Duplicate name detected: "${n.name}" exists as both ${r.get(n.name)} and component. All component, directive, pipe, and service names must be unique across the entire documentation.`);r.set(n.name,"component"),this.indexComponent(n,t)}if(e.directives)for(let n of e.directives){if(r.has(n.name))throw new Error(`Duplicate name detected: "${n.name}" exists as both ${r.get(n.name)} and directive. All component, directive, pipe, and service names must be unique across the entire documentation.`);r.set(n.name,"directive"),this.indexDirective(n,t)}if(e.pipes)for(let n of e.pipes){if(r.has(n.name))throw new Error(`Duplicate name detected: "${n.name}" exists as both ${r.get(n.name)} and pipe. All component, directive, pipe, and service names must be unique across the entire documentation.`);r.set(n.name,"pipe"),this.indexPipe(n,t)}if(e.injectables)for(let n of e.injectables){if(r.has(n.name))throw new Error(`Duplicate name detected: "${n.name}" exists as both ${r.get(n.name)} and injectable. All component, directive, pipe, and service names must be unique across the entire documentation.`);r.set(n.name,"injectable"),this.indexInjectable(n,t)}return t.totalCount=t.components.length+t.directives.length+t.pipes.length+t.services.length,t}indexComponent(e,t){t.components.push(e),t.byName.set(e.name,e),e.selector&&t.bySelector.set(e.selector,e),this.addToSearchIndex(e,t)}indexDirective(e,t){t.directives.push(e),t.byName.set(e.name,e),e.selector&&t.bySelector.set(e.selector,e),this.addToSearchIndex(e,t)}indexPipe(e,t){t.pipes.push(e),t.byName.set(e.name,e),this.addToSearchIndex(e,t)}indexInjectable(e,t){t.services.push(e),t.byName.set(e.name,e),this.addToSearchIndex(e,t)}addToSearchIndex(e,t){let r=new Set;if(this.extractWords(e.name,r),"selector"in e&&e.selector&&this.extractWords(e.selector,r),e.description&&this.extractWords(e.description,r),"inputs"in e&&e.inputs)for(let n of e.inputs)this.extractWords(n.name,r),n.description&&this.extractWords(n.description,r);if("outputs"in e&&e.outputs)for(let n of e.outputs)this.extractWords(n.name,r),n.description&&this.extractWords(n.description,r);if("methods"in e&&e.methods)for(let n of e.methods)this.extractWords(n.name,r);for(let n of r)t.searchIndex.has(n)||t.searchIndex.set(n,new Set),t.searchIndex.get(n).add(e.name)}extractWords(e,t){let r=e.toLowerCase(),n=r.split(/[^a-z0-9]+/).filter(o=>o.length>0);for(let o of n)t.add(o);n.length===0&&e.trim().length>0&&t.add(r.trim())}getStatistics(e){return{totalCount:e.totalCount,componentCount:e.components.length,directiveCount:e.directives.length,pipeCount:e.pipes.length,serviceCount:e.services.length,lastUpdated:e.lastUpdated}}rebuild(e,t){return this.build(e)}};import{Server as Se}from"@modelcontextprotocol/sdk/server/index.js";import{StdioServerTransport as Ie}from"@modelcontextprotocol/sdk/server/stdio.js";import{CallToolRequestSchema as Re,ListToolsRequestSchema as Te}from"@modelcontextprotocol/sdk/types.js";var N=class{index;constructor(e){this.index=e}getByName(e){return this.index.byName.get(e)}getBySelector(e){return this.index.bySelector.get(e)}getByType(e){switch(e){case"component":return this.index.components;case"directive":return this.index.directives;case"pipe":return this.index.pipes;case"service":return this.index.services;case"all":return[...this.index.components,...this.index.directives,...this.index.pipes,...this.index.services];default:return[]}}getAll(e=!1){let t=this.getByType("all");return e?t:t.filter(r=>!r.deprecated)}updateIndex(e){this.index=e}};var F=class{index;constructor(e){this.index=e}search(e){let{query:t,types:r,includeDeprecated:n=!1,limit:o=50,offset:s=0}=e,a=t.toLowerCase().trim();if(a.length===0)return{items:[],total:0,hasMore:!1};let p=this.getCandidates(a,r),u=[];for(let T of p){if(!n&&T.deprecated)continue;let U=this.calculateRelevanceScore(T,a);U>0&&u.push({doc:T,relevanceScore:U})}u.sort((T,U)=>U.relevanceScore-T.relevanceScore);let m=u.length,f=u.slice(s,s+o),K=s+o<m;return{items:f,total:m,hasMore:K}}getCandidates(e,t){let r=e.split(/[^a-z0-9]+/).filter(s=>s.length>0),n=new Set;for(let s of r){if(this.index.searchIndex.has(s)){let a=this.index.searchIndex.get(s);for(let p of a)n.add(p)}for(let[a,p]of this.index.searchIndex.entries())if(a.startsWith(s))for(let u of p)n.add(u)}let o=[];for(let s of n){let a=this.index.byName.get(s);a&&(t&&t.length>0?t.includes(a.type)&&o.push(a):o.push(a))}return o}calculateRelevanceScore(e,t){let r=0,n=e.name.toLowerCase();if(n===t&&(r+=100),"selector"in e&&e.selector){let o=e.selector.toLowerCase();(o===t||o.includes(t))&&(r+=80)}if(n.startsWith(t)&&(r+=60),!n.startsWith(t)&&n.includes(t)&&(r+=30),e.description&&e.description.toLowerCase().includes(t)&&(r+=40),"inputs"in e&&e.inputs){for(let o of e.inputs)if(o.name.toLowerCase().includes(t)){r+=30;break}}if("outputs"in e&&e.outputs){for(let o of e.outputs)if(o.name.toLowerCase().includes(t)){r+=30;break}}if("methods"in e&&e.methods){for(let o of e.methods)if(o.name.toLowerCase().includes(t)){r+=20;break}}return e.deprecated&&(r=Math.floor(r*.5)),r}updateIndex(e){this.index=e}};var J=class{getPreferredDescription(e){return e.rawdescription??e.description??""}formatList(e,t=!1){return e.filter(r=>t||!r.deprecated).map(r=>this.formatSummary(r))}formatSummary(e){let t=e.type==="injectable"?"service":e.type,r="selector"in e?e.selector:void 0;return{name:e.name,type:t,selector:r,description:this.getPreferredDescription(e),deprecated:e.deprecated}}formatDetails(e){let t=this.formatInputs(e),r=this.formatOutputs(e),n=this.formatMethods(e),o=this.formatExamples(e),s=e.type==="injectable"?"service":e.type,a="selector"in e?e.selector:void 0,p="standalone"in e?e.standalone:void 0,u="imports"in e?e.imports:void 0;return{name:e.name,type:s,selector:a,description:this.getPreferredDescription(e),inputs:t,outputs:r,methods:n,examples:o,deprecated:e.deprecated,deprecationMessage:e.deprecationMessage,standalone:p,imports:u}}formatInputs(e){let t=[];return"inputs"in e&&e.inputs&&t.push(...e.inputs.map(r=>this.formatProperty(r))),"inputsClass"in e&&e.inputsClass&&t.push(...e.inputsClass.map(r=>this.formatProperty(r))),t}formatOutputs(e){let t=[];return"outputs"in e&&e.outputs&&t.push(...e.outputs.map(r=>this.formatProperty(r))),"outputsClass"in e&&e.outputsClass&&t.push(...e.outputsClass.map(r=>this.formatProperty(r))),t}formatProperty(e){return{name:e.name,type:e.type||"any",required:!e.optional,description:this.getPreferredDescription(e),defaultValue:e.defaultValue}}formatMethods(e){return!("methods"in e)||!e.methods?[]:e.methods.map(t=>this.formatMethod(t))}formatMethod(e){let t=(e.args||[]).map(o=>({name:o.name,type:o.type||"any",optional:o.optional||!1,defaultValue:o.defaultValue})),r=t.map(o=>{let s=o.optional?"?":"",a=o.defaultValue?` = ${o.defaultValue}`:"";return`${o.name}${s}: ${o.type}${a}`}).join(", "),n=`${e.name}(${r}): ${e.returnType||"void"}`;return{name:e.name,signature:n,description:this.getPreferredDescription(e),parameters:t,returnType:e.returnType||"void"}}formatExamples(e){return!("examples"in e)||!e.examples?[]:e.examples}formatSearchResults(e){return e.map(t=>{let r=t.doc.type==="injectable"?"service":t.doc.type,n="selector"in t.doc?t.doc.selector:void 0;return{name:t.doc.name,type:r,selector:n,description:this.getPreferredDescription(t.doc),deprecated:t.doc.deprecated,relevanceScore:t.relevanceScore}})}toJSON(e){return JSON.stringify(e,null,2)}formatDeprecatedList(e,t){if(e.length===0)return"No deprecated items found.";let r=e.reduce((o,s)=>(o[s.type]||(o[s.type]=[]),o[s.type].push(s),o),{}),n=`Found ${e.length} deprecated item(s):
|
|
56
|
+
|
|
57
|
+
`;for(let[o,s]of Object.entries(r)){n+=`## ${o.charAt(0).toUpperCase()+o.slice(1)}s
|
|
58
|
+
|
|
59
|
+
`;for(let a of s)n+=`### ${a.name}
|
|
60
|
+
`,n+=`- **Message**: ${a.deprecationMessage}
|
|
61
|
+
`,a.versionDeprecated&&(n+=`- **Deprecated in**: v${a.versionDeprecated}
|
|
62
|
+
`),t&&a.replacementSuggestion&&(n+=`- **Replacement**: ${a.replacementSuggestion}
|
|
63
|
+
`),n+=`
|
|
64
|
+
`}return n}formatDeprecationInfo(e){if(!e.isDeprecated)return`${e.name} (${e.type}) is not deprecated.`;let t=`# ${e.name} (${e.type})
|
|
65
|
+
|
|
66
|
+
`;return t+=`**Status**: DEPRECATED
|
|
67
|
+
|
|
68
|
+
`,e.deprecationMessage&&(t+=`**Message**: ${e.deprecationMessage}
|
|
69
|
+
|
|
70
|
+
`),e.versionDeprecated&&(t+=`**Deprecated in**: v${e.versionDeprecated}
|
|
71
|
+
|
|
72
|
+
`),e.replacementSuggestion&&(t+=`**Recommended replacement**: ${e.replacementSuggestion}
|
|
73
|
+
|
|
74
|
+
`),t}};var h=class{query;formatter;constructor(e,t){this.query=e,this.formatter=t}execute(e={}){let{includeDeprecated:t=!1,type:r="all",limit:n=50,offset:o=0}=e;if(n<1||n>1e3)throw new Error("Limit must be between 1 and 1000");if(o<0)throw new Error("Offset must be non-negative");let s=this.query.getByType(r),a=t?s:s.filter(K=>!K.deprecated),p=a.length,u=a.slice(o,o+n),m=o+n<p;return{items:this.formatter.formatList(u,!0),total:p,hasMore:m,offset:o,limit:n}}static getToolDefinition(){return{name:"list-components",description:"Lists all available components, directives, pipes, and services from the EUI component library. Supports filtering by type and deprecated status, with pagination for large result sets.",inputSchema:{type:"object",properties:{includeDeprecated:{type:"boolean",description:"Whether to include deprecated components in the results (default: false)",default:!1},type:{type:"string",enum:["component","directive","pipe","service","all"],description:"Filter by type (default: all)",default:"all"},limit:{type:"number",description:"Maximum number of results to return (default: 50, max: 1000)",default:50,minimum:1,maximum:1e3},offset:{type:"number",description:"Number of results to skip for pagination (default: 0)",default:0,minimum:0}}}}}};var y=class{query;formatter;constructor(e,t){this.query=e,this.formatter=t}execute(e){let{name:t}=e;if(!t||typeof t!="string"||t.trim().length===0)throw new Error("Component name is required and must be a non-empty string");let r=this.query.getByName(t.trim());if(!r)throw new Error(`Component "${t}" not found in documentation`);return{component:this.formatter.formatDetails(r)}}static getToolDefinition(){return{name:"get-component-docs",description:"Retrieves detailed documentation for a specific component, directive, pipe, or service by name. Returns complete metadata including inputs, outputs, methods, examples, selector information, standalone flag, and module import requirements.",inputSchema:{type:"object",properties:{name:{type:"string",description:"The name of the component, directive, pipe, or service to retrieve"}},required:["name"]}}}};var v=class{searchEngine;formatter;constructor(e,t){this.searchEngine=e,this.formatter=t}execute(e){let{query:t,types:r,includeDeprecated:n=!1,limit:o=50}=e;if(t==null||typeof t!="string")throw new Error("Query is required and must be a string");let s=t.trim();if(s.length===0)throw new Error("Query cannot be empty");if(o<1||o>1e3)throw new Error("Limit must be between 1 and 1000");if(r&&r.length>0){let m=["component","directive","pipe","service"];for(let f of r)if(!m.includes(f))throw new Error(`Invalid type "${f}". Must be one of: ${m.join(", ")}`)}let a={query:s,types:r,includeDeprecated:n,limit:o,offset:0},p=this.searchEngine.search(a);return{items:this.formatter.formatSearchResults(p.items),total:p.total,hasMore:p.hasMore,query:s}}static getToolDefinition(){return{name:"search-components",description:"Searches for components, directives, pipes, and services by keyword or functionality. Returns results ranked by relevance, matching against component names, selectors, descriptions, inputs, outputs, and methods. Supports filtering by type and deprecated status.",inputSchema:{type:"object",properties:{query:{type:"string",description:"Search query to match against component metadata"},types:{type:"array",items:{type:"string",enum:["component","directive","pipe","service"]},description:"Filter results by type (optional). If not specified, searches all types."},includeDeprecated:{type:"boolean",description:"Whether to include deprecated components in results (default: false)",default:!1},limit:{type:"number",description:"Maximum number of results to return (default: 50, max: 1000)",default:50,minimum:1,maximum:1e3}},required:["query"]}}}};var C=class{query;formatter;constructor(e,t){this.query=e,this.formatter=t}execute(e){let{name:t}=e;if(!t||typeof t!="string"||t.trim().length===0)throw new Error("Component name is required and must be a non-empty string");let r=this.query.getByName(t.trim());if(!r)throw new Error(`Component "${t}" not found in documentation`);let n=this.formatter.formatInputs(r);return{componentName:r.name,inputs:n}}static getToolDefinition(){return{name:"get-component-inputs",description:"Retrieves all input properties for a specific component, directive, pipe, or service by name. Returns detailed information about each input including name, type, description, default value, and required flag.",inputSchema:{type:"object",properties:{name:{type:"string",description:"The name of the component, directive, pipe, or service"}},required:["name"]}}}};var x=class{query;formatter;constructor(e,t){this.query=e,this.formatter=t}execute(e){let{name:t}=e;if(!t||typeof t!="string"||t.trim().length===0)throw new Error("Component name is required and must be a non-empty string");let r=this.query.getByName(t.trim());if(!r)throw new Error(`Component "${t}" not found in documentation`);let n=this.formatter.formatOutputs(r);return{componentName:r.name,outputs:n}}static getToolDefinition(){return{name:"get-component-outputs",description:"Retrieves all output events for a specific component, directive, pipe, or service by name. Returns detailed information about each output including name, type, and description.",inputSchema:{type:"object",properties:{name:{type:"string",description:"The name of the component, directive, pipe, or service"}},required:["name"]}}}};var b=class{query;formatter;constructor(e,t){this.query=e,this.formatter=t}execute(e){let{name:t}=e;if(!t||typeof t!="string"||t.trim().length===0)throw new Error("Component name is required and must be a non-empty string");let r=this.query.getByName(t.trim());if(!r)throw new Error(`Component "${t}" not found in documentation`);let n=this.formatter.formatExamples(r);return{componentName:r.name,examples:n}}static getToolDefinition(){return{name:"get-component-examples",description:"Retrieves all usage examples for a specific component, directive, pipe, or service by name. Returns code examples with HTML templates and TypeScript code, preserving formatting. Returns an empty array if no examples are available.",inputSchema:{type:"object",properties:{name:{type:"string",description:"The name of the component, directive, pipe, or service"}},required:["name"]}}}};var w=class{async execute(e={}){try{let t=await fetch("https://registry.npmjs.org/@eui/components");if(!t.ok)throw t.status===404?new Error('Package "@eui/components" not found in npm registry'):new Error(`npm registry returned status ${t.status}`);let r=await t.json();if(!r["dist-tags"]||!r["dist-tags"].latest)throw new Error("Invalid response: missing dist-tags.latest");if(!r.time)throw new Error("Invalid response: missing time field");let n=r["dist-tags"].latest,o=r.time[n];if(!o)throw new Error(`Invalid response: no publish date for version ${n}`);return{packageName:"@eui/components",version:n,publishDate:o}}catch(t){throw t instanceof Error?t:new Error(`Unexpected error querying npm registry: ${String(t)}`)}}static getToolDefinition(){return{name:"get-library-version",description:"Queries the npm registry to retrieve the latest version information for the @eui/components package, including the version number and publish date.",inputSchema:{type:"object",properties:{}}}}};var Q=class{isDeprecated(e){return!!(e.deprecated===!0||e.decorators&&e.decorators.some(t=>t.name==="deprecated")||e.jsdoctags&&e.jsdoctags.some(t=>t.tagName?.text==="deprecated"))}extractDeprecationMessage(e){let t=e.jsdoctags?.find(r=>r.tagName?.text==="deprecated");return t?.comment?t.comment:e.deprecationMessage?e.deprecationMessage:"This item is deprecated."}extractVersion(e){let t=[/since\s+v?(\d+\.\d+\.\d+)/i,/deprecated\s+in\s+v?(\d+\.\d+\.\d+)/i,/v(\d+\.\d+\.\d+)/i];for(let r of t){let n=e.match(r);if(n)return n[1]}}extractReplacement(e){let t=[/use\s+([A-Za-z0-9_-]+)\s+instead/i,/replaced\s+by\s+([A-Za-z0-9_-]+)/i,/migrate\s+to\s+([A-Za-z0-9_-]+)/i,/see\s+([A-Za-z0-9_-]+)/i];for(let r of t){let n=e.match(r);if(n)return n[1]}}parseDeprecationInfo(e){let t=this.extractDeprecationMessage(e);return{deprecationMessage:t,versionDeprecated:this.extractVersion(t),replacementSuggestion:this.extractReplacement(t),filePath:e.file}}};var E=class{constructor(e){this.index=e;this.parser=new Q}parser;listDeprecated(e={}){let t=[],r=[{items:this.index.components,type:"component"},{items:this.index.directives,type:"directive"},{items:this.index.pipes,type:"pipe"},{items:this.index.services,type:"injectable"}];for(let{items:n,type:o}of r)if(!(e.type&&e.type!==o)){for(let s of n)if(this.parser.isDeprecated(s)){let a=this.parser.parseDeprecationInfo(s),p=e.includeReplacements?a.replacementSuggestion:void 0;t.push({name:s.name,type:o,deprecationMessage:a.deprecationMessage,versionDeprecated:a.versionDeprecated,replacementSuggestion:p,filePath:a.filePath})}}return t}getDeprecationInfo(e){let t=this.index.byName.get(e);if(!t)return null;if(!this.parser.isDeprecated(t))return{name:e,type:t.type,isDeprecated:!1};let n=this.parser.parseDeprecationInfo(t);return{name:e,type:t.type,isDeprecated:!0,deprecationMessage:n.deprecationMessage,versionDeprecated:n.versionDeprecated,replacementSuggestion:n.replacementSuggestion}}};var D=class{query;formatter;constructor(e,t){this.query=new E(e),this.formatter=t}execute(e={}){let{type:t,includeReplacements:r=!1}=e,n=this.query.listDeprecated({type:t,includeReplacements:r});return{content:[{type:"text",text:this.formatter.formatDeprecatedList(n,r)}]}}static getToolDefinition(){return{name:"list-deprecated",description:"Lists all deprecated items in the library (components, directives, pipes, services). Supports filtering by type and optionally includes replacement suggestions.",inputSchema:{type:"object",properties:{type:{type:"string",description:"Filter by type (component, directive, pipe, injectable)"},includeReplacements:{type:"boolean",description:"Include replacement suggestions in results (default: false)",default:!1}}}}}};var S=class{query;formatter;constructor(e,t){this.query=new E(e),this.formatter=t}execute(e){let{componentName:t}=e;if(!t||typeof t!="string"||t.trim().length===0)throw new Error("Component name is required and must be a non-empty string");let r=this.query.getDeprecationInfo(t.trim());if(!r)throw new Error(`Component "${t}" not found in documentation`);return{content:[{type:"text",text:this.formatter.formatDeprecationInfo(r)}]}}static getToolDefinition(){return{name:"get-deprecation-info",description:"Retrieves detailed deprecation information for a specific component, directive, pipe, or service. Returns deprecation status, message, version deprecated, and replacement suggestions.",inputSchema:{type:"object",properties:{componentName:{type:"string",description:"The name of the component or library element to check"}},required:["componentName"]}}}};var I=class{execute(e={}){return Promise.resolve({content:Ee,format:"markdown"})}static getToolDefinition(){return{name:"get-eui-cli-guide",description:"Returns a comprehensive markdown guide for getting started with EUI CLI, including installation, project creation, and basic usage instructions.",inputSchema:{type:"object",properties:{}}}}},Ee=`# Getting Started with EUI CLI
|
|
75
|
+
|
|
76
|
+
The EUI CLI is a command-line tool for scaffolding and managing EUI applications.
|
|
77
|
+
|
|
78
|
+
## Installation
|
|
79
|
+
|
|
80
|
+
Install the EUI CLI globally using npm:
|
|
81
|
+
|
|
82
|
+
\`\`\`bash
|
|
83
|
+
npm install -g @eui/cli
|
|
84
|
+
\`\`\`
|
|
85
|
+
|
|
86
|
+
Verify the installation:
|
|
87
|
+
|
|
88
|
+
\`\`\`bash
|
|
89
|
+
eui-cli --version
|
|
90
|
+
\`\`\`
|
|
91
|
+
|
|
92
|
+
## Creating a New Application
|
|
93
|
+
|
|
94
|
+
Generate a new EUI application using the \`new\` command:
|
|
95
|
+
|
|
96
|
+
\`\`\`bash
|
|
97
|
+
eui-cli new
|
|
98
|
+
\`\`\`
|
|
99
|
+
|
|
100
|
+
This will:
|
|
101
|
+
- Create a new directory called \`my-app\`
|
|
102
|
+
- Set up the project structure
|
|
103
|
+
- Install dependencies
|
|
104
|
+
- Configure build tools
|
|
105
|
+
|
|
106
|
+
### Interactive Setup
|
|
107
|
+
|
|
108
|
+
The CLI will prompt you for:
|
|
109
|
+
- **Application name**: Your app's display name
|
|
110
|
+
- **Description**: Brief description of your application
|
|
111
|
+
- **Framework**: Choose between Angular, React, or Vue
|
|
112
|
+
- **Styling**: Select CSS, SCSS, or styled-components
|
|
113
|
+
- **Features**: Optional features like routing, state management, etc.
|
|
114
|
+
|
|
115
|
+
### Non-Interactive Setup
|
|
116
|
+
|
|
117
|
+
Skip prompts by providing options:
|
|
118
|
+
|
|
119
|
+
eui-cli globally installed
|
|
120
|
+
\`\`\`bash
|
|
121
|
+
eui-cli new --config appType:angular,npmInstall:false --targetPath my-app
|
|
122
|
+
\`\`\`
|
|
123
|
+
or using npx
|
|
124
|
+
\`\`\`bash
|
|
125
|
+
npx @eui/cli new --config appType:angular,npmInstall:false --targetPath my-app
|
|
126
|
+
\`\`\`
|
|
127
|
+
|
|
128
|
+
## Project Structure
|
|
129
|
+
|
|
130
|
+
A generated EUI application has this structure:
|
|
131
|
+
|
|
132
|
+
\`\`\`
|
|
133
|
+
my-app/
|
|
134
|
+
\u251C\u2500\u2500 src/
|
|
135
|
+
\u2502 \u251C\u2500\u2500 app/
|
|
136
|
+
\u2502 \u2502 \u251C\u2500\u2500 features/
|
|
137
|
+
\u2502 \u2502 \u2502 \u251C\u2500\u2500 home/
|
|
138
|
+
\u2502 \u2502 \u2502 \u2502 \u251C\u2500\u2500 home.component.html
|
|
139
|
+
\u2502 \u2502 \u2502 \u2502 \u251C\u2500\u2500 home.component.ts
|
|
140
|
+
\u2502 \u2502 \u2502 \u2502 \u2514\u2500\u2500 home.routes.ts
|
|
141
|
+
\u2502 \u2502 \u2502 \u251C\u2500\u2500 module1/
|
|
142
|
+
\u2502 \u2502 \u2502 \u2502 \u251C\u2500\u2500 components/
|
|
143
|
+
\u2502 \u2502 \u2502 \u2502 \u2502 \u251C\u2500\u2500 page1/
|
|
144
|
+
\u2502 \u2502 \u2502 \u2502 \u2502 \u2502 \u251C\u2500\u2500 page1.component.html
|
|
145
|
+
\u2502 \u2502 \u2502 \u2502 \u2502 \u2502 \u2514\u2500\u2500 page1.component.ts
|
|
146
|
+
\u2502 \u2502 \u2502 \u2502 \u2502 \u2514\u2500\u2500 page2/
|
|
147
|
+
\u2502 \u2502 \u2502 \u2502 \u2502 \u251C\u2500\u2500 page2.component.html
|
|
148
|
+
\u2502 \u2502 \u2502 \u2502 \u2502 \u2514\u2500\u2500 page2.component.ts
|
|
149
|
+
\u2502 \u2502 \u2502 \u2502 \u251C\u2500\u2500 module1.component.html
|
|
150
|
+
\u2502 \u2502 \u2502 \u2502 \u251C\u2500\u2500 module1.component.ts
|
|
151
|
+
\u2502 \u2502 \u2502 \u2502 \u2514\u2500\u2500 module1.routes.ts
|
|
152
|
+
\u2502 \u2502 \u2502 \u2514\u2500\u2500 module2/
|
|
153
|
+
\u2502 \u2502 \u2502 \u251C\u2500\u2500 module2.component.html
|
|
154
|
+
\u2502 \u2502 \u2502 \u251C\u2500\u2500 module2.component.ts
|
|
155
|
+
\u2502 \u2502 \u2502 \u2514\u2500\u2500 module2.routes.ts
|
|
156
|
+
\u2502 \u2502 \u251C\u2500\u2500 shared/
|
|
157
|
+
\u2502 \u2502 \u2502 \u2514\u2500\u2500 testing/
|
|
158
|
+
\u2502 \u2502 \u2502 \u2514\u2500\u2500 router.mock.ts
|
|
159
|
+
\u2502 \u2502 \u251C\u2500\u2500 app-starter.service.ts
|
|
160
|
+
\u2502 \u2502 \u251C\u2500\u2500 app-starter.service.spec.ts
|
|
161
|
+
\u2502 \u2502 \u251C\u2500\u2500 app.component.html
|
|
162
|
+
\u2502 \u2502 \u251C\u2500\u2500 app.component.ts
|
|
163
|
+
\u2502 \u2502 \u251C\u2500\u2500 app.component.spec.ts
|
|
164
|
+
\u2502 \u2502 \u251C\u2500\u2500 app.config.ts
|
|
165
|
+
\u2502 \u2502 \u2514\u2500\u2500 app.routes.ts
|
|
166
|
+
\u2502 \u251C\u2500\u2500 assets/
|
|
167
|
+
\u2502 \u2502 \u251C\u2500\u2500 config/
|
|
168
|
+
\u2502 \u2502 \u2502 \u251C\u2500\u2500 env-json-config-dev.json
|
|
169
|
+
\u2502 \u2502 \u2502 \u251C\u2500\u2500 env-json-config-prod.json
|
|
170
|
+
\u2502 \u2502 \u2502 \u2514\u2500\u2500 env-json-config.json
|
|
171
|
+
\u2502 \u2502 \u2514\u2500\u2500 i18n/
|
|
172
|
+
\u2502 \u2502 \u251C\u2500\u2500 en.json
|
|
173
|
+
\u2502 \u2502 \u2514\u2500\u2500 fr.json
|
|
174
|
+
\u2502 \u251C\u2500\u2500 config/
|
|
175
|
+
\u2502 \u2502 \u251C\u2500\u2500 global.ts
|
|
176
|
+
\u2502 \u2502 \u251C\u2500\u2500 index.ts
|
|
177
|
+
\u2502 \u2502 \u2514\u2500\u2500 modules.ts
|
|
178
|
+
\u2502 \u251C\u2500\u2500 environments/
|
|
179
|
+
\u2502 \u2502 \u251C\u2500\u2500 environment.ts
|
|
180
|
+
\u2502 \u2502 \u2514\u2500\u2500 environment.prod.ts
|
|
181
|
+
\u2502 \u251C\u2500\u2500 index.html
|
|
182
|
+
\u2502 \u251C\u2500\u2500 main.ts
|
|
183
|
+
\u2502 \u251C\u2500\u2500 styles.scss
|
|
184
|
+
\u2502 \u251C\u2500\u2500 favicon.ico
|
|
185
|
+
\u2502 \u251C\u2500\u2500 dummy.spec.ts
|
|
186
|
+
\u2502 \u251C\u2500\u2500 tsconfig.app.json
|
|
187
|
+
\u2502 \u2514\u2500\u2500 tsconfig.spec.json
|
|
188
|
+
\u251C\u2500\u2500 mock/
|
|
189
|
+
\u2502 \u251C\u2500\u2500 app/
|
|
190
|
+
\u2502 \u2502 \u251C\u2500\u2500 models/
|
|
191
|
+
\u2502 \u2502 \u2502 \u2514\u2500\u2500 user.js
|
|
192
|
+
\u2502 \u2502 \u2514\u2500\u2500 routes/
|
|
193
|
+
\u2502 \u251C\u2500\u2500 db/
|
|
194
|
+
\u2502 \u2502 \u2514\u2500\u2500 db.json
|
|
195
|
+
\u2502 \u2514\u2500\u2500 server.js
|
|
196
|
+
\`\`\`
|
|
197
|
+
|
|
198
|
+
The application will be available at \`http://localhost:4200\`
|
|
199
|
+
`;var R=class{execute(e={}){return Promise.resolve({content:De,format:"markdown"})}static getToolDefinition(){return{name:"get-eui-cli-instructions",description:"Returns complete EUI CLI instructions including all commands, options, headless mode configuration, CI/CD usage, and best practices for automated scaffolding and building.",inputSchema:{type:"object",properties:{}}}}},De=`# eUI CLI - Complete Options Report
|
|
200
|
+
|
|
201
|
+
## Overview
|
|
202
|
+
|
|
203
|
+
The @eui/cli is a command-line tool for scaffolding and managing eUI Angular applications. It supports both interactive and headless (automated) modes for CI/CD pipelines and scripting.
|
|
204
|
+
|
|
205
|
+
## Installation
|
|
206
|
+
|
|
207
|
+
\`\`\`bash
|
|
208
|
+
npm install -g @eui/cli@latest
|
|
209
|
+
\`\`\`
|
|
210
|
+
|
|
211
|
+
## Available Commands
|
|
212
|
+
|
|
213
|
+
### 1. new (default command)
|
|
214
|
+
|
|
215
|
+
Generates a new eUI application with interactive prompts or automated configuration.
|
|
216
|
+
|
|
217
|
+
**Usage:**
|
|
218
|
+
|
|
219
|
+
\`\`\`bash
|
|
220
|
+
eui-cli new [options]
|
|
221
|
+
eui-cli [options] # 'new' is default
|
|
222
|
+
\`\`\`
|
|
223
|
+
|
|
224
|
+
**Interactive Options:**
|
|
225
|
+
|
|
226
|
+
**Application Type:**
|
|
227
|
+
- \`angular\` - eUI Angular Desktop
|
|
228
|
+
- \`mobile\` - eUI Angular Mobile (Ionic)
|
|
229
|
+
- \`web-spring-boot\` - eUI Angular + Spring Boot (requires JDK + Maven)
|
|
230
|
+
- \`web-maven\` - eUI Angular + Maven web module (requires JDK + Maven)
|
|
231
|
+
|
|
232
|
+
**Additional Configuration:**
|
|
233
|
+
- \`ecl\` - ECL app-shell template for ec.europa.eu apps
|
|
234
|
+
- ECL Theme: \`ecl-ec\` or \`ecl-eu\`
|
|
235
|
+
|
|
236
|
+
**Package Manager:**
|
|
237
|
+
- \`yarn\` (default)
|
|
238
|
+
- \`pnpm\` (experimental)
|
|
239
|
+
|
|
240
|
+
**Maven Options (for web-spring-boot):**
|
|
241
|
+
- \`groupId\` - Default: ec.europa.digit
|
|
242
|
+
- \`artifactId\` - Default: myapp
|
|
243
|
+
|
|
244
|
+
### 2. build-app
|
|
245
|
+
|
|
246
|
+
Builds the Angular application with linting, testing, and compilation.
|
|
247
|
+
|
|
248
|
+
**Usage:**
|
|
249
|
+
|
|
250
|
+
\`\`\`bash
|
|
251
|
+
eui-cli build-app [options]
|
|
252
|
+
\`\`\`
|
|
253
|
+
|
|
254
|
+
**Options:**
|
|
255
|
+
|
|
256
|
+
| Option | Type | Description |
|
|
257
|
+
|--------|------|-------------|
|
|
258
|
+
| \`--skipLint\` | boolean | Skip linting phase |
|
|
259
|
+
| \`--skipTest\` | boolean | Skip unit testing phase |
|
|
260
|
+
| \`--skipCompile\` | boolean | Skip compilation phase |
|
|
261
|
+
| \`--configuration\` | string | Build configuration (e.g., production, development) |
|
|
262
|
+
| \`--baseHref\` | string | Base URL for the application |
|
|
263
|
+
| \`--servePath\` | string | Path where files are served |
|
|
264
|
+
| \`--deployUrl\` | string | URL where files will be deployed |
|
|
265
|
+
| \`--watch\` | boolean | Enable watch mode for tests |
|
|
266
|
+
| \`--dryRun\` | boolean | Run without executing build |
|
|
267
|
+
| \`--maxSpaceSize\` | boolean | Increase Node memory (8096MB) |
|
|
268
|
+
| \`--statsJson\` | boolean | Generate stats.json for bundle analysis |
|
|
269
|
+
| \`--ci\` | boolean | CI mode (disables progress output) |
|
|
270
|
+
| \`--sourceMap\` | boolean | Generate source maps |
|
|
271
|
+
| \`--configEnvTarget\` | string | Inject environment-specific config |
|
|
272
|
+
| \`--project\` | string | Project name (default: 'app') |
|
|
273
|
+
|
|
274
|
+
**Example:**
|
|
275
|
+
|
|
276
|
+
\`\`\`bash
|
|
277
|
+
eui-cli build-app --configuration=production --baseHref=/myapp/ --skipTest
|
|
278
|
+
\`\`\`
|
|
279
|
+
|
|
280
|
+
### 3. serve-app
|
|
281
|
+
|
|
282
|
+
Serves the Angular application locally with development server.
|
|
283
|
+
|
|
284
|
+
**Usage:**
|
|
285
|
+
|
|
286
|
+
\`\`\`bash
|
|
287
|
+
eui-cli serve-app [options]
|
|
288
|
+
\`\`\`
|
|
289
|
+
|
|
290
|
+
**Options:**
|
|
291
|
+
|
|
292
|
+
| Option | Type | Description |
|
|
293
|
+
|--------|------|-------------|
|
|
294
|
+
| \`--configuration\` | string | Serve configuration |
|
|
295
|
+
| \`--baseHref\` | string | Base URL for the application |
|
|
296
|
+
| \`--servePath\` | string | Path where files are served |
|
|
297
|
+
| \`--host\` | string | Host to listen on (default: localhost) |
|
|
298
|
+
| \`--port\` | number | Port to listen on (default: 4200) |
|
|
299
|
+
| \`--proxyConfig\` | string | Proxy configuration file |
|
|
300
|
+
| \`--disableHostCheck\` | boolean | Disable host check |
|
|
301
|
+
| \`--open\` | string | Open browser (default: true, use 'false' to disable) |
|
|
302
|
+
| \`--maxSpaceSize\` | boolean | Increase Node memory (8192MB) |
|
|
303
|
+
| \`--noLiveReload\` | boolean | Disable live reload |
|
|
304
|
+
| \`--configEnvTarget\` | string | Inject environment-specific config |
|
|
305
|
+
| \`--project\` | string | Project name (default: 'app') |
|
|
306
|
+
| \`--debug\` | boolean | Enable debug logging |
|
|
307
|
+
|
|
308
|
+
**Example:**
|
|
309
|
+
|
|
310
|
+
\`\`\`bash
|
|
311
|
+
eui-cli serve-app --port=4300 --host=0.0.0.0 --proxyConfig=proxy.conf.json
|
|
312
|
+
\`\`\`
|
|
313
|
+
|
|
314
|
+
### 4. lint-app
|
|
315
|
+
|
|
316
|
+
Runs linting on the application.
|
|
317
|
+
|
|
318
|
+
**Usage:**
|
|
319
|
+
|
|
320
|
+
\`\`\`bash
|
|
321
|
+
eui-cli lint-app
|
|
322
|
+
\`\`\`
|
|
323
|
+
|
|
324
|
+
### 5. inject-config-app
|
|
325
|
+
|
|
326
|
+
Injects environment-specific configuration into the application.
|
|
327
|
+
|
|
328
|
+
**Usage:**
|
|
329
|
+
|
|
330
|
+
\`\`\`bash
|
|
331
|
+
eui-cli inject-config-app --configEnvTarget=<env>
|
|
332
|
+
\`\`\`
|
|
333
|
+
|
|
334
|
+
**Options:**
|
|
335
|
+
|
|
336
|
+
| Option | Type | Description |
|
|
337
|
+
|--------|------|-------------|
|
|
338
|
+
| \`--configEnvTarget\` | string | Target environment (dev, tst, acc, prd) |
|
|
339
|
+
|
|
340
|
+
**How it works:**
|
|
341
|
+
- Copies \`src/assets/config/env-json-config-<env>.json\` to \`src/assets/env-json-config.json\`
|
|
342
|
+
- Used for environment-specific OpenID/configuration injection
|
|
343
|
+
|
|
344
|
+
**Example:**
|
|
345
|
+
|
|
346
|
+
\`\`\`bash
|
|
347
|
+
eui-cli inject-config-app --configEnvTarget=production
|
|
348
|
+
\`\`\`
|
|
349
|
+
|
|
350
|
+
### 6. generate-sprite
|
|
351
|
+
|
|
352
|
+
Generates SVG sprite from individual SVG files.
|
|
353
|
+
|
|
354
|
+
**Usage:**
|
|
355
|
+
|
|
356
|
+
\`\`\`bash
|
|
357
|
+
eui-cli generate-sprite --inFolder=<path> --outFile=<filename.svg>
|
|
358
|
+
\`\`\`
|
|
359
|
+
|
|
360
|
+
**Options:**
|
|
361
|
+
|
|
362
|
+
| Option | Type | Description |
|
|
363
|
+
|--------|------|-------------|
|
|
364
|
+
| \`--inFolder\` | string | Input folder containing SVG files (required) |
|
|
365
|
+
| \`--outFile\` | string | Output sprite filename (required, must end with .svg) |
|
|
366
|
+
|
|
367
|
+
**Features:**
|
|
368
|
+
- Optimizes SVG files using imagemin-svgo
|
|
369
|
+
- Generates sprite file and JSON list of icons
|
|
370
|
+
- Cleans up IDs, removes styles and titles
|
|
371
|
+
|
|
372
|
+
**Example:**
|
|
373
|
+
|
|
374
|
+
\`\`\`bash
|
|
375
|
+
eui-cli generate-sprite --inFolder=src/assets/icons --outFile=sprite.svg
|
|
376
|
+
\`\`\`
|
|
377
|
+
|
|
378
|
+
## Headless Mode (Automated/CI Usage)
|
|
379
|
+
|
|
380
|
+
### Using --config Parameter
|
|
381
|
+
|
|
382
|
+
The CLI supports headless operation via the \`--config\` parameter for automated scaffolding without interactive prompts.
|
|
383
|
+
|
|
384
|
+
**Syntax:**
|
|
385
|
+
|
|
386
|
+
\`\`\`bash
|
|
387
|
+
eui-cli --config <key1>:<value1>,<key2>:<value2> --targetPath <path>
|
|
388
|
+
\`\`\`
|
|
389
|
+
|
|
390
|
+
### Configuration Options
|
|
391
|
+
|
|
392
|
+
| Key | Type | Values | Description |
|
|
393
|
+
|-----|------|--------|-------------|
|
|
394
|
+
| \`appType\` | string | angular, mobile, web-maven, web-spring-boot | Application type |
|
|
395
|
+
| \`appName\` | string | any | Application name (default: 'my-app') |
|
|
396
|
+
| \`appScope\` | string | any | NPM scope (default: '@app') |
|
|
397
|
+
| \`appOptions\` | array | ecl | Additional options (use underscore for multiple: ecl_option2) |
|
|
398
|
+
| \`appOptionsEclTheme\` | string | ecl-ec, ecl-eu | ECL theme flavor |
|
|
399
|
+
| \`groupId\` | string | any | Maven groupId (default: 'ec.europa.digit') |
|
|
400
|
+
| \`artifactId\` | string | any | Maven artifactId (default: 'myapp') |
|
|
401
|
+
| \`packageManager\` | string | yarn, pnpm | Package manager |
|
|
402
|
+
| \`npmInstall\` | boolean | true, false | Install dependencies |
|
|
403
|
+
| \`appStart\` | boolean | true, false | Start app after generation |
|
|
404
|
+
|
|
405
|
+
### Headless Examples
|
|
406
|
+
|
|
407
|
+
**1. Basic Angular App (no installation):**
|
|
408
|
+
|
|
409
|
+
\`\`\`bash
|
|
410
|
+
eui-cli --config appType:angular,npmInstall:false --targetPath my-angular-app
|
|
411
|
+
\`\`\`
|
|
412
|
+
|
|
413
|
+
**2. Angular App with ECL EC Theme:**
|
|
414
|
+
|
|
415
|
+
\`\`\`bash
|
|
416
|
+
eui-cli --config appType:angular,appOptions:ecl,appOptionsEclTheme:ecl-ec,npmInstall:true,packageManager:yarn --targetPath my-ecl-app
|
|
417
|
+
\`\`\`
|
|
418
|
+
|
|
419
|
+
**3. Mobile Ionic App:**
|
|
420
|
+
|
|
421
|
+
\`\`\`bash
|
|
422
|
+
eui-cli --config appType:mobile,npmInstall:true --targetPath my-mobile-app
|
|
423
|
+
\`\`\`
|
|
424
|
+
|
|
425
|
+
**4. Spring Boot Web App:**
|
|
426
|
+
|
|
427
|
+
\`\`\`bash
|
|
428
|
+
eui-cli --config appType:web-spring-boot,groupId:com.mycompany,artifactId:myproject,npmInstall:false --targetPath my-spring-app
|
|
429
|
+
\`\`\`
|
|
430
|
+
|
|
431
|
+
**5. CI/CD Pipeline Example:**
|
|
432
|
+
|
|
433
|
+
\`\`\`bash
|
|
434
|
+
# Generate app without installation
|
|
435
|
+
eui-cli --config appType:angular,appOptions:ecl,npmInstall:false --targetPath ./build/app
|
|
436
|
+
|
|
437
|
+
# Build for production
|
|
438
|
+
cd ./build/app
|
|
439
|
+
eui-cli build-app --configuration=production --ci --skipTest --baseHref=/app/
|
|
440
|
+
\`\`\`
|
|
441
|
+
|
|
442
|
+
## Environment Variables
|
|
443
|
+
|
|
444
|
+
### _CSDR_ARGS
|
|
445
|
+
|
|
446
|
+
Alternative method for passing arguments (used in CSDR pipelines).
|
|
447
|
+
|
|
448
|
+
**Format:**
|
|
449
|
+
|
|
450
|
+
\`\`\`bash
|
|
451
|
+
export _CSDR_ARGS="key1:value1,key2:value2"
|
|
452
|
+
eui-cli
|
|
453
|
+
\`\`\`
|
|
454
|
+
|
|
455
|
+
**Array Format:**
|
|
456
|
+
|
|
457
|
+
\`\`\`bash
|
|
458
|
+
export _CSDR_ARGS="itemsArray:key1=value1|key2=value2"
|
|
459
|
+
\`\`\`
|
|
460
|
+
|
|
461
|
+
## Advanced Usage
|
|
462
|
+
|
|
463
|
+
### Version Check
|
|
464
|
+
|
|
465
|
+
\`\`\`bash
|
|
466
|
+
eui-cli -v
|
|
467
|
+
eui-cli --version
|
|
468
|
+
\`\`\`
|
|
469
|
+
|
|
470
|
+
### Debug Mode
|
|
471
|
+
|
|
472
|
+
Enable verbose logging for troubleshooting:
|
|
473
|
+
|
|
474
|
+
\`\`\`bash
|
|
475
|
+
eui-cli serve-app --debug
|
|
476
|
+
eui-cli build-app --debug
|
|
477
|
+
\`\`\`
|
|
478
|
+
|
|
479
|
+
### CI/CD Build Pipeline
|
|
480
|
+
|
|
481
|
+
\`\`\`bash
|
|
482
|
+
# 1. Inject environment config
|
|
483
|
+
eui-cli inject-config-app --configEnvTarget=production
|
|
484
|
+
|
|
485
|
+
# 2. Build with optimizations
|
|
486
|
+
eui-cli build-app \\
|
|
487
|
+
--configuration=production \\
|
|
488
|
+
--baseHref=/myapp/ \\
|
|
489
|
+
--deployUrl=https://cdn.example.com/ \\
|
|
490
|
+
--ci \\
|
|
491
|
+
--statsJson \\
|
|
492
|
+
--skipTest
|
|
493
|
+
|
|
494
|
+
# 3. Output in dist/ folder
|
|
495
|
+
\`\`\`
|
|
496
|
+
|
|
497
|
+
### Memory-Intensive Builds
|
|
498
|
+
|
|
499
|
+
\`\`\`bash
|
|
500
|
+
eui-cli build-app --maxSpaceSize --configuration=production
|
|
501
|
+
eui-cli serve-app --maxSpaceSize
|
|
502
|
+
\`\`\`
|
|
503
|
+
|
|
504
|
+
## Default Configuration Values
|
|
505
|
+
|
|
506
|
+
\`\`\`javascript
|
|
507
|
+
{
|
|
508
|
+
appName: 'my-app',
|
|
509
|
+
appScope: '@app',
|
|
510
|
+
appType: 'angular',
|
|
511
|
+
appOptions: [],
|
|
512
|
+
appOptionsEclTheme: 'ecl-ec',
|
|
513
|
+
appFeatures: [],
|
|
514
|
+
groupId: 'ec.europa.digit',
|
|
515
|
+
artifactId: 'myapp',
|
|
516
|
+
packageManager: 'yarn',
|
|
517
|
+
npmInstall: true,
|
|
518
|
+
appStart: true
|
|
203
519
|
}
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
520
|
+
\`\`\`
|
|
521
|
+
|
|
522
|
+
## Exit Codes
|
|
523
|
+
|
|
524
|
+
- \`0\` - Success
|
|
525
|
+
- \`1\` - Error (build failure, missing arguments, etc.)
|
|
526
|
+
|
|
527
|
+
## Best Practices
|
|
528
|
+
|
|
529
|
+
1. **Headless Generation**: Always use \`--config\` with \`npmInstall:false\` in CI, then install separately
|
|
530
|
+
2. **Build Optimization**: Use \`--ci\` flag in pipelines to disable progress output
|
|
531
|
+
3. **Memory Management**: Use \`--maxSpaceSize\` for large applications
|
|
532
|
+
4. **Environment Config**: Use \`inject-config-app\` before builds for environment-specific settings
|
|
533
|
+
5. **Testing**: Skip tests in CI with \`--skipTest\` if running separately
|
|
534
|
+
|
|
535
|
+
## Supported Node Versions
|
|
536
|
+
|
|
537
|
+
- **Node.js**: >=24.0.0
|
|
538
|
+
- **Yarn**: >=1.22.4 <2
|
|
539
|
+
`;var j=class{server;index;query;searchEngine;formatter;tools;isRunning=!1;constructor(e,t){this.index=t,this.query=new N(t),this.searchEngine=new F(t),this.formatter=new J,this.tools=new Map,this.server=new Se({name:e.name,version:e.version},{capabilities:{tools:{}}}),this.registerTools(),this.setupHandlers()}registerTools(){let e=new h(this.query,this.formatter),t=new y(this.query,this.formatter),r=new v(this.searchEngine,this.formatter),n=new C(this.query,this.formatter),o=new x(this.query,this.formatter),s=new b(this.query,this.formatter),a=new w,p=new D(this.index,this.formatter),u=new S(this.index,this.formatter),m=new I,f=new R;this.tools.set("list-components",e),this.tools.set("get-component-docs",t),this.tools.set("search-components",r),this.tools.set("get-component-inputs",n),this.tools.set("get-component-outputs",o),this.tools.set("get-component-examples",s),this.tools.set("get-library-version",a),this.tools.set("list-deprecated",p),this.tools.set("get-deprecation-info",u),this.tools.set("get-eui-cli-guide",m),this.tools.set("get-eui-cli-instructions",f)}setupHandlers(){this.server.setRequestHandler(Te,()=>({tools:[h.getToolDefinition(),y.getToolDefinition(),v.getToolDefinition(),C.getToolDefinition(),x.getToolDefinition(),b.getToolDefinition(),w.getToolDefinition(),D.getToolDefinition(),S.getToolDefinition(),I.getToolDefinition(),R.getToolDefinition()]})),this.server.setRequestHandler(Re,async e=>{let{name:t,arguments:r}=e.params;try{let n=this.tools.get(t);if(!n)return{content:[{type:"text",text:JSON.stringify({error:{code:"TOOL_NOT_FOUND",message:`Tool '${t}' does not exist. Available tools: ${Array.from(this.tools.keys()).join(", ")}`}})}],isError:!0};if(r==null)return{content:[{type:"text",text:JSON.stringify({error:{code:"INVALID_PARAMETERS",message:"Tool parameters are required"}})}],isError:!0};let o=await n.execute(r??{});return{content:[{type:"text",text:JSON.stringify(o,null,2)}]}}catch(n){let o=n instanceof Error?n.message:"Unknown error occurred",s=this.categorizeError(n);return{content:[{type:"text",text:JSON.stringify({error:{code:s,message:o}})}],isError:!0}}})}categorizeError(e){if(e instanceof Error){let t=e.message.toLowerCase();if(t.includes("not found")||t.includes("does not exist"))return"NOT_FOUND";if(t.includes("invalid")||t.includes("must be")||t.includes("required")||t.includes("limit")||t.includes("offset"))return"INVALID_PARAMETERS"}return"INTERNAL_ERROR"}async start(){if(this.isRunning)throw new Error("Server is already running");let e=new Ie;await this.server.connect(e),this.isRunning=!0}async stop(){this.isRunning&&(await this.server.close(),this.isRunning=!1)}isHealthy(){return this.isRunning}getStats(){return{isRunning:this.isRunning,toolCount:this.tools.size,indexStats:{totalComponents:this.index.totalCount,lastUpdated:this.index.lastUpdated}}}updateIndex(e){this.index=e,this.query=new N(e),this.searchEngine=new F(e),this.registerTools()}};var d=null,Y=null,le=!1;async function Pe(){try{let i=te();(!i.success||!i.config)&&(process.stderr.write(`Failed to load configuration
|
|
540
|
+
`),i.errors&&i.errors.forEach(a=>process.stderr.write(` - ${a}
|
|
541
|
+
`)),process.exit(1));let e=i.config,t=re({level:e.logging.level,format:e.logging.format});t.info("Starting EUI Compodoc MCP Server",{version:e.server.version,documentationPath:e.documentation.path}),t.info("Loading documentation...",{path:e.documentation.path}),Y=new M({path:e.documentation.path,watchForChanges:e.documentation.watchForChanges,reloadDebounce:e.documentation.reloadDebounce,onReload:Oe,onError:ke});let r=await Y.load();(!r.success||!r.data)&&(t.error("Failed to load documentation",void 0,{error:r.error}),process.exit(1)),t.info("Documentation loaded successfully",{path:e.documentation.path}),t.info("Building component index...");let n=new A,o;try{o=n.build(r.data);let a=n.getStatistics(o);t.info("Index built successfully",{totalCount:a.totalCount,components:a.componentCount,directives:a.directiveCount,pipes:a.pipeCount,services:a.serviceCount})}catch(a){t.error("Failed to build index",a instanceof Error?a:new Error(String(a))),process.exit(1)}t.info("Initializing MCP server..."),d=new j({name:e.server.name,version:e.server.version},o),t.info("Starting MCP server..."),await d.start(),t.info("MCP server started successfully",{name:e.server.name,version:e.server.version,watchForChanges:e.documentation.watchForChanges}),d.isHealthy()?t.info("Health check passed"):t.warn("Health check failed - server may not be fully operational");let s=d.getStats();t.debug("Server statistics",s),t.info("Server is ready to accept requests")}catch(i){c().error("Fatal error during startup",i instanceof Error?i:new Error(String(i))),process.exit(1)}}function Oe(i){let e=c();e.info("Documentation file changed, reloading...");try{let t=new A,r=t.build(i);if(d){d.updateIndex(r);let n=t.getStatistics(r);e.info("Index updated successfully",{totalCount:n.totalCount,components:n.componentCount,directives:n.directiveCount,pipes:n.pipeCount,services:n.serviceCount})}}catch(t){e.error("Failed to reload documentation",t instanceof Error?t:new Error(String(t)))}}function ke(i){c().error("Documentation loader error",i)}async function Z(i){if(le)return;le=!0;let e=c();e.info(`Received ${i}, shutting down gracefully...`);try{d&&(e.info("Stopping MCP server..."),await d.stop(),e.info("MCP server stopped")),Y&&(e.info("Stopping documentation loader..."),await Y.dispose(),e.info("Documentation loader stopped")),e.info("Shutdown complete"),process.exit(0)}catch(t){e.error("Error during shutdown",t instanceof Error?t:new Error(String(t))),process.exit(1)}}function Le(){process.on("SIGINT",()=>{Z("SIGINT")}),process.on("SIGTERM",()=>{Z("SIGTERM")}),process.on("uncaughtException",i=>{c().error("Uncaught exception",i),Z("uncaughtException")}),process.on("unhandledRejection",i=>{c().error("Unhandled promise rejection",i instanceof Error?i:new Error(String(i))),Z("unhandledRejection")})}Le();Pe().catch(i=>{process.stderr.write(`Fatal error: ${i}
|
|
542
|
+
`),process.exit(1)});
|