gitlab-mcp-test 6.62.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/LICENSE +202 -0
- package/LICENSE.MIT +21 -0
- package/README.md +122 -0
- package/README.md.in +122 -0
- package/dist/generated/prisma/client.d.ts +13 -0
- package/dist/generated/prisma/client.js +46 -0
- package/dist/generated/prisma/client.js.map +1 -0
- package/dist/generated/prisma/commonInputTypes.d.ts +245 -0
- package/dist/generated/prisma/commonInputTypes.js +3 -0
- package/dist/generated/prisma/commonInputTypes.js.map +1 -0
- package/dist/generated/prisma/enums.d.ts +1 -0
- package/dist/generated/prisma/enums.js +3 -0
- package/dist/generated/prisma/enums.js.map +1 -0
- package/dist/generated/prisma/internal/class.d.ts +47 -0
- package/dist/generated/prisma/internal/class.js +75 -0
- package/dist/generated/prisma/internal/class.js.map +1 -0
- package/dist/generated/prisma/internal/prismaNamespace.d.ts +714 -0
- package/dist/generated/prisma/internal/prismaNamespace.js +141 -0
- package/dist/generated/prisma/internal/prismaNamespace.js.map +1 -0
- package/dist/generated/prisma/models/AuthCodeFlowState.d.ts +513 -0
- package/dist/generated/prisma/models/AuthCodeFlowState.js +3 -0
- package/dist/generated/prisma/models/AuthCodeFlowState.js.map +1 -0
- package/dist/generated/prisma/models/AuthorizationCode.d.ts +641 -0
- package/dist/generated/prisma/models/AuthorizationCode.js +3 -0
- package/dist/generated/prisma/models/AuthorizationCode.js.map +1 -0
- package/dist/generated/prisma/models/DeviceFlowState.d.ts +603 -0
- package/dist/generated/prisma/models/DeviceFlowState.js +3 -0
- package/dist/generated/prisma/models/DeviceFlowState.js.map +1 -0
- package/dist/generated/prisma/models/McpSessionMapping.d.ts +438 -0
- package/dist/generated/prisma/models/McpSessionMapping.js +3 -0
- package/dist/generated/prisma/models/McpSessionMapping.js.map +1 -0
- package/dist/generated/prisma/models/OAuthSession.d.ts +1037 -0
- package/dist/generated/prisma/models/OAuthSession.js +3 -0
- package/dist/generated/prisma/models/OAuthSession.js.map +1 -0
- package/dist/generated/prisma/models.d.ts +6 -0
- package/dist/generated/prisma/models.js +3 -0
- package/dist/generated/prisma/models.js.map +1 -0
- package/dist/src/cli/docker/container-runtime.d.ts +4 -0
- package/dist/src/cli/docker/container-runtime.js +85 -0
- package/dist/src/cli/docker/container-runtime.js.map +1 -0
- package/dist/src/cli/docker/docker-command.d.ts +15 -0
- package/dist/src/cli/docker/docker-command.js +421 -0
- package/dist/src/cli/docker/docker-command.js.map +1 -0
- package/dist/src/cli/docker/docker-utils.d.ts +25 -0
- package/dist/src/cli/docker/docker-utils.js +386 -0
- package/dist/src/cli/docker/docker-utils.js.map +1 -0
- package/dist/src/cli/docker/index.d.ts +4 -0
- package/dist/src/cli/docker/index.js +24 -0
- package/dist/src/cli/docker/index.js.map +1 -0
- package/dist/src/cli/docker/types.d.ts +83 -0
- package/dist/src/cli/docker/types.js +21 -0
- package/dist/src/cli/docker/types.js.map +1 -0
- package/dist/src/cli/init/browser.d.ts +7 -0
- package/dist/src/cli/init/browser.js +27 -0
- package/dist/src/cli/init/browser.js.map +1 -0
- package/dist/src/cli/init/config-generator.d.ts +11 -0
- package/dist/src/cli/init/config-generator.js +87 -0
- package/dist/src/cli/init/config-generator.js.map +1 -0
- package/dist/src/cli/init/connection.d.ts +8 -0
- package/dist/src/cli/init/connection.js +118 -0
- package/dist/src/cli/init/connection.js.map +1 -0
- package/dist/src/cli/init/index.d.ts +4 -0
- package/dist/src/cli/init/index.js +32 -0
- package/dist/src/cli/init/index.js.map +1 -0
- package/dist/src/cli/init/types.d.ts +31 -0
- package/dist/src/cli/init/types.js +66 -0
- package/dist/src/cli/init/types.js.map +1 -0
- package/dist/src/cli/init/wizard.d.ts +1 -0
- package/dist/src/cli/init/wizard.js +283 -0
- package/dist/src/cli/init/wizard.js.map +1 -0
- package/dist/src/cli/inject-tool-refs.d.ts +35 -0
- package/dist/src/cli/inject-tool-refs.js +261 -0
- package/dist/src/cli/inject-tool-refs.js.map +1 -0
- package/dist/src/cli/install/backup.d.ts +4 -0
- package/dist/src/cli/install/backup.js +63 -0
- package/dist/src/cli/install/backup.js.map +1 -0
- package/dist/src/cli/install/detector.d.ts +10 -0
- package/dist/src/cli/install/detector.js +133 -0
- package/dist/src/cli/install/detector.js.map +1 -0
- package/dist/src/cli/install/index.d.ts +5 -0
- package/dist/src/cli/install/index.js +27 -0
- package/dist/src/cli/install/index.js.map +1 -0
- package/dist/src/cli/install/install-command.d.ts +19 -0
- package/dist/src/cli/install/install-command.js +300 -0
- package/dist/src/cli/install/install-command.js.map +1 -0
- package/dist/src/cli/install/installers.d.ts +12 -0
- package/dist/src/cli/install/installers.js +439 -0
- package/dist/src/cli/install/installers.js.map +1 -0
- package/dist/src/cli/install/types.d.ts +52 -0
- package/dist/src/cli/install/types.js +87 -0
- package/dist/src/cli/install/types.js.map +1 -0
- package/dist/src/cli/instances/index.d.ts +2 -0
- package/dist/src/cli/instances/index.js +7 -0
- package/dist/src/cli/instances/index.js.map +1 -0
- package/dist/src/cli/instances/instances-command.d.ts +6 -0
- package/dist/src/cli/instances/instances-command.js +351 -0
- package/dist/src/cli/instances/instances-command.js.map +1 -0
- package/dist/src/cli/list-tools.d.ts +2 -0
- package/dist/src/cli/list-tools.js +1431 -0
- package/dist/src/cli/list-tools.js.map +1 -0
- package/dist/src/cli/setup/discovery.d.ts +3 -0
- package/dist/src/cli/setup/discovery.js +71 -0
- package/dist/src/cli/setup/discovery.js.map +1 -0
- package/dist/src/cli/setup/flows/configure-existing.d.ts +2 -0
- package/dist/src/cli/setup/flows/configure-existing.js +211 -0
- package/dist/src/cli/setup/flows/configure-existing.js.map +1 -0
- package/dist/src/cli/setup/flows/local-setup.d.ts +2 -0
- package/dist/src/cli/setup/flows/local-setup.js +206 -0
- package/dist/src/cli/setup/flows/local-setup.js.map +1 -0
- package/dist/src/cli/setup/flows/server-setup.d.ts +2 -0
- package/dist/src/cli/setup/flows/server-setup.js +185 -0
- package/dist/src/cli/setup/flows/server-setup.js.map +1 -0
- package/dist/src/cli/setup/flows/tool-selection.d.ts +3 -0
- package/dist/src/cli/setup/flows/tool-selection.js +275 -0
- package/dist/src/cli/setup/flows/tool-selection.js.map +1 -0
- package/dist/src/cli/setup/index.d.ts +4 -0
- package/dist/src/cli/setup/index.js +29 -0
- package/dist/src/cli/setup/index.js.map +1 -0
- package/dist/src/cli/setup/presets.d.ts +7 -0
- package/dist/src/cli/setup/presets.js +261 -0
- package/dist/src/cli/setup/presets.js.map +1 -0
- package/dist/src/cli/setup/types.d.ts +68 -0
- package/dist/src/cli/setup/types.js +3 -0
- package/dist/src/cli/setup/types.js.map +1 -0
- package/dist/src/cli/setup/wizard.d.ts +4 -0
- package/dist/src/cli/setup/wizard.js +128 -0
- package/dist/src/cli/setup/wizard.js.map +1 -0
- package/dist/src/cli/utils/index.d.ts +1 -0
- package/dist/src/cli/utils/index.js +6 -0
- package/dist/src/cli/utils/index.js.map +1 -0
- package/dist/src/cli/utils/path-utils.d.ts +1 -0
- package/dist/src/cli/utils/path-utils.js +18 -0
- package/dist/src/cli/utils/path-utils.js.map +1 -0
- package/dist/src/cli-utils.d.ts +19 -0
- package/dist/src/cli-utils.js +183 -0
- package/dist/src/cli-utils.js.map +1 -0
- package/dist/src/config/index.d.ts +4 -0
- package/dist/src/config/index.js +19 -0
- package/dist/src/config/index.js.map +1 -0
- package/dist/src/config/instances-loader.d.ts +10 -0
- package/dist/src/config/instances-loader.js +294 -0
- package/dist/src/config/instances-loader.js.map +1 -0
- package/dist/src/config/instances-schema.d.ts +89 -0
- package/dist/src/config/instances-schema.js +196 -0
- package/dist/src/config/instances-schema.js.map +1 -0
- package/dist/src/config.d.ts +82 -0
- package/dist/src/config.js +379 -0
- package/dist/src/config.js.map +1 -0
- package/dist/src/dashboard/handler.d.ts +4 -0
- package/dist/src/dashboard/handler.js +37 -0
- package/dist/src/dashboard/handler.js.map +1 -0
- package/dist/src/dashboard/html-template.d.ts +2 -0
- package/dist/src/dashboard/html-template.js +443 -0
- package/dist/src/dashboard/html-template.js.map +1 -0
- package/dist/src/dashboard/index.d.ts +4 -0
- package/dist/src/dashboard/index.js +15 -0
- package/dist/src/dashboard/index.js.map +1 -0
- package/dist/src/dashboard/metrics.d.ts +79 -0
- package/dist/src/dashboard/metrics.js +194 -0
- package/dist/src/dashboard/metrics.js.map +1 -0
- package/dist/src/discovery/auto.d.ts +22 -0
- package/dist/src/discovery/auto.js +170 -0
- package/dist/src/discovery/auto.js.map +1 -0
- package/dist/src/discovery/git-remote.d.ts +19 -0
- package/dist/src/discovery/git-remote.js +197 -0
- package/dist/src/discovery/git-remote.js.map +1 -0
- package/dist/src/discovery/index.d.ts +3 -0
- package/dist/src/discovery/index.js +16 -0
- package/dist/src/discovery/index.js.map +1 -0
- package/dist/src/discovery/profile-matcher.d.ts +8 -0
- package/dist/src/discovery/profile-matcher.js +48 -0
- package/dist/src/discovery/profile-matcher.js.map +1 -0
- package/dist/src/entities/context/context-manager.d.ts +31 -0
- package/dist/src/entities/context/context-manager.js +352 -0
- package/dist/src/entities/context/context-manager.js.map +1 -0
- package/dist/src/entities/context/handlers.d.ts +11 -0
- package/dist/src/entities/context/handlers.js +67 -0
- package/dist/src/entities/context/handlers.js.map +1 -0
- package/dist/src/entities/context/index.d.ts +11 -0
- package/dist/src/entities/context/index.js +34 -0
- package/dist/src/entities/context/index.js.map +1 -0
- package/dist/src/entities/context/registry.d.ts +5 -0
- package/dist/src/entities/context/registry.js +66 -0
- package/dist/src/entities/context/registry.js.map +1 -0
- package/dist/src/entities/context/schema.d.ts +60 -0
- package/dist/src/entities/context/schema.js +61 -0
- package/dist/src/entities/context/schema.js.map +1 -0
- package/dist/src/entities/context/types.d.ts +112 -0
- package/dist/src/entities/context/types.js +3 -0
- package/dist/src/entities/context/types.js.map +1 -0
- package/dist/src/entities/context/whoami.d.ts +2 -0
- package/dist/src/entities/context/whoami.js +267 -0
- package/dist/src/entities/context/whoami.js.map +1 -0
- package/dist/src/entities/core/index.d.ts +7 -0
- package/dist/src/entities/core/index.js +31 -0
- package/dist/src/entities/core/index.js.map +1 -0
- package/dist/src/entities/core/registry.d.ts +5 -0
- package/dist/src/entities/core/registry.js +784 -0
- package/dist/src/entities/core/registry.js.map +1 -0
- package/dist/src/entities/core/schema-readonly.d.ts +268 -0
- package/dist/src/entities/core/schema-readonly.js +289 -0
- package/dist/src/entities/core/schema-readonly.js.map +1 -0
- package/dist/src/entities/core/schema.d.ts +116 -0
- package/dist/src/entities/core/schema.js +173 -0
- package/dist/src/entities/core/schema.js.map +1 -0
- package/dist/src/entities/files/index.d.ts +7 -0
- package/dist/src/entities/files/index.js +31 -0
- package/dist/src/entities/files/index.js.map +1 -0
- package/dist/src/entities/files/registry.d.ts +5 -0
- package/dist/src/entities/files/registry.js +267 -0
- package/dist/src/entities/files/registry.js.map +1 -0
- package/dist/src/entities/files/schema-readonly.d.ts +83 -0
- package/dist/src/entities/files/schema-readonly.js +64 -0
- package/dist/src/entities/files/schema-readonly.js.map +1 -0
- package/dist/src/entities/files/schema.d.ts +43 -0
- package/dist/src/entities/files/schema.js +54 -0
- package/dist/src/entities/files/schema.js.map +1 -0
- package/dist/src/entities/index.d.ts +17 -0
- package/dist/src/entities/index.js +34 -0
- package/dist/src/entities/index.js.map +1 -0
- package/dist/src/entities/integrations/index.d.ts +4 -0
- package/dist/src/entities/integrations/index.js +21 -0
- package/dist/src/entities/integrations/index.js.map +1 -0
- package/dist/src/entities/integrations/registry.d.ts +5 -0
- package/dist/src/entities/integrations/registry.js +127 -0
- package/dist/src/entities/integrations/registry.js.map +1 -0
- package/dist/src/entities/integrations/schema-readonly.d.ts +63 -0
- package/dist/src/entities/integrations/schema-readonly.js +22 -0
- package/dist/src/entities/integrations/schema-readonly.js.map +1 -0
- package/dist/src/entities/integrations/schema.d.ts +180 -0
- package/dist/src/entities/integrations/schema.js +106 -0
- package/dist/src/entities/integrations/schema.js.map +1 -0
- package/dist/src/entities/iterations/index.d.ts +2 -0
- package/dist/src/entities/iterations/index.js +19 -0
- package/dist/src/entities/iterations/index.js.map +1 -0
- package/dist/src/entities/iterations/registry.d.ts +5 -0
- package/dist/src/entities/iterations/registry.js +106 -0
- package/dist/src/entities/iterations/registry.js.map +1 -0
- package/dist/src/entities/iterations/schema-readonly.d.ts +21 -0
- package/dist/src/entities/iterations/schema-readonly.js +28 -0
- package/dist/src/entities/iterations/schema-readonly.js.map +1 -0
- package/dist/src/entities/labels/index.d.ts +7 -0
- package/dist/src/entities/labels/index.js +31 -0
- package/dist/src/entities/labels/index.js.map +1 -0
- package/dist/src/entities/labels/registry.d.ts +5 -0
- package/dist/src/entities/labels/registry.js +131 -0
- package/dist/src/entities/labels/registry.js.map +1 -0
- package/dist/src/entities/labels/schema-readonly.d.ts +16 -0
- package/dist/src/entities/labels/schema-readonly.js +28 -0
- package/dist/src/entities/labels/schema-readonly.js.map +1 -0
- package/dist/src/entities/labels/schema.d.ts +23 -0
- package/dist/src/entities/labels/schema.js +46 -0
- package/dist/src/entities/labels/schema.js.map +1 -0
- package/dist/src/entities/members/index.d.ts +3 -0
- package/dist/src/entities/members/index.js +25 -0
- package/dist/src/entities/members/index.js.map +1 -0
- package/dist/src/entities/members/registry.d.ts +5 -0
- package/dist/src/entities/members/registry.js +224 -0
- package/dist/src/entities/members/registry.js.map +1 -0
- package/dist/src/entities/members/schema-readonly.d.ts +53 -0
- package/dist/src/entities/members/schema-readonly.js +79 -0
- package/dist/src/entities/members/schema-readonly.js.map +1 -0
- package/dist/src/entities/members/schema.d.ts +40 -0
- package/dist/src/entities/members/schema.js +80 -0
- package/dist/src/entities/members/schema.js.map +1 -0
- package/dist/src/entities/milestones/index.d.ts +7 -0
- package/dist/src/entities/milestones/index.js +31 -0
- package/dist/src/entities/milestones/index.js.map +1 -0
- package/dist/src/entities/milestones/registry.d.ts +5 -0
- package/dist/src/entities/milestones/registry.js +150 -0
- package/dist/src/entities/milestones/registry.js.map +1 -0
- package/dist/src/entities/milestones/schema-readonly.d.ts +57 -0
- package/dist/src/entities/milestones/schema-readonly.js +81 -0
- package/dist/src/entities/milestones/schema-readonly.js.map +1 -0
- package/dist/src/entities/milestones/schema.d.ts +30 -0
- package/dist/src/entities/milestones/schema.js +47 -0
- package/dist/src/entities/milestones/schema.js.map +1 -0
- package/dist/src/entities/mrs/index.d.ts +7 -0
- package/dist/src/entities/mrs/index.js +31 -0
- package/dist/src/entities/mrs/index.js.map +1 -0
- package/dist/src/entities/mrs/registry.d.ts +22 -0
- package/dist/src/entities/mrs/registry.js +495 -0
- package/dist/src/entities/mrs/registry.js.map +1 -0
- package/dist/src/entities/mrs/schema-readonly.d.ts +135 -0
- package/dist/src/entities/mrs/schema-readonly.js +326 -0
- package/dist/src/entities/mrs/schema-readonly.js.map +1 -0
- package/dist/src/entities/mrs/schema.d.ts +339 -0
- package/dist/src/entities/mrs/schema.js +259 -0
- package/dist/src/entities/mrs/schema.js.map +1 -0
- package/dist/src/entities/pipelines/index.d.ts +7 -0
- package/dist/src/entities/pipelines/index.js +31 -0
- package/dist/src/entities/pipelines/index.js.map +1 -0
- package/dist/src/entities/pipelines/registry.d.ts +5 -0
- package/dist/src/entities/pipelines/registry.js +323 -0
- package/dist/src/entities/pipelines/registry.js.map +1 -0
- package/dist/src/entities/pipelines/schema-readonly.d.ts +239 -0
- package/dist/src/entities/pipelines/schema-readonly.js +278 -0
- package/dist/src/entities/pipelines/schema-readonly.js.map +1 -0
- package/dist/src/entities/pipelines/schema.d.ts +47 -0
- package/dist/src/entities/pipelines/schema.js +73 -0
- package/dist/src/entities/pipelines/schema.js.map +1 -0
- package/dist/src/entities/refs/index.d.ts +3 -0
- package/dist/src/entities/refs/index.js +25 -0
- package/dist/src/entities/refs/index.js.map +1 -0
- package/dist/src/entities/refs/registry.d.ts +5 -0
- package/dist/src/entities/refs/registry.js +233 -0
- package/dist/src/entities/refs/registry.js.map +1 -0
- package/dist/src/entities/refs/schema-readonly.d.ts +48 -0
- package/dist/src/entities/refs/schema-readonly.js +76 -0
- package/dist/src/entities/refs/schema-readonly.js.map +1 -0
- package/dist/src/entities/refs/schema.d.ts +85 -0
- package/dist/src/entities/refs/schema.js +149 -0
- package/dist/src/entities/refs/schema.js.map +1 -0
- package/dist/src/entities/releases/index.d.ts +3 -0
- package/dist/src/entities/releases/index.js +13 -0
- package/dist/src/entities/releases/index.js.map +1 -0
- package/dist/src/entities/releases/registry.d.ts +5 -0
- package/dist/src/entities/releases/registry.js +183 -0
- package/dist/src/entities/releases/registry.js.map +1 -0
- package/dist/src/entities/releases/schema-readonly.d.ts +28 -0
- package/dist/src/entities/releases/schema-readonly.js +56 -0
- package/dist/src/entities/releases/schema-readonly.js.map +1 -0
- package/dist/src/entities/releases/schema.d.ts +56 -0
- package/dist/src/entities/releases/schema.js +97 -0
- package/dist/src/entities/releases/schema.js.map +1 -0
- package/dist/src/entities/search/index.d.ts +2 -0
- package/dist/src/entities/search/index.js +24 -0
- package/dist/src/entities/search/index.js.map +1 -0
- package/dist/src/entities/search/registry.d.ts +5 -0
- package/dist/src/entities/search/registry.js +113 -0
- package/dist/src/entities/search/registry.js.map +1 -0
- package/dist/src/entities/search/schema-readonly.d.ts +228 -0
- package/dist/src/entities/search/schema-readonly.js +64 -0
- package/dist/src/entities/search/schema-readonly.js.map +1 -0
- package/dist/src/entities/shared.d.ts +291 -0
- package/dist/src/entities/shared.js +269 -0
- package/dist/src/entities/shared.js.map +1 -0
- package/dist/src/entities/snippets/index.d.ts +7 -0
- package/dist/src/entities/snippets/index.js +31 -0
- package/dist/src/entities/snippets/index.js.map +1 -0
- package/dist/src/entities/snippets/registry.d.ts +5 -0
- package/dist/src/entities/snippets/registry.js +200 -0
- package/dist/src/entities/snippets/registry.js.map +1 -0
- package/dist/src/entities/snippets/schema-readonly.d.ts +25 -0
- package/dist/src/entities/snippets/schema-readonly.js +45 -0
- package/dist/src/entities/snippets/schema-readonly.js.map +1 -0
- package/dist/src/entities/snippets/schema.d.ts +56 -0
- package/dist/src/entities/snippets/schema.js +89 -0
- package/dist/src/entities/snippets/schema.js.map +1 -0
- package/dist/src/entities/utils.d.ts +16 -0
- package/dist/src/entities/utils.js +57 -0
- package/dist/src/entities/utils.js.map +1 -0
- package/dist/src/entities/variables/index.d.ts +7 -0
- package/dist/src/entities/variables/index.js +31 -0
- package/dist/src/entities/variables/index.js.map +1 -0
- package/dist/src/entities/variables/registry.d.ts +5 -0
- package/dist/src/entities/variables/registry.js +140 -0
- package/dist/src/entities/variables/registry.js.map +1 -0
- package/dist/src/entities/variables/schema-readonly.d.ts +15 -0
- package/dist/src/entities/variables/schema-readonly.js +33 -0
- package/dist/src/entities/variables/schema-readonly.js.map +1 -0
- package/dist/src/entities/variables/schema.d.ts +41 -0
- package/dist/src/entities/variables/schema.js +92 -0
- package/dist/src/entities/variables/schema.js.map +1 -0
- package/dist/src/entities/webhooks/index.d.ts +4 -0
- package/dist/src/entities/webhooks/index.js +21 -0
- package/dist/src/entities/webhooks/index.js.map +1 -0
- package/dist/src/entities/webhooks/registry.d.ts +5 -0
- package/dist/src/entities/webhooks/registry.js +162 -0
- package/dist/src/entities/webhooks/registry.js.map +1 -0
- package/dist/src/entities/webhooks/schema-readonly.d.ts +22 -0
- package/dist/src/entities/webhooks/schema-readonly.js +25 -0
- package/dist/src/entities/webhooks/schema-readonly.js.map +1 -0
- package/dist/src/entities/webhooks/schema.d.ts +101 -0
- package/dist/src/entities/webhooks/schema.js +101 -0
- package/dist/src/entities/webhooks/schema.js.map +1 -0
- package/dist/src/entities/wiki/index.d.ts +7 -0
- package/dist/src/entities/wiki/index.js +31 -0
- package/dist/src/entities/wiki/index.js.map +1 -0
- package/dist/src/entities/wiki/registry.d.ts +5 -0
- package/dist/src/entities/wiki/registry.js +127 -0
- package/dist/src/entities/wiki/registry.js.map +1 -0
- package/dist/src/entities/wiki/schema-readonly.d.ts +22 -0
- package/dist/src/entities/wiki/schema-readonly.js +27 -0
- package/dist/src/entities/wiki/schema-readonly.js.map +1 -0
- package/dist/src/entities/wiki/schema.d.ts +30 -0
- package/dist/src/entities/wiki/schema.js +38 -0
- package/dist/src/entities/wiki/schema.js.map +1 -0
- package/dist/src/entities/workitems/index.d.ts +7 -0
- package/dist/src/entities/workitems/index.js +31 -0
- package/dist/src/entities/workitems/index.js.map +1 -0
- package/dist/src/entities/workitems/registry.d.ts +5 -0
- package/dist/src/entities/workitems/registry.js +725 -0
- package/dist/src/entities/workitems/registry.js.map +1 -0
- package/dist/src/entities/workitems/schema-readonly.d.ts +49 -0
- package/dist/src/entities/workitems/schema-readonly.js +87 -0
- package/dist/src/entities/workitems/schema-readonly.js.map +1 -0
- package/dist/src/entities/workitems/schema.d.ts +97 -0
- package/dist/src/entities/workitems/schema.js +187 -0
- package/dist/src/entities/workitems/schema.js.map +1 -0
- package/dist/src/graphql/DynamicWorkItemsQuery.d.ts +56 -0
- package/dist/src/graphql/DynamicWorkItemsQuery.js +190 -0
- package/dist/src/graphql/DynamicWorkItemsQuery.js.map +1 -0
- package/dist/src/graphql/client.d.ts +17 -0
- package/dist/src/graphql/client.js +56 -0
- package/dist/src/graphql/client.js.map +1 -0
- package/dist/src/graphql/index.d.ts +2 -0
- package/dist/src/graphql/index.js +21 -0
- package/dist/src/graphql/index.js.map +1 -0
- package/dist/src/graphql/workItems.d.ts +659 -0
- package/dist/src/graphql/workItems.js +1545 -0
- package/dist/src/graphql/workItems.js.map +1 -0
- package/dist/src/handlers.d.ts +2 -0
- package/dist/src/handlers.js +346 -0
- package/dist/src/handlers.js.map +1 -0
- package/dist/src/http-client.d.ts +1 -0
- package/dist/src/http-client.js +9 -0
- package/dist/src/http-client.js.map +1 -0
- package/dist/src/logger.d.ts +9 -0
- package/dist/src/logger.js +129 -0
- package/dist/src/logger.js.map +1 -0
- package/dist/src/logging/access-log.d.ts +15 -0
- package/dist/src/logging/access-log.js +157 -0
- package/dist/src/logging/access-log.js.map +1 -0
- package/dist/src/logging/connection-tracker.d.ts +21 -0
- package/dist/src/logging/connection-tracker.js +106 -0
- package/dist/src/logging/connection-tracker.js.map +1 -0
- package/dist/src/logging/index.d.ts +5 -0
- package/dist/src/logging/index.js +27 -0
- package/dist/src/logging/index.js.map +1 -0
- package/dist/src/logging/request-tracker.d.ts +39 -0
- package/dist/src/logging/request-tracker.js +208 -0
- package/dist/src/logging/request-tracker.js.map +1 -0
- package/dist/src/logging/types.d.ts +55 -0
- package/dist/src/logging/types.js +5 -0
- package/dist/src/logging/types.js.map +1 -0
- package/dist/src/main.d.ts +2 -0
- package/dist/src/main.js +219 -0
- package/dist/src/main.js.map +1 -0
- package/dist/src/middleware/index.d.ts +2 -0
- package/dist/src/middleware/index.js +12 -0
- package/dist/src/middleware/index.js.map +1 -0
- package/dist/src/middleware/oauth-auth.d.ts +4 -0
- package/dist/src/middleware/oauth-auth.js +137 -0
- package/dist/src/middleware/oauth-auth.js.map +1 -0
- package/dist/src/middleware/rate-limiter.d.ts +11 -0
- package/dist/src/middleware/rate-limiter.js +183 -0
- package/dist/src/middleware/rate-limiter.js.map +1 -0
- package/dist/src/oauth/config.d.ts +25 -0
- package/dist/src/oauth/config.js +109 -0
- package/dist/src/oauth/config.js.map +1 -0
- package/dist/src/oauth/endpoints/authorize.d.ts +3 -0
- package/dist/src/oauth/endpoints/authorize.js +454 -0
- package/dist/src/oauth/endpoints/authorize.js.map +1 -0
- package/dist/src/oauth/endpoints/callback.d.ts +2 -0
- package/dist/src/oauth/endpoints/callback.js +134 -0
- package/dist/src/oauth/endpoints/callback.js.map +1 -0
- package/dist/src/oauth/endpoints/index.d.ts +5 -0
- package/dist/src/oauth/endpoints/index.js +19 -0
- package/dist/src/oauth/endpoints/index.js.map +1 -0
- package/dist/src/oauth/endpoints/metadata.d.ts +5 -0
- package/dist/src/oauth/endpoints/metadata.js +42 -0
- package/dist/src/oauth/endpoints/metadata.js.map +1 -0
- package/dist/src/oauth/endpoints/register.d.ts +15 -0
- package/dist/src/oauth/endpoints/register.js +85 -0
- package/dist/src/oauth/endpoints/register.js.map +1 -0
- package/dist/src/oauth/endpoints/token.d.ts +2 -0
- package/dist/src/oauth/endpoints/token.js +167 -0
- package/dist/src/oauth/endpoints/token.js.map +1 -0
- package/dist/src/oauth/gitlab-device-flow.d.ts +10 -0
- package/dist/src/oauth/gitlab-device-flow.js +215 -0
- package/dist/src/oauth/gitlab-device-flow.js.map +1 -0
- package/dist/src/oauth/index.d.ts +10 -0
- package/dist/src/oauth/index.js +69 -0
- package/dist/src/oauth/index.js.map +1 -0
- package/dist/src/oauth/session-store.d.ts +54 -0
- package/dist/src/oauth/session-store.js +311 -0
- package/dist/src/oauth/session-store.js.map +1 -0
- package/dist/src/oauth/storage/factory.d.ts +4 -0
- package/dist/src/oauth/storage/factory.js +73 -0
- package/dist/src/oauth/storage/factory.js.map +1 -0
- package/dist/src/oauth/storage/file.d.ts +48 -0
- package/dist/src/oauth/storage/file.js +307 -0
- package/dist/src/oauth/storage/file.js.map +1 -0
- package/dist/src/oauth/storage/index.d.ts +5 -0
- package/dist/src/oauth/storage/index.js +22 -0
- package/dist/src/oauth/storage/index.js.map +1 -0
- package/dist/src/oauth/storage/memory.d.ts +76 -0
- package/dist/src/oauth/storage/memory.js +280 -0
- package/dist/src/oauth/storage/memory.js.map +1 -0
- package/dist/src/oauth/storage/postgresql.d.ts +41 -0
- package/dist/src/oauth/storage/postgresql.js +444 -0
- package/dist/src/oauth/storage/postgresql.js.map +1 -0
- package/dist/src/oauth/storage/types.d.ts +66 -0
- package/dist/src/oauth/storage/types.js +5 -0
- package/dist/src/oauth/storage/types.js.map +1 -0
- package/dist/src/oauth/token-context.d.ts +10 -0
- package/dist/src/oauth/token-context.js +50 -0
- package/dist/src/oauth/token-context.js.map +1 -0
- package/dist/src/oauth/token-utils.d.ts +14 -0
- package/dist/src/oauth/token-utils.js +148 -0
- package/dist/src/oauth/token-utils.js.map +1 -0
- package/dist/src/oauth/types.d.ts +117 -0
- package/dist/src/oauth/types.js +3 -0
- package/dist/src/oauth/types.js.map +1 -0
- package/dist/src/profiles/applicator.d.ts +19 -0
- package/dist/src/profiles/applicator.js +256 -0
- package/dist/src/profiles/applicator.js.map +1 -0
- package/dist/src/profiles/builtin/admin.yaml +30 -0
- package/dist/src/profiles/builtin/ci.yaml +35 -0
- package/dist/src/profiles/builtin/code-reviewer.yaml +41 -0
- package/dist/src/profiles/builtin/developer.yaml +40 -0
- package/dist/src/profiles/builtin/devops.yaml +33 -0
- package/dist/src/profiles/builtin/full-access.yaml +29 -0
- package/dist/src/profiles/builtin/gitlab-com.yaml +40 -0
- package/dist/src/profiles/builtin/junior-dev.yaml +35 -0
- package/dist/src/profiles/builtin/pm.yaml +36 -0
- package/dist/src/profiles/builtin/readonly.yaml +33 -0
- package/dist/src/profiles/builtin/senior-dev.yaml +41 -0
- package/dist/src/profiles/builtin/team-lead.yaml +42 -0
- package/dist/src/profiles/index.d.ts +5 -0
- package/dist/src/profiles/index.js +34 -0
- package/dist/src/profiles/index.js.map +1 -0
- package/dist/src/profiles/loader.d.ts +32 -0
- package/dist/src/profiles/loader.js +319 -0
- package/dist/src/profiles/loader.js.map +1 -0
- package/dist/src/profiles/project-loader.d.ts +12 -0
- package/dist/src/profiles/project-loader.js +214 -0
- package/dist/src/profiles/project-loader.js.map +1 -0
- package/dist/src/profiles/scope-enforcer.d.ts +28 -0
- package/dist/src/profiles/scope-enforcer.js +236 -0
- package/dist/src/profiles/scope-enforcer.js.map +1 -0
- package/dist/src/profiles/types.d.ts +261 -0
- package/dist/src/profiles/types.js +153 -0
- package/dist/src/profiles/types.js.map +1 -0
- package/dist/src/registry-manager.d.ts +37 -0
- package/dist/src/registry-manager.js +488 -0
- package/dist/src/registry-manager.js.map +1 -0
- package/dist/src/server.d.ts +2 -0
- package/dist/src/server.js +624 -0
- package/dist/src/server.js.map +1 -0
- package/dist/src/services/ConnectionManager.d.ts +41 -0
- package/dist/src/services/ConnectionManager.js +438 -0
- package/dist/src/services/ConnectionManager.js.map +1 -0
- package/dist/src/services/GitLabVersionDetector.d.ts +52 -0
- package/dist/src/services/GitLabVersionDetector.js +215 -0
- package/dist/src/services/GitLabVersionDetector.js.map +1 -0
- package/dist/src/services/InstanceConnectionPool.d.ts +54 -0
- package/dist/src/services/InstanceConnectionPool.js +180 -0
- package/dist/src/services/InstanceConnectionPool.js.map +1 -0
- package/dist/src/services/InstanceRateLimiter.d.ts +35 -0
- package/dist/src/services/InstanceRateLimiter.js +131 -0
- package/dist/src/services/InstanceRateLimiter.js.map +1 -0
- package/dist/src/services/InstanceRegistry.d.ts +61 -0
- package/dist/src/services/InstanceRegistry.js +250 -0
- package/dist/src/services/InstanceRegistry.js.map +1 -0
- package/dist/src/services/NamespaceTierDetector.d.ts +9 -0
- package/dist/src/services/NamespaceTierDetector.js +249 -0
- package/dist/src/services/NamespaceTierDetector.js.map +1 -0
- package/dist/src/services/SchemaIntrospector.d.ts +39 -0
- package/dist/src/services/SchemaIntrospector.js +190 -0
- package/dist/src/services/SchemaIntrospector.js.map +1 -0
- package/dist/src/services/TokenScopeDetector.d.ts +35 -0
- package/dist/src/services/TokenScopeDetector.js +232 -0
- package/dist/src/services/TokenScopeDetector.js.map +1 -0
- package/dist/src/services/ToolAvailability.d.ts +32 -0
- package/dist/src/services/ToolAvailability.js +410 -0
- package/dist/src/services/ToolAvailability.js.map +1 -0
- package/dist/src/services/WidgetAvailability.d.ts +23 -0
- package/dist/src/services/WidgetAvailability.js +158 -0
- package/dist/src/services/WidgetAvailability.js.map +1 -0
- package/dist/src/session-manager.d.ts +19 -0
- package/dist/src/session-manager.js +131 -0
- package/dist/src/session-manager.js.map +1 -0
- package/dist/src/types.d.ts +28 -0
- package/dist/src/types.js +11 -0
- package/dist/src/types.js.map +1 -0
- package/dist/src/utils/description-utils.d.ts +2 -0
- package/dist/src/utils/description-utils.js +25 -0
- package/dist/src/utils/description-utils.js.map +1 -0
- package/dist/src/utils/error-handler.d.ts +93 -0
- package/dist/src/utils/error-handler.js +597 -0
- package/dist/src/utils/error-handler.js.map +1 -0
- package/dist/src/utils/fetch.d.ts +13 -0
- package/dist/src/utils/fetch.js +539 -0
- package/dist/src/utils/fetch.js.map +1 -0
- package/dist/src/utils/gitlab-api.d.ts +24 -0
- package/dist/src/utils/gitlab-api.js +139 -0
- package/dist/src/utils/gitlab-api.js.map +1 -0
- package/dist/src/utils/idConversion.d.ts +81 -0
- package/dist/src/utils/idConversion.js +193 -0
- package/dist/src/utils/idConversion.js.map +1 -0
- package/dist/src/utils/namespace.d.ts +7 -0
- package/dist/src/utils/namespace.js +59 -0
- package/dist/src/utils/namespace.js.map +1 -0
- package/dist/src/utils/projectIdentifier.d.ts +9 -0
- package/dist/src/utils/projectIdentifier.js +59 -0
- package/dist/src/utils/projectIdentifier.js.map +1 -0
- package/dist/src/utils/request-logger.d.ts +24 -0
- package/dist/src/utils/request-logger.js +55 -0
- package/dist/src/utils/request-logger.js.map +1 -0
- package/dist/src/utils/schema-utils.d.ts +31 -0
- package/dist/src/utils/schema-utils.js +288 -0
- package/dist/src/utils/schema-utils.js.map +1 -0
- package/dist/src/utils/smart-user-search.d.ts +33 -0
- package/dist/src/utils/smart-user-search.js +142 -0
- package/dist/src/utils/smart-user-search.js.map +1 -0
- package/dist/src/utils/version.d.ts +1 -0
- package/dist/src/utils/version.js +14 -0
- package/dist/src/utils/version.js.map +1 -0
- package/dist/src/utils/workItemTypes.d.ts +6 -0
- package/dist/src/utils/workItemTypes.js +14 -0
- package/dist/src/utils/workItemTypes.js.map +1 -0
- package/dist/tsconfig.build.tsbuildinfo +1 -0
- package/package.json +511 -0
|
@@ -0,0 +1,784 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.coreToolRegistry = void 0;
|
|
37
|
+
exports.getCoreReadOnlyToolNames = getCoreReadOnlyToolNames;
|
|
38
|
+
exports.getCoreToolDefinitions = getCoreToolDefinitions;
|
|
39
|
+
exports.getFilteredCoreTools = getFilteredCoreTools;
|
|
40
|
+
const z = __importStar(require("zod"));
|
|
41
|
+
const schema_readonly_1 = require("./schema-readonly");
|
|
42
|
+
const schema_1 = require("./schema");
|
|
43
|
+
const fetch_1 = require("../../utils/fetch");
|
|
44
|
+
const projectIdentifier_1 = require("../../utils/projectIdentifier");
|
|
45
|
+
const smart_user_search_1 = require("../../utils/smart-user-search");
|
|
46
|
+
const idConversion_1 = require("../../utils/idConversion");
|
|
47
|
+
const config_1 = require("../../config");
|
|
48
|
+
exports.coreToolRegistry = new Map([
|
|
49
|
+
[
|
|
50
|
+
"browse_projects",
|
|
51
|
+
{
|
|
52
|
+
name: "browse_projects",
|
|
53
|
+
description: "Find, list, or inspect GitLab projects. Actions: search (find by name/topic across GitLab), list (browse accessible projects or group projects), get (retrieve full project details). Related: manage_project to create/update/delete projects.",
|
|
54
|
+
inputSchema: z.toJSONSchema(schema_readonly_1.BrowseProjectsSchema),
|
|
55
|
+
handler: async (args) => {
|
|
56
|
+
const input = schema_readonly_1.BrowseProjectsSchema.parse(args);
|
|
57
|
+
if ((0, config_1.isActionDenied)("browse_projects", input.action)) {
|
|
58
|
+
throw new Error(`Action '${input.action}' is not allowed for browse_projects tool`);
|
|
59
|
+
}
|
|
60
|
+
switch (input.action) {
|
|
61
|
+
case "search": {
|
|
62
|
+
const { q, with_programming_language, visibility, order_by, sort, per_page, page } = input;
|
|
63
|
+
const queryParams = new URLSearchParams();
|
|
64
|
+
if (q) {
|
|
65
|
+
let finalSearchTerms = q;
|
|
66
|
+
const topicMatches = q.match(/topic:(\w+)/g);
|
|
67
|
+
if (topicMatches) {
|
|
68
|
+
const topics = topicMatches.map(match => match.replace("topic:", ""));
|
|
69
|
+
queryParams.set("topic", topics.join(","));
|
|
70
|
+
finalSearchTerms = finalSearchTerms.replace(/topic:\w+/g, "").trim();
|
|
71
|
+
}
|
|
72
|
+
if (finalSearchTerms) {
|
|
73
|
+
queryParams.set("search", finalSearchTerms);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
if (with_programming_language)
|
|
77
|
+
queryParams.set("with_programming_language", with_programming_language);
|
|
78
|
+
if (visibility)
|
|
79
|
+
queryParams.set("visibility", visibility);
|
|
80
|
+
if (order_by)
|
|
81
|
+
queryParams.set("order_by", order_by);
|
|
82
|
+
if (sort)
|
|
83
|
+
queryParams.set("sort", sort);
|
|
84
|
+
if (per_page)
|
|
85
|
+
queryParams.set("per_page", String(per_page));
|
|
86
|
+
if (page)
|
|
87
|
+
queryParams.set("page", String(page));
|
|
88
|
+
queryParams.set("active", "true");
|
|
89
|
+
const apiUrl = `${process.env.GITLAB_API_URL}/api/v4/projects?${queryParams}`;
|
|
90
|
+
const response = await (0, fetch_1.enhancedFetch)(apiUrl);
|
|
91
|
+
if (!response.ok) {
|
|
92
|
+
throw new Error(`GitLab API error: ${response.status} ${response.statusText}`);
|
|
93
|
+
}
|
|
94
|
+
const projects = await response.json();
|
|
95
|
+
return (0, idConversion_1.cleanGidsFromObject)(projects);
|
|
96
|
+
}
|
|
97
|
+
case "list": {
|
|
98
|
+
const { group_id, search, owned, starred, membership, simple, with_programming_language, include_subgroups, with_shared, visibility, archived, order_by, sort, per_page, page, } = input;
|
|
99
|
+
const queryParams = new URLSearchParams();
|
|
100
|
+
if (visibility)
|
|
101
|
+
queryParams.set("visibility", visibility);
|
|
102
|
+
if (archived !== undefined)
|
|
103
|
+
queryParams.set("archived", String(archived));
|
|
104
|
+
if (owned !== undefined)
|
|
105
|
+
queryParams.set("owned", String(owned));
|
|
106
|
+
if (starred !== undefined)
|
|
107
|
+
queryParams.set("starred", String(starred));
|
|
108
|
+
if (membership !== undefined)
|
|
109
|
+
queryParams.set("membership", String(membership));
|
|
110
|
+
if (search)
|
|
111
|
+
queryParams.set("search", search);
|
|
112
|
+
if (simple !== undefined)
|
|
113
|
+
queryParams.set("simple", String(simple));
|
|
114
|
+
if (order_by)
|
|
115
|
+
queryParams.set("order_by", order_by);
|
|
116
|
+
if (sort)
|
|
117
|
+
queryParams.set("sort", sort);
|
|
118
|
+
if (per_page)
|
|
119
|
+
queryParams.set("per_page", String(per_page));
|
|
120
|
+
if (page)
|
|
121
|
+
queryParams.set("page", String(page));
|
|
122
|
+
if (include_subgroups !== undefined)
|
|
123
|
+
queryParams.set("include_subgroups", String(include_subgroups));
|
|
124
|
+
if (with_shared !== undefined)
|
|
125
|
+
queryParams.set("with_shared", String(with_shared));
|
|
126
|
+
if (with_programming_language)
|
|
127
|
+
queryParams.set("with_programming_language", with_programming_language);
|
|
128
|
+
if (!queryParams.has("order_by"))
|
|
129
|
+
queryParams.set("order_by", "created_at");
|
|
130
|
+
if (!queryParams.has("sort"))
|
|
131
|
+
queryParams.set("sort", "desc");
|
|
132
|
+
if (!queryParams.has("simple"))
|
|
133
|
+
queryParams.set("simple", "true");
|
|
134
|
+
if (!queryParams.has("per_page"))
|
|
135
|
+
queryParams.set("per_page", "20");
|
|
136
|
+
let apiUrl;
|
|
137
|
+
if (group_id) {
|
|
138
|
+
apiUrl = `${process.env.GITLAB_API_URL}/api/v4/groups/${encodeURIComponent(group_id)}/projects?${queryParams}`;
|
|
139
|
+
}
|
|
140
|
+
else {
|
|
141
|
+
queryParams.set("active", "true");
|
|
142
|
+
apiUrl = `${process.env.GITLAB_API_URL}/api/v4/projects?${queryParams}`;
|
|
143
|
+
}
|
|
144
|
+
const response = await (0, fetch_1.enhancedFetch)(apiUrl);
|
|
145
|
+
if (!response.ok) {
|
|
146
|
+
throw new Error(`GitLab API error: ${response.status} ${response.statusText}`);
|
|
147
|
+
}
|
|
148
|
+
const projects = await response.json();
|
|
149
|
+
return (0, idConversion_1.cleanGidsFromObject)(projects);
|
|
150
|
+
}
|
|
151
|
+
case "get": {
|
|
152
|
+
const { project_id, statistics, license } = input;
|
|
153
|
+
const queryParams = new URLSearchParams();
|
|
154
|
+
if (statistics)
|
|
155
|
+
queryParams.set("statistics", "true");
|
|
156
|
+
if (license)
|
|
157
|
+
queryParams.set("license", "true");
|
|
158
|
+
const apiUrl = `${process.env.GITLAB_API_URL}/api/v4/projects/${(0, projectIdentifier_1.normalizeProjectId)(project_id)}?${queryParams}`;
|
|
159
|
+
const response = await (0, fetch_1.enhancedFetch)(apiUrl);
|
|
160
|
+
if (!response.ok) {
|
|
161
|
+
throw new Error(`GitLab API error: ${response.status} ${response.statusText}`);
|
|
162
|
+
}
|
|
163
|
+
const project = await response.json();
|
|
164
|
+
return (0, idConversion_1.cleanGidsFromObject)(project);
|
|
165
|
+
}
|
|
166
|
+
default:
|
|
167
|
+
throw new Error(`Unknown action: ${input.action}`);
|
|
168
|
+
}
|
|
169
|
+
},
|
|
170
|
+
},
|
|
171
|
+
],
|
|
172
|
+
[
|
|
173
|
+
"browse_namespaces",
|
|
174
|
+
{
|
|
175
|
+
name: "browse_namespaces",
|
|
176
|
+
description: "Explore GitLab groups and user namespaces. Actions: list (discover available namespaces), get (retrieve details with storage stats), verify (check if path exists). Related: manage_namespace to create/update/delete groups.",
|
|
177
|
+
inputSchema: z.toJSONSchema(schema_readonly_1.BrowseNamespacesSchema),
|
|
178
|
+
handler: async (args) => {
|
|
179
|
+
const input = schema_readonly_1.BrowseNamespacesSchema.parse(args);
|
|
180
|
+
if ((0, config_1.isActionDenied)("browse_namespaces", input.action)) {
|
|
181
|
+
throw new Error(`Action '${input.action}' is not allowed for browse_namespaces tool`);
|
|
182
|
+
}
|
|
183
|
+
switch (input.action) {
|
|
184
|
+
case "list": {
|
|
185
|
+
const { search, owned_only, top_level_only, with_statistics, min_access_level, per_page, page, } = input;
|
|
186
|
+
const queryParams = new URLSearchParams();
|
|
187
|
+
if (search)
|
|
188
|
+
queryParams.set("search", search);
|
|
189
|
+
if (owned_only !== undefined)
|
|
190
|
+
queryParams.set("owned_only", String(owned_only));
|
|
191
|
+
if (top_level_only !== undefined)
|
|
192
|
+
queryParams.set("top_level_only", String(top_level_only));
|
|
193
|
+
if (with_statistics !== undefined)
|
|
194
|
+
queryParams.set("with_statistics", String(with_statistics));
|
|
195
|
+
if (min_access_level !== undefined)
|
|
196
|
+
queryParams.set("min_access_level", String(min_access_level));
|
|
197
|
+
if (per_page)
|
|
198
|
+
queryParams.set("per_page", String(per_page));
|
|
199
|
+
if (page)
|
|
200
|
+
queryParams.set("page", String(page));
|
|
201
|
+
const apiUrl = `${process.env.GITLAB_API_URL}/api/v4/namespaces?${queryParams}`;
|
|
202
|
+
const response = await (0, fetch_1.enhancedFetch)(apiUrl);
|
|
203
|
+
if (!response.ok) {
|
|
204
|
+
throw new Error(`GitLab API error: ${response.status} ${response.statusText}`);
|
|
205
|
+
}
|
|
206
|
+
const namespaces = await response.json();
|
|
207
|
+
return (0, idConversion_1.cleanGidsFromObject)(namespaces);
|
|
208
|
+
}
|
|
209
|
+
case "get": {
|
|
210
|
+
const { namespace_id } = input;
|
|
211
|
+
const apiUrl = `${process.env.GITLAB_API_URL}/api/v4/namespaces/${encodeURIComponent(namespace_id)}`;
|
|
212
|
+
const response = await (0, fetch_1.enhancedFetch)(apiUrl);
|
|
213
|
+
if (!response.ok) {
|
|
214
|
+
throw new Error(`GitLab API error: ${response.status} ${response.statusText}`);
|
|
215
|
+
}
|
|
216
|
+
const namespace = await response.json();
|
|
217
|
+
return (0, idConversion_1.cleanGidsFromObject)(namespace);
|
|
218
|
+
}
|
|
219
|
+
case "verify": {
|
|
220
|
+
const { namespace_id } = input;
|
|
221
|
+
const apiUrl = `${process.env.GITLAB_API_URL}/api/v4/namespaces/${encodeURIComponent(namespace_id)}`;
|
|
222
|
+
const response = await (0, fetch_1.enhancedFetch)(apiUrl);
|
|
223
|
+
return {
|
|
224
|
+
exists: response.ok,
|
|
225
|
+
status: response.status,
|
|
226
|
+
namespace: namespace_id,
|
|
227
|
+
data: response.ok ? await response.json() : null,
|
|
228
|
+
};
|
|
229
|
+
}
|
|
230
|
+
default:
|
|
231
|
+
throw new Error(`Unknown action: ${input.action}`);
|
|
232
|
+
}
|
|
233
|
+
},
|
|
234
|
+
},
|
|
235
|
+
],
|
|
236
|
+
[
|
|
237
|
+
"browse_commits",
|
|
238
|
+
{
|
|
239
|
+
name: "browse_commits",
|
|
240
|
+
description: "Explore repository commit history and diffs. Actions: list (browse commits with filters), get (retrieve commit metadata and stats), diff (view code changes). Related: browse_refs for branch/tag info.",
|
|
241
|
+
inputSchema: z.toJSONSchema(schema_readonly_1.BrowseCommitsSchema),
|
|
242
|
+
handler: async (args) => {
|
|
243
|
+
const input = schema_readonly_1.BrowseCommitsSchema.parse(args);
|
|
244
|
+
if ((0, config_1.isActionDenied)("browse_commits", input.action)) {
|
|
245
|
+
throw new Error(`Action '${input.action}' is not allowed for browse_commits tool`);
|
|
246
|
+
}
|
|
247
|
+
switch (input.action) {
|
|
248
|
+
case "list": {
|
|
249
|
+
const { project_id, ref_name, since, until, path, author, all, with_stats, first_parent, order, trailers, per_page, page, } = input;
|
|
250
|
+
const queryParams = new URLSearchParams();
|
|
251
|
+
if (ref_name)
|
|
252
|
+
queryParams.set("ref_name", ref_name);
|
|
253
|
+
if (since)
|
|
254
|
+
queryParams.set("since", since);
|
|
255
|
+
if (until)
|
|
256
|
+
queryParams.set("until", until);
|
|
257
|
+
if (path)
|
|
258
|
+
queryParams.set("path", path);
|
|
259
|
+
if (author)
|
|
260
|
+
queryParams.set("author", author);
|
|
261
|
+
if (all !== undefined)
|
|
262
|
+
queryParams.set("all", String(all));
|
|
263
|
+
if (with_stats !== undefined)
|
|
264
|
+
queryParams.set("with_stats", String(with_stats));
|
|
265
|
+
if (first_parent !== undefined)
|
|
266
|
+
queryParams.set("first_parent", String(first_parent));
|
|
267
|
+
if (order)
|
|
268
|
+
queryParams.set("order", order);
|
|
269
|
+
if (trailers !== undefined)
|
|
270
|
+
queryParams.set("trailers", String(trailers));
|
|
271
|
+
if (per_page)
|
|
272
|
+
queryParams.set("per_page", String(per_page));
|
|
273
|
+
if (page)
|
|
274
|
+
queryParams.set("page", String(page));
|
|
275
|
+
const apiUrl = `${process.env.GITLAB_API_URL}/api/v4/projects/${encodeURIComponent(project_id)}/repository/commits?${queryParams}`;
|
|
276
|
+
const response = await (0, fetch_1.enhancedFetch)(apiUrl);
|
|
277
|
+
if (!response.ok) {
|
|
278
|
+
throw new Error(`GitLab API error: ${response.status} ${response.statusText}`);
|
|
279
|
+
}
|
|
280
|
+
return await response.json();
|
|
281
|
+
}
|
|
282
|
+
case "get": {
|
|
283
|
+
const { project_id, sha, stats } = input;
|
|
284
|
+
const queryParams = new URLSearchParams();
|
|
285
|
+
if (stats)
|
|
286
|
+
queryParams.set("stats", "true");
|
|
287
|
+
const apiUrl = `${process.env.GITLAB_API_URL}/api/v4/projects/${encodeURIComponent(project_id)}/repository/commits/${encodeURIComponent(sha)}?${queryParams}`;
|
|
288
|
+
const response = await (0, fetch_1.enhancedFetch)(apiUrl);
|
|
289
|
+
if (!response.ok) {
|
|
290
|
+
throw new Error(`GitLab API error: ${response.status} ${response.statusText}`);
|
|
291
|
+
}
|
|
292
|
+
return await response.json();
|
|
293
|
+
}
|
|
294
|
+
case "diff": {
|
|
295
|
+
const { project_id, sha, unidiff, per_page, page } = input;
|
|
296
|
+
const queryParams = new URLSearchParams();
|
|
297
|
+
if (unidiff)
|
|
298
|
+
queryParams.set("unidiff", "true");
|
|
299
|
+
if (per_page)
|
|
300
|
+
queryParams.set("per_page", String(per_page));
|
|
301
|
+
if (page)
|
|
302
|
+
queryParams.set("page", String(page));
|
|
303
|
+
const apiUrl = `${process.env.GITLAB_API_URL}/api/v4/projects/${encodeURIComponent(project_id)}/repository/commits/${encodeURIComponent(sha)}/diff?${queryParams}`;
|
|
304
|
+
const response = await (0, fetch_1.enhancedFetch)(apiUrl);
|
|
305
|
+
if (!response.ok) {
|
|
306
|
+
throw new Error(`GitLab API error: ${response.status} ${response.statusText}`);
|
|
307
|
+
}
|
|
308
|
+
return await response.json();
|
|
309
|
+
}
|
|
310
|
+
default:
|
|
311
|
+
throw new Error(`Unknown action: ${input.action}`);
|
|
312
|
+
}
|
|
313
|
+
},
|
|
314
|
+
},
|
|
315
|
+
],
|
|
316
|
+
[
|
|
317
|
+
"browse_events",
|
|
318
|
+
{
|
|
319
|
+
name: "browse_events",
|
|
320
|
+
description: "Track GitLab activity and events. Actions: user (your activity across all projects), project (specific project activity feed). Filter by date range, action type, or target type.",
|
|
321
|
+
inputSchema: z.toJSONSchema(schema_readonly_1.BrowseEventsSchema),
|
|
322
|
+
handler: async (args) => {
|
|
323
|
+
const input = schema_readonly_1.BrowseEventsSchema.parse(args);
|
|
324
|
+
if ((0, config_1.isActionDenied)("browse_events", input.action)) {
|
|
325
|
+
throw new Error(`Action '${input.action}' is not allowed for browse_events tool`);
|
|
326
|
+
}
|
|
327
|
+
const buildQueryParams = (opts) => {
|
|
328
|
+
const queryParams = new URLSearchParams();
|
|
329
|
+
if (opts.target_type)
|
|
330
|
+
queryParams.set("target_type", opts.target_type);
|
|
331
|
+
if (opts.event_action)
|
|
332
|
+
queryParams.set("action", opts.event_action);
|
|
333
|
+
if (opts.before)
|
|
334
|
+
queryParams.set("before", opts.before);
|
|
335
|
+
if (opts.after)
|
|
336
|
+
queryParams.set("after", opts.after);
|
|
337
|
+
if (opts.sort)
|
|
338
|
+
queryParams.set("sort", opts.sort);
|
|
339
|
+
if (opts.per_page)
|
|
340
|
+
queryParams.set("per_page", String(opts.per_page));
|
|
341
|
+
if (opts.page)
|
|
342
|
+
queryParams.set("page", String(opts.page));
|
|
343
|
+
return queryParams;
|
|
344
|
+
};
|
|
345
|
+
switch (input.action) {
|
|
346
|
+
case "user": {
|
|
347
|
+
const queryParams = buildQueryParams(input);
|
|
348
|
+
const apiUrl = `${process.env.GITLAB_API_URL}/api/v4/events?${queryParams}`;
|
|
349
|
+
const response = await (0, fetch_1.enhancedFetch)(apiUrl);
|
|
350
|
+
if (!response.ok) {
|
|
351
|
+
throw new Error(`GitLab API error: ${response.status} ${response.statusText}`);
|
|
352
|
+
}
|
|
353
|
+
return await response.json();
|
|
354
|
+
}
|
|
355
|
+
case "project": {
|
|
356
|
+
const { project_id } = input;
|
|
357
|
+
const queryParams = buildQueryParams(input);
|
|
358
|
+
const apiUrl = `${process.env.GITLAB_API_URL}/api/v4/projects/${encodeURIComponent(project_id)}/events?${queryParams}`;
|
|
359
|
+
const response = await (0, fetch_1.enhancedFetch)(apiUrl);
|
|
360
|
+
if (!response.ok) {
|
|
361
|
+
throw new Error(`GitLab API error: ${response.status} ${response.statusText}`);
|
|
362
|
+
}
|
|
363
|
+
return await response.json();
|
|
364
|
+
}
|
|
365
|
+
default:
|
|
366
|
+
throw new Error(`Unknown action: ${input.action}`);
|
|
367
|
+
}
|
|
368
|
+
},
|
|
369
|
+
},
|
|
370
|
+
],
|
|
371
|
+
[
|
|
372
|
+
"browse_users",
|
|
373
|
+
{
|
|
374
|
+
name: "browse_users",
|
|
375
|
+
description: "Find GitLab users with smart pattern detection. Actions: search (find users by name/email/username with transliteration support), get (retrieve specific user by ID). Related: browse_members for project/group membership.",
|
|
376
|
+
inputSchema: z.toJSONSchema(schema_readonly_1.BrowseUsersSchema),
|
|
377
|
+
handler: async (args) => {
|
|
378
|
+
const input = schema_readonly_1.BrowseUsersSchema.parse(args);
|
|
379
|
+
if ((0, config_1.isActionDenied)("browse_users", input.action)) {
|
|
380
|
+
throw new Error(`Action '${input.action}' is not allowed for browse_users tool`);
|
|
381
|
+
}
|
|
382
|
+
switch (input.action) {
|
|
383
|
+
case "search": {
|
|
384
|
+
const { smart_search, search, username, public_email, ...otherParams } = input;
|
|
385
|
+
const hasUsernameOrEmail = Boolean(username) || Boolean(public_email);
|
|
386
|
+
const hasOnlySearch = Boolean(search) && !hasUsernameOrEmail;
|
|
387
|
+
const shouldUseSmartSearch = smart_search === false ? false : smart_search === true || hasOnlySearch;
|
|
388
|
+
if (shouldUseSmartSearch && (search || username || public_email)) {
|
|
389
|
+
const query = search ?? username ?? public_email ?? "";
|
|
390
|
+
const additionalParams = {};
|
|
391
|
+
Object.entries(otherParams).forEach(([key, value]) => {
|
|
392
|
+
if (value !== undefined && key !== "smart_search" && key !== "action") {
|
|
393
|
+
additionalParams[key] = value;
|
|
394
|
+
}
|
|
395
|
+
});
|
|
396
|
+
return await (0, smart_user_search_1.smartUserSearch)(query, additionalParams);
|
|
397
|
+
}
|
|
398
|
+
else {
|
|
399
|
+
const queryParams = new URLSearchParams();
|
|
400
|
+
Object.entries(input).forEach(([key, value]) => {
|
|
401
|
+
if (value !== undefined && key !== "smart_search" && key !== "action") {
|
|
402
|
+
queryParams.set(key, String(value));
|
|
403
|
+
}
|
|
404
|
+
});
|
|
405
|
+
const apiUrl = `${process.env.GITLAB_API_URL}/api/v4/users?${queryParams}`;
|
|
406
|
+
const response = await (0, fetch_1.enhancedFetch)(apiUrl);
|
|
407
|
+
if (!response.ok) {
|
|
408
|
+
throw new Error(`GitLab API error: ${response.status} ${response.statusText}`);
|
|
409
|
+
}
|
|
410
|
+
const users = await response.json();
|
|
411
|
+
return (0, idConversion_1.cleanGidsFromObject)(users);
|
|
412
|
+
}
|
|
413
|
+
}
|
|
414
|
+
case "get": {
|
|
415
|
+
const { user_id } = input;
|
|
416
|
+
const apiUrl = `${process.env.GITLAB_API_URL}/api/v4/users/${encodeURIComponent(user_id)}`;
|
|
417
|
+
const response = await (0, fetch_1.enhancedFetch)(apiUrl);
|
|
418
|
+
if (!response.ok) {
|
|
419
|
+
throw new Error(`GitLab API error: ${response.status} ${response.statusText}`);
|
|
420
|
+
}
|
|
421
|
+
const user = await response.json();
|
|
422
|
+
return (0, idConversion_1.cleanGidsFromObject)(user);
|
|
423
|
+
}
|
|
424
|
+
default:
|
|
425
|
+
throw new Error(`Unknown action: ${input.action}`);
|
|
426
|
+
}
|
|
427
|
+
},
|
|
428
|
+
},
|
|
429
|
+
],
|
|
430
|
+
[
|
|
431
|
+
"browse_todos",
|
|
432
|
+
{
|
|
433
|
+
name: "browse_todos",
|
|
434
|
+
description: "View your GitLab todo queue (notifications requiring action). Actions: list (filter by state, action type, target type). Todos are auto-created for assignments, mentions, reviews, and pipeline failures. Related: manage_todos to mark done/restore.",
|
|
435
|
+
inputSchema: z.toJSONSchema(schema_readonly_1.BrowseTodosSchema),
|
|
436
|
+
handler: async (args) => {
|
|
437
|
+
const input = schema_readonly_1.BrowseTodosSchema.parse(args);
|
|
438
|
+
if ((0, config_1.isActionDenied)("browse_todos", input.action)) {
|
|
439
|
+
throw new Error(`Action '${input.action}' is not allowed for browse_todos tool`);
|
|
440
|
+
}
|
|
441
|
+
switch (input.action) {
|
|
442
|
+
case "list": {
|
|
443
|
+
const queryParams = new URLSearchParams();
|
|
444
|
+
const { action: _action, todo_action, ...rest } = input;
|
|
445
|
+
if (todo_action)
|
|
446
|
+
queryParams.set("action", todo_action);
|
|
447
|
+
Object.entries(rest).forEach(([key, value]) => {
|
|
448
|
+
if (value !== undefined) {
|
|
449
|
+
queryParams.set(key, String(value));
|
|
450
|
+
}
|
|
451
|
+
});
|
|
452
|
+
const apiUrl = `${process.env.GITLAB_API_URL}/api/v4/todos?${queryParams}`;
|
|
453
|
+
const response = await (0, fetch_1.enhancedFetch)(apiUrl);
|
|
454
|
+
if (!response.ok) {
|
|
455
|
+
throw new Error(`GitLab API error: ${response.status} ${response.statusText}`);
|
|
456
|
+
}
|
|
457
|
+
const todos = await response.json();
|
|
458
|
+
return (0, idConversion_1.cleanGidsFromObject)(todos);
|
|
459
|
+
}
|
|
460
|
+
default:
|
|
461
|
+
throw new Error(`Unknown action: ${input.action}`);
|
|
462
|
+
}
|
|
463
|
+
},
|
|
464
|
+
},
|
|
465
|
+
],
|
|
466
|
+
[
|
|
467
|
+
"manage_project",
|
|
468
|
+
{
|
|
469
|
+
name: "manage_project",
|
|
470
|
+
description: "Create, update, or manage GitLab projects. Actions: create (new project with settings), fork (copy existing project), update (modify settings), delete (remove permanently), archive/unarchive (toggle read-only), transfer (move to different namespace). Related: browse_projects for discovery.",
|
|
471
|
+
inputSchema: z.toJSONSchema(schema_1.ManageProjectSchema),
|
|
472
|
+
handler: async (args) => {
|
|
473
|
+
const input = schema_1.ManageProjectSchema.parse(args);
|
|
474
|
+
if ((0, config_1.isActionDenied)("manage_project", input.action)) {
|
|
475
|
+
throw new Error(`Action '${input.action}' is not allowed for manage_project tool`);
|
|
476
|
+
}
|
|
477
|
+
switch (input.action) {
|
|
478
|
+
case "create": {
|
|
479
|
+
const { name, namespace, description, visibility, initialize_with_readme, issues_enabled, merge_requests_enabled, jobs_enabled, wiki_enabled, snippets_enabled, lfs_enabled, request_access_enabled, only_allow_merge_if_pipeline_succeeds, only_allow_merge_if_all_discussions_are_resolved, } = input;
|
|
480
|
+
let namespaceId;
|
|
481
|
+
let resolvedNamespace = null;
|
|
482
|
+
if (namespace) {
|
|
483
|
+
const namespaceApiUrl = `${process.env.GITLAB_API_URL}/api/v4/namespaces/${encodeURIComponent(namespace)}`;
|
|
484
|
+
const namespaceResponse = await (0, fetch_1.enhancedFetch)(namespaceApiUrl);
|
|
485
|
+
if (namespaceResponse.ok) {
|
|
486
|
+
resolvedNamespace = (await namespaceResponse.json());
|
|
487
|
+
namespaceId = String(resolvedNamespace.id);
|
|
488
|
+
}
|
|
489
|
+
else {
|
|
490
|
+
throw new Error(`Namespace '${namespace}' not found or not accessible`);
|
|
491
|
+
}
|
|
492
|
+
}
|
|
493
|
+
const targetNamespacePath = resolvedNamespace
|
|
494
|
+
? resolvedNamespace.full_path
|
|
495
|
+
: "current-user";
|
|
496
|
+
const projectPath = `${targetNamespacePath}/${name}`;
|
|
497
|
+
const checkProjectUrl = `${process.env.GITLAB_API_URL}/api/v4/projects/${encodeURIComponent(projectPath)}`;
|
|
498
|
+
const checkResponse = await (0, fetch_1.enhancedFetch)(checkProjectUrl);
|
|
499
|
+
if (checkResponse.ok) {
|
|
500
|
+
const existingProject = (await checkResponse.json());
|
|
501
|
+
throw new Error(`Project '${projectPath}' already exists (ID: ${existingProject.id}).`);
|
|
502
|
+
}
|
|
503
|
+
const body = new URLSearchParams();
|
|
504
|
+
body.set("name", name);
|
|
505
|
+
const generatedPath = name
|
|
506
|
+
.toLowerCase()
|
|
507
|
+
.replace(/[^a-z0-9-]/g, "-")
|
|
508
|
+
.replace(/-+/g, "-")
|
|
509
|
+
.replace(/^-|-$/g, "");
|
|
510
|
+
body.set("path", generatedPath);
|
|
511
|
+
if (namespaceId)
|
|
512
|
+
body.set("namespace_id", namespaceId);
|
|
513
|
+
if (description)
|
|
514
|
+
body.set("description", description);
|
|
515
|
+
if (visibility)
|
|
516
|
+
body.set("visibility", visibility);
|
|
517
|
+
if (initialize_with_readme)
|
|
518
|
+
body.set("initialize_with_readme", "true");
|
|
519
|
+
if (issues_enabled !== undefined)
|
|
520
|
+
body.set("issues_enabled", String(issues_enabled));
|
|
521
|
+
if (merge_requests_enabled !== undefined)
|
|
522
|
+
body.set("merge_requests_enabled", String(merge_requests_enabled));
|
|
523
|
+
if (jobs_enabled !== undefined)
|
|
524
|
+
body.set("jobs_enabled", String(jobs_enabled));
|
|
525
|
+
if (wiki_enabled !== undefined)
|
|
526
|
+
body.set("wiki_enabled", String(wiki_enabled));
|
|
527
|
+
if (snippets_enabled !== undefined)
|
|
528
|
+
body.set("snippets_enabled", String(snippets_enabled));
|
|
529
|
+
if (lfs_enabled !== undefined)
|
|
530
|
+
body.set("lfs_enabled", String(lfs_enabled));
|
|
531
|
+
if (request_access_enabled !== undefined)
|
|
532
|
+
body.set("request_access_enabled", String(request_access_enabled));
|
|
533
|
+
if (only_allow_merge_if_pipeline_succeeds !== undefined)
|
|
534
|
+
body.set("only_allow_merge_if_pipeline_succeeds", String(only_allow_merge_if_pipeline_succeeds));
|
|
535
|
+
if (only_allow_merge_if_all_discussions_are_resolved !== undefined)
|
|
536
|
+
body.set("only_allow_merge_if_all_discussions_are_resolved", String(only_allow_merge_if_all_discussions_are_resolved));
|
|
537
|
+
const createApiUrl = `${process.env.GITLAB_API_URL}/api/v4/projects`;
|
|
538
|
+
const createResponse = await (0, fetch_1.enhancedFetch)(createApiUrl, {
|
|
539
|
+
method: "POST",
|
|
540
|
+
headers: { "Content-Type": "application/x-www-form-urlencoded" },
|
|
541
|
+
body: body.toString(),
|
|
542
|
+
});
|
|
543
|
+
if (!createResponse.ok) {
|
|
544
|
+
throw new Error(`GitLab API error: ${createResponse.status} ${createResponse.statusText}`);
|
|
545
|
+
}
|
|
546
|
+
const project = await createResponse.json();
|
|
547
|
+
return {
|
|
548
|
+
...project,
|
|
549
|
+
validation: {
|
|
550
|
+
namespace_resolved: namespace ? `${namespace} -> ${namespaceId}` : "current-user",
|
|
551
|
+
generated_path: generatedPath,
|
|
552
|
+
},
|
|
553
|
+
};
|
|
554
|
+
}
|
|
555
|
+
case "fork": {
|
|
556
|
+
const { project_id, namespace, namespace_path, fork_name, fork_path } = input;
|
|
557
|
+
const body = new URLSearchParams();
|
|
558
|
+
if (namespace)
|
|
559
|
+
body.set("namespace", namespace);
|
|
560
|
+
if (namespace_path)
|
|
561
|
+
body.set("namespace_path", namespace_path);
|
|
562
|
+
if (fork_name)
|
|
563
|
+
body.set("name", fork_name);
|
|
564
|
+
if (fork_path)
|
|
565
|
+
body.set("path", fork_path);
|
|
566
|
+
const apiUrl = `${process.env.GITLAB_API_URL}/api/v4/projects/${encodeURIComponent(project_id)}/fork`;
|
|
567
|
+
const response = await (0, fetch_1.enhancedFetch)(apiUrl, {
|
|
568
|
+
method: "POST",
|
|
569
|
+
headers: { "Content-Type": "application/x-www-form-urlencoded" },
|
|
570
|
+
body: body.toString(),
|
|
571
|
+
});
|
|
572
|
+
if (!response.ok) {
|
|
573
|
+
throw new Error(`GitLab API error: ${response.status} ${response.statusText}`);
|
|
574
|
+
}
|
|
575
|
+
return await response.json();
|
|
576
|
+
}
|
|
577
|
+
case "update": {
|
|
578
|
+
const { project_id, action: _action, ...updateParams } = input;
|
|
579
|
+
const body = new URLSearchParams();
|
|
580
|
+
Object.entries(updateParams).forEach(([key, value]) => {
|
|
581
|
+
if (value !== undefined) {
|
|
582
|
+
body.set(key, String(value));
|
|
583
|
+
}
|
|
584
|
+
});
|
|
585
|
+
const apiUrl = `${process.env.GITLAB_API_URL}/api/v4/projects/${(0, projectIdentifier_1.normalizeProjectId)(project_id)}`;
|
|
586
|
+
const response = await (0, fetch_1.enhancedFetch)(apiUrl, {
|
|
587
|
+
method: "PUT",
|
|
588
|
+
headers: { "Content-Type": "application/x-www-form-urlencoded" },
|
|
589
|
+
body: body.toString(),
|
|
590
|
+
});
|
|
591
|
+
if (!response.ok) {
|
|
592
|
+
throw new Error(`GitLab API error: ${response.status} ${response.statusText}`);
|
|
593
|
+
}
|
|
594
|
+
return await response.json();
|
|
595
|
+
}
|
|
596
|
+
case "delete": {
|
|
597
|
+
const { project_id } = input;
|
|
598
|
+
const apiUrl = `${process.env.GITLAB_API_URL}/api/v4/projects/${(0, projectIdentifier_1.normalizeProjectId)(project_id)}`;
|
|
599
|
+
const response = await (0, fetch_1.enhancedFetch)(apiUrl, { method: "DELETE" });
|
|
600
|
+
if (!response.ok) {
|
|
601
|
+
throw new Error(`GitLab API error: ${response.status} ${response.statusText}`);
|
|
602
|
+
}
|
|
603
|
+
return { success: true, message: `Project ${project_id} deleted` };
|
|
604
|
+
}
|
|
605
|
+
case "archive": {
|
|
606
|
+
const { project_id } = input;
|
|
607
|
+
const apiUrl = `${process.env.GITLAB_API_URL}/api/v4/projects/${(0, projectIdentifier_1.normalizeProjectId)(project_id)}/archive`;
|
|
608
|
+
const response = await (0, fetch_1.enhancedFetch)(apiUrl, { method: "POST" });
|
|
609
|
+
if (!response.ok) {
|
|
610
|
+
throw new Error(`GitLab API error: ${response.status} ${response.statusText}`);
|
|
611
|
+
}
|
|
612
|
+
return await response.json();
|
|
613
|
+
}
|
|
614
|
+
case "unarchive": {
|
|
615
|
+
const { project_id } = input;
|
|
616
|
+
const apiUrl = `${process.env.GITLAB_API_URL}/api/v4/projects/${(0, projectIdentifier_1.normalizeProjectId)(project_id)}/unarchive`;
|
|
617
|
+
const response = await (0, fetch_1.enhancedFetch)(apiUrl, { method: "POST" });
|
|
618
|
+
if (!response.ok) {
|
|
619
|
+
throw new Error(`GitLab API error: ${response.status} ${response.statusText}`);
|
|
620
|
+
}
|
|
621
|
+
return await response.json();
|
|
622
|
+
}
|
|
623
|
+
case "transfer": {
|
|
624
|
+
const { project_id, namespace } = input;
|
|
625
|
+
const body = new URLSearchParams();
|
|
626
|
+
body.set("namespace", namespace);
|
|
627
|
+
const apiUrl = `${process.env.GITLAB_API_URL}/api/v4/projects/${(0, projectIdentifier_1.normalizeProjectId)(project_id)}/transfer`;
|
|
628
|
+
const response = await (0, fetch_1.enhancedFetch)(apiUrl, {
|
|
629
|
+
method: "PUT",
|
|
630
|
+
headers: { "Content-Type": "application/x-www-form-urlencoded" },
|
|
631
|
+
body: body.toString(),
|
|
632
|
+
});
|
|
633
|
+
if (!response.ok) {
|
|
634
|
+
throw new Error(`GitLab API error: ${response.status} ${response.statusText}`);
|
|
635
|
+
}
|
|
636
|
+
return await response.json();
|
|
637
|
+
}
|
|
638
|
+
default:
|
|
639
|
+
throw new Error(`Unknown action: ${input.action}`);
|
|
640
|
+
}
|
|
641
|
+
},
|
|
642
|
+
},
|
|
643
|
+
],
|
|
644
|
+
[
|
|
645
|
+
"manage_namespace",
|
|
646
|
+
{
|
|
647
|
+
name: "manage_namespace",
|
|
648
|
+
description: "Create, update, or delete GitLab groups/namespaces. Actions: create (new group with visibility/settings), update (modify group settings), delete (remove permanently). Related: browse_namespaces for discovery.",
|
|
649
|
+
inputSchema: z.toJSONSchema(schema_1.ManageNamespaceSchema),
|
|
650
|
+
handler: async (args) => {
|
|
651
|
+
const input = schema_1.ManageNamespaceSchema.parse(args);
|
|
652
|
+
if ((0, config_1.isActionDenied)("manage_namespace", input.action)) {
|
|
653
|
+
throw new Error(`Action '${input.action}' is not allowed for manage_namespace tool`);
|
|
654
|
+
}
|
|
655
|
+
switch (input.action) {
|
|
656
|
+
case "create": {
|
|
657
|
+
const body = new URLSearchParams();
|
|
658
|
+
body.set("name", input.name);
|
|
659
|
+
body.set("path", input.path);
|
|
660
|
+
if (input.description)
|
|
661
|
+
body.set("description", input.description);
|
|
662
|
+
if (input.visibility)
|
|
663
|
+
body.set("visibility", input.visibility);
|
|
664
|
+
if (input.parent_id !== undefined)
|
|
665
|
+
body.set("parent_id", String(input.parent_id));
|
|
666
|
+
if (input.lfs_enabled !== undefined)
|
|
667
|
+
body.set("lfs_enabled", String(input.lfs_enabled));
|
|
668
|
+
if (input.request_access_enabled !== undefined)
|
|
669
|
+
body.set("request_access_enabled", String(input.request_access_enabled));
|
|
670
|
+
if (input.default_branch_protection !== undefined)
|
|
671
|
+
body.set("default_branch_protection", String(input.default_branch_protection));
|
|
672
|
+
if (input.avatar)
|
|
673
|
+
body.set("avatar", input.avatar);
|
|
674
|
+
const apiUrl = `${process.env.GITLAB_API_URL}/api/v4/groups`;
|
|
675
|
+
const response = await (0, fetch_1.enhancedFetch)(apiUrl, {
|
|
676
|
+
method: "POST",
|
|
677
|
+
headers: { "Content-Type": "application/x-www-form-urlencoded" },
|
|
678
|
+
body: body.toString(),
|
|
679
|
+
});
|
|
680
|
+
if (!response.ok) {
|
|
681
|
+
throw new Error(`GitLab API error: ${response.status} ${response.statusText}`);
|
|
682
|
+
}
|
|
683
|
+
return await response.json();
|
|
684
|
+
}
|
|
685
|
+
case "update": {
|
|
686
|
+
const { group_id, action: _action, ...updateParams } = input;
|
|
687
|
+
const body = new URLSearchParams();
|
|
688
|
+
Object.entries(updateParams).forEach(([key, value]) => {
|
|
689
|
+
if (value !== undefined) {
|
|
690
|
+
body.set(key, String(value));
|
|
691
|
+
}
|
|
692
|
+
});
|
|
693
|
+
const apiUrl = `${process.env.GITLAB_API_URL}/api/v4/groups/${encodeURIComponent(group_id)}`;
|
|
694
|
+
const response = await (0, fetch_1.enhancedFetch)(apiUrl, {
|
|
695
|
+
method: "PUT",
|
|
696
|
+
headers: { "Content-Type": "application/x-www-form-urlencoded" },
|
|
697
|
+
body: body.toString(),
|
|
698
|
+
});
|
|
699
|
+
if (!response.ok) {
|
|
700
|
+
throw new Error(`GitLab API error: ${response.status} ${response.statusText}`);
|
|
701
|
+
}
|
|
702
|
+
return await response.json();
|
|
703
|
+
}
|
|
704
|
+
case "delete": {
|
|
705
|
+
const { group_id } = input;
|
|
706
|
+
const apiUrl = `${process.env.GITLAB_API_URL}/api/v4/groups/${encodeURIComponent(group_id)}`;
|
|
707
|
+
const response = await (0, fetch_1.enhancedFetch)(apiUrl, { method: "DELETE" });
|
|
708
|
+
if (!response.ok) {
|
|
709
|
+
throw new Error(`GitLab API error: ${response.status} ${response.statusText}`);
|
|
710
|
+
}
|
|
711
|
+
return { success: true, message: `Group ${group_id} deleted` };
|
|
712
|
+
}
|
|
713
|
+
default:
|
|
714
|
+
throw new Error(`Unknown action: ${input.action}`);
|
|
715
|
+
}
|
|
716
|
+
},
|
|
717
|
+
},
|
|
718
|
+
],
|
|
719
|
+
[
|
|
720
|
+
"manage_todos",
|
|
721
|
+
{
|
|
722
|
+
name: "manage_todos",
|
|
723
|
+
description: "Manage your GitLab todo queue. Actions: mark_done (complete a single todo), mark_all_done (clear entire queue), restore (undo completion). Related: browse_todos to view your todo list.",
|
|
724
|
+
inputSchema: z.toJSONSchema(schema_1.ManageTodosSchema),
|
|
725
|
+
handler: async (args) => {
|
|
726
|
+
const input = schema_1.ManageTodosSchema.parse(args);
|
|
727
|
+
if ((0, config_1.isActionDenied)("manage_todos", input.action)) {
|
|
728
|
+
throw new Error(`Action '${input.action}' is not allowed for manage_todos tool`);
|
|
729
|
+
}
|
|
730
|
+
switch (input.action) {
|
|
731
|
+
case "mark_done": {
|
|
732
|
+
const apiUrl = `${process.env.GITLAB_API_URL}/api/v4/todos/${input.id}/mark_as_done`;
|
|
733
|
+
const response = await (0, fetch_1.enhancedFetch)(apiUrl, { method: "POST" });
|
|
734
|
+
if (!response.ok) {
|
|
735
|
+
throw new Error(`GitLab API error: ${response.status} ${response.statusText}`);
|
|
736
|
+
}
|
|
737
|
+
const todo = await response.json();
|
|
738
|
+
return (0, idConversion_1.cleanGidsFromObject)(todo);
|
|
739
|
+
}
|
|
740
|
+
case "mark_all_done": {
|
|
741
|
+
const apiUrl = `${process.env.GITLAB_API_URL}/api/v4/todos/mark_all_as_done`;
|
|
742
|
+
const response = await (0, fetch_1.enhancedFetch)(apiUrl, { method: "POST" });
|
|
743
|
+
if (!response.ok) {
|
|
744
|
+
throw new Error(`GitLab API error: ${response.status} ${response.statusText}`);
|
|
745
|
+
}
|
|
746
|
+
return { success: true, message: "All todos marked as done" };
|
|
747
|
+
}
|
|
748
|
+
case "restore": {
|
|
749
|
+
const apiUrl = `${process.env.GITLAB_API_URL}/api/v4/todos/${input.id}/mark_as_pending`;
|
|
750
|
+
const response = await (0, fetch_1.enhancedFetch)(apiUrl, { method: "POST" });
|
|
751
|
+
if (!response.ok) {
|
|
752
|
+
throw new Error(`GitLab API error: ${response.status} ${response.statusText}`);
|
|
753
|
+
}
|
|
754
|
+
const todo = await response.json();
|
|
755
|
+
return (0, idConversion_1.cleanGidsFromObject)(todo);
|
|
756
|
+
}
|
|
757
|
+
default:
|
|
758
|
+
throw new Error(`Unknown action: ${input.action}`);
|
|
759
|
+
}
|
|
760
|
+
},
|
|
761
|
+
},
|
|
762
|
+
],
|
|
763
|
+
]);
|
|
764
|
+
function getCoreReadOnlyToolNames() {
|
|
765
|
+
return [
|
|
766
|
+
"browse_projects",
|
|
767
|
+
"browse_namespaces",
|
|
768
|
+
"browse_commits",
|
|
769
|
+
"browse_events",
|
|
770
|
+
"browse_users",
|
|
771
|
+
"browse_todos",
|
|
772
|
+
];
|
|
773
|
+
}
|
|
774
|
+
function getCoreToolDefinitions() {
|
|
775
|
+
return Array.from(exports.coreToolRegistry.values());
|
|
776
|
+
}
|
|
777
|
+
function getFilteredCoreTools(readOnlyMode = false) {
|
|
778
|
+
if (readOnlyMode) {
|
|
779
|
+
const readOnlyNames = getCoreReadOnlyToolNames();
|
|
780
|
+
return Array.from(exports.coreToolRegistry.values()).filter(tool => readOnlyNames.includes(tool.name));
|
|
781
|
+
}
|
|
782
|
+
return getCoreToolDefinitions();
|
|
783
|
+
}
|
|
784
|
+
//# sourceMappingURL=registry.js.map
|