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,47 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ManageMilestoneSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const utils_1 = require("../utils");
|
|
6
|
+
const namespaceField = zod_1.z.string().describe("Namespace path (group or project)");
|
|
7
|
+
const milestoneIdField = utils_1.requiredId.describe("The ID of a project or group milestone. Required for 'update', 'delete', 'promote' action(s).");
|
|
8
|
+
const CreateMilestoneSchema = zod_1.z.object({
|
|
9
|
+
action: zod_1.z.literal("create"),
|
|
10
|
+
namespace: namespaceField,
|
|
11
|
+
title: zod_1.z.string().describe("The title of the milestone"),
|
|
12
|
+
description: zod_1.z.string().optional().describe("The description of the milestone"),
|
|
13
|
+
due_date: zod_1.z.string().optional().describe("The due date of the milestone (YYYY-MM-DD)"),
|
|
14
|
+
start_date: zod_1.z.string().optional().describe("The start date of the milestone (YYYY-MM-DD)"),
|
|
15
|
+
});
|
|
16
|
+
const UpdateMilestoneSchema = zod_1.z.object({
|
|
17
|
+
action: zod_1.z.literal("update"),
|
|
18
|
+
namespace: namespaceField,
|
|
19
|
+
milestone_id: milestoneIdField,
|
|
20
|
+
title: zod_1.z.string().optional().describe("The new title of the milestone"),
|
|
21
|
+
description: zod_1.z.string().optional().describe("The new description of the milestone"),
|
|
22
|
+
due_date: zod_1.z.string().optional().describe("The due date of the milestone (YYYY-MM-DD)"),
|
|
23
|
+
start_date: zod_1.z.string().optional().describe("The start date of the milestone (YYYY-MM-DD)"),
|
|
24
|
+
state_event: zod_1.z
|
|
25
|
+
.string()
|
|
26
|
+
.transform(val => val.toLowerCase())
|
|
27
|
+
.pipe(zod_1.z.enum(["close", "activate"]))
|
|
28
|
+
.optional()
|
|
29
|
+
.describe("State event to apply: 'close' or 'activate'"),
|
|
30
|
+
});
|
|
31
|
+
const DeleteMilestoneSchema = zod_1.z.object({
|
|
32
|
+
action: zod_1.z.literal("delete"),
|
|
33
|
+
namespace: namespaceField,
|
|
34
|
+
milestone_id: milestoneIdField,
|
|
35
|
+
});
|
|
36
|
+
const PromoteMilestoneSchema = zod_1.z.object({
|
|
37
|
+
action: zod_1.z.literal("promote"),
|
|
38
|
+
namespace: namespaceField,
|
|
39
|
+
milestone_id: milestoneIdField,
|
|
40
|
+
});
|
|
41
|
+
exports.ManageMilestoneSchema = zod_1.z.discriminatedUnion("action", [
|
|
42
|
+
CreateMilestoneSchema,
|
|
43
|
+
UpdateMilestoneSchema,
|
|
44
|
+
DeleteMilestoneSchema,
|
|
45
|
+
PromoteMilestoneSchema,
|
|
46
|
+
]);
|
|
47
|
+
//# sourceMappingURL=schema.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema.js","sourceRoot":"","sources":["../../../../src/entities/milestones/schema.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AACxB,oCAAsC;AAetC,MAAM,cAAc,GAAG,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,mCAAmC,CAAC,CAAC;AAOhF,MAAM,gBAAgB,GAAG,kBAAU,CAAC,QAAQ,CAC1C,+FAA+F,CAChG,CAAC;AAGF,MAAM,qBAAqB,GAAG,OAAC,CAAC,MAAM,CAAC;IACrC,MAAM,EAAE,OAAC,CAAC,OAAO,CAAC,QAAQ,CAAC;IAC3B,SAAS,EAAE,cAAc;IACzB,KAAK,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,4BAA4B,CAAC;IACxD,WAAW,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,kCAAkC,CAAC;IAC/E,QAAQ,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,4CAA4C,CAAC;IACtF,UAAU,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,8CAA8C,CAAC;CAC3F,CAAC,CAAC;AAGH,MAAM,qBAAqB,GAAG,OAAC,CAAC,MAAM,CAAC;IACrC,MAAM,EAAE,OAAC,CAAC,OAAO,CAAC,QAAQ,CAAC;IAC3B,SAAS,EAAE,cAAc;IACzB,YAAY,EAAE,gBAAgB;IAC9B,KAAK,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,gCAAgC,CAAC;IACvE,WAAW,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,sCAAsC,CAAC;IACnF,QAAQ,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,4CAA4C,CAAC;IACtF,UAAU,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,8CAA8C,CAAC;IAC1F,WAAW,EAAE,OAAC;SACX,MAAM,EAAE;SACR,SAAS,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,WAAW,EAAE,CAAC;SACnC,IAAI,CAAC,OAAC,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,UAAU,CAAC,CAAC,CAAC;SACnC,QAAQ,EAAE;SACV,QAAQ,CAAC,6CAA6C,CAAC;CAC3D,CAAC,CAAC;AAGH,MAAM,qBAAqB,GAAG,OAAC,CAAC,MAAM,CAAC;IACrC,MAAM,EAAE,OAAC,CAAC,OAAO,CAAC,QAAQ,CAAC;IAC3B,SAAS,EAAE,cAAc;IACzB,YAAY,EAAE,gBAAgB;CAC/B,CAAC,CAAC;AAGH,MAAM,sBAAsB,GAAG,OAAC,CAAC,MAAM,CAAC;IACtC,MAAM,EAAE,OAAC,CAAC,OAAO,CAAC,SAAS,CAAC;IAC5B,SAAS,EAAE,cAAc;IACzB,YAAY,EAAE,gBAAgB;CAC/B,CAAC,CAAC;AAGU,QAAA,qBAAqB,GAAG,OAAC,CAAC,kBAAkB,CAAC,QAAQ,EAAE;IAClE,qBAAqB;IACrB,qBAAqB;IACrB,qBAAqB;IACrB,sBAAsB;CACvB,CAAC,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export * from "../shared";
|
|
2
|
+
export * from "./schema-readonly";
|
|
3
|
+
export * from "./schema";
|
|
4
|
+
export * from "./registry";
|
|
5
|
+
import type { ToolDefinition } from "../../types";
|
|
6
|
+
export declare const mrsTools: ToolDefinition[];
|
|
7
|
+
export declare const mrsReadOnlyTools: string[];
|
|
@@ -0,0 +1,31 @@
|
|
|
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 __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
exports.mrsReadOnlyTools = exports.mrsTools = void 0;
|
|
18
|
+
__exportStar(require("../shared"), exports);
|
|
19
|
+
__exportStar(require("./schema-readonly"), exports);
|
|
20
|
+
__exportStar(require("./schema"), exports);
|
|
21
|
+
__exportStar(require("./registry"), exports);
|
|
22
|
+
const registry_1 = require("./registry");
|
|
23
|
+
const isReadOnly = process.env.GITLAB_READONLY === "true";
|
|
24
|
+
const mrsToolsFromRegistry = (0, registry_1.getFilteredMrsTools)(isReadOnly);
|
|
25
|
+
exports.mrsTools = mrsToolsFromRegistry.map((tool) => ({
|
|
26
|
+
name: tool.name,
|
|
27
|
+
description: tool.description,
|
|
28
|
+
inputSchema: tool.inputSchema,
|
|
29
|
+
}));
|
|
30
|
+
exports.mrsReadOnlyTools = (0, registry_1.getMrsReadOnlyToolNames)();
|
|
31
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/entities/mrs/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AACA,4CAA0B;AAG1B,oDAAkC;AAGlC,2CAAyB;AAGzB,6CAA2B;AAG3B,yCAA0E;AAI1E,MAAM,UAAU,GAAG,OAAO,CAAC,GAAG,CAAC,eAAe,KAAK,MAAM,CAAC;AAG1D,MAAM,oBAAoB,GAAG,IAAA,8BAAmB,EAAC,UAAU,CAAC,CAAC;AAGhD,QAAA,QAAQ,GAAqB,oBAAoB,CAAC,GAAG,CAChE,CAAC,IAAI,EAAkB,EAAE,CAAC,CAAC;IACzB,IAAI,EAAE,IAAI,CAAC,IAAI;IACf,WAAW,EAAE,IAAI,CAAC,WAAW;IAC7B,WAAW,EAAE,IAAI,CAAC,WAAW;CAC9B,CAAC,CACH,CAAC;AAGW,QAAA,gBAAgB,GAAG,IAAA,kCAAuB,GAAE,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { ToolRegistry, EnhancedToolDefinition } from "../../types";
|
|
2
|
+
export interface MergeBlockedResponse {
|
|
3
|
+
error: true;
|
|
4
|
+
message: string;
|
|
5
|
+
detailed_merge_status: string;
|
|
6
|
+
merge_status: string;
|
|
7
|
+
has_conflicts: boolean;
|
|
8
|
+
blocking_discussions_resolved: boolean;
|
|
9
|
+
hint: string;
|
|
10
|
+
is_retryable: boolean;
|
|
11
|
+
can_auto_merge: boolean;
|
|
12
|
+
suggested_action: string;
|
|
13
|
+
}
|
|
14
|
+
export declare const RETRYABLE_MERGE_STATUSES: readonly ["checking", "unchecked", "ci_still_running", "ci_must_pass", "approvals_syncing"];
|
|
15
|
+
export declare const AUTO_MERGE_ELIGIBLE_STATUSES: readonly ["ci_still_running", "ci_must_pass"];
|
|
16
|
+
export declare function getMergeStatusHint(status: string): string;
|
|
17
|
+
export declare function getSuggestedAction(isRetryable: boolean, canAutoMerge: boolean): string;
|
|
18
|
+
export declare function flattenPositionToFormFields(body: Record<string, unknown>, position: Record<string, unknown>): void;
|
|
19
|
+
export declare const mrsToolRegistry: ToolRegistry;
|
|
20
|
+
export declare function getMrsReadOnlyToolNames(): string[];
|
|
21
|
+
export declare function getMrsToolDefinitions(): EnhancedToolDefinition[];
|
|
22
|
+
export declare function getFilteredMrsTools(readOnlyMode?: boolean): EnhancedToolDefinition[];
|
|
@@ -0,0 +1,495 @@
|
|
|
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
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
36
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
37
|
+
};
|
|
38
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
exports.mrsToolRegistry = exports.AUTO_MERGE_ELIGIBLE_STATUSES = exports.RETRYABLE_MERGE_STATUSES = void 0;
|
|
40
|
+
exports.getMergeStatusHint = getMergeStatusHint;
|
|
41
|
+
exports.getSuggestedAction = getSuggestedAction;
|
|
42
|
+
exports.flattenPositionToFormFields = flattenPositionToFormFields;
|
|
43
|
+
exports.getMrsReadOnlyToolNames = getMrsReadOnlyToolNames;
|
|
44
|
+
exports.getMrsToolDefinitions = getMrsToolDefinitions;
|
|
45
|
+
exports.getFilteredMrsTools = getFilteredMrsTools;
|
|
46
|
+
const z = __importStar(require("zod"));
|
|
47
|
+
const picomatch_1 = __importDefault(require("picomatch"));
|
|
48
|
+
const schema_readonly_1 = require("./schema-readonly");
|
|
49
|
+
const schema_1 = require("./schema");
|
|
50
|
+
const gitlab_api_1 = require("../../utils/gitlab-api");
|
|
51
|
+
const projectIdentifier_1 = require("../../utils/projectIdentifier");
|
|
52
|
+
const config_1 = require("../../config");
|
|
53
|
+
exports.RETRYABLE_MERGE_STATUSES = [
|
|
54
|
+
"checking",
|
|
55
|
+
"unchecked",
|
|
56
|
+
"ci_still_running",
|
|
57
|
+
"ci_must_pass",
|
|
58
|
+
"approvals_syncing",
|
|
59
|
+
];
|
|
60
|
+
exports.AUTO_MERGE_ELIGIBLE_STATUSES = ["ci_still_running", "ci_must_pass"];
|
|
61
|
+
function getMergeStatusHint(status) {
|
|
62
|
+
const hints = {
|
|
63
|
+
checking: "Wait a moment and retry - GitLab is calculating mergeability",
|
|
64
|
+
unchecked: "Wait a moment and retry - GitLab has not checked mergeability yet",
|
|
65
|
+
ci_must_pass: "Pipeline must pass. Use merge_when_pipeline_succeeds: true for auto-merge, or wait for pipeline",
|
|
66
|
+
ci_still_running: "Pipeline is running. Use merge_when_pipeline_succeeds: true for auto-merge, or wait for completion",
|
|
67
|
+
not_approved: "MR requires approval before merging",
|
|
68
|
+
approvals_syncing: "Approvals are being synchronized - wait and retry",
|
|
69
|
+
conflict: "Resolve merge conflicts before merging",
|
|
70
|
+
need_rebase: "Rebase the source branch before merging",
|
|
71
|
+
draft_status: "Remove draft status before merging by updating the title to remove any 'Draft:' or 'WIP:' prefix",
|
|
72
|
+
discussions_not_resolved: "Resolve all blocking discussions before merging",
|
|
73
|
+
blocked_status: "MR is blocked by another MR or issue",
|
|
74
|
+
external_status_checks: "External status checks are pending",
|
|
75
|
+
jira_association_missing: "Jira issue association is required",
|
|
76
|
+
not_open: "MR is not in open state - cannot merge closed or already merged MRs",
|
|
77
|
+
mergeable: "MR is ready to merge",
|
|
78
|
+
};
|
|
79
|
+
return hints[status] || `Check MR detailed status: ${status}`;
|
|
80
|
+
}
|
|
81
|
+
function getSuggestedAction(isRetryable, canAutoMerge) {
|
|
82
|
+
if (canAutoMerge) {
|
|
83
|
+
return "Consider using merge_when_pipeline_succeeds: true to auto-merge when pipeline passes";
|
|
84
|
+
}
|
|
85
|
+
if (isRetryable) {
|
|
86
|
+
return "Wait a moment and retry the merge";
|
|
87
|
+
}
|
|
88
|
+
return "Resolve the blocking condition before merging";
|
|
89
|
+
}
|
|
90
|
+
function flattenPositionToFormFields(body, position) {
|
|
91
|
+
for (const [key, value] of Object.entries(position)) {
|
|
92
|
+
if (value === undefined || value === null)
|
|
93
|
+
continue;
|
|
94
|
+
if (typeof value === "object" && !Array.isArray(value)) {
|
|
95
|
+
for (const [nestedKey, nestedValue] of Object.entries(value)) {
|
|
96
|
+
if (nestedValue === undefined || nestedValue === null)
|
|
97
|
+
continue;
|
|
98
|
+
if (typeof nestedValue === "object" && !Array.isArray(nestedValue)) {
|
|
99
|
+
for (const [deepKey, deepValue] of Object.entries(nestedValue)) {
|
|
100
|
+
if (deepValue !== undefined && deepValue !== null) {
|
|
101
|
+
body[`position[${key}][${nestedKey}][${deepKey}]`] = deepValue;
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
else {
|
|
106
|
+
body[`position[${key}][${nestedKey}]`] = nestedValue;
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
else {
|
|
111
|
+
body[`position[${key}]`] = value;
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
exports.mrsToolRegistry = new Map([
|
|
116
|
+
[
|
|
117
|
+
"browse_merge_requests",
|
|
118
|
+
{
|
|
119
|
+
name: "browse_merge_requests",
|
|
120
|
+
description: "Find and inspect merge requests. Actions: list (filter by state/author/reviewer/labels/branch), get (MR details by IID or source branch), diffs (file-level changes with inline suggestions), compare (diff between any two refs), versions (list diff versions from pushes), version (get specific version with diffs). Related: manage_merge_request to create/update/merge.",
|
|
121
|
+
inputSchema: z.toJSONSchema(schema_readonly_1.BrowseMergeRequestsSchema),
|
|
122
|
+
gate: { envVar: "USE_MRS", defaultValue: true },
|
|
123
|
+
handler: async (args) => {
|
|
124
|
+
const input = schema_readonly_1.BrowseMergeRequestsSchema.parse(args);
|
|
125
|
+
if ((0, config_1.isActionDenied)("browse_merge_requests", input.action)) {
|
|
126
|
+
throw new Error(`Action '${input.action}' is not allowed for browse_merge_requests tool`);
|
|
127
|
+
}
|
|
128
|
+
switch (input.action) {
|
|
129
|
+
case "list": {
|
|
130
|
+
const { action: _action, project_id, ...rest } = input;
|
|
131
|
+
const query = (0, gitlab_api_1.toQuery)(rest, []);
|
|
132
|
+
const path = project_id
|
|
133
|
+
? `projects/${(0, projectIdentifier_1.normalizeProjectId)(project_id)}/merge_requests`
|
|
134
|
+
: `merge_requests`;
|
|
135
|
+
return gitlab_api_1.gitlab.get(path, { query });
|
|
136
|
+
}
|
|
137
|
+
case "get": {
|
|
138
|
+
const { project_id, merge_request_iid, branch_name } = input;
|
|
139
|
+
const query = {};
|
|
140
|
+
if (input.include_diverged_commits_count !== undefined)
|
|
141
|
+
query.include_diverged_commits_count = input.include_diverged_commits_count;
|
|
142
|
+
if (input.include_rebase_in_progress !== undefined)
|
|
143
|
+
query.include_rebase_in_progress = input.include_rebase_in_progress;
|
|
144
|
+
if (merge_request_iid) {
|
|
145
|
+
return gitlab_api_1.gitlab.get(`projects/${(0, projectIdentifier_1.normalizeProjectId)(project_id)}/merge_requests/${merge_request_iid}`, Object.keys(query).length > 0 ? { query } : undefined);
|
|
146
|
+
}
|
|
147
|
+
else if (branch_name) {
|
|
148
|
+
const result = await gitlab_api_1.gitlab.get(`projects/${(0, projectIdentifier_1.normalizeProjectId)(project_id)}/merge_requests`, { query: { source_branch: branch_name, ...query } });
|
|
149
|
+
if (Array.isArray(result) && result.length > 0) {
|
|
150
|
+
return result[0];
|
|
151
|
+
}
|
|
152
|
+
throw new Error("No merge request found for branch");
|
|
153
|
+
}
|
|
154
|
+
throw new Error("Either merge_request_iid or branch_name must be provided");
|
|
155
|
+
}
|
|
156
|
+
case "diffs": {
|
|
157
|
+
const { project_id, merge_request_iid, exclude_patterns, exclude_lockfiles, exclude_generated, } = input;
|
|
158
|
+
const query = {};
|
|
159
|
+
if (input.page !== undefined)
|
|
160
|
+
query.page = input.page;
|
|
161
|
+
if (input.per_page !== undefined)
|
|
162
|
+
query.per_page = input.per_page;
|
|
163
|
+
if (input.include_diverged_commits_count !== undefined)
|
|
164
|
+
query.include_diverged_commits_count = input.include_diverged_commits_count;
|
|
165
|
+
if (input.include_rebase_in_progress !== undefined)
|
|
166
|
+
query.include_rebase_in_progress = input.include_rebase_in_progress;
|
|
167
|
+
const response = await gitlab_api_1.gitlab.get(`projects/${(0, projectIdentifier_1.normalizeProjectId)(project_id)}/merge_requests/${merge_request_iid}/changes`, { query });
|
|
168
|
+
const patterns = [];
|
|
169
|
+
if (exclude_patterns?.length) {
|
|
170
|
+
patterns.push(...exclude_patterns);
|
|
171
|
+
}
|
|
172
|
+
if (exclude_lockfiles) {
|
|
173
|
+
patterns.push(...schema_readonly_1.LOCKFILE_PATTERNS);
|
|
174
|
+
}
|
|
175
|
+
if (exclude_generated) {
|
|
176
|
+
patterns.push(...schema_readonly_1.GENERATED_PATTERNS);
|
|
177
|
+
}
|
|
178
|
+
if (patterns.length > 0 && Array.isArray(response.changes)) {
|
|
179
|
+
const originalCount = response.changes.length;
|
|
180
|
+
const matcher = (0, picomatch_1.default)(patterns);
|
|
181
|
+
response.changes = response.changes.filter((diff) => !matcher(diff.new_path) && !matcher(diff.old_path));
|
|
182
|
+
response._filtered = {
|
|
183
|
+
original_count: originalCount,
|
|
184
|
+
filtered_count: response.changes.length,
|
|
185
|
+
excluded_count: originalCount - response.changes.length,
|
|
186
|
+
patterns_applied: patterns,
|
|
187
|
+
};
|
|
188
|
+
}
|
|
189
|
+
return response;
|
|
190
|
+
}
|
|
191
|
+
case "compare": {
|
|
192
|
+
const { project_id, from, to, straight } = input;
|
|
193
|
+
const query = {
|
|
194
|
+
from,
|
|
195
|
+
to,
|
|
196
|
+
};
|
|
197
|
+
if (straight !== undefined)
|
|
198
|
+
query.straight = straight;
|
|
199
|
+
return gitlab_api_1.gitlab.get(`projects/${(0, projectIdentifier_1.normalizeProjectId)(project_id)}/repository/compare`, {
|
|
200
|
+
query,
|
|
201
|
+
});
|
|
202
|
+
}
|
|
203
|
+
case "versions": {
|
|
204
|
+
const { action: _action, project_id, merge_request_iid, ...rest } = input;
|
|
205
|
+
const query = (0, gitlab_api_1.toQuery)(rest, []);
|
|
206
|
+
return gitlab_api_1.gitlab.get(`projects/${(0, projectIdentifier_1.normalizeProjectId)(project_id)}/merge_requests/${merge_request_iid}/versions`, { query });
|
|
207
|
+
}
|
|
208
|
+
case "version": {
|
|
209
|
+
const { project_id, merge_request_iid, version_id } = input;
|
|
210
|
+
return gitlab_api_1.gitlab.get(`projects/${(0, projectIdentifier_1.normalizeProjectId)(project_id)}/merge_requests/${merge_request_iid}/versions/${version_id}`);
|
|
211
|
+
}
|
|
212
|
+
default:
|
|
213
|
+
throw new Error(`Unknown action: ${input.action}`);
|
|
214
|
+
}
|
|
215
|
+
},
|
|
216
|
+
},
|
|
217
|
+
],
|
|
218
|
+
[
|
|
219
|
+
"browse_mr_discussions",
|
|
220
|
+
{
|
|
221
|
+
name: "browse_mr_discussions",
|
|
222
|
+
description: "Read discussion threads and draft review notes on merge requests. Actions: list (all threads with resolution status), drafts (unpublished draft notes), draft (single draft details). Related: manage_mr_discussion to comment, manage_draft_notes to create drafts.",
|
|
223
|
+
inputSchema: z.toJSONSchema(schema_readonly_1.BrowseMrDiscussionsSchema),
|
|
224
|
+
gate: { envVar: "USE_MRS", defaultValue: true },
|
|
225
|
+
handler: async (args) => {
|
|
226
|
+
const input = schema_readonly_1.BrowseMrDiscussionsSchema.parse(args);
|
|
227
|
+
if ((0, config_1.isActionDenied)("browse_mr_discussions", input.action)) {
|
|
228
|
+
throw new Error(`Action '${input.action}' is not allowed for browse_mr_discussions tool`);
|
|
229
|
+
}
|
|
230
|
+
switch (input.action) {
|
|
231
|
+
case "list": {
|
|
232
|
+
const { action: _action, project_id, merge_request_iid, ...rest } = input;
|
|
233
|
+
const query = (0, gitlab_api_1.toQuery)(rest, []);
|
|
234
|
+
return gitlab_api_1.gitlab.get(`projects/${(0, projectIdentifier_1.normalizeProjectId)(project_id)}/merge_requests/${merge_request_iid}/discussions`, { query });
|
|
235
|
+
}
|
|
236
|
+
case "drafts": {
|
|
237
|
+
const { project_id, merge_request_iid } = input;
|
|
238
|
+
return gitlab_api_1.gitlab.get(`projects/${(0, projectIdentifier_1.normalizeProjectId)(project_id)}/merge_requests/${merge_request_iid}/draft_notes`);
|
|
239
|
+
}
|
|
240
|
+
case "draft": {
|
|
241
|
+
const { project_id, merge_request_iid, draft_note_id } = input;
|
|
242
|
+
return gitlab_api_1.gitlab.get(`projects/${(0, projectIdentifier_1.normalizeProjectId)(project_id)}/merge_requests/${merge_request_iid}/draft_notes/${draft_note_id}`);
|
|
243
|
+
}
|
|
244
|
+
default:
|
|
245
|
+
throw new Error(`Unknown action: ${input.action}`);
|
|
246
|
+
}
|
|
247
|
+
},
|
|
248
|
+
},
|
|
249
|
+
],
|
|
250
|
+
[
|
|
251
|
+
"manage_merge_request",
|
|
252
|
+
{
|
|
253
|
+
name: "manage_merge_request",
|
|
254
|
+
description: "Create, update, merge, or approve merge requests. Actions: create (new MR from source to target), update (title/description/assignees/reviewers/labels), merge (into target branch), approve/unapprove (review approval), get_approval_state (current approvals). Related: browse_merge_requests for discovery.",
|
|
255
|
+
inputSchema: z.toJSONSchema(schema_1.ManageMergeRequestSchema),
|
|
256
|
+
gate: { envVar: "USE_MRS", defaultValue: true },
|
|
257
|
+
handler: async (args) => {
|
|
258
|
+
const input = schema_1.ManageMergeRequestSchema.parse(args);
|
|
259
|
+
if ((0, config_1.isActionDenied)("manage_merge_request", input.action)) {
|
|
260
|
+
throw new Error(`Action '${input.action}' is not allowed for manage_merge_request tool`);
|
|
261
|
+
}
|
|
262
|
+
switch (input.action) {
|
|
263
|
+
case "create": {
|
|
264
|
+
const { action: _action, project_id, ...body } = input;
|
|
265
|
+
const processedBody = {};
|
|
266
|
+
for (const [key, value] of Object.entries(body)) {
|
|
267
|
+
if (Array.isArray(value)) {
|
|
268
|
+
processedBody[key] = value.join(",");
|
|
269
|
+
}
|
|
270
|
+
else {
|
|
271
|
+
processedBody[key] = value;
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
return gitlab_api_1.gitlab.post(`projects/${(0, projectIdentifier_1.normalizeProjectId)(project_id)}/merge_requests`, {
|
|
275
|
+
body: processedBody,
|
|
276
|
+
contentType: "form",
|
|
277
|
+
});
|
|
278
|
+
}
|
|
279
|
+
case "update": {
|
|
280
|
+
const { action: _action, project_id, merge_request_iid, ...body } = input;
|
|
281
|
+
const processedBody = {};
|
|
282
|
+
for (const [key, value] of Object.entries(body)) {
|
|
283
|
+
if (Array.isArray(value)) {
|
|
284
|
+
processedBody[key] = value.join(",");
|
|
285
|
+
}
|
|
286
|
+
else {
|
|
287
|
+
processedBody[key] = value;
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
return gitlab_api_1.gitlab.put(`projects/${(0, projectIdentifier_1.normalizeProjectId)(project_id)}/merge_requests/${merge_request_iid}`, { body: processedBody, contentType: "form" });
|
|
291
|
+
}
|
|
292
|
+
case "merge": {
|
|
293
|
+
const { action: _action, project_id, merge_request_iid, merge_when_pipeline_succeeds, ...body } = input;
|
|
294
|
+
const projectPath = (0, projectIdentifier_1.normalizeProjectId)(project_id);
|
|
295
|
+
const mergeEndpoint = `projects/${projectPath}/merge_requests/${merge_request_iid}/merge`;
|
|
296
|
+
if (merge_when_pipeline_succeeds) {
|
|
297
|
+
return gitlab_api_1.gitlab.put(mergeEndpoint, {
|
|
298
|
+
body: { ...body, merge_when_pipeline_succeeds: true },
|
|
299
|
+
contentType: "form",
|
|
300
|
+
});
|
|
301
|
+
}
|
|
302
|
+
const mrStatus = await gitlab_api_1.gitlab.get(`projects/${projectPath}/merge_requests/${merge_request_iid}`);
|
|
303
|
+
const detailedStatus = mrStatus.detailed_merge_status;
|
|
304
|
+
if (detailedStatus === "mergeable") {
|
|
305
|
+
return gitlab_api_1.gitlab.put(mergeEndpoint, { body, contentType: "form" });
|
|
306
|
+
}
|
|
307
|
+
const isRetryable = exports.RETRYABLE_MERGE_STATUSES.includes(detailedStatus);
|
|
308
|
+
const canAutoMerge = exports.AUTO_MERGE_ELIGIBLE_STATUSES.includes(detailedStatus);
|
|
309
|
+
const blockedResponse = {
|
|
310
|
+
error: true,
|
|
311
|
+
message: `MR cannot be merged: ${detailedStatus}`,
|
|
312
|
+
detailed_merge_status: detailedStatus,
|
|
313
|
+
merge_status: mrStatus.merge_status,
|
|
314
|
+
has_conflicts: mrStatus.has_conflicts,
|
|
315
|
+
blocking_discussions_resolved: mrStatus.blocking_discussions_resolved,
|
|
316
|
+
hint: getMergeStatusHint(detailedStatus),
|
|
317
|
+
is_retryable: isRetryable,
|
|
318
|
+
can_auto_merge: canAutoMerge,
|
|
319
|
+
suggested_action: getSuggestedAction(isRetryable, canAutoMerge),
|
|
320
|
+
};
|
|
321
|
+
return blockedResponse;
|
|
322
|
+
}
|
|
323
|
+
case "approve": {
|
|
324
|
+
const { project_id, merge_request_iid, sha } = input;
|
|
325
|
+
const body = {};
|
|
326
|
+
if (sha)
|
|
327
|
+
body.sha = sha;
|
|
328
|
+
return gitlab_api_1.gitlab.post(`projects/${(0, projectIdentifier_1.normalizeProjectId)(project_id)}/merge_requests/${merge_request_iid}/approve`, { body: Object.keys(body).length > 0 ? body : undefined, contentType: "json" });
|
|
329
|
+
}
|
|
330
|
+
case "unapprove": {
|
|
331
|
+
const { project_id, merge_request_iid } = input;
|
|
332
|
+
return gitlab_api_1.gitlab.post(`projects/${(0, projectIdentifier_1.normalizeProjectId)(project_id)}/merge_requests/${merge_request_iid}/unapprove`);
|
|
333
|
+
}
|
|
334
|
+
case "get_approval_state": {
|
|
335
|
+
const { project_id, merge_request_iid } = input;
|
|
336
|
+
return gitlab_api_1.gitlab.get(`projects/${(0, projectIdentifier_1.normalizeProjectId)(project_id)}/merge_requests/${merge_request_iid}/approval_state`);
|
|
337
|
+
}
|
|
338
|
+
default:
|
|
339
|
+
throw new Error(`Unknown action: ${input.action}`);
|
|
340
|
+
}
|
|
341
|
+
},
|
|
342
|
+
},
|
|
343
|
+
],
|
|
344
|
+
[
|
|
345
|
+
"manage_mr_discussion",
|
|
346
|
+
{
|
|
347
|
+
name: "manage_mr_discussion",
|
|
348
|
+
description: "Post comments, start threads, and suggest code changes on merge requests. Actions: comment (simple note), thread (line-level discussion), reply (to existing thread), update (edit note text), resolve (toggle thread resolution), suggest (code suggestion block), apply_suggestion/apply_suggestions (accept code suggestions). Related: browse_mr_discussions to read threads.",
|
|
349
|
+
inputSchema: z.toJSONSchema(schema_1.ManageMrDiscussionSchema),
|
|
350
|
+
gate: { envVar: "USE_MRS", defaultValue: true },
|
|
351
|
+
handler: async (args) => {
|
|
352
|
+
const input = schema_1.ManageMrDiscussionSchema.parse(args);
|
|
353
|
+
if ((0, config_1.isActionDenied)("manage_mr_discussion", input.action)) {
|
|
354
|
+
throw new Error(`Action '${input.action}' is not allowed for manage_mr_discussion tool`);
|
|
355
|
+
}
|
|
356
|
+
switch (input.action) {
|
|
357
|
+
case "comment": {
|
|
358
|
+
const { project_id, noteable_type, noteable_id, body: noteBody, created_at, confidential, } = input;
|
|
359
|
+
const body = { body: noteBody };
|
|
360
|
+
if (created_at)
|
|
361
|
+
body.created_at = created_at;
|
|
362
|
+
if (confidential !== undefined)
|
|
363
|
+
body.confidential = confidential;
|
|
364
|
+
const resourceType = noteable_type === "merge_request" ? "merge_requests" : "issues";
|
|
365
|
+
return gitlab_api_1.gitlab.post(`projects/${(0, projectIdentifier_1.normalizeProjectId)(project_id)}/${resourceType}/${noteable_id}/notes`, { body, contentType: "form" });
|
|
366
|
+
}
|
|
367
|
+
case "thread": {
|
|
368
|
+
const { project_id, merge_request_iid, body: noteBody, position, commit_id } = input;
|
|
369
|
+
const body = { body: noteBody };
|
|
370
|
+
if (position)
|
|
371
|
+
flattenPositionToFormFields(body, position);
|
|
372
|
+
if (commit_id)
|
|
373
|
+
body.commit_id = commit_id;
|
|
374
|
+
return gitlab_api_1.gitlab.post(`projects/${(0, projectIdentifier_1.normalizeProjectId)(project_id)}/merge_requests/${merge_request_iid}/discussions`, { body, contentType: "form" });
|
|
375
|
+
}
|
|
376
|
+
case "reply": {
|
|
377
|
+
const { project_id, merge_request_iid, discussion_id, body: noteBody, created_at, } = input;
|
|
378
|
+
const body = { body: noteBody };
|
|
379
|
+
if (created_at)
|
|
380
|
+
body.created_at = created_at;
|
|
381
|
+
return gitlab_api_1.gitlab.post(`projects/${(0, projectIdentifier_1.normalizeProjectId)(project_id)}/merge_requests/${merge_request_iid}/discussions/${discussion_id}/notes`, { body, contentType: "form" });
|
|
382
|
+
}
|
|
383
|
+
case "update": {
|
|
384
|
+
const { project_id, merge_request_iid, note_id, body: noteBody } = input;
|
|
385
|
+
return gitlab_api_1.gitlab.put(`projects/${(0, projectIdentifier_1.normalizeProjectId)(project_id)}/merge_requests/${merge_request_iid}/notes/${note_id}`, { body: { body: noteBody }, contentType: "form" });
|
|
386
|
+
}
|
|
387
|
+
case "apply_suggestion": {
|
|
388
|
+
const { suggestion_id, commit_message } = input;
|
|
389
|
+
const body = {};
|
|
390
|
+
if (commit_message) {
|
|
391
|
+
body.commit_message = commit_message;
|
|
392
|
+
}
|
|
393
|
+
return gitlab_api_1.gitlab.put(`suggestions/${suggestion_id}/apply`, {
|
|
394
|
+
body: Object.keys(body).length > 0 ? body : undefined,
|
|
395
|
+
contentType: "json",
|
|
396
|
+
});
|
|
397
|
+
}
|
|
398
|
+
case "apply_suggestions": {
|
|
399
|
+
const { suggestion_ids, commit_message } = input;
|
|
400
|
+
const body = {
|
|
401
|
+
ids: suggestion_ids,
|
|
402
|
+
};
|
|
403
|
+
if (commit_message) {
|
|
404
|
+
body.commit_message = commit_message;
|
|
405
|
+
}
|
|
406
|
+
return gitlab_api_1.gitlab.put(`suggestions/batch_apply`, { body, contentType: "json" });
|
|
407
|
+
}
|
|
408
|
+
case "resolve": {
|
|
409
|
+
const { project_id, merge_request_iid, discussion_id, resolved } = input;
|
|
410
|
+
return gitlab_api_1.gitlab.put(`projects/${(0, projectIdentifier_1.normalizeProjectId)(project_id)}/merge_requests/${merge_request_iid}/discussions/${discussion_id}`, { body: { resolved }, contentType: "form" });
|
|
411
|
+
}
|
|
412
|
+
case "suggest": {
|
|
413
|
+
const { project_id, merge_request_iid, position, suggestion, comment, lines_above, lines_below, } = input;
|
|
414
|
+
const rangeSpec = lines_above || lines_below ? `:-${lines_above || 0}+${lines_below || 0}` : "";
|
|
415
|
+
const suggestionBlock = `\`\`\`suggestion${rangeSpec}\n${suggestion}\n\`\`\``;
|
|
416
|
+
const noteBody = comment ? `${comment}\n\n${suggestionBlock}` : suggestionBlock;
|
|
417
|
+
const body = {
|
|
418
|
+
body: noteBody,
|
|
419
|
+
};
|
|
420
|
+
flattenPositionToFormFields(body, position);
|
|
421
|
+
return gitlab_api_1.gitlab.post(`projects/${(0, projectIdentifier_1.normalizeProjectId)(project_id)}/merge_requests/${merge_request_iid}/discussions`, { body, contentType: "form" });
|
|
422
|
+
}
|
|
423
|
+
default:
|
|
424
|
+
throw new Error(`Unknown action: ${input.action}`);
|
|
425
|
+
}
|
|
426
|
+
},
|
|
427
|
+
},
|
|
428
|
+
],
|
|
429
|
+
[
|
|
430
|
+
"manage_draft_notes",
|
|
431
|
+
{
|
|
432
|
+
name: "manage_draft_notes",
|
|
433
|
+
description: "Create and manage unpublished review comments on merge requests. Actions: create (new draft), update (modify text), publish (make single draft visible), publish_all (submit entire review), delete (discard draft). Related: browse_mr_discussions action 'drafts' to list existing drafts.",
|
|
434
|
+
inputSchema: z.toJSONSchema(schema_1.ManageDraftNotesSchema),
|
|
435
|
+
gate: { envVar: "USE_MRS", defaultValue: true },
|
|
436
|
+
handler: async (args) => {
|
|
437
|
+
const input = schema_1.ManageDraftNotesSchema.parse(args);
|
|
438
|
+
if ((0, config_1.isActionDenied)("manage_draft_notes", input.action)) {
|
|
439
|
+
throw new Error(`Action '${input.action}' is not allowed for manage_draft_notes tool`);
|
|
440
|
+
}
|
|
441
|
+
switch (input.action) {
|
|
442
|
+
case "create": {
|
|
443
|
+
const { project_id, merge_request_iid, note, position, in_reply_to_discussion_id, commit_id, } = input;
|
|
444
|
+
const body = { note };
|
|
445
|
+
if (position)
|
|
446
|
+
flattenPositionToFormFields(body, position);
|
|
447
|
+
if (in_reply_to_discussion_id)
|
|
448
|
+
body.in_reply_to_discussion_id = in_reply_to_discussion_id;
|
|
449
|
+
if (commit_id)
|
|
450
|
+
body.commit_id = commit_id;
|
|
451
|
+
return gitlab_api_1.gitlab.post(`projects/${(0, projectIdentifier_1.normalizeProjectId)(project_id)}/merge_requests/${merge_request_iid}/draft_notes`, { body, contentType: "form" });
|
|
452
|
+
}
|
|
453
|
+
case "update": {
|
|
454
|
+
const { project_id, merge_request_iid, draft_note_id, note, position } = input;
|
|
455
|
+
const body = { note };
|
|
456
|
+
if (position)
|
|
457
|
+
flattenPositionToFormFields(body, position);
|
|
458
|
+
return gitlab_api_1.gitlab.put(`projects/${(0, projectIdentifier_1.normalizeProjectId)(project_id)}/merge_requests/${merge_request_iid}/draft_notes/${draft_note_id}`, { body, contentType: "form" });
|
|
459
|
+
}
|
|
460
|
+
case "publish": {
|
|
461
|
+
const { project_id, merge_request_iid, draft_note_id } = input;
|
|
462
|
+
const result = await gitlab_api_1.gitlab.put(`projects/${(0, projectIdentifier_1.normalizeProjectId)(project_id)}/merge_requests/${merge_request_iid}/draft_notes/${draft_note_id}/publish`);
|
|
463
|
+
return result ?? { published: true };
|
|
464
|
+
}
|
|
465
|
+
case "publish_all": {
|
|
466
|
+
const { project_id, merge_request_iid } = input;
|
|
467
|
+
const result = await gitlab_api_1.gitlab.post(`projects/${(0, projectIdentifier_1.normalizeProjectId)(project_id)}/merge_requests/${merge_request_iid}/draft_notes/bulk_publish`);
|
|
468
|
+
return result ?? { published: true };
|
|
469
|
+
}
|
|
470
|
+
case "delete": {
|
|
471
|
+
const { project_id, merge_request_iid, draft_note_id } = input;
|
|
472
|
+
await gitlab_api_1.gitlab.delete(`projects/${(0, projectIdentifier_1.normalizeProjectId)(project_id)}/merge_requests/${merge_request_iid}/draft_notes/${draft_note_id}`);
|
|
473
|
+
return { success: true, message: "Draft note deleted successfully" };
|
|
474
|
+
}
|
|
475
|
+
default:
|
|
476
|
+
throw new Error(`Unknown action: ${input.action}`);
|
|
477
|
+
}
|
|
478
|
+
},
|
|
479
|
+
},
|
|
480
|
+
],
|
|
481
|
+
]);
|
|
482
|
+
function getMrsReadOnlyToolNames() {
|
|
483
|
+
return ["browse_merge_requests", "browse_mr_discussions"];
|
|
484
|
+
}
|
|
485
|
+
function getMrsToolDefinitions() {
|
|
486
|
+
return Array.from(exports.mrsToolRegistry.values());
|
|
487
|
+
}
|
|
488
|
+
function getFilteredMrsTools(readOnlyMode = false) {
|
|
489
|
+
if (readOnlyMode) {
|
|
490
|
+
const readOnlyNames = getMrsReadOnlyToolNames();
|
|
491
|
+
return Array.from(exports.mrsToolRegistry.values()).filter(tool => readOnlyNames.includes(tool.name));
|
|
492
|
+
}
|
|
493
|
+
return getMrsToolDefinitions();
|
|
494
|
+
}
|
|
495
|
+
//# sourceMappingURL=registry.js.map
|