@structured-world/gitlab-mcp 6.62.1 → 7.0.1
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 +22 -1
- package/README.md.in +21 -0
- 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/generated/prisma/models/AuthCodeFlowState.d.ts +1 -2
- package/dist/generated/prisma/models/AuthorizationCode.d.ts +1 -2
- package/dist/generated/prisma/models/DeviceFlowState.d.ts +1 -2
- package/dist/generated/prisma/models/McpSessionMapping.d.ts +1 -2
- package/dist/generated/prisma/models/OAuthSession.d.ts +1 -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 +27 -27
- package/dist/src/cli/init/connection.js.map +1 -1
- 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 +70 -66
- 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 +11 -4
- package/dist/src/config.js +112 -111
- 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 +2 -2
- 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 +2 -1
- package/dist/src/handlers.js +258 -86
- 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/logging/types.js.map +1 -1
- package/dist/src/main.js +28 -28
- package/dist/src/middleware/index.d.ts +3 -2
- package/dist/src/middleware/index.js +3 -1
- package/dist/src/middleware/index.js.map +1 -1
- 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/middleware/response-write-timeout.d.ts +2 -0
- package/dist/src/middleware/response-write-timeout.js +62 -0
- package/dist/src/middleware/response-write-timeout.js.map +1 -0
- 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 +73 -68
- 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 +19 -11
- package/dist/src/registry-manager.js +257 -172
- package/dist/src/registry-manager.js.map +1 -1
- package/dist/src/server.js +165 -149
- package/dist/src/server.js.map +1 -1
- package/dist/src/services/ConnectionManager.d.ts +33 -24
- package/dist/src/services/ConnectionManager.js +304 -179
- 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/HealthMonitor.d.ts +42 -0
- package/dist/src/services/HealthMonitor.js +544 -0
- package/dist/src/services/HealthMonitor.js.map +1 -0
- 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 -5
- package/dist/src/services/InstanceRegistry.js +29 -41
- 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 +2 -1
- package/dist/src/services/SchemaIntrospector.js +45 -42
- package/dist/src/services/SchemaIntrospector.js.map +1 -1
- package/dist/src/services/TokenScopeDetector.d.ts +4 -4
- package/dist/src/services/TokenScopeDetector.js +133 -110
- package/dist/src/services/TokenScopeDetector.js.map +1 -1
- package/dist/src/services/ToolAvailability.d.ts +15 -11
- package/dist/src/services/ToolAvailability.js +150 -130
- package/dist/src/services/ToolAvailability.js.map +1 -1
- package/dist/src/services/WidgetAvailability.d.ts +5 -5
- package/dist/src/services/WidgetAvailability.js +40 -39
- package/dist/src/services/WidgetAvailability.js.map +1 -1
- 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 +19 -10
- package/dist/src/utils/error-handler.js +272 -187
- package/dist/src/utils/error-handler.js.map +1 -1
- package/dist/src/utils/fetch.d.ts +7 -0
- package/dist/src/utils/fetch.js +136 -122
- 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 +29 -26
- package/dist/src/utils/gitlab-api.js.map +1 -1
- 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/url.d.ts +1 -0
- package/dist/src/utils/url.js +38 -0
- package/dist/src/utils/url.js.map +1 -0
- package/dist/src/utils/version.js +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +22 -31
- package/dist/structured-world-gitlab-mcp-6.62.1.tgz +0 -0
|
@@ -9,16 +9,16 @@ const logger_1 = require("../logger");
|
|
|
9
9
|
const namespace_1 = require("../utils/namespace");
|
|
10
10
|
async function autoDiscover(options = {}) {
|
|
11
11
|
const repoPath = options.repoPath ?? process.cwd();
|
|
12
|
-
(0, logger_1.logInfo)(
|
|
12
|
+
(0, logger_1.logInfo)('Starting auto-discovery', { path: repoPath });
|
|
13
13
|
const remote = await (0, git_remote_1.parseGitRemote)({
|
|
14
14
|
repoPath,
|
|
15
15
|
remoteName: options.remoteName,
|
|
16
16
|
});
|
|
17
17
|
if (!remote) {
|
|
18
|
-
(0, logger_1.logWarn)(
|
|
18
|
+
(0, logger_1.logWarn)('Auto-discovery: No git remote found', { path: repoPath });
|
|
19
19
|
return null;
|
|
20
20
|
}
|
|
21
|
-
(0, logger_1.logInfo)(
|
|
21
|
+
(0, logger_1.logInfo)('Detected git remote', {
|
|
22
22
|
host: remote.host,
|
|
23
23
|
projectPath: remote.projectPath,
|
|
24
24
|
remote: remote.remoteName,
|
|
@@ -26,19 +26,19 @@ async function autoDiscover(options = {}) {
|
|
|
26
26
|
const availableRemotes = await (0, git_remote_1.listGitRemotes)(repoPath);
|
|
27
27
|
const matchedProfile = await (0, profile_matcher_1.findProfileByHost)(remote.host);
|
|
28
28
|
if (matchedProfile) {
|
|
29
|
-
(0, logger_1.logInfo)(
|
|
29
|
+
(0, logger_1.logInfo)('Matched host to user profile', {
|
|
30
30
|
profile: matchedProfile.profileName,
|
|
31
31
|
matchType: matchedProfile.matchType,
|
|
32
32
|
});
|
|
33
33
|
}
|
|
34
34
|
else {
|
|
35
|
-
(0, logger_1.logDebug)(
|
|
35
|
+
(0, logger_1.logDebug)('No matching user profile found', { host: remote.host });
|
|
36
36
|
}
|
|
37
37
|
let projectConfig = null;
|
|
38
38
|
if (!options.noProjectConfig) {
|
|
39
39
|
projectConfig = await (0, profiles_1.findProjectConfig)(repoPath);
|
|
40
40
|
if (projectConfig) {
|
|
41
|
-
(0, logger_1.logInfo)(
|
|
41
|
+
(0, logger_1.logInfo)('Found project configuration', { path: projectConfig.configPath });
|
|
42
42
|
}
|
|
43
43
|
}
|
|
44
44
|
const apiUrl = `https://${remote.host}`;
|
|
@@ -58,22 +58,22 @@ async function autoDiscover(options = {}) {
|
|
|
58
58
|
try {
|
|
59
59
|
await (0, profiles_1.loadAndApplyProfile)(matchedProfile.profileName);
|
|
60
60
|
result.profileApplied = true;
|
|
61
|
-
(0, logger_1.logInfo)(
|
|
61
|
+
(0, logger_1.logInfo)('Applied matched profile', { profile: matchedProfile.profileName });
|
|
62
62
|
}
|
|
63
63
|
catch (error) {
|
|
64
64
|
const message = error instanceof Error ? error.message : String(error);
|
|
65
|
-
(0, logger_1.logError)(
|
|
65
|
+
(0, logger_1.logError)('Failed to apply matched profile', { error: message });
|
|
66
66
|
}
|
|
67
67
|
}
|
|
68
68
|
else {
|
|
69
69
|
if (!process.env.GITLAB_API_URL) {
|
|
70
70
|
process.env.GITLAB_API_URL = apiUrl;
|
|
71
|
-
(0, logger_1.logInfo)(
|
|
71
|
+
(0, logger_1.logInfo)('Set GITLAB_API_URL from discovered host', { apiUrl });
|
|
72
72
|
}
|
|
73
73
|
}
|
|
74
74
|
if (projectConfig) {
|
|
75
75
|
result.projectConfigApplied = true;
|
|
76
|
-
(0, logger_1.logDebug)(
|
|
76
|
+
(0, logger_1.logDebug)('Project config loaded (enforcement pending)', { config: projectConfig });
|
|
77
77
|
}
|
|
78
78
|
setDefaultContext(remote.projectPath);
|
|
79
79
|
}
|
|
@@ -82,37 +82,37 @@ async function autoDiscover(options = {}) {
|
|
|
82
82
|
function setDefaultContext(projectPath) {
|
|
83
83
|
if (!process.env.GITLAB_DEFAULT_PROJECT) {
|
|
84
84
|
process.env.GITLAB_DEFAULT_PROJECT = projectPath;
|
|
85
|
-
(0, logger_1.logDebug)(
|
|
85
|
+
(0, logger_1.logDebug)('Set default project context', { project: projectPath });
|
|
86
86
|
}
|
|
87
87
|
if (!process.env.GITLAB_DEFAULT_NAMESPACE) {
|
|
88
88
|
const namespace = (0, namespace_1.extractNamespaceFromPath)(projectPath);
|
|
89
89
|
if (namespace) {
|
|
90
90
|
process.env.GITLAB_DEFAULT_NAMESPACE = namespace;
|
|
91
|
-
(0, logger_1.logDebug)(
|
|
91
|
+
(0, logger_1.logDebug)('Set default namespace context', { namespace });
|
|
92
92
|
}
|
|
93
93
|
}
|
|
94
94
|
}
|
|
95
95
|
function formatDiscoveryResult(result) {
|
|
96
96
|
const lines = [];
|
|
97
|
-
lines.push(
|
|
98
|
-
lines.push(
|
|
99
|
-
lines.push(
|
|
100
|
-
lines.push(
|
|
97
|
+
lines.push('Auto-discovery Results');
|
|
98
|
+
lines.push('======================');
|
|
99
|
+
lines.push('');
|
|
100
|
+
lines.push('Git Remote:');
|
|
101
101
|
lines.push(` Remote: ${result.remote.remoteName}`);
|
|
102
102
|
lines.push(` Host: ${result.host}`);
|
|
103
103
|
lines.push(` Project: ${result.projectPath}`);
|
|
104
104
|
lines.push(` Protocol: ${result.remote.protocol}`);
|
|
105
105
|
lines.push(` URL: ${result.remote.url}`);
|
|
106
|
-
lines.push(
|
|
106
|
+
lines.push('');
|
|
107
107
|
if (result.availableRemotes.length > 1) {
|
|
108
|
-
lines.push(
|
|
108
|
+
lines.push('Available Remotes:');
|
|
109
109
|
for (const remote of result.availableRemotes) {
|
|
110
|
-
const selected = remote.remoteName === result.remote.remoteName ?
|
|
110
|
+
const selected = remote.remoteName === result.remote.remoteName ? ' (selected)' : '';
|
|
111
111
|
lines.push(` ${remote.remoteName}: ${remote.host}/${remote.projectPath}${selected}`);
|
|
112
112
|
}
|
|
113
|
-
lines.push(
|
|
113
|
+
lines.push('');
|
|
114
114
|
}
|
|
115
|
-
lines.push(
|
|
115
|
+
lines.push('Profile Match:');
|
|
116
116
|
if (result.matchedProfile) {
|
|
117
117
|
lines.push(` Profile: ${result.matchedProfile.profileName}`);
|
|
118
118
|
lines.push(` Match Type: ${result.matchedProfile.matchType}`);
|
|
@@ -128,12 +128,12 @@ function formatDiscoveryResult(result) {
|
|
|
128
128
|
lines.push(` Will use: ${result.apiUrl} (from discovered host)`);
|
|
129
129
|
lines.push(` Auth: GITLAB_TOKEN environment variable required`);
|
|
130
130
|
}
|
|
131
|
-
lines.push(
|
|
132
|
-
lines.push(
|
|
131
|
+
lines.push('');
|
|
132
|
+
lines.push('Project Configuration:');
|
|
133
133
|
if (result.projectConfig) {
|
|
134
134
|
lines.push(` Path: ${result.projectConfig.configPath}`);
|
|
135
135
|
if (result.projectConfig.preset) {
|
|
136
|
-
lines.push(` Preset: ${result.projectConfig.preset.description ??
|
|
136
|
+
lines.push(` Preset: ${result.projectConfig.preset.description ?? 'custom restrictions'}`);
|
|
137
137
|
if (result.projectConfig.preset.scope) {
|
|
138
138
|
const scope = result.projectConfig.preset.scope;
|
|
139
139
|
if (scope.project) {
|
|
@@ -151,7 +151,7 @@ function formatDiscoveryResult(result) {
|
|
|
151
151
|
}
|
|
152
152
|
}
|
|
153
153
|
if (result.projectConfig.profile) {
|
|
154
|
-
lines.push(` Profile: ${result.projectConfig.profile.description ??
|
|
154
|
+
lines.push(` Profile: ${result.projectConfig.profile.description ?? 'custom tool selection'}`);
|
|
155
155
|
if (result.projectConfig.profile.extends) {
|
|
156
156
|
lines.push(` Extends: ${result.projectConfig.profile.extends}`);
|
|
157
157
|
}
|
|
@@ -160,11 +160,11 @@ function formatDiscoveryResult(result) {
|
|
|
160
160
|
else {
|
|
161
161
|
lines.push(` No .gitlab-mcp/ directory found`);
|
|
162
162
|
}
|
|
163
|
-
lines.push(
|
|
164
|
-
lines.push(
|
|
163
|
+
lines.push('');
|
|
164
|
+
lines.push('Default Context:');
|
|
165
165
|
lines.push(` Project: ${result.projectPath}`);
|
|
166
166
|
const namespace = (0, namespace_1.extractNamespaceFromPath)(result.projectPath) ?? result.projectPath;
|
|
167
167
|
lines.push(` Namespace: ${namespace}`);
|
|
168
|
-
return lines.join(
|
|
168
|
+
return lines.join('\n');
|
|
169
169
|
}
|
|
170
170
|
//# sourceMappingURL=auto.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export interface GitRemoteInfo {
|
|
2
2
|
host: string;
|
|
3
3
|
projectPath: string;
|
|
4
|
-
protocol:
|
|
4
|
+
protocol: 'ssh' | 'https';
|
|
5
5
|
url: string;
|
|
6
6
|
remoteName: string;
|
|
7
7
|
}
|
|
@@ -9,7 +9,7 @@ export interface ParseGitRemoteOptions {
|
|
|
9
9
|
remoteName?: string;
|
|
10
10
|
repoPath?: string;
|
|
11
11
|
}
|
|
12
|
-
export declare function parseRemoteUrl(url: string): Omit<GitRemoteInfo,
|
|
12
|
+
export declare function parseRemoteUrl(url: string): Omit<GitRemoteInfo, 'remoteName'> | null;
|
|
13
13
|
export declare function parseGitConfig(content: string): Map<string, string>;
|
|
14
14
|
export declare function selectBestRemote(remotes: Map<string, string>, preferredRemote?: string): {
|
|
15
15
|
name: string;
|
|
@@ -48,7 +48,7 @@ function parseRemoteUrl(url) {
|
|
|
48
48
|
return {
|
|
49
49
|
host: sshMatch[1],
|
|
50
50
|
projectPath: normalizeProjectPath(sshMatch[2]),
|
|
51
|
-
protocol:
|
|
51
|
+
protocol: 'ssh',
|
|
52
52
|
url: normalizedUrl,
|
|
53
53
|
};
|
|
54
54
|
}
|
|
@@ -60,7 +60,7 @@ function parseRemoteUrl(url) {
|
|
|
60
60
|
return {
|
|
61
61
|
host: sshHost,
|
|
62
62
|
projectPath: normalizeProjectPath(sshProtocolMatch[3]),
|
|
63
|
-
protocol:
|
|
63
|
+
protocol: 'ssh',
|
|
64
64
|
url: normalizedUrl,
|
|
65
65
|
};
|
|
66
66
|
}
|
|
@@ -70,15 +70,15 @@ function parseRemoteUrl(url) {
|
|
|
70
70
|
return {
|
|
71
71
|
host: httpsHost,
|
|
72
72
|
projectPath: normalizeProjectPath(httpsMatch[3]),
|
|
73
|
-
protocol:
|
|
73
|
+
protocol: 'https',
|
|
74
74
|
url: normalizedUrl,
|
|
75
75
|
};
|
|
76
76
|
}
|
|
77
|
-
(0, logger_1.logDebug)(
|
|
77
|
+
(0, logger_1.logDebug)('Could not parse remote URL', { url: normalizedUrl });
|
|
78
78
|
return null;
|
|
79
79
|
}
|
|
80
80
|
function normalizeProjectPath(projectPath) {
|
|
81
|
-
return projectPath.replace(/^\/+|\/+$/g,
|
|
81
|
+
return projectPath.replace(/^\/+|\/+$/g, '');
|
|
82
82
|
}
|
|
83
83
|
function parseGitConfig(content) {
|
|
84
84
|
const remotes = new Map();
|
|
@@ -94,7 +94,7 @@ function parseGitConfig(content) {
|
|
|
94
94
|
currentRemote = remoteHeaderMatch[1];
|
|
95
95
|
continue;
|
|
96
96
|
}
|
|
97
|
-
if (line.startsWith(
|
|
97
|
+
if (line.startsWith('[') && line.endsWith(']')) {
|
|
98
98
|
currentRemote = null;
|
|
99
99
|
continue;
|
|
100
100
|
}
|
|
@@ -104,7 +104,7 @@ function parseGitConfig(content) {
|
|
|
104
104
|
const urlMatch = line.match(/^url\s*=\s*(.+)$/);
|
|
105
105
|
if (urlMatch) {
|
|
106
106
|
const url = urlMatch[1].trim();
|
|
107
|
-
if (url !==
|
|
107
|
+
if (url !== '') {
|
|
108
108
|
remotes.set(currentRemote, url);
|
|
109
109
|
}
|
|
110
110
|
}
|
|
@@ -121,9 +121,9 @@ function selectBestRemote(remotes, preferredRemote) {
|
|
|
121
121
|
return { name: preferredRemote, url };
|
|
122
122
|
}
|
|
123
123
|
}
|
|
124
|
-
const originUrl = remotes.get(
|
|
124
|
+
const originUrl = remotes.get('origin');
|
|
125
125
|
if (originUrl !== undefined) {
|
|
126
|
-
return { name:
|
|
126
|
+
return { name: 'origin', url: originUrl };
|
|
127
127
|
}
|
|
128
128
|
const firstEntry = remotes.entries().next();
|
|
129
129
|
if (firstEntry.done) {
|
|
@@ -134,26 +134,26 @@ function selectBestRemote(remotes, preferredRemote) {
|
|
|
134
134
|
}
|
|
135
135
|
async function parseGitRemote(options = {}) {
|
|
136
136
|
const repoPath = options.repoPath ?? process.cwd();
|
|
137
|
-
const gitConfigPath = path.join(repoPath,
|
|
137
|
+
const gitConfigPath = path.join(repoPath, '.git', 'config');
|
|
138
138
|
try {
|
|
139
139
|
await fs.access(gitConfigPath);
|
|
140
140
|
}
|
|
141
141
|
catch {
|
|
142
|
-
(0, logger_1.logDebug)(
|
|
142
|
+
(0, logger_1.logDebug)('No .git/config found - not a git repository', { path: repoPath });
|
|
143
143
|
return null;
|
|
144
144
|
}
|
|
145
145
|
let content;
|
|
146
146
|
try {
|
|
147
|
-
content = await fs.readFile(gitConfigPath,
|
|
147
|
+
content = await fs.readFile(gitConfigPath, 'utf-8');
|
|
148
148
|
}
|
|
149
149
|
catch (error) {
|
|
150
150
|
const message = error instanceof Error ? error.message : String(error);
|
|
151
|
-
(0, logger_1.logWarn)(
|
|
151
|
+
(0, logger_1.logWarn)('Failed to read git config', { error: message, path: gitConfigPath });
|
|
152
152
|
return null;
|
|
153
153
|
}
|
|
154
154
|
const remotes = parseGitConfig(content);
|
|
155
155
|
if (remotes.size === 0) {
|
|
156
|
-
(0, logger_1.logDebug)(
|
|
156
|
+
(0, logger_1.logDebug)('No remotes found in git config', { path: repoPath });
|
|
157
157
|
return null;
|
|
158
158
|
}
|
|
159
159
|
const selected = selectBestRemote(remotes, options.remoteName);
|
|
@@ -162,10 +162,10 @@ async function parseGitRemote(options = {}) {
|
|
|
162
162
|
}
|
|
163
163
|
const parsed = parseRemoteUrl(selected.url);
|
|
164
164
|
if (!parsed) {
|
|
165
|
-
(0, logger_1.logWarn)(
|
|
165
|
+
(0, logger_1.logWarn)('Could not parse remote URL format', { remote: selected.name, url: selected.url });
|
|
166
166
|
return null;
|
|
167
167
|
}
|
|
168
|
-
(0, logger_1.logDebug)(
|
|
168
|
+
(0, logger_1.logDebug)('Parsed git remote', {
|
|
169
169
|
remote: selected.name,
|
|
170
170
|
host: parsed.host,
|
|
171
171
|
projectPath: parsed.projectPath,
|
|
@@ -177,9 +177,9 @@ async function parseGitRemote(options = {}) {
|
|
|
177
177
|
};
|
|
178
178
|
}
|
|
179
179
|
async function listGitRemotes(repoPath) {
|
|
180
|
-
const gitConfigPath = path.join(repoPath ?? process.cwd(),
|
|
180
|
+
const gitConfigPath = path.join(repoPath ?? process.cwd(), '.git', 'config');
|
|
181
181
|
try {
|
|
182
|
-
const content = await fs.readFile(gitConfigPath,
|
|
182
|
+
const content = await fs.readFile(gitConfigPath, 'utf-8');
|
|
183
183
|
const remotes = parseGitConfig(content);
|
|
184
184
|
const result = [];
|
|
185
185
|
for (const [name, url] of remotes) {
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { parseGitRemote, parseRemoteUrl, parseGitConfig, selectBestRemote, listGitRemotes, GitRemoteInfo, ParseGitRemoteOptions, } from
|
|
2
|
-
export { matchProfileByHost, findProfileByHost, ProfileMatchResult } from
|
|
3
|
-
export { autoDiscover, formatDiscoveryResult, AutoDiscoveryOptions, AutoDiscoveryResult, } from
|
|
1
|
+
export { parseGitRemote, parseRemoteUrl, parseGitConfig, selectBestRemote, listGitRemotes, GitRemoteInfo, ParseGitRemoteOptions, } from './git-remote';
|
|
2
|
+
export { matchProfileByHost, findProfileByHost, ProfileMatchResult } from './profile-matcher';
|
|
3
|
+
export { autoDiscover, formatDiscoveryResult, AutoDiscoveryOptions, AutoDiscoveryResult, } from './auto';
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { ProfileLoader, ProfileInfo } from
|
|
1
|
+
import { ProfileLoader, ProfileInfo } from '../profiles';
|
|
2
2
|
export interface ProfileMatchResult {
|
|
3
3
|
profileName: string;
|
|
4
4
|
profile: ProfileInfo;
|
|
5
|
-
matchType:
|
|
5
|
+
matchType: 'exact' | 'subdomain';
|
|
6
6
|
}
|
|
7
7
|
export declare function matchProfileByHost(host: string, profiles: ProfileInfo[]): ProfileMatchResult | null;
|
|
8
8
|
export declare function findProfileByHost(host: string, loader?: ProfileLoader): Promise<ProfileMatchResult | null>;
|
|
@@ -6,38 +6,38 @@ const profiles_1 = require("../profiles");
|
|
|
6
6
|
const logger_1 = require("../logger");
|
|
7
7
|
function matchProfileByHost(host, profiles) {
|
|
8
8
|
const normalizedHost = host.toLowerCase();
|
|
9
|
-
const userProfiles = profiles.filter((p) => typeof p.host ===
|
|
9
|
+
const userProfiles = profiles.filter((p) => typeof p.host === 'string' && !p.isPreset);
|
|
10
10
|
for (const profile of userProfiles) {
|
|
11
11
|
const profileHost = profile.host.toLowerCase();
|
|
12
12
|
if (normalizedHost === profileHost) {
|
|
13
|
-
(0, logger_1.logDebug)(
|
|
13
|
+
(0, logger_1.logDebug)('Matched profile by exact host', {
|
|
14
14
|
host,
|
|
15
15
|
profile: profile.name,
|
|
16
|
-
matchType:
|
|
16
|
+
matchType: 'exact',
|
|
17
17
|
});
|
|
18
18
|
return {
|
|
19
19
|
profileName: profile.name,
|
|
20
20
|
profile,
|
|
21
|
-
matchType:
|
|
21
|
+
matchType: 'exact',
|
|
22
22
|
};
|
|
23
23
|
}
|
|
24
24
|
}
|
|
25
25
|
for (const profile of userProfiles) {
|
|
26
26
|
const profileHost = profile.host.toLowerCase();
|
|
27
27
|
if (normalizedHost.endsWith(`.${profileHost}`)) {
|
|
28
|
-
(0, logger_1.logDebug)(
|
|
28
|
+
(0, logger_1.logDebug)('Matched profile by subdomain', {
|
|
29
29
|
host,
|
|
30
30
|
profile: profile.name,
|
|
31
|
-
matchType:
|
|
31
|
+
matchType: 'subdomain',
|
|
32
32
|
});
|
|
33
33
|
return {
|
|
34
34
|
profileName: profile.name,
|
|
35
35
|
profile,
|
|
36
|
-
matchType:
|
|
36
|
+
matchType: 'subdomain',
|
|
37
37
|
};
|
|
38
38
|
}
|
|
39
39
|
}
|
|
40
|
-
(0, logger_1.logDebug)(
|
|
40
|
+
(0, logger_1.logDebug)('No profile match found', { host, availableHosts: userProfiles.map((p) => p.host) });
|
|
41
41
|
return null;
|
|
42
42
|
}
|
|
43
43
|
async function findProfileByHost(host, loader) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"profile-matcher.js","sourceRoot":"","sources":["../../../src/discovery/profile-matcher.ts"],"names":[],"mappings":";;AAqCA,gDAiDC;AASD,8CAOC;AAhGD,0CAAyD;AACzD,sCAAqC;AA8BrC,SAAgB,kBAAkB,CAChC,IAAY,EACZ,QAAuB;IAEvB,MAAM,cAAc,GAAG,IAAI,CAAC,WAAW,EAAE,CAAC;IAI1C,MAAM,YAAY,GAAG,QAAQ,CAAC,MAAM,CAClC,CAAC,CAAC,EAAuC,EAAE,CAAC,OAAO,CAAC,CAAC,IAAI,KAAK,QAAQ,IAAI,CAAC,CAAC,CAAC,QAAQ,CACtF,CAAC;IAGF,KAAK,MAAM,OAAO,IAAI,YAAY,EAAE,CAAC;QACnC,MAAM,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC;QAC/C,IAAI,cAAc,KAAK,WAAW,EAAE,CAAC;YACnC,IAAA,iBAAQ,EAAC,+BAA+B,EAAE;gBACxC,IAAI;gBACJ,OAAO,EAAE,OAAO,CAAC,IAAI;gBACrB,SAAS,EAAE,OAAO;aACnB,CAAC,CAAC;YACH,OAAO;gBACL,WAAW,EAAE,OAAO,CAAC,IAAI;gBACzB,OAAO;gBACP,SAAS,EAAE,OAAO;aACnB,CAAC;QACJ,CAAC;IACH,CAAC;IAID,KAAK,MAAM,OAAO,IAAI,YAAY,EAAE,CAAC;QACnC,MAAM,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC;QAC/C,IAAI,cAAc,CAAC,QAAQ,CAAC,IAAI,WAAW,EAAE,CAAC,EAAE,CAAC;YAC/C,IAAA,iBAAQ,EAAC,8BAA8B,EAAE;gBACvC,IAAI;gBACJ,OAAO,EAAE,OAAO,CAAC,IAAI;gBACrB,SAAS,EAAE,WAAW;aACvB,CAAC,CAAC;YACH,OAAO;gBACL,WAAW,EAAE,OAAO,CAAC,IAAI;gBACzB,OAAO;gBACP,SAAS,EAAE,WAAW;aACvB,CAAC;QACJ,CAAC;IACH,CAAC;IAED,IAAA,iBAAQ,EAAC,wBAAwB,EAAE,EAAE,IAAI,EAAE,cAAc,EAAE,YAAY,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"profile-matcher.js","sourceRoot":"","sources":["../../../src/discovery/profile-matcher.ts"],"names":[],"mappings":";;AAqCA,gDAiDC;AASD,8CAOC;AAhGD,0CAAyD;AACzD,sCAAqC;AA8BrC,SAAgB,kBAAkB,CAChC,IAAY,EACZ,QAAuB;IAEvB,MAAM,cAAc,GAAG,IAAI,CAAC,WAAW,EAAE,CAAC;IAI1C,MAAM,YAAY,GAAG,QAAQ,CAAC,MAAM,CAClC,CAAC,CAAC,EAAuC,EAAE,CAAC,OAAO,CAAC,CAAC,IAAI,KAAK,QAAQ,IAAI,CAAC,CAAC,CAAC,QAAQ,CACtF,CAAC;IAGF,KAAK,MAAM,OAAO,IAAI,YAAY,EAAE,CAAC;QACnC,MAAM,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC;QAC/C,IAAI,cAAc,KAAK,WAAW,EAAE,CAAC;YACnC,IAAA,iBAAQ,EAAC,+BAA+B,EAAE;gBACxC,IAAI;gBACJ,OAAO,EAAE,OAAO,CAAC,IAAI;gBACrB,SAAS,EAAE,OAAO;aACnB,CAAC,CAAC;YACH,OAAO;gBACL,WAAW,EAAE,OAAO,CAAC,IAAI;gBACzB,OAAO;gBACP,SAAS,EAAE,OAAO;aACnB,CAAC;QACJ,CAAC;IACH,CAAC;IAID,KAAK,MAAM,OAAO,IAAI,YAAY,EAAE,CAAC;QACnC,MAAM,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC;QAC/C,IAAI,cAAc,CAAC,QAAQ,CAAC,IAAI,WAAW,EAAE,CAAC,EAAE,CAAC;YAC/C,IAAA,iBAAQ,EAAC,8BAA8B,EAAE;gBACvC,IAAI;gBACJ,OAAO,EAAE,OAAO,CAAC,IAAI;gBACrB,SAAS,EAAE,WAAW;aACvB,CAAC,CAAC;YACH,OAAO;gBACL,WAAW,EAAE,OAAO,CAAC,IAAI;gBACzB,OAAO;gBACP,SAAS,EAAE,WAAW;aACvB,CAAC;QACJ,CAAC;IACH,CAAC;IAED,IAAA,iBAAQ,EAAC,wBAAwB,EAAE,EAAE,IAAI,EAAE,cAAc,EAAE,YAAY,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IAC9F,OAAO,IAAI,CAAC;AACd,CAAC;AASM,KAAK,UAAU,iBAAiB,CACrC,IAAY,EACZ,MAAsB;IAEtB,MAAM,aAAa,GAAG,MAAM,IAAI,IAAI,wBAAa,EAAE,CAAC;IACpD,MAAM,QAAQ,GAAG,MAAM,aAAa,CAAC,YAAY,EAAE,CAAC;IACpD,OAAO,kBAAkB,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;AAC5C,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { ScopeEnforcer } from
|
|
2
|
-
import { Preset, ProfileInfo } from
|
|
3
|
-
import { PresetInfo, ResetResult, SessionContext, SetScopeResult, SwitchResult } from
|
|
1
|
+
import { ScopeEnforcer } from '../../profiles/scope-enforcer';
|
|
2
|
+
import { Preset, ProfileInfo } from '../../profiles/types';
|
|
3
|
+
import { PresetInfo, ResetResult, SessionContext, SetScopeResult, SwitchResult } from './types';
|
|
4
4
|
export declare class ContextManager {
|
|
5
5
|
private static instance;
|
|
6
6
|
private profileLoader;
|
|
@@ -42,7 +42,7 @@ const scope_enforcer_1 = require("../../profiles/scope-enforcer");
|
|
|
42
42
|
const server_1 = require("../../server");
|
|
43
43
|
const namespace_1 = require("../../utils/namespace");
|
|
44
44
|
function isOAuthMode() {
|
|
45
|
-
return process.env.OAUTH_ENABLED ===
|
|
45
|
+
return process.env.OAUTH_ENABLED === 'true';
|
|
46
46
|
}
|
|
47
47
|
function getHost() {
|
|
48
48
|
try {
|
|
@@ -85,12 +85,12 @@ class ContextManager {
|
|
|
85
85
|
? this.scopeConfigToRuntimeScope(this.currentScope, false)
|
|
86
86
|
: undefined,
|
|
87
87
|
};
|
|
88
|
-
(0, logger_1.logDebug)(
|
|
88
|
+
(0, logger_1.logDebug)('Captured initial context', { initialContext: this.initialContext });
|
|
89
89
|
}
|
|
90
90
|
scopeConfigToRuntimeScope(scope, detected) {
|
|
91
91
|
if (scope.project) {
|
|
92
92
|
return {
|
|
93
|
-
type:
|
|
93
|
+
type: 'project',
|
|
94
94
|
path: scope.project,
|
|
95
95
|
includeSubgroups: false,
|
|
96
96
|
detected,
|
|
@@ -98,7 +98,7 @@ class ContextManager {
|
|
|
98
98
|
}
|
|
99
99
|
if (scope.group) {
|
|
100
100
|
return {
|
|
101
|
-
type:
|
|
101
|
+
type: 'group',
|
|
102
102
|
path: scope.group,
|
|
103
103
|
includeSubgroups: scope.includeSubgroups !== false,
|
|
104
104
|
detected,
|
|
@@ -106,7 +106,7 @@ class ContextManager {
|
|
|
106
106
|
}
|
|
107
107
|
if (scope.namespace) {
|
|
108
108
|
return {
|
|
109
|
-
type:
|
|
109
|
+
type: 'group',
|
|
110
110
|
path: scope.namespace,
|
|
111
111
|
includeSubgroups: scope.includeSubgroups !== false,
|
|
112
112
|
detected,
|
|
@@ -114,7 +114,7 @@ class ContextManager {
|
|
|
114
114
|
}
|
|
115
115
|
if (scope.projects && scope.projects.length > 0) {
|
|
116
116
|
return {
|
|
117
|
-
type:
|
|
117
|
+
type: 'project',
|
|
118
118
|
path: scope.projects[0],
|
|
119
119
|
additionalPaths: scope.projects.length > 1 ? scope.projects.slice(1) : undefined,
|
|
120
120
|
includeSubgroups: false,
|
|
@@ -123,15 +123,15 @@ class ContextManager {
|
|
|
123
123
|
}
|
|
124
124
|
if (scope.groups && scope.groups.length > 0) {
|
|
125
125
|
return {
|
|
126
|
-
type:
|
|
126
|
+
type: 'group',
|
|
127
127
|
path: scope.groups[0],
|
|
128
128
|
additionalPaths: scope.groups.length > 1 ? scope.groups.slice(1) : undefined,
|
|
129
129
|
includeSubgroups: scope.includeSubgroups !== false,
|
|
130
130
|
detected,
|
|
131
131
|
};
|
|
132
132
|
}
|
|
133
|
-
(0, logger_1.logError)(
|
|
134
|
-
throw new Error(
|
|
133
|
+
(0, logger_1.logError)('Invalid scope configuration: no usable scope fields found', { scope });
|
|
134
|
+
throw new Error('Invalid scope configuration: expected project, group, namespace, projects, or groups to be defined');
|
|
135
135
|
}
|
|
136
136
|
getContext() {
|
|
137
137
|
const context = {
|
|
@@ -151,15 +151,15 @@ class ContextManager {
|
|
|
151
151
|
async listPresets() {
|
|
152
152
|
const profiles = await this.profileLoader.listProfiles();
|
|
153
153
|
const presets = profiles
|
|
154
|
-
.filter(p => p.isPreset)
|
|
155
|
-
.map(p => ({
|
|
154
|
+
.filter((p) => p.isPreset)
|
|
155
|
+
.map((p) => ({
|
|
156
156
|
name: p.name,
|
|
157
157
|
description: p.description,
|
|
158
158
|
readOnly: p.readOnly,
|
|
159
159
|
isBuiltIn: p.isBuiltIn,
|
|
160
160
|
}));
|
|
161
161
|
if (this.currentPresetName && this.currentPreset) {
|
|
162
|
-
const exists = presets.some(p => p.name === this.currentPresetName);
|
|
162
|
+
const exists = presets.some((p) => p.name === this.currentPresetName);
|
|
163
163
|
if (!exists) {
|
|
164
164
|
presets.unshift({
|
|
165
165
|
name: this.currentPresetName,
|
|
@@ -173,10 +173,10 @@ class ContextManager {
|
|
|
173
173
|
}
|
|
174
174
|
async listProfiles() {
|
|
175
175
|
if (!isOAuthMode()) {
|
|
176
|
-
throw new Error(
|
|
176
|
+
throw new Error('list_profiles is only available in OAuth mode');
|
|
177
177
|
}
|
|
178
178
|
const profiles = await this.profileLoader.listProfiles();
|
|
179
|
-
return profiles.filter(p => !p.isPreset);
|
|
179
|
+
return profiles.filter((p) => !p.isPreset);
|
|
180
180
|
}
|
|
181
181
|
async switchPreset(presetName) {
|
|
182
182
|
const previousPreset = this.currentPresetName;
|
|
@@ -192,7 +192,7 @@ class ContextManager {
|
|
|
192
192
|
this.currentScope = null;
|
|
193
193
|
this.currentScopeEnforcer = null;
|
|
194
194
|
}
|
|
195
|
-
(0, logger_1.logInfo)(
|
|
195
|
+
(0, logger_1.logInfo)('Switched preset', { previous: previousPreset, current: presetName });
|
|
196
196
|
await (0, server_1.sendToolsListChangedNotification)();
|
|
197
197
|
return {
|
|
198
198
|
success: true,
|
|
@@ -203,19 +203,19 @@ class ContextManager {
|
|
|
203
203
|
}
|
|
204
204
|
catch (error) {
|
|
205
205
|
const message = error instanceof Error ? error.message : String(error);
|
|
206
|
-
(0, logger_1.logError)(
|
|
206
|
+
(0, logger_1.logError)('Failed to switch preset', { error: message, preset: presetName });
|
|
207
207
|
throw new Error(`Failed to switch to preset '${presetName}': ${message}`, { cause: error });
|
|
208
208
|
}
|
|
209
209
|
}
|
|
210
210
|
async switchProfile(profileName) {
|
|
211
211
|
if (!isOAuthMode()) {
|
|
212
|
-
throw new Error(
|
|
212
|
+
throw new Error('switch_profile is only available in OAuth mode');
|
|
213
213
|
}
|
|
214
214
|
const previousProfile = this.currentProfileName;
|
|
215
215
|
try {
|
|
216
216
|
await this.profileLoader.loadProfile(profileName);
|
|
217
217
|
this.currentProfileName = profileName;
|
|
218
|
-
(0, logger_1.logInfo)(
|
|
218
|
+
(0, logger_1.logInfo)('Switched profile', { previous: previousProfile, current: profileName });
|
|
219
219
|
return {
|
|
220
220
|
success: true,
|
|
221
221
|
previous: previousProfile ?? undefined,
|
|
@@ -225,7 +225,7 @@ class ContextManager {
|
|
|
225
225
|
}
|
|
226
226
|
catch (error) {
|
|
227
227
|
const message = error instanceof Error ? error.message : String(error);
|
|
228
|
-
(0, logger_1.logError)(
|
|
228
|
+
(0, logger_1.logError)('Failed to switch profile', { error: message, profile: profileName });
|
|
229
229
|
throw new Error(`Failed to switch to profile '${profileName}': ${message}`, { cause: error });
|
|
230
230
|
}
|
|
231
231
|
}
|
|
@@ -233,7 +233,7 @@ class ContextManager {
|
|
|
233
233
|
try {
|
|
234
234
|
const namespaceType = await (0, namespace_1.detectNamespaceType)(namespace);
|
|
235
235
|
let scopeConfig;
|
|
236
|
-
if (namespaceType ===
|
|
236
|
+
if (namespaceType === 'project') {
|
|
237
237
|
scopeConfig = {
|
|
238
238
|
project: namespace,
|
|
239
239
|
includeSubgroups: false,
|
|
@@ -250,10 +250,10 @@ class ContextManager {
|
|
|
250
250
|
const runtimeScope = {
|
|
251
251
|
type: namespaceType,
|
|
252
252
|
path: namespace,
|
|
253
|
-
includeSubgroups: namespaceType ===
|
|
253
|
+
includeSubgroups: namespaceType === 'group' ? includeSubgroups : false,
|
|
254
254
|
detected: true,
|
|
255
255
|
};
|
|
256
|
-
(0, logger_1.logInfo)(
|
|
256
|
+
(0, logger_1.logInfo)('Scope set with auto-detection', {
|
|
257
257
|
namespace,
|
|
258
258
|
type: namespaceType,
|
|
259
259
|
includeSubgroups,
|
|
@@ -261,18 +261,18 @@ class ContextManager {
|
|
|
261
261
|
return {
|
|
262
262
|
success: true,
|
|
263
263
|
scope: runtimeScope,
|
|
264
|
-
message: `Scope set to ${namespaceType} '${namespace}'${namespaceType ===
|
|
264
|
+
message: `Scope set to ${namespaceType} '${namespace}'${namespaceType === 'group' && includeSubgroups ? ' (including subgroups)' : ''}`,
|
|
265
265
|
};
|
|
266
266
|
}
|
|
267
267
|
catch (error) {
|
|
268
268
|
const message = error instanceof Error ? error.message : String(error);
|
|
269
|
-
(0, logger_1.logError)(
|
|
269
|
+
(0, logger_1.logError)('Failed to set scope', { error: message, namespace });
|
|
270
270
|
throw new Error(`Failed to set scope for '${namespace}': ${message}`, { cause: error });
|
|
271
271
|
}
|
|
272
272
|
}
|
|
273
273
|
reset() {
|
|
274
274
|
if (!this.initialContext) {
|
|
275
|
-
throw new Error(
|
|
275
|
+
throw new Error('No initial context captured - cannot reset');
|
|
276
276
|
}
|
|
277
277
|
this.currentPreset = null;
|
|
278
278
|
this.currentPresetName = null;
|
|
@@ -280,10 +280,10 @@ class ContextManager {
|
|
|
280
280
|
this.currentScopeEnforcer = null;
|
|
281
281
|
this.currentProfileName = null;
|
|
282
282
|
this.captureInitialContext();
|
|
283
|
-
(0, logger_1.logInfo)(
|
|
283
|
+
(0, logger_1.logInfo)('Context reset to initial state');
|
|
284
284
|
return {
|
|
285
285
|
success: true,
|
|
286
|
-
message:
|
|
286
|
+
message: 'Context reset to initial state',
|
|
287
287
|
context: this.getContext(),
|
|
288
288
|
};
|
|
289
289
|
}
|
|
@@ -301,12 +301,12 @@ class ContextManager {
|
|
|
301
301
|
}
|
|
302
302
|
async switchInstance(instanceUrl) {
|
|
303
303
|
if (isOAuthMode()) {
|
|
304
|
-
throw new Error(
|
|
305
|
-
|
|
304
|
+
throw new Error('Cannot switch instances in OAuth mode. ' +
|
|
305
|
+
'Please re-authenticate with the desired GitLab instance.');
|
|
306
306
|
}
|
|
307
|
-
const { InstanceRegistry } = await Promise.resolve().then(() => __importStar(require(
|
|
308
|
-
const { clearNamespaceTierCache } = await Promise.resolve().then(() => __importStar(require(
|
|
309
|
-
const { ConnectionManager } = await Promise.resolve().then(() => __importStar(require(
|
|
307
|
+
const { InstanceRegistry } = await Promise.resolve().then(() => __importStar(require('../../services/InstanceRegistry.js')));
|
|
308
|
+
const { clearNamespaceTierCache } = await Promise.resolve().then(() => __importStar(require('../../services/NamespaceTierDetector.js')));
|
|
309
|
+
const { ConnectionManager } = await Promise.resolve().then(() => __importStar(require('../../services/ConnectionManager.js')));
|
|
310
310
|
const registry = InstanceRegistry.getInstance();
|
|
311
311
|
if (!registry.isInitialized()) {
|
|
312
312
|
await registry.initialize();
|
|
@@ -323,7 +323,7 @@ class ContextManager {
|
|
|
323
323
|
await connectionManager.reinitialize(instanceUrl);
|
|
324
324
|
this.currentScope = null;
|
|
325
325
|
this.currentScopeEnforcer = null;
|
|
326
|
-
(0, logger_1.logInfo)(
|
|
326
|
+
(0, logger_1.logInfo)('Switched GitLab instance', {
|
|
327
327
|
previous: previousUrl,
|
|
328
328
|
current: instanceUrl,
|
|
329
329
|
label: instance.config.label,
|
|
@@ -338,7 +338,7 @@ class ContextManager {
|
|
|
338
338
|
}
|
|
339
339
|
catch (error) {
|
|
340
340
|
const message = error instanceof Error ? error.message : String(error);
|
|
341
|
-
(0, logger_1.logError)(
|
|
341
|
+
(0, logger_1.logError)('Failed to switch instance', { error: message, instanceUrl });
|
|
342
342
|
throw new Error(`Failed to switch to instance '${instanceUrl}': ${message}`, {
|
|
343
343
|
cause: error,
|
|
344
344
|
});
|