@structured-world/gitlab-mcp 6.62.1 → 6.62.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/README.md +1 -1
- package/dist/generated/prisma/client.js.map +1 -1
- package/dist/generated/prisma/internal/class.js +2 -2
- package/dist/generated/prisma/internal/class.js.map +1 -1
- package/dist/generated/prisma/internal/prismaNamespace.js +2 -2
- package/dist/src/cli/docker/container-runtime.d.ts +1 -1
- package/dist/src/cli/docker/container-runtime.js +14 -14
- package/dist/src/cli/docker/docker-command.d.ts +1 -1
- package/dist/src/cli/docker/docker-command.js +113 -113
- package/dist/src/cli/docker/docker-command.js.map +1 -1
- package/dist/src/cli/docker/docker-utils.d.ts +3 -3
- package/dist/src/cli/docker/docker-utils.js +74 -74
- package/dist/src/cli/docker/docker-utils.js.map +1 -1
- package/dist/src/cli/docker/index.d.ts +4 -4
- package/dist/src/cli/docker/types.d.ts +3 -3
- package/dist/src/cli/docker/types.js +5 -5
- package/dist/src/cli/init/browser.js +2 -2
- package/dist/src/cli/init/config-generator.d.ts +2 -2
- package/dist/src/cli/init/config-generator.js +22 -22
- package/dist/src/cli/init/connection.d.ts +1 -1
- package/dist/src/cli/init/connection.js +17 -17
- package/dist/src/cli/init/index.d.ts +4 -4
- package/dist/src/cli/init/types.d.ts +3 -3
- package/dist/src/cli/init/types.js +36 -36
- package/dist/src/cli/init/wizard.js +80 -80
- package/dist/src/cli/init/wizard.js.map +1 -1
- package/dist/src/cli/inject-tool-refs.js +47 -47
- package/dist/src/cli/inject-tool-refs.js.map +1 -1
- package/dist/src/cli/install/backup.d.ts +1 -1
- package/dist/src/cli/install/backup.js +3 -3
- package/dist/src/cli/install/detector.d.ts +2 -2
- package/dist/src/cli/install/detector.js +18 -18
- package/dist/src/cli/install/detector.js.map +1 -1
- package/dist/src/cli/install/index.d.ts +5 -5
- package/dist/src/cli/install/install-command.d.ts +2 -2
- package/dist/src/cli/install/install-command.js +68 -68
- package/dist/src/cli/install/install-command.js.map +1 -1
- package/dist/src/cli/install/installers.d.ts +2 -2
- package/dist/src/cli/install/installers.js +55 -55
- package/dist/src/cli/install/installers.js.map +1 -1
- package/dist/src/cli/install/types.d.ts +4 -4
- package/dist/src/cli/install/types.js +48 -48
- package/dist/src/cli/instances/index.d.ts +2 -2
- package/dist/src/cli/instances/instances-command.d.ts +1 -1
- package/dist/src/cli/instances/instances-command.js +65 -65
- package/dist/src/cli/instances/instances-command.js.map +1 -1
- package/dist/src/cli/list-tools.js +396 -396
- package/dist/src/cli/list-tools.js.map +1 -1
- package/dist/src/cli/setup/discovery.d.ts +1 -1
- package/dist/src/cli/setup/discovery.js +10 -10
- package/dist/src/cli/setup/discovery.js.map +1 -1
- package/dist/src/cli/setup/flows/configure-existing.d.ts +1 -1
- package/dist/src/cli/setup/flows/configure-existing.js +57 -57
- package/dist/src/cli/setup/flows/configure-existing.js.map +1 -1
- package/dist/src/cli/setup/flows/local-setup.d.ts +1 -1
- package/dist/src/cli/setup/flows/local-setup.js +51 -51
- package/dist/src/cli/setup/flows/local-setup.js.map +1 -1
- package/dist/src/cli/setup/flows/server-setup.d.ts +1 -1
- package/dist/src/cli/setup/flows/server-setup.js +50 -50
- package/dist/src/cli/setup/flows/server-setup.js.map +1 -1
- package/dist/src/cli/setup/flows/tool-selection.d.ts +1 -1
- package/dist/src/cli/setup/flows/tool-selection.js +94 -94
- package/dist/src/cli/setup/flows/tool-selection.js.map +1 -1
- package/dist/src/cli/setup/index.d.ts +4 -4
- package/dist/src/cli/setup/presets.d.ts +1 -1
- package/dist/src/cli/setup/presets.js +157 -157
- package/dist/src/cli/setup/presets.js.map +1 -1
- package/dist/src/cli/setup/types.d.ts +7 -7
- package/dist/src/cli/setup/wizard.d.ts +1 -1
- package/dist/src/cli/setup/wizard.js +25 -25
- package/dist/src/cli/utils/index.d.ts +1 -1
- package/dist/src/cli/utils/path-utils.js +3 -3
- package/dist/src/cli-utils.d.ts +2 -2
- package/dist/src/cli-utils.js +46 -46
- package/dist/src/config/index.d.ts +4 -4
- package/dist/src/config/instances-loader.d.ts +3 -3
- package/dist/src/config/instances-loader.js +53 -53
- package/dist/src/config/instances-loader.js.map +1 -1
- package/dist/src/config/instances-schema.d.ts +1 -1
- package/dist/src/config/instances-schema.js +33 -33
- package/dist/src/config/instances-schema.js.map +1 -1
- package/dist/src/config.d.ts +4 -4
- package/dist/src/config.js +89 -89
- package/dist/src/config.js.map +1 -1
- package/dist/src/dashboard/handler.d.ts +2 -2
- package/dist/src/dashboard/handler.js +7 -7
- package/dist/src/dashboard/html-template.d.ts +1 -1
- package/dist/src/dashboard/html-template.js +44 -44
- package/dist/src/dashboard/html-template.js.map +1 -1
- package/dist/src/dashboard/index.d.ts +4 -4
- package/dist/src/dashboard/metrics.d.ts +3 -3
- package/dist/src/dashboard/metrics.js +42 -42
- package/dist/src/discovery/auto.d.ts +3 -3
- package/dist/src/discovery/auto.js +28 -28
- package/dist/src/discovery/git-remote.d.ts +2 -2
- package/dist/src/discovery/git-remote.js +18 -18
- package/dist/src/discovery/index.d.ts +3 -3
- package/dist/src/discovery/profile-matcher.d.ts +2 -2
- package/dist/src/discovery/profile-matcher.js +8 -8
- package/dist/src/discovery/profile-matcher.js.map +1 -1
- package/dist/src/entities/context/context-manager.d.ts +3 -3
- package/dist/src/entities/context/context-manager.js +34 -34
- package/dist/src/entities/context/context-manager.js.map +1 -1
- package/dist/src/entities/context/handlers.d.ts +2 -2
- package/dist/src/entities/context/handlers.js +8 -8
- package/dist/src/entities/context/index.d.ts +8 -8
- package/dist/src/entities/context/index.js +1 -1
- package/dist/src/entities/context/registry.d.ts +1 -1
- package/dist/src/entities/context/registry.js +4 -4
- package/dist/src/entities/context/schema.d.ts +1 -1
- package/dist/src/entities/context/schema.js +19 -19
- package/dist/src/entities/context/types.d.ts +9 -9
- package/dist/src/entities/context/whoami.d.ts +1 -1
- package/dist/src/entities/context/whoami.js +31 -31
- package/dist/src/entities/context/whoami.js.map +1 -1
- package/dist/src/entities/core/index.d.ts +5 -5
- package/dist/src/entities/core/index.js +1 -1
- package/dist/src/entities/core/registry.d.ts +1 -1
- package/dist/src/entities/core/registry.js +194 -194
- package/dist/src/entities/core/registry.js.map +1 -1
- package/dist/src/entities/core/schema-readonly.d.ts +1 -1
- package/dist/src/entities/core/schema-readonly.js +117 -117
- package/dist/src/entities/core/schema.d.ts +1 -1
- package/dist/src/entities/core/schema.js +67 -67
- package/dist/src/entities/files/index.d.ts +5 -5
- package/dist/src/entities/files/index.js +1 -1
- package/dist/src/entities/files/registry.d.ts +1 -1
- package/dist/src/entities/files/registry.js +45 -45
- package/dist/src/entities/files/registry.js.map +1 -1
- package/dist/src/entities/files/schema-readonly.d.ts +1 -1
- package/dist/src/entities/files/schema-readonly.js +13 -13
- package/dist/src/entities/files/schema.d.ts +1 -1
- package/dist/src/entities/files/schema.js +29 -29
- package/dist/src/entities/index.d.ts +17 -17
- package/dist/src/entities/integrations/index.d.ts +4 -4
- package/dist/src/entities/integrations/registry.d.ts +1 -1
- package/dist/src/entities/integrations/registry.js +17 -17
- package/dist/src/entities/integrations/registry.js.map +1 -1
- package/dist/src/entities/integrations/schema-readonly.d.ts +1 -1
- package/dist/src/entities/integrations/schema-readonly.js +5 -5
- package/dist/src/entities/integrations/schema.d.ts +1 -1
- package/dist/src/entities/integrations/schema.js +69 -69
- package/dist/src/entities/iterations/index.d.ts +2 -2
- package/dist/src/entities/iterations/registry.d.ts +1 -1
- package/dist/src/entities/iterations/registry.js +13 -13
- package/dist/src/entities/iterations/registry.js.map +1 -1
- package/dist/src/entities/iterations/schema-readonly.d.ts +1 -1
- package/dist/src/entities/iterations/schema-readonly.js +9 -9
- package/dist/src/entities/labels/index.d.ts +5 -5
- package/dist/src/entities/labels/index.js +1 -1
- package/dist/src/entities/labels/registry.d.ts +1 -1
- package/dist/src/entities/labels/registry.js +19 -19
- package/dist/src/entities/labels/registry.js.map +1 -1
- package/dist/src/entities/labels/schema-readonly.d.ts +1 -1
- package/dist/src/entities/labels/schema-readonly.js +8 -8
- package/dist/src/entities/labels/schema.d.ts +1 -1
- package/dist/src/entities/labels/schema.js +11 -11
- package/dist/src/entities/members/index.d.ts +3 -3
- package/dist/src/entities/members/registry.d.ts +1 -1
- package/dist/src/entities/members/registry.js +26 -26
- package/dist/src/entities/members/registry.js.map +1 -1
- package/dist/src/entities/members/schema-readonly.d.ts +1 -1
- package/dist/src/entities/members/schema-readonly.js +32 -32
- package/dist/src/entities/members/schema-readonly.js.map +1 -1
- package/dist/src/entities/members/schema.d.ts +1 -1
- package/dist/src/entities/members/schema.js +28 -28
- package/dist/src/entities/milestones/index.d.ts +5 -5
- package/dist/src/entities/milestones/index.js +1 -1
- package/dist/src/entities/milestones/registry.d.ts +1 -1
- package/dist/src/entities/milestones/registry.js +25 -25
- package/dist/src/entities/milestones/registry.js.map +1 -1
- package/dist/src/entities/milestones/schema-readonly.d.ts +2 -2
- package/dist/src/entities/milestones/schema-readonly.js +15 -15
- package/dist/src/entities/milestones/schema.d.ts +1 -1
- package/dist/src/entities/milestones/schema.js +16 -16
- package/dist/src/entities/milestones/schema.js.map +1 -1
- package/dist/src/entities/mrs/index.d.ts +5 -5
- package/dist/src/entities/mrs/index.js +1 -1
- package/dist/src/entities/mrs/registry.d.ts +1 -1
- package/dist/src/entities/mrs/registry.js +102 -102
- package/dist/src/entities/mrs/registry.js.map +1 -1
- package/dist/src/entities/mrs/schema-readonly.d.ts +1 -1
- package/dist/src/entities/mrs/schema-readonly.js +126 -126
- package/dist/src/entities/mrs/schema-readonly.js.map +1 -1
- package/dist/src/entities/mrs/schema.d.ts +1 -1
- package/dist/src/entities/mrs/schema.js +111 -111
- package/dist/src/entities/mrs/schema.js.map +1 -1
- package/dist/src/entities/pipelines/index.d.ts +5 -5
- package/dist/src/entities/pipelines/index.js +1 -1
- package/dist/src/entities/pipelines/registry.d.ts +1 -1
- package/dist/src/entities/pipelines/registry.js +45 -45
- package/dist/src/entities/pipelines/registry.js.map +1 -1
- package/dist/src/entities/pipelines/schema-readonly.d.ts +1 -1
- package/dist/src/entities/pipelines/schema-readonly.js +73 -73
- package/dist/src/entities/pipelines/schema.d.ts +1 -1
- package/dist/src/entities/pipelines/schema.js +21 -21
- package/dist/src/entities/refs/index.d.ts +3 -3
- package/dist/src/entities/refs/registry.d.ts +1 -1
- package/dist/src/entities/refs/registry.js +31 -31
- package/dist/src/entities/refs/registry.js.map +1 -1
- package/dist/src/entities/refs/schema-readonly.d.ts +1 -1
- package/dist/src/entities/refs/schema-readonly.js +21 -21
- package/dist/src/entities/refs/schema.d.ts +1 -1
- package/dist/src/entities/refs/schema.js +56 -56
- package/dist/src/entities/releases/index.d.ts +3 -3
- package/dist/src/entities/releases/registry.d.ts +1 -1
- package/dist/src/entities/releases/registry.js +21 -21
- package/dist/src/entities/releases/registry.js.map +1 -1
- package/dist/src/entities/releases/schema-readonly.d.ts +1 -1
- package/dist/src/entities/releases/schema-readonly.js +13 -13
- package/dist/src/entities/releases/schema.d.ts +1 -1
- package/dist/src/entities/releases/schema.js +21 -21
- package/dist/src/entities/search/index.d.ts +2 -2
- package/dist/src/entities/search/registry.d.ts +1 -1
- package/dist/src/entities/search/registry.js +13 -13
- package/dist/src/entities/search/schema-readonly.d.ts +1 -1
- package/dist/src/entities/search/schema-readonly.js +23 -23
- package/dist/src/entities/shared.d.ts +1 -1
- package/dist/src/entities/shared.js +5 -5
- package/dist/src/entities/snippets/index.d.ts +5 -5
- package/dist/src/entities/snippets/index.js +1 -1
- package/dist/src/entities/snippets/registry.d.ts +1 -1
- package/dist/src/entities/snippets/registry.js +24 -24
- package/dist/src/entities/snippets/registry.js.map +1 -1
- package/dist/src/entities/snippets/schema-readonly.d.ts +1 -1
- package/dist/src/entities/snippets/schema-readonly.js +11 -11
- package/dist/src/entities/snippets/schema.d.ts +1 -1
- package/dist/src/entities/snippets/schema.js +27 -27
- package/dist/src/entities/snippets/schema.js.map +1 -1
- package/dist/src/entities/utils.d.ts +2 -2
- package/dist/src/entities/utils.js +8 -8
- package/dist/src/entities/utils.js.map +1 -1
- package/dist/src/entities/variables/index.d.ts +5 -5
- package/dist/src/entities/variables/index.js +1 -1
- package/dist/src/entities/variables/registry.d.ts +1 -1
- package/dist/src/entities/variables/registry.js +22 -22
- package/dist/src/entities/variables/registry.js.map +1 -1
- package/dist/src/entities/variables/schema-readonly.d.ts +1 -1
- package/dist/src/entities/variables/schema-readonly.js +6 -6
- package/dist/src/entities/variables/schema.d.ts +1 -1
- package/dist/src/entities/variables/schema.js +21 -21
- package/dist/src/entities/variables/schema.js.map +1 -1
- package/dist/src/entities/webhooks/index.d.ts +4 -4
- package/dist/src/entities/webhooks/registry.d.ts +1 -1
- package/dist/src/entities/webhooks/registry.js +29 -29
- package/dist/src/entities/webhooks/registry.js.map +1 -1
- package/dist/src/entities/webhooks/schema-readonly.d.ts +1 -1
- package/dist/src/entities/webhooks/schema-readonly.js +9 -9
- package/dist/src/entities/webhooks/schema.d.ts +1 -1
- package/dist/src/entities/webhooks/schema.js +59 -59
- package/dist/src/entities/wiki/index.d.ts +5 -5
- package/dist/src/entities/wiki/index.js +1 -1
- package/dist/src/entities/wiki/registry.d.ts +1 -1
- package/dist/src/entities/wiki/registry.js +19 -19
- package/dist/src/entities/wiki/registry.js.map +1 -1
- package/dist/src/entities/wiki/schema-readonly.d.ts +1 -1
- package/dist/src/entities/wiki/schema-readonly.js +6 -6
- package/dist/src/entities/wiki/schema.d.ts +1 -1
- package/dist/src/entities/wiki/schema.js +12 -12
- package/dist/src/entities/workitems/index.d.ts +5 -5
- package/dist/src/entities/workitems/index.js +1 -1
- package/dist/src/entities/workitems/registry.d.ts +1 -1
- package/dist/src/entities/workitems/registry.js +101 -101
- package/dist/src/entities/workitems/registry.js.map +1 -1
- package/dist/src/entities/workitems/schema-readonly.d.ts +1 -1
- package/dist/src/entities/workitems/schema-readonly.js +27 -27
- package/dist/src/entities/workitems/schema-readonly.js.map +1 -1
- package/dist/src/entities/workitems/schema.d.ts +1 -1
- package/dist/src/entities/workitems/schema.js +58 -58
- package/dist/src/graphql/DynamicWorkItemsQuery.d.ts +2 -2
- package/dist/src/graphql/DynamicWorkItemsQuery.js +47 -47
- package/dist/src/graphql/DynamicWorkItemsQuery.js.map +1 -1
- package/dist/src/graphql/client.d.ts +1 -1
- package/dist/src/graphql/client.js +4 -4
- package/dist/src/graphql/client.js.map +1 -1
- package/dist/src/graphql/index.d.ts +2 -2
- package/dist/src/graphql/workItems.d.ts +38 -38
- package/dist/src/graphql/workItems.js +30 -30
- package/dist/src/handlers.d.ts +1 -1
- package/dist/src/handlers.js +55 -55
- package/dist/src/handlers.js.map +1 -1
- package/dist/src/http-client.js +3 -3
- package/dist/src/logger.js +25 -25
- package/dist/src/logging/access-log.d.ts +2 -2
- package/dist/src/logging/access-log.js +25 -25
- package/dist/src/logging/connection-tracker.d.ts +1 -1
- package/dist/src/logging/connection-tracker.js +3 -3
- package/dist/src/logging/index.d.ts +5 -5
- package/dist/src/logging/request-tracker.d.ts +3 -3
- package/dist/src/logging/request-tracker.js +4 -4
- package/dist/src/logging/types.d.ts +3 -3
- package/dist/src/logging/types.js +1 -1
- package/dist/src/main.js +28 -28
- package/dist/src/middleware/index.d.ts +2 -2
- package/dist/src/middleware/oauth-auth.d.ts +1 -1
- package/dist/src/middleware/oauth-auth.js +17 -17
- package/dist/src/middleware/rate-limiter.d.ts +1 -1
- package/dist/src/middleware/rate-limiter.js +32 -32
- package/dist/src/oauth/config.d.ts +1 -1
- package/dist/src/oauth/config.js +18 -18
- package/dist/src/oauth/config.js.map +1 -1
- package/dist/src/oauth/endpoints/authorize.d.ts +1 -1
- package/dist/src/oauth/endpoints/authorize.js +32 -32
- package/dist/src/oauth/endpoints/callback.d.ts +1 -1
- package/dist/src/oauth/endpoints/callback.js +26 -26
- package/dist/src/oauth/endpoints/index.d.ts +5 -5
- package/dist/src/oauth/endpoints/metadata.d.ts +1 -1
- package/dist/src/oauth/endpoints/metadata.js +12 -12
- package/dist/src/oauth/endpoints/register.d.ts +1 -1
- package/dist/src/oauth/endpoints/register.js +9 -9
- package/dist/src/oauth/endpoints/token.d.ts +1 -1
- package/dist/src/oauth/endpoints/token.js +28 -28
- package/dist/src/oauth/gitlab-device-flow.d.ts +2 -2
- package/dist/src/oauth/gitlab-device-flow.js +46 -46
- package/dist/src/oauth/gitlab-device-flow.js.map +1 -1
- package/dist/src/oauth/index.d.ts +10 -10
- package/dist/src/oauth/session-store.d.ts +2 -2
- package/dist/src/oauth/session-store.js +40 -40
- package/dist/src/oauth/session-store.js.map +1 -1
- package/dist/src/oauth/storage/factory.d.ts +2 -2
- package/dist/src/oauth/storage/factory.js +16 -16
- package/dist/src/oauth/storage/file.d.ts +2 -2
- package/dist/src/oauth/storage/file.js +22 -22
- package/dist/src/oauth/storage/file.js.map +1 -1
- package/dist/src/oauth/storage/index.d.ts +5 -5
- package/dist/src/oauth/storage/memory.d.ts +2 -2
- package/dist/src/oauth/storage/memory.js +18 -18
- package/dist/src/oauth/storage/memory.js.map +1 -1
- package/dist/src/oauth/storage/postgresql.d.ts +2 -2
- package/dist/src/oauth/storage/postgresql.js +11 -11
- package/dist/src/oauth/storage/postgresql.js.map +1 -1
- package/dist/src/oauth/storage/types.d.ts +3 -3
- package/dist/src/oauth/token-context.d.ts +1 -1
- package/dist/src/oauth/token-context.js +1 -1
- package/dist/src/oauth/token-utils.d.ts +1 -1
- package/dist/src/oauth/token-utils.js +20 -20
- package/dist/src/oauth/types.d.ts +3 -3
- package/dist/src/profiles/applicator.d.ts +1 -1
- package/dist/src/profiles/applicator.js +48 -48
- package/dist/src/profiles/index.d.ts +5 -5
- package/dist/src/profiles/loader.d.ts +3 -3
- package/dist/src/profiles/loader.js +25 -25
- package/dist/src/profiles/loader.js.map +1 -1
- package/dist/src/profiles/project-loader.d.ts +1 -1
- package/dist/src/profiles/project-loader.js +23 -23
- package/dist/src/profiles/project-loader.js.map +1 -1
- package/dist/src/profiles/scope-enforcer.d.ts +2 -2
- package/dist/src/profiles/scope-enforcer.js +25 -25
- package/dist/src/profiles/scope-enforcer.js.map +1 -1
- package/dist/src/profiles/types.d.ts +2 -2
- package/dist/src/profiles/types.js +50 -48
- package/dist/src/profiles/types.js.map +1 -1
- package/dist/src/registry-manager.d.ts +1 -1
- package/dist/src/registry-manager.js +64 -64
- package/dist/src/registry-manager.js.map +1 -1
- package/dist/src/server.js +136 -136
- package/dist/src/server.js.map +1 -1
- package/dist/src/services/ConnectionManager.d.ts +5 -5
- package/dist/src/services/ConnectionManager.js +45 -45
- package/dist/src/services/ConnectionManager.js.map +1 -1
- package/dist/src/services/GitLabVersionDetector.d.ts +2 -2
- package/dist/src/services/GitLabVersionDetector.js +45 -45
- package/dist/src/services/GitLabVersionDetector.js.map +1 -1
- package/dist/src/services/InstanceConnectionPool.d.ts +2 -2
- package/dist/src/services/InstanceConnectionPool.js +13 -13
- package/dist/src/services/InstanceConnectionPool.js.map +1 -1
- package/dist/src/services/InstanceRateLimiter.js +6 -6
- package/dist/src/services/InstanceRateLimiter.js.map +1 -1
- package/dist/src/services/InstanceRegistry.d.ts +4 -4
- package/dist/src/services/InstanceRegistry.js +23 -23
- package/dist/src/services/InstanceRegistry.js.map +1 -1
- package/dist/src/services/NamespaceTierDetector.d.ts +2 -2
- package/dist/src/services/NamespaceTierDetector.js +30 -30
- package/dist/src/services/NamespaceTierDetector.js.map +1 -1
- package/dist/src/services/SchemaIntrospector.d.ts +1 -1
- package/dist/src/services/SchemaIntrospector.js +42 -42
- package/dist/src/services/SchemaIntrospector.js.map +1 -1
- package/dist/src/services/TokenScopeDetector.d.ts +2 -2
- package/dist/src/services/TokenScopeDetector.js +80 -80
- package/dist/src/services/TokenScopeDetector.js.map +1 -1
- package/dist/src/services/ToolAvailability.d.ts +6 -6
- package/dist/src/services/ToolAvailability.js +122 -122
- package/dist/src/services/ToolAvailability.js.map +1 -1
- package/dist/src/services/WidgetAvailability.d.ts +2 -2
- package/dist/src/services/WidgetAvailability.js +34 -34
- package/dist/src/session-manager.d.ts +3 -2
- package/dist/src/session-manager.js +17 -14
- package/dist/src/session-manager.js.map +1 -1
- package/dist/src/types.js +4 -4
- package/dist/src/utils/description-utils.js +4 -4
- package/dist/src/utils/description-utils.js.map +1 -1
- package/dist/src/utils/error-handler.d.ts +9 -9
- package/dist/src/utils/error-handler.js +187 -187
- package/dist/src/utils/error-handler.js.map +1 -1
- package/dist/src/utils/fetch.js +85 -85
- package/dist/src/utils/fetch.js.map +1 -1
- package/dist/src/utils/gitlab-api.d.ts +1 -1
- package/dist/src/utils/gitlab-api.js +24 -24
- package/dist/src/utils/idConversion.js +47 -47
- package/dist/src/utils/idConversion.js.map +1 -1
- package/dist/src/utils/namespace.d.ts +2 -2
- package/dist/src/utils/namespace.js +15 -15
- package/dist/src/utils/projectIdentifier.js +4 -4
- package/dist/src/utils/request-logger.d.ts +4 -4
- package/dist/src/utils/request-logger.js +5 -5
- package/dist/src/utils/schema-utils.js +24 -24
- package/dist/src/utils/schema-utils.js.map +1 -1
- package/dist/src/utils/smart-user-search.d.ts +1 -1
- package/dist/src/utils/smart-user-search.js +10 -10
- package/dist/src/utils/version.js +1 -1
- package/dist/structured-world-gitlab-mcp-6.62.2.tgz +0 -0
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +18 -21
- package/dist/structured-world-gitlab-mcp-6.62.1.tgz +0 -0
|
@@ -43,7 +43,7 @@ const profiles_1 = require("../profiles");
|
|
|
43
43
|
function parseArgs() {
|
|
44
44
|
const args = process.argv.slice(2);
|
|
45
45
|
const options = {
|
|
46
|
-
format:
|
|
46
|
+
format: 'markdown',
|
|
47
47
|
showEnv: false,
|
|
48
48
|
showEnvGates: false,
|
|
49
49
|
verbose: false,
|
|
@@ -57,90 +57,90 @@ function parseArgs() {
|
|
|
57
57
|
for (let i = 0; i < args.length; i++) {
|
|
58
58
|
const arg = args[i];
|
|
59
59
|
switch (arg) {
|
|
60
|
-
case
|
|
61
|
-
options.format =
|
|
60
|
+
case '--json':
|
|
61
|
+
options.format = 'json';
|
|
62
62
|
break;
|
|
63
|
-
case
|
|
64
|
-
options.format =
|
|
63
|
+
case '--simple':
|
|
64
|
+
options.format = 'simple';
|
|
65
65
|
break;
|
|
66
|
-
case
|
|
67
|
-
options.format =
|
|
66
|
+
case '--export':
|
|
67
|
+
options.format = 'export';
|
|
68
68
|
break;
|
|
69
|
-
case
|
|
69
|
+
case '--entity':
|
|
70
70
|
if (i + 1 >= args.length) {
|
|
71
|
-
console.error(
|
|
72
|
-
console.error(
|
|
71
|
+
console.error('Error: --entity flag requires a value.');
|
|
72
|
+
console.error('Usage: yarn list-tools --entity <entity_name>');
|
|
73
73
|
process.exit(1);
|
|
74
74
|
}
|
|
75
75
|
options.entity = args[++i];
|
|
76
76
|
break;
|
|
77
|
-
case
|
|
77
|
+
case '--tool':
|
|
78
78
|
if (i + 1 >= args.length) {
|
|
79
|
-
console.error(
|
|
80
|
-
console.error(
|
|
79
|
+
console.error('Error: --tool flag requires a value.');
|
|
80
|
+
console.error('Usage: yarn list-tools --tool <tool_name>');
|
|
81
81
|
process.exit(1);
|
|
82
82
|
}
|
|
83
83
|
options.tool = args[++i];
|
|
84
84
|
break;
|
|
85
|
-
case
|
|
85
|
+
case '--env':
|
|
86
86
|
options.showEnv = true;
|
|
87
87
|
break;
|
|
88
|
-
case
|
|
88
|
+
case '--env-gates':
|
|
89
89
|
options.showEnvGates = true;
|
|
90
90
|
break;
|
|
91
|
-
case
|
|
92
|
-
case
|
|
91
|
+
case '--verbose':
|
|
92
|
+
case '-v':
|
|
93
93
|
options.verbose = true;
|
|
94
94
|
break;
|
|
95
|
-
case
|
|
95
|
+
case '--detail':
|
|
96
96
|
options.detail = true;
|
|
97
97
|
break;
|
|
98
|
-
case
|
|
98
|
+
case '--no-examples':
|
|
99
99
|
options.noExamples = true;
|
|
100
100
|
break;
|
|
101
|
-
case
|
|
101
|
+
case '--toc':
|
|
102
102
|
options.toc = true;
|
|
103
103
|
break;
|
|
104
|
-
case
|
|
104
|
+
case '--presets':
|
|
105
105
|
options.showPresets = true;
|
|
106
106
|
break;
|
|
107
|
-
case
|
|
107
|
+
case '--profiles':
|
|
108
108
|
options.showProfiles = true;
|
|
109
109
|
break;
|
|
110
|
-
case
|
|
110
|
+
case '--preset':
|
|
111
111
|
if (i + 1 >= args.length) {
|
|
112
|
-
console.error(
|
|
113
|
-
console.error(
|
|
112
|
+
console.error('Error: --preset flag requires a value.');
|
|
113
|
+
console.error('Usage: yarn list-tools --preset <preset_name>');
|
|
114
114
|
process.exit(1);
|
|
115
115
|
}
|
|
116
116
|
options.preset = args[++i];
|
|
117
117
|
break;
|
|
118
|
-
case
|
|
118
|
+
case '--profile':
|
|
119
119
|
if (i + 1 >= args.length) {
|
|
120
|
-
console.error(
|
|
121
|
-
console.error(
|
|
120
|
+
console.error('Error: --profile flag requires a value.');
|
|
121
|
+
console.error('Usage: yarn list-tools --profile <profile_name>');
|
|
122
122
|
process.exit(1);
|
|
123
123
|
}
|
|
124
124
|
options.profile = args[++i];
|
|
125
125
|
break;
|
|
126
|
-
case
|
|
126
|
+
case '--validate':
|
|
127
127
|
options.validate = true;
|
|
128
128
|
break;
|
|
129
|
-
case
|
|
129
|
+
case '--compare':
|
|
130
130
|
if (i + 1 >= args.length) {
|
|
131
|
-
console.error(
|
|
132
|
-
console.error(
|
|
131
|
+
console.error('Error: --compare flag requires a value.');
|
|
132
|
+
console.error('Usage: yarn list-tools --preset <name> --compare <other_name>');
|
|
133
133
|
process.exit(1);
|
|
134
134
|
}
|
|
135
135
|
options.compare = args[++i];
|
|
136
136
|
break;
|
|
137
|
-
case
|
|
138
|
-
case
|
|
137
|
+
case '--help':
|
|
138
|
+
case '-h':
|
|
139
139
|
printHelp();
|
|
140
140
|
process.exit(0);
|
|
141
141
|
break;
|
|
142
142
|
default:
|
|
143
|
-
if (arg.startsWith(
|
|
143
|
+
if (arg.startsWith('-')) {
|
|
144
144
|
console.error(`Error: Unrecognized option '${arg}'.`);
|
|
145
145
|
console.error("Use '--help' to see available options.");
|
|
146
146
|
process.exit(1);
|
|
@@ -208,28 +208,28 @@ Environment Variables:
|
|
|
208
208
|
}
|
|
209
209
|
function resolveJsonSchemaType(prop, schema) {
|
|
210
210
|
if (prop.$ref) {
|
|
211
|
-
const refPath = prop.$ref.replace(
|
|
211
|
+
const refPath = prop.$ref.replace('#/properties/', '');
|
|
212
212
|
const referencedProp = schema.properties?.[refPath];
|
|
213
213
|
if (referencedProp) {
|
|
214
214
|
return resolveJsonSchemaType(referencedProp, schema);
|
|
215
215
|
}
|
|
216
|
-
return
|
|
216
|
+
return 'reference';
|
|
217
217
|
}
|
|
218
218
|
if (prop.type) {
|
|
219
|
-
if (prop.type ===
|
|
219
|
+
if (prop.type === 'array' && prop.items) {
|
|
220
220
|
const itemType = resolveJsonSchemaType(prop.items, schema);
|
|
221
221
|
return `${itemType}[]`;
|
|
222
222
|
}
|
|
223
223
|
return prop.type;
|
|
224
224
|
}
|
|
225
225
|
if (prop.enum) {
|
|
226
|
-
return
|
|
226
|
+
return 'enum';
|
|
227
227
|
}
|
|
228
228
|
if (prop.oneOf ?? prop.anyOf) {
|
|
229
|
-
const unionTypes = (prop.oneOf ?? prop.anyOf)?.map(option => resolveJsonSchemaType(option, schema)) ?? [];
|
|
230
|
-
return unionTypes.join(
|
|
229
|
+
const unionTypes = (prop.oneOf ?? prop.anyOf)?.map((option) => resolveJsonSchemaType(option, schema)) ?? [];
|
|
230
|
+
return unionTypes.join(' | ');
|
|
231
231
|
}
|
|
232
|
-
return
|
|
232
|
+
return 'unknown';
|
|
233
233
|
}
|
|
234
234
|
function getParameterDescription(schema) {
|
|
235
235
|
const params = [];
|
|
@@ -238,8 +238,8 @@ function getParameterDescription(schema) {
|
|
|
238
238
|
const prop = value;
|
|
239
239
|
const required = schema.required?.includes(key) ?? false;
|
|
240
240
|
const type = resolveJsonSchemaType(prop, schema);
|
|
241
|
-
const description = prop.description ??
|
|
242
|
-
let paramStr = ` - \`${key}\` (${type}${required ?
|
|
241
|
+
const description = prop.description ?? '';
|
|
242
|
+
let paramStr = ` - \`${key}\` (${type}${required ? ', required' : ', optional'})`;
|
|
243
243
|
if (description) {
|
|
244
244
|
paramStr += `: ${description}`;
|
|
245
245
|
}
|
|
@@ -257,33 +257,33 @@ function getParameterDescription(schema) {
|
|
|
257
257
|
return params;
|
|
258
258
|
}
|
|
259
259
|
function printEnvironmentInfo() {
|
|
260
|
-
console.log(
|
|
261
|
-
console.log(`GITLAB_READONLY: ${process.env.GITLAB_READONLY ??
|
|
262
|
-
console.log(`GITLAB_DENIED_TOOLS_REGEX: ${process.env.GITLAB_DENIED_TOOLS_REGEX ??
|
|
263
|
-
console.log(`GITLAB_ALLOWED_TOOLS_REGEX: ${process.env.GITLAB_ALLOWED_TOOLS_REGEX ??
|
|
264
|
-
console.log(`GITLAB_API_URL: ${process.env.GITLAB_API_URL ??
|
|
260
|
+
console.log('=== Environment Configuration ===\n');
|
|
261
|
+
console.log(`GITLAB_READONLY: ${process.env.GITLAB_READONLY ?? 'false'}`);
|
|
262
|
+
console.log(`GITLAB_DENIED_TOOLS_REGEX: ${process.env.GITLAB_DENIED_TOOLS_REGEX ?? '(not set)'}`);
|
|
263
|
+
console.log(`GITLAB_ALLOWED_TOOLS_REGEX: ${process.env.GITLAB_ALLOWED_TOOLS_REGEX ?? '(not set)'}`);
|
|
264
|
+
console.log(`GITLAB_API_URL: ${process.env.GITLAB_API_URL ?? 'https://gitlab.com'}`);
|
|
265
265
|
console.log();
|
|
266
266
|
}
|
|
267
267
|
function getToolTierInfo(toolName, action) {
|
|
268
268
|
if (action) {
|
|
269
269
|
const requirement = ToolAvailability_1.ToolAvailability.getToolRequirement(toolName, action);
|
|
270
270
|
if (!requirement)
|
|
271
|
-
return
|
|
271
|
+
return '';
|
|
272
272
|
const tierBadge = {
|
|
273
|
-
free:
|
|
274
|
-
premium:
|
|
275
|
-
ultimate:
|
|
273
|
+
free: 'Free',
|
|
274
|
+
premium: 'Premium',
|
|
275
|
+
ultimate: 'Ultimate',
|
|
276
276
|
}[requirement.requiredTier] ?? requirement.requiredTier;
|
|
277
277
|
return `[tier: ${tierBadge}]`;
|
|
278
278
|
}
|
|
279
279
|
const highestTier = ToolAvailability_1.ToolAvailability.getHighestTier(toolName);
|
|
280
280
|
const tierBadge = {
|
|
281
|
-
free:
|
|
282
|
-
premium:
|
|
283
|
-
ultimate:
|
|
281
|
+
free: 'Free',
|
|
282
|
+
premium: 'Premium',
|
|
283
|
+
ultimate: 'Ultimate',
|
|
284
284
|
}[highestTier] ?? highestTier;
|
|
285
285
|
const toolReq = ToolAvailability_1.ToolAvailability.getActionRequirement(toolName);
|
|
286
|
-
const defaultTier = toolReq?.tier ??
|
|
286
|
+
const defaultTier = toolReq?.tier ?? 'free';
|
|
287
287
|
const hasMixedTiers = highestTier !== defaultTier;
|
|
288
288
|
if (hasMixedTiers) {
|
|
289
289
|
return `[tier: ${tierBadge}*]`;
|
|
@@ -291,60 +291,60 @@ function getToolTierInfo(toolName, action) {
|
|
|
291
291
|
return `[tier: ${tierBadge}]`;
|
|
292
292
|
}
|
|
293
293
|
const ENTITY_TOOLS = {
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
294
|
+
'Projects & Repository': [
|
|
295
|
+
'browse_projects',
|
|
296
|
+
'browse_namespaces',
|
|
297
|
+
'browse_commits',
|
|
298
|
+
'browse_events',
|
|
299
|
+
'browse_files',
|
|
300
|
+
'browse_refs',
|
|
301
|
+
'manage_project',
|
|
302
|
+
'manage_namespace',
|
|
303
|
+
'manage_files',
|
|
304
|
+
'manage_ref',
|
|
305
|
+
'browse_releases',
|
|
306
|
+
'manage_release',
|
|
307
307
|
],
|
|
308
308
|
Collaboration: [
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
309
|
+
'browse_merge_requests',
|
|
310
|
+
'browse_mr_discussions',
|
|
311
|
+
'manage_merge_request',
|
|
312
|
+
'manage_mr_discussion',
|
|
313
|
+
'manage_draft_notes',
|
|
314
|
+
'browse_members',
|
|
315
|
+
'manage_member',
|
|
316
|
+
'browse_users',
|
|
317
|
+
'browse_todos',
|
|
318
|
+
'manage_todos',
|
|
319
319
|
],
|
|
320
320
|
Planning: [
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
321
|
+
'browse_work_items',
|
|
322
|
+
'manage_work_item',
|
|
323
|
+
'browse_milestones',
|
|
324
|
+
'manage_milestone',
|
|
325
|
+
'browse_labels',
|
|
326
|
+
'manage_label',
|
|
327
|
+
'browse_iterations',
|
|
328
328
|
],
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
329
|
+
'CI/CD': [
|
|
330
|
+
'browse_pipelines',
|
|
331
|
+
'manage_pipeline',
|
|
332
|
+
'manage_pipeline_job',
|
|
333
|
+
'browse_variables',
|
|
334
|
+
'manage_variable',
|
|
335
335
|
],
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
336
|
+
'Integrations & Content': [
|
|
337
|
+
'browse_wiki',
|
|
338
|
+
'manage_wiki',
|
|
339
|
+
'browse_snippets',
|
|
340
|
+
'manage_snippet',
|
|
341
|
+
'browse_webhooks',
|
|
342
|
+
'manage_webhook',
|
|
343
|
+
'browse_integrations',
|
|
344
|
+
'manage_integration',
|
|
345
345
|
],
|
|
346
|
-
Discovery: [
|
|
347
|
-
Session: [
|
|
346
|
+
Discovery: ['browse_search'],
|
|
347
|
+
Session: ['manage_context'],
|
|
348
348
|
};
|
|
349
349
|
function groupToolsByEntity(tools) {
|
|
350
350
|
const grouped = new Map();
|
|
@@ -355,21 +355,21 @@ function groupToolsByEntity(tools) {
|
|
|
355
355
|
}
|
|
356
356
|
}
|
|
357
357
|
for (const tool of tools) {
|
|
358
|
-
const entity = toolToEntity.get(tool.name) ??
|
|
358
|
+
const entity = toolToEntity.get(tool.name) ?? 'Other';
|
|
359
359
|
if (!grouped.has(entity)) {
|
|
360
360
|
grouped.set(entity, []);
|
|
361
361
|
}
|
|
362
362
|
grouped.get(entity).push(tool);
|
|
363
363
|
}
|
|
364
364
|
const entityOrder = [
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
365
|
+
'Projects & Repository',
|
|
366
|
+
'Collaboration',
|
|
367
|
+
'Planning',
|
|
368
|
+
'CI/CD',
|
|
369
|
+
'Integrations & Content',
|
|
370
|
+
'Discovery',
|
|
371
|
+
'Session',
|
|
372
|
+
'Other',
|
|
373
373
|
];
|
|
374
374
|
const sortedGrouped = new Map();
|
|
375
375
|
for (const entity of entityOrder) {
|
|
@@ -380,32 +380,32 @@ function groupToolsByEntity(tools) {
|
|
|
380
380
|
return sortedGrouped;
|
|
381
381
|
}
|
|
382
382
|
const ACTION_DESCRIPTIONS = {
|
|
383
|
-
list:
|
|
384
|
-
get:
|
|
385
|
-
create:
|
|
386
|
-
update:
|
|
387
|
-
delete:
|
|
388
|
-
search:
|
|
389
|
-
diffs:
|
|
390
|
-
compare:
|
|
391
|
-
merge:
|
|
392
|
-
approve:
|
|
393
|
-
unapprove:
|
|
394
|
-
rebase:
|
|
395
|
-
cancel:
|
|
396
|
-
retry:
|
|
397
|
-
play:
|
|
398
|
-
publish:
|
|
399
|
-
drafts:
|
|
400
|
-
draft:
|
|
401
|
-
resolve:
|
|
402
|
-
unresolve:
|
|
403
|
-
note:
|
|
404
|
-
mark_done:
|
|
405
|
-
mark_pending:
|
|
406
|
-
disable:
|
|
407
|
-
test:
|
|
408
|
-
read:
|
|
383
|
+
list: 'List items with filtering and pagination',
|
|
384
|
+
get: 'Get a single item by ID',
|
|
385
|
+
create: 'Create a new item',
|
|
386
|
+
update: 'Update an existing item',
|
|
387
|
+
delete: 'Delete an item',
|
|
388
|
+
search: 'Search for items',
|
|
389
|
+
diffs: 'Get file changes/diffs',
|
|
390
|
+
compare: 'Compare two branches or commits',
|
|
391
|
+
merge: 'Merge a merge request',
|
|
392
|
+
approve: 'Approve a merge request',
|
|
393
|
+
unapprove: 'Remove approval from a merge request',
|
|
394
|
+
rebase: 'Rebase a merge request',
|
|
395
|
+
cancel: 'Cancel a running operation',
|
|
396
|
+
retry: 'Retry a failed operation',
|
|
397
|
+
play: 'Run a manual job',
|
|
398
|
+
publish: 'Publish draft notes',
|
|
399
|
+
drafts: 'List draft notes',
|
|
400
|
+
draft: 'Get a single draft note',
|
|
401
|
+
resolve: 'Resolve a discussion thread',
|
|
402
|
+
unresolve: 'Unresolve a discussion thread',
|
|
403
|
+
note: 'Add a note/comment',
|
|
404
|
+
mark_done: 'Mark as done',
|
|
405
|
+
mark_pending: 'Mark as pending',
|
|
406
|
+
disable: 'Disable the integration',
|
|
407
|
+
test: 'Test a webhook',
|
|
408
|
+
read: 'Read item details',
|
|
409
409
|
};
|
|
410
410
|
function extractActions(schema) {
|
|
411
411
|
const actions = [];
|
|
@@ -425,7 +425,7 @@ function extractActions(schema) {
|
|
|
425
425
|
const actionProp = schema.properties?.action;
|
|
426
426
|
if (actionProp?.enum && Array.isArray(actionProp.enum)) {
|
|
427
427
|
for (const actionName of actionProp.enum) {
|
|
428
|
-
if (typeof actionName ===
|
|
428
|
+
if (typeof actionName === 'string') {
|
|
429
429
|
const description = ACTION_DESCRIPTIONS[actionName] ?? `Perform ${actionName} operation`;
|
|
430
430
|
actions.push({ name: actionName, description });
|
|
431
431
|
}
|
|
@@ -443,7 +443,7 @@ function extractParameters(schema) {
|
|
|
443
443
|
name,
|
|
444
444
|
type: resolveJsonSchemaType(prop, schema),
|
|
445
445
|
required: requiredFields.includes(name),
|
|
446
|
-
description: prop.description ??
|
|
446
|
+
description: prop.description ?? '',
|
|
447
447
|
});
|
|
448
448
|
}
|
|
449
449
|
return sortParameters(params);
|
|
@@ -454,9 +454,9 @@ function sortParameters(params) {
|
|
|
454
454
|
return -1;
|
|
455
455
|
if (!a.required && b.required)
|
|
456
456
|
return 1;
|
|
457
|
-
if (a.name ===
|
|
457
|
+
if (a.name === 'action')
|
|
458
458
|
return -1;
|
|
459
|
-
if (b.name ===
|
|
459
|
+
if (b.name === 'action')
|
|
460
460
|
return 1;
|
|
461
461
|
return a.name.localeCompare(b.name);
|
|
462
462
|
});
|
|
@@ -478,11 +478,11 @@ function extractParametersGrouped(schema) {
|
|
|
478
478
|
continue;
|
|
479
479
|
const requiredFields = branch.required ?? [];
|
|
480
480
|
for (const [name, prop] of Object.entries(branch.properties)) {
|
|
481
|
-
if (name ===
|
|
481
|
+
if (name === 'action')
|
|
482
482
|
continue;
|
|
483
483
|
const type = resolveJsonSchemaType(prop, branch);
|
|
484
484
|
const required = requiredFields.includes(name);
|
|
485
|
-
const description = prop.description ??
|
|
485
|
+
const description = prop.description ?? '';
|
|
486
486
|
if (!paramOccurrences.has(name)) {
|
|
487
487
|
paramOccurrences.set(name, {
|
|
488
488
|
actions: new Map(),
|
|
@@ -499,7 +499,7 @@ function extractParametersGrouped(schema) {
|
|
|
499
499
|
}
|
|
500
500
|
for (const [name, data] of paramOccurrences) {
|
|
501
501
|
if (data.actions.size === totalActions) {
|
|
502
|
-
const requiredInAll = Array.from(data.actions.values()).every(a => a.required);
|
|
502
|
+
const requiredInAll = Array.from(data.actions.values()).every((a) => a.required);
|
|
503
503
|
result.common.push({
|
|
504
504
|
name,
|
|
505
505
|
type: data.type,
|
|
@@ -555,58 +555,58 @@ function generateExample(schema) {
|
|
|
555
555
|
if (!targetSchema.properties)
|
|
556
556
|
return example;
|
|
557
557
|
for (const [name, prop] of Object.entries(targetSchema.properties)) {
|
|
558
|
-
if (name ===
|
|
558
|
+
if (name === 'action')
|
|
559
559
|
continue;
|
|
560
560
|
const isRequired = requiredFields.includes(name);
|
|
561
|
-
const description = (prop.description ??
|
|
561
|
+
const description = (prop.description ?? '').toLowerCase();
|
|
562
562
|
if (!isRequired)
|
|
563
563
|
continue;
|
|
564
564
|
if (prop.enum && Array.isArray(prop.enum) && prop.enum.length > 0) {
|
|
565
565
|
example[name] = prop.enum[0];
|
|
566
566
|
}
|
|
567
|
-
else if (name.includes(
|
|
568
|
-
example[name] =
|
|
567
|
+
else if (name.includes('project_id') || name === 'projectId') {
|
|
568
|
+
example[name] = 'my-group/my-project';
|
|
569
569
|
}
|
|
570
|
-
else if (name.includes(
|
|
571
|
-
example[name] =
|
|
570
|
+
else if (name.includes('group_id') || name === 'groupId') {
|
|
571
|
+
example[name] = 'my-group';
|
|
572
572
|
}
|
|
573
|
-
else if (name.includes(
|
|
574
|
-
example[name] =
|
|
573
|
+
else if (name.includes('namespace')) {
|
|
574
|
+
example[name] = 'my-group/my-project';
|
|
575
575
|
}
|
|
576
|
-
else if (name.includes(
|
|
577
|
-
example[name] =
|
|
576
|
+
else if (name.includes('_iid') || name === 'iid') {
|
|
577
|
+
example[name] = '1';
|
|
578
578
|
}
|
|
579
|
-
else if (name.includes(
|
|
580
|
-
example[name] =
|
|
579
|
+
else if (name.includes('_id') || name === 'id') {
|
|
580
|
+
example[name] = '123';
|
|
581
581
|
}
|
|
582
|
-
else if (name ===
|
|
583
|
-
example[name] =
|
|
582
|
+
else if (name === 'title') {
|
|
583
|
+
example[name] = 'Example title';
|
|
584
584
|
}
|
|
585
|
-
else if (name ===
|
|
586
|
-
example[name] =
|
|
585
|
+
else if (name === 'description') {
|
|
586
|
+
example[name] = 'Example description';
|
|
587
587
|
}
|
|
588
|
-
else if (name ===
|
|
589
|
-
example[name] =
|
|
588
|
+
else if (name === 'url') {
|
|
589
|
+
example[name] = 'https://example.com/webhook';
|
|
590
590
|
}
|
|
591
|
-
else if (name ===
|
|
592
|
-
example[name] =
|
|
591
|
+
else if (name === 'content') {
|
|
592
|
+
example[name] = 'File content here';
|
|
593
593
|
}
|
|
594
|
-
else if (name ===
|
|
595
|
-
example[name] =
|
|
594
|
+
else if (name === 'file_path' || name === 'path') {
|
|
595
|
+
example[name] = 'path/to/file.txt';
|
|
596
596
|
}
|
|
597
|
-
else if (name ===
|
|
598
|
-
example[name] =
|
|
597
|
+
else if (name === 'ref' || name === 'branch') {
|
|
598
|
+
example[name] = 'main';
|
|
599
599
|
}
|
|
600
|
-
else if (name ===
|
|
601
|
-
example[name] = name ===
|
|
600
|
+
else if (name === 'from' || name === 'to') {
|
|
601
|
+
example[name] = name === 'from' ? 'main' : 'feature-branch';
|
|
602
602
|
}
|
|
603
|
-
else if (description.includes(
|
|
603
|
+
else if (description.includes('boolean') || prop.type === 'boolean') {
|
|
604
604
|
example[name] = true;
|
|
605
605
|
}
|
|
606
|
-
else if (prop.type ===
|
|
606
|
+
else if (prop.type === 'number' || prop.type === 'integer') {
|
|
607
607
|
example[name] = 10;
|
|
608
608
|
}
|
|
609
|
-
else if (prop.type ===
|
|
609
|
+
else if (prop.type === 'array') {
|
|
610
610
|
example[name] = [];
|
|
611
611
|
}
|
|
612
612
|
else {
|
|
@@ -620,15 +620,15 @@ function getPackageVersion() {
|
|
|
620
620
|
let dir = process.cwd();
|
|
621
621
|
let fallbackVersion = null;
|
|
622
622
|
for (let i = 0; i < 5; i++) {
|
|
623
|
-
const pkgPath = path.join(dir,
|
|
623
|
+
const pkgPath = path.join(dir, 'package.json');
|
|
624
624
|
if (fs.existsSync(pkgPath)) {
|
|
625
|
-
const content = fs.readFileSync(pkgPath,
|
|
625
|
+
const content = fs.readFileSync(pkgPath, 'utf8');
|
|
626
626
|
const pkg = JSON.parse(content);
|
|
627
627
|
if (fallbackVersion === null && pkg.version) {
|
|
628
628
|
fallbackVersion = pkg.version;
|
|
629
629
|
}
|
|
630
|
-
if (pkg.name ===
|
|
631
|
-
return pkg.version ??
|
|
630
|
+
if (pkg.name === '@structured-world/gitlab-mcp') {
|
|
631
|
+
return pkg.version ?? 'unknown';
|
|
632
632
|
}
|
|
633
633
|
}
|
|
634
634
|
const parent = path.dirname(dir);
|
|
@@ -636,74 +636,74 @@ function getPackageVersion() {
|
|
|
636
636
|
break;
|
|
637
637
|
dir = parent;
|
|
638
638
|
}
|
|
639
|
-
return fallbackVersion ??
|
|
639
|
+
return fallbackVersion ?? 'unknown';
|
|
640
640
|
}
|
|
641
641
|
catch {
|
|
642
|
-
return
|
|
642
|
+
return 'unknown';
|
|
643
643
|
}
|
|
644
644
|
}
|
|
645
645
|
function generateExportMarkdown(tools, options) {
|
|
646
646
|
const lines = [];
|
|
647
647
|
const version = getPackageVersion();
|
|
648
|
-
const timestamp = new Date().toISOString().split(
|
|
649
|
-
lines.push(
|
|
650
|
-
lines.push(
|
|
651
|
-
lines.push(
|
|
648
|
+
const timestamp = new Date().toISOString().split('T')[0];
|
|
649
|
+
lines.push('# GitLab MCP Tools Reference');
|
|
650
|
+
lines.push('');
|
|
651
|
+
lines.push('> Auto-generated from source code. Do not edit manually.');
|
|
652
652
|
lines.push(`> Generated: ${timestamp} | Tools: ${tools.length} | Version: ${version}`);
|
|
653
|
-
lines.push(
|
|
653
|
+
lines.push('');
|
|
654
654
|
const grouped = groupToolsByEntity(tools);
|
|
655
655
|
if (options.toc) {
|
|
656
|
-
lines.push(
|
|
657
|
-
lines.push(
|
|
656
|
+
lines.push('## Table of Contents');
|
|
657
|
+
lines.push('');
|
|
658
658
|
for (const [entity, entityTools] of grouped) {
|
|
659
|
-
const anchor = entity.toLowerCase().replace(/\s+/g,
|
|
659
|
+
const anchor = entity.toLowerCase().replace(/\s+/g, '-');
|
|
660
660
|
lines.push(`- [${entity} (${entityTools.length})](#${anchor})`);
|
|
661
661
|
}
|
|
662
|
-
lines.push(
|
|
663
|
-
lines.push(
|
|
664
|
-
lines.push(
|
|
662
|
+
lines.push('');
|
|
663
|
+
lines.push('---');
|
|
664
|
+
lines.push('');
|
|
665
665
|
}
|
|
666
666
|
for (const [entity, entityTools] of grouped) {
|
|
667
667
|
lines.push(`## ${entity}`);
|
|
668
|
-
lines.push(
|
|
668
|
+
lines.push('');
|
|
669
669
|
for (const tool of entityTools) {
|
|
670
670
|
const tierInfo = getToolTierInfo(tool.name);
|
|
671
|
-
const tierDisplay = tierInfo ? ` ${tierInfo}` :
|
|
671
|
+
const tierDisplay = tierInfo ? ` ${tierInfo}` : '';
|
|
672
672
|
lines.push(`### ${tool.name}${tierDisplay}`);
|
|
673
|
-
lines.push(
|
|
673
|
+
lines.push('');
|
|
674
674
|
lines.push(tool.description);
|
|
675
|
-
lines.push(
|
|
675
|
+
lines.push('');
|
|
676
676
|
const actions = extractActions(tool.inputSchema);
|
|
677
677
|
if (actions.length > 0) {
|
|
678
|
-
lines.push(
|
|
679
|
-
lines.push(
|
|
680
|
-
lines.push(
|
|
681
|
-
lines.push(
|
|
678
|
+
lines.push('#### Actions');
|
|
679
|
+
lines.push('');
|
|
680
|
+
lines.push('| Action | Tier | Description |');
|
|
681
|
+
lines.push('|--------|------|-------------|');
|
|
682
682
|
for (const action of actions) {
|
|
683
683
|
const actionTierInfo = getToolTierInfo(tool.name, action.name);
|
|
684
|
-
const tierDisplay = actionTierInfo.replace(
|
|
684
|
+
const tierDisplay = actionTierInfo.replace('[tier: ', '').replace(/]/g, '') || 'Free';
|
|
685
685
|
lines.push(`| \`${action.name}\` | ${tierDisplay} | ${action.description} |`);
|
|
686
686
|
}
|
|
687
|
-
lines.push(
|
|
687
|
+
lines.push('');
|
|
688
688
|
}
|
|
689
689
|
const groupedParams = extractParametersGrouped(tool.inputSchema);
|
|
690
690
|
const hasParams = groupedParams.common.length > 0 || groupedParams.byAction.size > 0;
|
|
691
691
|
if (hasParams) {
|
|
692
|
-
lines.push(
|
|
693
|
-
lines.push(
|
|
692
|
+
lines.push('#### Parameters');
|
|
693
|
+
lines.push('');
|
|
694
694
|
if (groupedParams.common.length > 0) {
|
|
695
695
|
if (groupedParams.byAction.size > 0) {
|
|
696
|
-
lines.push(
|
|
697
|
-
lines.push(
|
|
696
|
+
lines.push('**Common** (all actions):');
|
|
697
|
+
lines.push('');
|
|
698
698
|
}
|
|
699
|
-
lines.push(
|
|
700
|
-
lines.push(
|
|
699
|
+
lines.push('| Parameter | Type | Required | Description |');
|
|
700
|
+
lines.push('|-----------|------|----------|-------------|');
|
|
701
701
|
for (const param of groupedParams.common) {
|
|
702
|
-
const req = param.required ?
|
|
703
|
-
const desc = param.description ||
|
|
702
|
+
const req = param.required ? 'Yes' : 'No';
|
|
703
|
+
const desc = param.description || '-';
|
|
704
704
|
lines.push(`| \`${param.name}\` | ${param.type} | ${req} | ${desc} |`);
|
|
705
705
|
}
|
|
706
|
-
lines.push(
|
|
706
|
+
lines.push('');
|
|
707
707
|
}
|
|
708
708
|
if (groupedParams.byAction.size > 0) {
|
|
709
709
|
const sortedActions = Array.from(groupedParams.byAction.keys()).sort();
|
|
@@ -712,34 +712,34 @@ function generateExportMarkdown(tools, options) {
|
|
|
712
712
|
if (actionParams.length === 0)
|
|
713
713
|
continue;
|
|
714
714
|
lines.push(`**Action \`${actionName}\`**:`);
|
|
715
|
-
lines.push(
|
|
716
|
-
lines.push(
|
|
717
|
-
lines.push(
|
|
715
|
+
lines.push('');
|
|
716
|
+
lines.push('| Parameter | Type | Required | Description |');
|
|
717
|
+
lines.push('|-----------|------|----------|-------------|');
|
|
718
718
|
for (const param of actionParams) {
|
|
719
|
-
const req = param.requiredForAction ?
|
|
720
|
-
const desc = param.description ||
|
|
719
|
+
const req = param.requiredForAction ? 'Yes' : 'No';
|
|
720
|
+
const desc = param.description || '-';
|
|
721
721
|
lines.push(`| \`${param.name}\` | ${param.type} | ${req} | ${desc} |`);
|
|
722
722
|
}
|
|
723
|
-
lines.push(
|
|
723
|
+
lines.push('');
|
|
724
724
|
}
|
|
725
725
|
}
|
|
726
726
|
}
|
|
727
727
|
if (!options.noExamples && tool.inputSchema) {
|
|
728
728
|
const example = generateExample(tool.inputSchema);
|
|
729
729
|
if (Object.keys(example).length > 0) {
|
|
730
|
-
lines.push(
|
|
731
|
-
lines.push(
|
|
732
|
-
lines.push(
|
|
730
|
+
lines.push('#### Example');
|
|
731
|
+
lines.push('');
|
|
732
|
+
lines.push('```json');
|
|
733
733
|
lines.push(JSON.stringify(example, null, 2));
|
|
734
|
-
lines.push(
|
|
735
|
-
lines.push(
|
|
734
|
+
lines.push('```');
|
|
735
|
+
lines.push('');
|
|
736
736
|
}
|
|
737
737
|
}
|
|
738
|
-
lines.push(
|
|
739
|
-
lines.push(
|
|
738
|
+
lines.push('---');
|
|
739
|
+
lines.push('');
|
|
740
740
|
}
|
|
741
741
|
}
|
|
742
|
-
return lines.join(
|
|
742
|
+
return lines.join('\n');
|
|
743
743
|
}
|
|
744
744
|
function extractEnvGates(tools) {
|
|
745
745
|
const gatesMap = new Map();
|
|
@@ -761,92 +761,92 @@ function extractEnvGates(tools) {
|
|
|
761
761
|
return Array.from(gatesMap.values()).sort((a, b) => a.envVar.localeCompare(b.envVar));
|
|
762
762
|
}
|
|
763
763
|
function getUngatedTools(tools) {
|
|
764
|
-
return tools.filter(tool => !tool.gate).map(tool => tool.name);
|
|
764
|
+
return tools.filter((tool) => !tool.gate).map((tool) => tool.name);
|
|
765
765
|
}
|
|
766
766
|
function printEnvGatesMarkdown(gates, ungatedTools, format) {
|
|
767
|
-
if (format ===
|
|
767
|
+
if (format === 'json') {
|
|
768
768
|
const output = {
|
|
769
|
-
gates: gates.map(g => ({
|
|
769
|
+
gates: gates.map((g) => ({
|
|
770
770
|
envVar: g.envVar,
|
|
771
771
|
defaultValue: g.defaultValue,
|
|
772
772
|
tools: g.tools,
|
|
773
773
|
})),
|
|
774
774
|
ungated: {
|
|
775
|
-
description:
|
|
775
|
+
description: 'Core tools (always enabled)',
|
|
776
776
|
tools: ungatedTools,
|
|
777
777
|
},
|
|
778
778
|
};
|
|
779
779
|
console.log(JSON.stringify(output, null, 2));
|
|
780
780
|
return;
|
|
781
781
|
}
|
|
782
|
-
console.log(
|
|
783
|
-
console.log(
|
|
784
|
-
console.log(
|
|
785
|
-
console.log(
|
|
782
|
+
console.log('# Environment Variable Gates\n');
|
|
783
|
+
console.log('This table shows which `USE_*` environment variables control which tools.\n');
|
|
784
|
+
console.log('| Variable | Default | Tools Controlled |');
|
|
785
|
+
console.log('|----------|---------|------------------|');
|
|
786
786
|
for (const gate of gates) {
|
|
787
|
-
const defaultStr = gate.defaultValue ?
|
|
788
|
-
const toolsStr = gate.tools.map(t => `\`${t}\``).join(
|
|
787
|
+
const defaultStr = gate.defaultValue ? '`true`' : '`false`';
|
|
788
|
+
const toolsStr = gate.tools.map((t) => `\`${t}\``).join(', ');
|
|
789
789
|
console.log(`| \`${gate.envVar}\` | ${defaultStr} | ${toolsStr} |`);
|
|
790
790
|
}
|
|
791
791
|
if (ungatedTools.length > 0) {
|
|
792
|
-
const toolsStr = ungatedTools.map(t => `\`${t}\``).join(
|
|
792
|
+
const toolsStr = ungatedTools.map((t) => `\`${t}\``).join(', ');
|
|
793
793
|
console.log(`| *(none - always on)* | - | ${toolsStr} |`);
|
|
794
794
|
}
|
|
795
|
-
console.log(
|
|
796
|
-
console.log(
|
|
797
|
-
console.log(
|
|
798
|
-
console.log(
|
|
799
|
-
console.log(
|
|
800
|
-
console.log(
|
|
801
|
-
console.log(
|
|
802
|
-
console.log(
|
|
803
|
-
console.log(
|
|
795
|
+
console.log('\n## Usage\n');
|
|
796
|
+
console.log('Set environment variables to `false` to disable tool groups:\n');
|
|
797
|
+
console.log('```bash');
|
|
798
|
+
console.log('# Disable wiki tools');
|
|
799
|
+
console.log('USE_GITLAB_WIKI=false');
|
|
800
|
+
console.log('');
|
|
801
|
+
console.log('# Disable pipeline tools');
|
|
802
|
+
console.log('USE_PIPELINE=false');
|
|
803
|
+
console.log('```');
|
|
804
804
|
}
|
|
805
805
|
const FEATURE_TO_TOOLS = {
|
|
806
|
-
wiki: [
|
|
807
|
-
milestones: [
|
|
808
|
-
pipelines: [
|
|
809
|
-
labels: [
|
|
806
|
+
wiki: ['browse_wiki', 'manage_wiki'],
|
|
807
|
+
milestones: ['browse_milestones', 'manage_milestone'],
|
|
808
|
+
pipelines: ['browse_pipelines', 'manage_pipeline', 'manage_pipeline_job'],
|
|
809
|
+
labels: ['browse_labels', 'manage_label'],
|
|
810
810
|
mrs: [
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
811
|
+
'browse_merge_requests',
|
|
812
|
+
'browse_mr_discussions',
|
|
813
|
+
'manage_merge_request',
|
|
814
|
+
'manage_mr_discussion',
|
|
815
|
+
'manage_draft_notes',
|
|
816
816
|
],
|
|
817
|
-
files: [
|
|
818
|
-
variables: [
|
|
819
|
-
workitems: [
|
|
820
|
-
webhooks: [
|
|
821
|
-
snippets: [
|
|
822
|
-
integrations: [
|
|
823
|
-
iterations: [
|
|
817
|
+
files: ['browse_files', 'manage_files'],
|
|
818
|
+
variables: ['browse_variables', 'manage_variable'],
|
|
819
|
+
workitems: ['browse_work_items', 'manage_work_item'],
|
|
820
|
+
webhooks: ['browse_webhooks', 'manage_webhook'],
|
|
821
|
+
snippets: ['browse_snippets', 'manage_snippet'],
|
|
822
|
+
integrations: ['browse_integrations', 'manage_integration'],
|
|
823
|
+
iterations: ['browse_iterations'],
|
|
824
824
|
};
|
|
825
825
|
const FEATURE_NAMES = Object.keys(FEATURE_TO_TOOLS);
|
|
826
826
|
function countToolsForPreset(preset, allToolNames) {
|
|
827
827
|
let enabledTools = allToolNames;
|
|
828
828
|
if (preset.read_only) {
|
|
829
|
-
enabledTools = enabledTools.filter(name => !name.startsWith(
|
|
829
|
+
enabledTools = enabledTools.filter((name) => !name.startsWith('manage_'));
|
|
830
830
|
}
|
|
831
831
|
if (preset.denied_tools_regex) {
|
|
832
832
|
try {
|
|
833
833
|
const regex = new RegExp(preset.denied_tools_regex);
|
|
834
|
-
enabledTools = enabledTools.filter(name => !regex.test(name));
|
|
834
|
+
enabledTools = enabledTools.filter((name) => !regex.test(name));
|
|
835
835
|
}
|
|
836
836
|
catch (error) {
|
|
837
|
-
console.warn(`Warning: invalid denied_tools_regex "${preset.denied_tools_regex}": ${error instanceof Error ? error.message :
|
|
837
|
+
console.warn(`Warning: invalid denied_tools_regex "${preset.denied_tools_regex}": ${error instanceof Error ? error.message : 'unknown error'}`);
|
|
838
838
|
}
|
|
839
839
|
}
|
|
840
840
|
if (preset.allowed_tools && preset.allowed_tools.length > 0) {
|
|
841
841
|
const allowedSet = new Set(preset.allowed_tools);
|
|
842
|
-
enabledTools = enabledTools.filter(name => allowedSet.has(name));
|
|
842
|
+
enabledTools = enabledTools.filter((name) => allowedSet.has(name));
|
|
843
843
|
}
|
|
844
844
|
if (preset.features) {
|
|
845
845
|
for (const [feature, tools] of Object.entries(FEATURE_TO_TOOLS)) {
|
|
846
846
|
const featureKey = feature;
|
|
847
847
|
if (preset.features[featureKey] === false) {
|
|
848
848
|
const toolSet = new Set(tools);
|
|
849
|
-
enabledTools = enabledTools.filter(name => !toolSet.has(name));
|
|
849
|
+
enabledTools = enabledTools.filter((name) => !toolSet.has(name));
|
|
850
850
|
}
|
|
851
851
|
}
|
|
852
852
|
}
|
|
@@ -856,35 +856,35 @@ function getToolsForPreset(preset, allToolNames) {
|
|
|
856
856
|
let enabledTools = [...allToolNames];
|
|
857
857
|
const disabledTools = [];
|
|
858
858
|
if (preset.read_only) {
|
|
859
|
-
const manageTools = enabledTools.filter(name => name.startsWith(
|
|
859
|
+
const manageTools = enabledTools.filter((name) => name.startsWith('manage_'));
|
|
860
860
|
disabledTools.push(...manageTools);
|
|
861
|
-
enabledTools = enabledTools.filter(name => !name.startsWith(
|
|
861
|
+
enabledTools = enabledTools.filter((name) => !name.startsWith('manage_'));
|
|
862
862
|
}
|
|
863
863
|
if (preset.denied_tools_regex) {
|
|
864
864
|
try {
|
|
865
865
|
const regex = new RegExp(preset.denied_tools_regex);
|
|
866
|
-
const denied = enabledTools.filter(name => regex.test(name));
|
|
866
|
+
const denied = enabledTools.filter((name) => regex.test(name));
|
|
867
867
|
disabledTools.push(...denied);
|
|
868
|
-
enabledTools = enabledTools.filter(name => !regex.test(name));
|
|
868
|
+
enabledTools = enabledTools.filter((name) => !regex.test(name));
|
|
869
869
|
}
|
|
870
870
|
catch (error) {
|
|
871
|
-
console.warn(`Warning: invalid denied_tools_regex "${preset.denied_tools_regex}": ${error instanceof Error ? error.message :
|
|
871
|
+
console.warn(`Warning: invalid denied_tools_regex "${preset.denied_tools_regex}": ${error instanceof Error ? error.message : 'unknown error'}`);
|
|
872
872
|
}
|
|
873
873
|
}
|
|
874
874
|
if (preset.allowed_tools && preset.allowed_tools.length > 0) {
|
|
875
875
|
const allowedSet = new Set(preset.allowed_tools);
|
|
876
|
-
const notAllowed = enabledTools.filter(name => !allowedSet.has(name));
|
|
876
|
+
const notAllowed = enabledTools.filter((name) => !allowedSet.has(name));
|
|
877
877
|
disabledTools.push(...notAllowed);
|
|
878
|
-
enabledTools = enabledTools.filter(name => allowedSet.has(name));
|
|
878
|
+
enabledTools = enabledTools.filter((name) => allowedSet.has(name));
|
|
879
879
|
}
|
|
880
880
|
if (preset.features) {
|
|
881
881
|
for (const [feature, tools] of Object.entries(FEATURE_TO_TOOLS)) {
|
|
882
882
|
const featureKey = feature;
|
|
883
883
|
if (preset.features[featureKey] === false) {
|
|
884
884
|
const toolSet = new Set(tools);
|
|
885
|
-
const disabled = enabledTools.filter(name => toolSet.has(name));
|
|
885
|
+
const disabled = enabledTools.filter((name) => toolSet.has(name));
|
|
886
886
|
disabledTools.push(...disabled);
|
|
887
|
-
enabledTools = enabledTools.filter(name => !toolSet.has(name));
|
|
887
|
+
enabledTools = enabledTools.filter((name) => !toolSet.has(name));
|
|
888
888
|
}
|
|
889
889
|
}
|
|
890
890
|
}
|
|
@@ -895,15 +895,15 @@ function getToolsForPreset(preset, allToolNames) {
|
|
|
895
895
|
}
|
|
896
896
|
async function printPresetsList(loader, allToolNames, format) {
|
|
897
897
|
const profiles = await loader.listProfiles();
|
|
898
|
-
const presets = profiles.filter(p => p.isPreset);
|
|
899
|
-
const userProfiles = profiles.filter(p => !p.isPreset);
|
|
900
|
-
if (format ===
|
|
898
|
+
const presets = profiles.filter((p) => p.isPreset);
|
|
899
|
+
const userProfiles = profiles.filter((p) => !p.isPreset);
|
|
900
|
+
if (format === 'json') {
|
|
901
901
|
const output = {
|
|
902
902
|
builtIn: await Promise.all(presets.map(async (p) => {
|
|
903
903
|
const preset = await loader.loadPreset(p.name);
|
|
904
904
|
return {
|
|
905
905
|
name: p.name,
|
|
906
|
-
description: p.description ??
|
|
906
|
+
description: p.description ?? '',
|
|
907
907
|
readOnly: p.readOnly,
|
|
908
908
|
toolCount: countToolsForPreset(preset, allToolNames),
|
|
909
909
|
};
|
|
@@ -914,29 +914,29 @@ async function printPresetsList(loader, allToolNames, format) {
|
|
|
914
914
|
console.log(JSON.stringify(output, null, 2));
|
|
915
915
|
return;
|
|
916
916
|
}
|
|
917
|
-
console.log(
|
|
917
|
+
console.log('# Available Presets\n');
|
|
918
918
|
console.log(`Total tools available: ${allToolNames.length}\n`);
|
|
919
|
-
console.log(
|
|
920
|
-
console.log(
|
|
921
|
-
console.log(
|
|
919
|
+
console.log('## Built-in Presets\n');
|
|
920
|
+
console.log('| Preset | Tools | Read-Only | Description |');
|
|
921
|
+
console.log('|--------|-------|-----------|-------------|');
|
|
922
922
|
for (const p of presets) {
|
|
923
923
|
const preset = await loader.loadPreset(p.name);
|
|
924
924
|
const toolCount = countToolsForPreset(preset, allToolNames);
|
|
925
|
-
const ro = p.readOnly ?
|
|
926
|
-
const desc = p.description ??
|
|
925
|
+
const ro = p.readOnly ? 'Yes' : 'No';
|
|
926
|
+
const desc = p.description ?? '-';
|
|
927
927
|
console.log(`| \`${p.name}\` | ${toolCount} | ${ro} | ${desc} |`);
|
|
928
928
|
}
|
|
929
929
|
if (userProfiles.length > 0) {
|
|
930
|
-
console.log(
|
|
930
|
+
console.log('\n## User Profiles\n');
|
|
931
931
|
console.log(`${userProfiles.length} user profile(s) defined. Use \`--profiles\` to list them.`);
|
|
932
932
|
}
|
|
933
|
-
console.log(
|
|
933
|
+
console.log('\nUse `yarn list-tools --preset <name>` for details.');
|
|
934
934
|
}
|
|
935
935
|
async function printProfilesList(loader, format) {
|
|
936
936
|
const profiles = await loader.listProfiles();
|
|
937
|
-
const userProfiles = profiles.filter(p => !p.isPreset);
|
|
938
|
-
if (format ===
|
|
939
|
-
const output = userProfiles.map(p => ({
|
|
937
|
+
const userProfiles = profiles.filter((p) => !p.isPreset);
|
|
938
|
+
if (format === 'json') {
|
|
939
|
+
const output = userProfiles.map((p) => ({
|
|
940
940
|
name: p.name,
|
|
941
941
|
host: p.host,
|
|
942
942
|
authType: p.authType,
|
|
@@ -945,28 +945,28 @@ async function printProfilesList(loader, format) {
|
|
|
945
945
|
console.log(JSON.stringify(output, null, 2));
|
|
946
946
|
return;
|
|
947
947
|
}
|
|
948
|
-
console.log(
|
|
948
|
+
console.log('# User Profiles\n');
|
|
949
949
|
if (userProfiles.length === 0) {
|
|
950
|
-
console.log(
|
|
951
|
-
console.log(
|
|
952
|
-
console.log(
|
|
953
|
-
console.log(
|
|
954
|
-
console.log(
|
|
955
|
-
console.log(
|
|
956
|
-
console.log(
|
|
957
|
-
console.log(
|
|
958
|
-
console.log(
|
|
959
|
-
console.log(
|
|
960
|
-
console.log(
|
|
950
|
+
console.log('No user profiles defined.\n');
|
|
951
|
+
console.log('Create profiles in: `~/.config/gitlab-mcp/profiles.yaml`\n');
|
|
952
|
+
console.log('Example:\n');
|
|
953
|
+
console.log('```yaml');
|
|
954
|
+
console.log('profiles:');
|
|
955
|
+
console.log(' work:');
|
|
956
|
+
console.log(' host: gitlab.company.com');
|
|
957
|
+
console.log(' auth:');
|
|
958
|
+
console.log(' type: pat');
|
|
959
|
+
console.log(' token_env: GITLAB_WORK_TOKEN');
|
|
960
|
+
console.log('```');
|
|
961
961
|
return;
|
|
962
962
|
}
|
|
963
|
-
console.log(
|
|
964
|
-
console.log(
|
|
963
|
+
console.log('| Profile | Host | Auth | Read-Only |');
|
|
964
|
+
console.log('|---------|------|------|-----------|');
|
|
965
965
|
for (const p of userProfiles) {
|
|
966
|
-
const ro = p.readOnly ?
|
|
967
|
-
console.log(`| \`${p.name}\` | ${p.host ??
|
|
966
|
+
const ro = p.readOnly ? 'Yes' : 'No';
|
|
967
|
+
console.log(`| \`${p.name}\` | ${p.host ?? '-'} | ${p.authType ?? '-'} | ${ro} |`);
|
|
968
968
|
}
|
|
969
|
-
console.log(
|
|
969
|
+
console.log('\nUse `yarn list-tools --profile <name>` for details.');
|
|
970
970
|
}
|
|
971
971
|
async function printPresetDetails(loader, presetName, allToolNames, format, validate) {
|
|
972
972
|
let preset;
|
|
@@ -979,10 +979,10 @@ async function printPresetDetails(loader, presetName, allToolNames, format, vali
|
|
|
979
979
|
return;
|
|
980
980
|
}
|
|
981
981
|
const { enabled, disabled } = getToolsForPreset(preset, allToolNames);
|
|
982
|
-
if (format ===
|
|
982
|
+
if (format === 'json') {
|
|
983
983
|
const output = {
|
|
984
984
|
name: presetName,
|
|
985
|
-
type:
|
|
985
|
+
type: 'builtin',
|
|
986
986
|
description: preset.description ?? null,
|
|
987
987
|
readOnly: preset.read_only ?? false,
|
|
988
988
|
toolsEnabled: enabled.length,
|
|
@@ -1003,25 +1003,25 @@ async function printPresetDetails(loader, presetName, allToolNames, format, vali
|
|
|
1003
1003
|
}
|
|
1004
1004
|
console.log(`# Preset: ${presetName}\n`);
|
|
1005
1005
|
console.log(`**Type:** Built-in`);
|
|
1006
|
-
console.log(`**Description:** ${preset.description ??
|
|
1006
|
+
console.log(`**Description:** ${preset.description ?? '-'}`);
|
|
1007
1007
|
console.log(`**Tools Enabled:** ${enabled.length} (of ${allToolNames.length} available)`);
|
|
1008
|
-
console.log(`**Read-Only:** ${preset.read_only ?
|
|
1008
|
+
console.log(`**Read-Only:** ${preset.read_only ? 'Yes' : 'No'}\n`);
|
|
1009
1009
|
if (preset.features) {
|
|
1010
|
-
console.log(
|
|
1011
|
-
console.log(
|
|
1012
|
-
console.log(
|
|
1010
|
+
console.log('## Features\n');
|
|
1011
|
+
console.log('| Feature | Status |');
|
|
1012
|
+
console.log('|---------|--------|');
|
|
1013
1013
|
for (const f of FEATURE_NAMES) {
|
|
1014
1014
|
const featureKey = f;
|
|
1015
1015
|
const status = preset.features[featureKey] === true
|
|
1016
|
-
?
|
|
1016
|
+
? 'Enabled'
|
|
1017
1017
|
: preset.features[featureKey] === false
|
|
1018
|
-
?
|
|
1019
|
-
:
|
|
1018
|
+
? 'Disabled'
|
|
1019
|
+
: '-';
|
|
1020
1020
|
console.log(`| ${f} | ${status} |`);
|
|
1021
1021
|
}
|
|
1022
1022
|
console.log();
|
|
1023
1023
|
}
|
|
1024
|
-
console.log(
|
|
1024
|
+
console.log('## Tool Restrictions\n');
|
|
1025
1025
|
if (preset.denied_tools_regex) {
|
|
1026
1026
|
console.log(`**Denied tools regex:** \`${preset.denied_tools_regex}\`\n`);
|
|
1027
1027
|
}
|
|
@@ -1029,46 +1029,46 @@ async function printPresetDetails(loader, presetName, allToolNames, format, vali
|
|
|
1029
1029
|
console.log(`**Allowed tools (whitelist):** ${preset.allowed_tools.length} tools\n`);
|
|
1030
1030
|
}
|
|
1031
1031
|
if (preset.denied_actions && preset.denied_actions.length > 0) {
|
|
1032
|
-
console.log(`**Denied actions:** ${preset.denied_actions.join(
|
|
1032
|
+
console.log(`**Denied actions:** ${preset.denied_actions.join(', ')}\n`);
|
|
1033
1033
|
}
|
|
1034
1034
|
if (!preset.denied_tools_regex &&
|
|
1035
1035
|
!preset.allowed_tools?.length &&
|
|
1036
1036
|
!preset.denied_actions?.length) {
|
|
1037
|
-
console.log(
|
|
1037
|
+
console.log('No explicit tool restrictions.\n');
|
|
1038
1038
|
}
|
|
1039
|
-
console.log(
|
|
1039
|
+
console.log('## Enabled Tools\n');
|
|
1040
1040
|
for (const tool of enabled) {
|
|
1041
1041
|
console.log(`- ${tool}`);
|
|
1042
1042
|
}
|
|
1043
1043
|
console.log();
|
|
1044
1044
|
if (disabled.length > 0) {
|
|
1045
|
-
console.log(
|
|
1045
|
+
console.log('## Disabled Tools\n');
|
|
1046
1046
|
for (const tool of disabled) {
|
|
1047
1047
|
console.log(`- ${tool}`);
|
|
1048
1048
|
}
|
|
1049
1049
|
console.log();
|
|
1050
1050
|
}
|
|
1051
1051
|
if (validate) {
|
|
1052
|
-
console.log(
|
|
1052
|
+
console.log('## Validation\n');
|
|
1053
1053
|
const validation = await loader.validatePreset(preset);
|
|
1054
1054
|
if (validation.valid && validation.warnings.length === 0) {
|
|
1055
|
-
console.log(
|
|
1055
|
+
console.log('**Status: VALID**\n');
|
|
1056
1056
|
}
|
|
1057
1057
|
else if (validation.valid) {
|
|
1058
1058
|
console.log(`**Status: VALID** (${validation.warnings.length} warning(s))\n`);
|
|
1059
|
-
console.log(
|
|
1059
|
+
console.log('### Warnings\n');
|
|
1060
1060
|
for (const w of validation.warnings) {
|
|
1061
1061
|
console.log(`- ${w}`);
|
|
1062
1062
|
}
|
|
1063
1063
|
}
|
|
1064
1064
|
else {
|
|
1065
1065
|
console.log(`**Status: INVALID** (${validation.errors.length} error(s))\n`);
|
|
1066
|
-
console.log(
|
|
1066
|
+
console.log('### Errors\n');
|
|
1067
1067
|
for (const e of validation.errors) {
|
|
1068
1068
|
console.log(`- ${e}`);
|
|
1069
1069
|
}
|
|
1070
1070
|
if (validation.warnings.length > 0) {
|
|
1071
|
-
console.log(
|
|
1071
|
+
console.log('\n### Warnings\n');
|
|
1072
1072
|
for (const w of validation.warnings) {
|
|
1073
1073
|
console.log(`- ${w}`);
|
|
1074
1074
|
}
|
|
@@ -1086,10 +1086,10 @@ async function printProfileDetails(loader, profileName, format, validate) {
|
|
|
1086
1086
|
process.exit(1);
|
|
1087
1087
|
return;
|
|
1088
1088
|
}
|
|
1089
|
-
if (format ===
|
|
1089
|
+
if (format === 'json') {
|
|
1090
1090
|
const output = {
|
|
1091
1091
|
name: profileName,
|
|
1092
|
-
type:
|
|
1092
|
+
type: 'user',
|
|
1093
1093
|
host: profile.host,
|
|
1094
1094
|
authType: profile.auth.type,
|
|
1095
1095
|
readOnly: profile.read_only ?? false,
|
|
@@ -1115,12 +1115,12 @@ async function printProfileDetails(loader, profileName, format, validate) {
|
|
|
1115
1115
|
console.log(`**Type:** User-defined`);
|
|
1116
1116
|
console.log(`**Host:** ${profile.host}`);
|
|
1117
1117
|
console.log(`**Auth:** ${profile.auth.type}`);
|
|
1118
|
-
console.log(`**Read-Only:** ${profile.read_only ?
|
|
1119
|
-
console.log(
|
|
1120
|
-
console.log(
|
|
1121
|
-
console.log(
|
|
1122
|
-
console.log(`| Timeout | ${profile.timeout_ms ??
|
|
1123
|
-
console.log(`| TLS Verify | ${profile.skip_tls_verify ?
|
|
1118
|
+
console.log(`**Read-Only:** ${profile.read_only ? 'Yes' : 'No'}\n`);
|
|
1119
|
+
console.log('## Settings\n');
|
|
1120
|
+
console.log('| Setting | Value |');
|
|
1121
|
+
console.log('|---------|-------|');
|
|
1122
|
+
console.log(`| Timeout | ${profile.timeout_ms ?? 'default'}ms |`);
|
|
1123
|
+
console.log(`| TLS Verify | ${profile.skip_tls_verify ? 'No' : 'Yes'} |`);
|
|
1124
1124
|
if (profile.default_project) {
|
|
1125
1125
|
console.log(`| Default Project | ${profile.default_project} |`);
|
|
1126
1126
|
}
|
|
@@ -1129,18 +1129,18 @@ async function printProfileDetails(loader, profileName, format, validate) {
|
|
|
1129
1129
|
}
|
|
1130
1130
|
console.log();
|
|
1131
1131
|
if (profile.allowed_projects?.length || profile.allowed_groups?.length) {
|
|
1132
|
-
console.log(
|
|
1132
|
+
console.log('## Access Restrictions\n');
|
|
1133
1133
|
if (profile.allowed_projects?.length) {
|
|
1134
|
-
console.log(`**Allowed Projects:** ${profile.allowed_projects.join(
|
|
1134
|
+
console.log(`**Allowed Projects:** ${profile.allowed_projects.join(', ')}\n`);
|
|
1135
1135
|
}
|
|
1136
1136
|
if (profile.allowed_groups?.length) {
|
|
1137
|
-
console.log(`**Allowed Groups:** ${profile.allowed_groups.join(
|
|
1137
|
+
console.log(`**Allowed Groups:** ${profile.allowed_groups.join(', ')}\n`);
|
|
1138
1138
|
}
|
|
1139
1139
|
}
|
|
1140
1140
|
if (profile.denied_tools_regex ||
|
|
1141
1141
|
profile.allowed_tools?.length ||
|
|
1142
1142
|
profile.denied_actions?.length) {
|
|
1143
|
-
console.log(
|
|
1143
|
+
console.log('## Tool Restrictions\n');
|
|
1144
1144
|
if (profile.denied_tools_regex) {
|
|
1145
1145
|
console.log(`**Denied tools regex:** \`${profile.denied_tools_regex}\`\n`);
|
|
1146
1146
|
}
|
|
@@ -1148,25 +1148,25 @@ async function printProfileDetails(loader, profileName, format, validate) {
|
|
|
1148
1148
|
console.log(`**Allowed tools (whitelist):** ${profile.allowed_tools.length} tools\n`);
|
|
1149
1149
|
}
|
|
1150
1150
|
if (profile.denied_actions?.length) {
|
|
1151
|
-
console.log(`**Denied actions:** ${profile.denied_actions.join(
|
|
1151
|
+
console.log(`**Denied actions:** ${profile.denied_actions.join(', ')}\n`);
|
|
1152
1152
|
}
|
|
1153
1153
|
}
|
|
1154
1154
|
if (validate) {
|
|
1155
|
-
console.log(
|
|
1155
|
+
console.log('## Validation\n');
|
|
1156
1156
|
const validation = await loader.validateProfile(profile);
|
|
1157
1157
|
if (validation.valid && validation.warnings.length === 0) {
|
|
1158
|
-
console.log(
|
|
1158
|
+
console.log('**Status: VALID**\n');
|
|
1159
1159
|
}
|
|
1160
1160
|
else if (validation.valid) {
|
|
1161
1161
|
console.log(`**Status: VALID** (${validation.warnings.length} warning(s))\n`);
|
|
1162
|
-
console.log(
|
|
1162
|
+
console.log('### Warnings\n');
|
|
1163
1163
|
for (const w of validation.warnings) {
|
|
1164
1164
|
console.log(`- ${w}`);
|
|
1165
1165
|
}
|
|
1166
1166
|
}
|
|
1167
1167
|
else {
|
|
1168
1168
|
console.log(`**Status: INVALID** (${validation.errors.length} error(s))\n`);
|
|
1169
|
-
console.log(
|
|
1169
|
+
console.log('### Errors\n');
|
|
1170
1170
|
for (const e of validation.errors) {
|
|
1171
1171
|
console.log(`- ${e}`);
|
|
1172
1172
|
}
|
|
@@ -1195,10 +1195,10 @@ async function comparePresets(loader, presetA, presetB, allToolNames, format) {
|
|
|
1195
1195
|
const toolsB = getToolsForPreset(b, allToolNames);
|
|
1196
1196
|
const enabledSetA = new Set(toolsA.enabled);
|
|
1197
1197
|
const enabledSetB = new Set(toolsB.enabled);
|
|
1198
|
-
const onlyInA = toolsA.enabled.filter(t => !enabledSetB.has(t));
|
|
1199
|
-
const onlyInB = toolsB.enabled.filter(t => !enabledSetA.has(t));
|
|
1200
|
-
const common = toolsA.enabled.filter(t => enabledSetB.has(t));
|
|
1201
|
-
if (format ===
|
|
1198
|
+
const onlyInA = toolsA.enabled.filter((t) => !enabledSetB.has(t));
|
|
1199
|
+
const onlyInB = toolsB.enabled.filter((t) => !enabledSetA.has(t));
|
|
1200
|
+
const common = toolsA.enabled.filter((t) => enabledSetB.has(t));
|
|
1201
|
+
if (format === 'json') {
|
|
1202
1202
|
const output = {
|
|
1203
1203
|
presetA: {
|
|
1204
1204
|
name: presetA,
|
|
@@ -1224,11 +1224,11 @@ async function comparePresets(loader, presetA, presetB, allToolNames, format) {
|
|
|
1224
1224
|
return;
|
|
1225
1225
|
}
|
|
1226
1226
|
console.log(`# Comparison: ${presetA} vs ${presetB}\n`);
|
|
1227
|
-
console.log(
|
|
1228
|
-
console.log(
|
|
1229
|
-
console.log(
|
|
1227
|
+
console.log('## Summary\n');
|
|
1228
|
+
console.log('| | ' + presetA + ' | ' + presetB + ' |');
|
|
1229
|
+
console.log('|---|---|---|');
|
|
1230
1230
|
console.log(`| Tools | ${toolsA.enabled.length} | ${toolsB.enabled.length} |`);
|
|
1231
|
-
console.log(`| Read-Only | ${a.read_only ?
|
|
1231
|
+
console.log(`| Read-Only | ${a.read_only ? 'Yes' : 'No'} | ${b.read_only ? 'Yes' : 'No'} |`);
|
|
1232
1232
|
console.log();
|
|
1233
1233
|
console.log(`**Common tools:** ${common.length}\n`);
|
|
1234
1234
|
if (onlyInA.length > 0) {
|
|
@@ -1246,13 +1246,13 @@ async function comparePresets(loader, presetA, presetB, allToolNames, format) {
|
|
|
1246
1246
|
console.log();
|
|
1247
1247
|
}
|
|
1248
1248
|
if (a.features || b.features) {
|
|
1249
|
-
console.log(
|
|
1250
|
-
console.log(
|
|
1251
|
-
console.log(
|
|
1249
|
+
console.log('## Feature Comparison\n');
|
|
1250
|
+
console.log('| Feature | ' + presetA + ' | ' + presetB + ' |');
|
|
1251
|
+
console.log('|---------|---|---|');
|
|
1252
1252
|
for (const f of FEATURE_NAMES) {
|
|
1253
1253
|
const featureKey = f;
|
|
1254
|
-
const statusA = a.features?.[featureKey] === true ?
|
|
1255
|
-
const statusB = b.features?.[featureKey] === true ?
|
|
1254
|
+
const statusA = a.features?.[featureKey] === true ? 'Yes' : a.features?.[featureKey] === false ? 'No' : '-';
|
|
1255
|
+
const statusB = b.features?.[featureKey] === true ? 'Yes' : b.features?.[featureKey] === false ? 'No' : '-';
|
|
1256
1256
|
if (statusA !== statusB) {
|
|
1257
1257
|
console.log(`| **${f}** | ${statusA} | ${statusB} |`);
|
|
1258
1258
|
}
|
|
@@ -1265,15 +1265,15 @@ async function comparePresets(loader, presetA, presetB, allToolNames, format) {
|
|
|
1265
1265
|
async function main() {
|
|
1266
1266
|
const options = parseArgs();
|
|
1267
1267
|
if (options.compare && !options.preset) {
|
|
1268
|
-
console.error(
|
|
1269
|
-
console.error(
|
|
1268
|
+
console.error('Error: --compare flag must be used with --preset.');
|
|
1269
|
+
console.error('Usage: yarn list-tools --preset <name> --compare <other_name>');
|
|
1270
1270
|
process.exit(1);
|
|
1271
1271
|
return;
|
|
1272
1272
|
}
|
|
1273
1273
|
if (options.validate && !options.preset && !options.profile) {
|
|
1274
|
-
console.error(
|
|
1275
|
-
console.error(
|
|
1276
|
-
console.error(
|
|
1274
|
+
console.error('Error: --validate flag must be used with --preset or --profile.');
|
|
1275
|
+
console.error('Usage: yarn list-tools --preset <name> --validate');
|
|
1276
|
+
console.error(' or: yarn list-tools --profile <name> --validate');
|
|
1277
1277
|
process.exit(1);
|
|
1278
1278
|
return;
|
|
1279
1279
|
}
|
|
@@ -1285,7 +1285,7 @@ async function main() {
|
|
|
1285
1285
|
const allTools = registryManager.getAllToolDefinitionsUnfiltered();
|
|
1286
1286
|
const gates = extractEnvGates(allTools);
|
|
1287
1287
|
const ungated = getUngatedTools(allTools);
|
|
1288
|
-
printEnvGatesMarkdown(gates, ungated, options.format ===
|
|
1288
|
+
printEnvGatesMarkdown(gates, ungated, options.format === 'json' ? 'json' : 'markdown');
|
|
1289
1289
|
return;
|
|
1290
1290
|
}
|
|
1291
1291
|
const needsProfileLoader = Boolean(options.showPresets) ||
|
|
@@ -1294,32 +1294,32 @@ async function main() {
|
|
|
1294
1294
|
Boolean(options.profile);
|
|
1295
1295
|
if (needsProfileLoader) {
|
|
1296
1296
|
const loader = new profiles_1.ProfileLoader();
|
|
1297
|
-
const allToolNames = registryManager.getAllToolDefinitionsUnfiltered().map(t => t.name);
|
|
1297
|
+
const allToolNames = registryManager.getAllToolDefinitionsUnfiltered().map((t) => t.name);
|
|
1298
1298
|
if (options.showPresets) {
|
|
1299
|
-
await printPresetsList(loader, allToolNames, options.format ===
|
|
1299
|
+
await printPresetsList(loader, allToolNames, options.format === 'json' ? 'json' : 'markdown');
|
|
1300
1300
|
return;
|
|
1301
1301
|
}
|
|
1302
1302
|
if (options.showProfiles) {
|
|
1303
|
-
await printProfilesList(loader, options.format ===
|
|
1303
|
+
await printProfilesList(loader, options.format === 'json' ? 'json' : 'markdown');
|
|
1304
1304
|
return;
|
|
1305
1305
|
}
|
|
1306
1306
|
if (options.preset && options.compare) {
|
|
1307
|
-
await comparePresets(loader, options.preset, options.compare, allToolNames, options.format ===
|
|
1307
|
+
await comparePresets(loader, options.preset, options.compare, allToolNames, options.format === 'json' ? 'json' : 'markdown');
|
|
1308
1308
|
return;
|
|
1309
1309
|
}
|
|
1310
1310
|
if (options.preset) {
|
|
1311
|
-
await printPresetDetails(loader, options.preset, allToolNames, options.format ===
|
|
1311
|
+
await printPresetDetails(loader, options.preset, allToolNames, options.format === 'json' ? 'json' : 'markdown', options.validate ?? false);
|
|
1312
1312
|
return;
|
|
1313
1313
|
}
|
|
1314
1314
|
if (options.profile) {
|
|
1315
|
-
await printProfileDetails(loader, options.profile, options.format ===
|
|
1315
|
+
await printProfileDetails(loader, options.profile, options.format === 'json' ? 'json' : 'markdown', options.validate ?? false);
|
|
1316
1316
|
return;
|
|
1317
1317
|
}
|
|
1318
1318
|
}
|
|
1319
|
-
const toolDefinitions = options.format ===
|
|
1319
|
+
const toolDefinitions = options.format === 'export'
|
|
1320
1320
|
? registryManager.getAllToolDefinitionsUnfiltered()
|
|
1321
1321
|
: registryManager.getAllToolDefinitionsTierless();
|
|
1322
|
-
const tools = toolDefinitions.map(def => ({
|
|
1322
|
+
const tools = toolDefinitions.map((def) => ({
|
|
1323
1323
|
name: def.name,
|
|
1324
1324
|
description: def.description,
|
|
1325
1325
|
inputSchema: def.inputSchema,
|
|
@@ -1327,7 +1327,7 @@ async function main() {
|
|
|
1327
1327
|
let filteredTools = tools;
|
|
1328
1328
|
if (options.entity) {
|
|
1329
1329
|
const grouped = groupToolsByEntity(tools);
|
|
1330
|
-
const entityKey = Array.from(grouped.keys()).find(k => k.toLowerCase().replace(/ /g,
|
|
1330
|
+
const entityKey = Array.from(grouped.keys()).find((k) => k.toLowerCase().replace(/ /g, '') === options.entity.toLowerCase().replace(/ /g, ''));
|
|
1331
1331
|
filteredTools = entityKey ? (grouped.get(entityKey) ?? []) : [];
|
|
1332
1332
|
if (filteredTools.length === 0) {
|
|
1333
1333
|
console.error(`No tools found for entity: ${options.entity}`);
|
|
@@ -1335,42 +1335,42 @@ async function main() {
|
|
|
1335
1335
|
}
|
|
1336
1336
|
}
|
|
1337
1337
|
if (options.tool) {
|
|
1338
|
-
filteredTools = filteredTools.filter(t => t.name === options.tool);
|
|
1338
|
+
filteredTools = filteredTools.filter((t) => t.name === options.tool);
|
|
1339
1339
|
if (filteredTools.length === 0) {
|
|
1340
1340
|
console.error(`Tool not found: ${options.tool}`);
|
|
1341
1341
|
process.exit(1);
|
|
1342
1342
|
}
|
|
1343
1343
|
}
|
|
1344
1344
|
switch (options.format) {
|
|
1345
|
-
case
|
|
1346
|
-
const output = filteredTools.map(tool => ({
|
|
1345
|
+
case 'json':
|
|
1346
|
+
const output = filteredTools.map((tool) => ({
|
|
1347
1347
|
name: tool.name,
|
|
1348
1348
|
description: tool.description,
|
|
1349
|
-
tier: ToolAvailability_1.ToolAvailability.getToolRequirement(tool.name)?.requiredTier ??
|
|
1349
|
+
tier: ToolAvailability_1.ToolAvailability.getToolRequirement(tool.name)?.requiredTier ?? 'unknown',
|
|
1350
1350
|
minVersion: ToolAvailability_1.ToolAvailability.getToolRequirement(tool.name)?.minVersion,
|
|
1351
1351
|
parameters: tool.inputSchema,
|
|
1352
1352
|
}));
|
|
1353
1353
|
console.log(JSON.stringify(output, null, 2));
|
|
1354
1354
|
break;
|
|
1355
|
-
case
|
|
1356
|
-
filteredTools.forEach(tool => {
|
|
1355
|
+
case 'simple':
|
|
1356
|
+
filteredTools.forEach((tool) => {
|
|
1357
1357
|
console.log(tool.name);
|
|
1358
1358
|
});
|
|
1359
1359
|
break;
|
|
1360
|
-
case
|
|
1360
|
+
case 'export':
|
|
1361
1361
|
const markdown = generateExportMarkdown(filteredTools, {
|
|
1362
1362
|
noExamples: options.noExamples,
|
|
1363
1363
|
toc: options.toc,
|
|
1364
1364
|
});
|
|
1365
1365
|
console.log(markdown);
|
|
1366
1366
|
break;
|
|
1367
|
-
case
|
|
1367
|
+
case 'markdown':
|
|
1368
1368
|
default:
|
|
1369
1369
|
if (!options.entity && !options.tool) {
|
|
1370
|
-
console.log(
|
|
1370
|
+
console.log('# GitLab MCP Tools\n');
|
|
1371
1371
|
console.log(`Total tools available: ${filteredTools.length}\n`);
|
|
1372
1372
|
const grouped = groupToolsByEntity(filteredTools);
|
|
1373
|
-
console.log(
|
|
1373
|
+
console.log('## Categories\n');
|
|
1374
1374
|
for (const [entity, entityTools] of grouped) {
|
|
1375
1375
|
console.log(`- **${entity}**: ${entityTools.length} tools`);
|
|
1376
1376
|
}
|
|
@@ -1379,17 +1379,17 @@ async function main() {
|
|
|
1379
1379
|
console.log(`## ${entity}\n`);
|
|
1380
1380
|
for (const tool of entityTools) {
|
|
1381
1381
|
const tierInfo = getToolTierInfo(tool.name);
|
|
1382
|
-
const tierDisplay = tierInfo ? ` ${tierInfo}` :
|
|
1382
|
+
const tierDisplay = tierInfo ? ` ${tierInfo}` : '';
|
|
1383
1383
|
console.log(`### ${tool.name}${tierDisplay}`);
|
|
1384
1384
|
console.log(`**Description**: ${tool.description}\n`);
|
|
1385
1385
|
if ((options.verbose || options.detail) && tool.inputSchema) {
|
|
1386
|
-
console.log(
|
|
1386
|
+
console.log('**Parameters**:');
|
|
1387
1387
|
const params = getParameterDescription(tool.inputSchema);
|
|
1388
1388
|
if (params.length > 0) {
|
|
1389
|
-
params.forEach(p => console.log(p));
|
|
1389
|
+
params.forEach((p) => console.log(p));
|
|
1390
1390
|
}
|
|
1391
1391
|
else {
|
|
1392
|
-
console.log(
|
|
1392
|
+
console.log(' (no parameters)');
|
|
1393
1393
|
}
|
|
1394
1394
|
console.log();
|
|
1395
1395
|
}
|
|
@@ -1399,17 +1399,17 @@ async function main() {
|
|
|
1399
1399
|
else {
|
|
1400
1400
|
for (const tool of filteredTools) {
|
|
1401
1401
|
const tierInfo = getToolTierInfo(tool.name);
|
|
1402
|
-
const tierDisplay = tierInfo ? ` ${tierInfo}` :
|
|
1402
|
+
const tierDisplay = tierInfo ? ` ${tierInfo}` : '';
|
|
1403
1403
|
console.log(`## ${tool.name}${tierDisplay}\n`);
|
|
1404
1404
|
console.log(`**Description**: ${tool.description}\n`);
|
|
1405
1405
|
if (tool.inputSchema) {
|
|
1406
|
-
console.log(
|
|
1406
|
+
console.log('**Parameters**:\n');
|
|
1407
1407
|
const params = getParameterDescription(tool.inputSchema);
|
|
1408
1408
|
if (params.length > 0) {
|
|
1409
|
-
params.forEach(p => console.log(p));
|
|
1409
|
+
params.forEach((p) => console.log(p));
|
|
1410
1410
|
}
|
|
1411
1411
|
else {
|
|
1412
|
-
console.log(
|
|
1412
|
+
console.log('(no parameters)');
|
|
1413
1413
|
}
|
|
1414
1414
|
}
|
|
1415
1415
|
console.log();
|
|
@@ -1417,14 +1417,14 @@ async function main() {
|
|
|
1417
1417
|
}
|
|
1418
1418
|
break;
|
|
1419
1419
|
}
|
|
1420
|
-
if (options.showEnv && options.format ===
|
|
1421
|
-
console.log(
|
|
1422
|
-
console.log(
|
|
1420
|
+
if (options.showEnv && options.format === 'markdown') {
|
|
1421
|
+
console.log('\n---\n');
|
|
1422
|
+
console.log('*Note: Tool availability may be affected by environment variables shown above.*');
|
|
1423
1423
|
}
|
|
1424
1424
|
}
|
|
1425
|
-
if (!process.env.NODE_ENV || process.env.NODE_ENV !==
|
|
1426
|
-
main().catch(error => {
|
|
1427
|
-
console.error(
|
|
1425
|
+
if (!process.env.NODE_ENV || process.env.NODE_ENV !== 'test') {
|
|
1426
|
+
main().catch((error) => {
|
|
1427
|
+
console.error('Error:', error);
|
|
1428
1428
|
process.exit(1);
|
|
1429
1429
|
});
|
|
1430
1430
|
}
|