@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
|
@@ -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,WA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O;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
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context-manager.js","sourceRoot":"","sources":["../../../../src/entities/context/context-manager.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsfA,8CAEC;AA1eD,yCAAsE;AACtE,yCAA2D;AAC3D,kDAAsD;AACtD,kEAA8D;AAE9D,yCAAgE;AAChE,qDAA4D;AAa5D,SAAS,WAAW;IAClB,OAAO,OAAO,CAAC,GAAG,CAAC,aAAa,KAAK,MAAM,CAAC;AAC9C,CAAC;AAKD,SAAS,OAAO;IACd,IAAI,CAAC;QACH,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC,wBAAe,CAAC,CAAC;QACrC,OAAO,GAAG,CAAC,QAAQ,CAAC;IACtB,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,wBAAe,CAAC;IACzB,CAAC;AACH,CAAC;AAQD,MAAa,cAA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A4bC;AAGD,SAAgB,iBAAiB;IAC/B,OAAO,cAAc,CAAC,WAAW,EAAE,CAAC;AACtC,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ListPresetsInput, ListProfilesInput, ManageContextInput, ResetContextInput, SetScopeInput, ShowContextInput, SwitchPresetInput, SwitchProfileInput, WhoamiInput } from
|
|
2
|
-
import { PresetInfo, ProfileInfo, ResetResult, SessionContext, SetScopeResult, SwitchResult, WhoamiResult } from
|
|
1
|
+
import { ListPresetsInput, ListProfilesInput, ManageContextInput, ResetContextInput, SetScopeInput, ShowContextInput, SwitchPresetInput, SwitchProfileInput, WhoamiInput } from './schema';
|
|
2
|
+
import { PresetInfo, ProfileInfo, ResetResult, SessionContext, SetScopeResult, SwitchResult, WhoamiResult } from './types';
|
|
3
3
|
export declare function handleShowContext(_input: ShowContextInput): Promise<SessionContext>;
|
|
4
4
|
export declare function handleListPresets(_input: ListPresetsInput): Promise<PresetInfo[]>;
|
|
5
5
|
export declare function handleListProfiles(_input: ListProfilesInput): Promise<ProfileInfo[]>;
|
|
@@ -44,21 +44,21 @@ async function handleWhoami(_input) {
|
|
|
44
44
|
}
|
|
45
45
|
async function handleManageContext(input) {
|
|
46
46
|
switch (input.action) {
|
|
47
|
-
case
|
|
47
|
+
case 'show':
|
|
48
48
|
return handleShowContext(input);
|
|
49
|
-
case
|
|
49
|
+
case 'list_presets':
|
|
50
50
|
return handleListPresets(input);
|
|
51
|
-
case
|
|
51
|
+
case 'list_profiles':
|
|
52
52
|
return handleListProfiles(input);
|
|
53
|
-
case
|
|
53
|
+
case 'switch_preset':
|
|
54
54
|
return handleSwitchPreset(input);
|
|
55
|
-
case
|
|
55
|
+
case 'switch_profile':
|
|
56
56
|
return handleSwitchProfile(input);
|
|
57
|
-
case
|
|
57
|
+
case 'set_scope':
|
|
58
58
|
return handleSetScope(input);
|
|
59
|
-
case
|
|
59
|
+
case 'reset':
|
|
60
60
|
return handleResetContext(input);
|
|
61
|
-
case
|
|
61
|
+
case 'whoami':
|
|
62
62
|
return handleWhoami(input);
|
|
63
63
|
default:
|
|
64
64
|
throw new Error(`Unknown action: ${input.action}`);
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
export * from
|
|
2
|
-
export * from
|
|
3
|
-
export * from
|
|
4
|
-
export * from
|
|
5
|
-
export * from
|
|
6
|
-
export * from
|
|
7
|
-
import { contextToolRegistry } from
|
|
8
|
-
import type { ToolDefinition } from
|
|
1
|
+
export * from '../shared';
|
|
2
|
+
export * from './types';
|
|
3
|
+
export * from './schema';
|
|
4
|
+
export * from './context-manager';
|
|
5
|
+
export * from './handlers';
|
|
6
|
+
export * from './registry';
|
|
7
|
+
import { contextToolRegistry } from './registry';
|
|
8
|
+
import type { ToolDefinition } from '../../types';
|
|
9
9
|
export declare const contextTools: ToolDefinition[];
|
|
10
10
|
export declare const contextReadOnlyTools: string[];
|
|
11
11
|
export { contextToolRegistry };
|
|
@@ -23,7 +23,7 @@ __exportStar(require("./handlers"), exports);
|
|
|
23
23
|
__exportStar(require("./registry"), exports);
|
|
24
24
|
const registry_1 = require("./registry");
|
|
25
25
|
Object.defineProperty(exports, "contextToolRegistry", { enumerable: true, get: function () { return registry_1.contextToolRegistry; } });
|
|
26
|
-
const isReadOnly = process.env.GITLAB_READ_ONLY_MODE ===
|
|
26
|
+
const isReadOnly = process.env.GITLAB_READ_ONLY_MODE === 'true';
|
|
27
27
|
const contextToolsFromRegistry = (0, registry_1.getFilteredContextTools)(isReadOnly);
|
|
28
28
|
exports.contextTools = contextToolsFromRegistry.map((tool) => ({
|
|
29
29
|
name: tool.name,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ToolRegistry, EnhancedToolDefinition } from
|
|
1
|
+
import { ToolRegistry, EnhancedToolDefinition } from '../../types';
|
|
2
2
|
export declare const contextToolRegistry: ToolRegistry;
|
|
3
3
|
export declare function getContextReadOnlyToolNames(): string[];
|
|
4
4
|
export declare function getContextToolDefinitions(): EnhancedToolDefinition[];
|
|
@@ -42,10 +42,10 @@ const schema_1 = require("./schema");
|
|
|
42
42
|
const handlers_1 = require("./handlers");
|
|
43
43
|
exports.contextToolRegistry = new Map([
|
|
44
44
|
[
|
|
45
|
-
|
|
45
|
+
'manage_context',
|
|
46
46
|
{
|
|
47
|
-
name:
|
|
48
|
-
description:
|
|
47
|
+
name: 'manage_context',
|
|
48
|
+
description: 'View and manage runtime session configuration. Actions: show (current host/preset/scope/mode), list_presets (available tool configurations), list_profiles (OAuth users), whoami (token introspection with live refresh - detects permission changes and updates available tools), switch_preset (change active preset), switch_profile (change OAuth user), set_scope (restrict to namespace), reset (restore initial state). Use whoami to diagnose access issues and verify token permissions.',
|
|
49
49
|
inputSchema: z.toJSONSchema(schema_1.ManageContextSchema),
|
|
50
50
|
handler: async (args) => {
|
|
51
51
|
const input = schema_1.ManageContextSchema.parse(args);
|
|
@@ -55,7 +55,7 @@ exports.contextToolRegistry = new Map([
|
|
|
55
55
|
],
|
|
56
56
|
]);
|
|
57
57
|
function getContextReadOnlyToolNames() {
|
|
58
|
-
return [
|
|
58
|
+
return ['manage_context'];
|
|
59
59
|
}
|
|
60
60
|
function getContextToolDefinitions() {
|
|
61
61
|
return Array.from(exports.contextToolRegistry.values());
|