@structured-world/gitlab-mcp 5.8.0 → 6.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +61 -95
- 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 +66 -0
- package/dist/generated/prisma/internal/class.js.map +1 -0
- package/dist/generated/prisma/internal/prismaNamespace.d.ts +712 -0
- package/dist/generated/prisma/internal/prismaNamespace.js +139 -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 +606 -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 +962 -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/{config.d.ts → src/config.d.ts} +6 -0
- package/dist/{config.js → src/config.js} +7 -1
- package/dist/src/config.js.map +1 -0
- package/dist/src/entities/core/index.js.map +1 -0
- package/dist/src/entities/core/registry.js +745 -0
- package/dist/src/entities/core/registry.js.map +1 -0
- package/dist/{entities → src/entities}/core/schema-readonly.d.ts +156 -143
- package/dist/src/entities/core/schema-readonly.js +296 -0
- package/dist/src/entities/core/schema-readonly.js.map +1 -0
- package/dist/src/entities/core/schema.d.ts +71 -0
- package/dist/src/entities/core/schema.js +93 -0
- package/dist/src/entities/core/schema.js.map +1 -0
- package/dist/src/entities/files/index.js.map +1 -0
- package/dist/src/entities/files/registry.js +165 -0
- package/dist/src/entities/files/registry.js.map +1 -0
- package/dist/{entities → src/entities}/files/schema-readonly.d.ts +15 -0
- package/dist/{entities → src/entities}/files/schema-readonly.js +20 -1
- package/dist/src/entities/files/schema-readonly.js.map +1 -0
- package/dist/{entities → src/entities}/files/schema.d.ts +40 -0
- package/dist/src/entities/files/schema.js +79 -0
- package/dist/src/entities/files/schema.js.map +1 -0
- package/dist/src/entities/index.js.map +1 -0
- package/dist/src/entities/labels/index.js.map +1 -0
- package/dist/{entities → src/entities}/labels/registry.js +19 -89
- package/dist/src/entities/labels/registry.js.map +1 -0
- package/dist/src/entities/labels/schema-readonly.js.map +1 -0
- package/dist/src/entities/labels/schema.js.map +1 -0
- package/dist/src/entities/milestones/index.js.map +1 -0
- package/dist/src/entities/milestones/registry.js +197 -0
- package/dist/src/entities/milestones/registry.js.map +1 -0
- package/dist/src/entities/milestones/schema-readonly.js.map +1 -0
- package/dist/src/entities/milestones/schema.js.map +1 -0
- package/dist/src/entities/mrs/index.js.map +1 -0
- package/dist/src/entities/mrs/registry.js +290 -0
- package/dist/src/entities/mrs/registry.js.map +1 -0
- package/dist/{entities → src/entities}/mrs/schema-readonly.d.ts +115 -1
- package/dist/src/entities/mrs/schema-readonly.js +261 -0
- package/dist/src/entities/mrs/schema-readonly.js.map +1 -0
- package/dist/{entities → src/entities}/mrs/schema.d.ts +262 -0
- package/dist/src/entities/mrs/schema.js +316 -0
- package/dist/src/entities/mrs/schema.js.map +1 -0
- package/dist/src/entities/pipelines/index.js.map +1 -0
- package/dist/{entities → src/entities}/pipelines/registry.js +26 -187
- package/dist/src/entities/pipelines/registry.js.map +1 -0
- package/dist/src/entities/pipelines/schema-readonly.js.map +1 -0
- package/dist/src/entities/pipelines/schema.js.map +1 -0
- package/dist/src/entities/shared.js.map +1 -0
- package/dist/src/entities/utils.js.map +1 -0
- package/dist/src/entities/variables/index.js.map +1 -0
- package/dist/src/entities/variables/registry.js +153 -0
- package/dist/src/entities/variables/registry.js.map +1 -0
- package/dist/src/entities/variables/schema-readonly.js.map +1 -0
- package/dist/src/entities/variables/schema.js.map +1 -0
- package/dist/src/entities/wiki/index.js.map +1 -0
- package/dist/{entities → src/entities}/wiki/registry.js +19 -89
- package/dist/src/entities/wiki/registry.js.map +1 -0
- package/dist/src/entities/wiki/schema-readonly.js.map +1 -0
- package/dist/src/entities/wiki/schema.js.map +1 -0
- package/dist/src/entities/workitems/index.js.map +1 -0
- package/dist/src/entities/workitems/registry.js.map +1 -0
- package/dist/src/entities/workitems/schema-readonly.js.map +1 -0
- package/dist/src/entities/workitems/schema.js.map +1 -0
- package/dist/src/graphql/DynamicWorkItemsQuery.js.map +1 -0
- package/dist/src/graphql/client.js.map +1 -0
- package/dist/src/graphql/index.js.map +1 -0
- package/dist/src/graphql/workItems.js.map +1 -0
- package/dist/{handlers.js → src/handlers.js} +15 -0
- package/dist/src/handlers.js.map +1 -0
- package/dist/{http-client.js → src/http-client.js} +0 -4
- package/dist/src/http-client.js.map +1 -0
- package/dist/src/logger.js.map +1 -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/{middleware → src/middleware}/oauth-auth.js +24 -40
- 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 +145 -0
- package/dist/src/middleware/rate-limiter.js.map +1 -0
- package/dist/src/oauth/config.js.map +1 -0
- package/dist/{oauth → src/oauth}/endpoints/authorize.js +45 -5
- 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 +129 -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 +20 -0
- package/dist/src/oauth/endpoints/index.js.map +1 -0
- package/dist/{oauth → src/oauth}/endpoints/metadata.d.ts +1 -0
- package/dist/{oauth → src/oauth}/endpoints/metadata.js +12 -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.js.map +1 -0
- package/dist/{oauth → src/oauth}/gitlab-device-flow.d.ts +2 -0
- package/dist/{oauth → src/oauth}/gitlab-device-flow.js +44 -1
- package/dist/src/oauth/gitlab-device-flow.js.map +1 -0
- package/dist/src/oauth/index.d.ts +10 -0
- package/dist/{oauth → src/oauth}/index.js +18 -1
- package/dist/src/oauth/index.js.map +1 -0
- package/dist/{oauth → src/oauth}/session-store.d.ts +19 -2
- package/dist/{oauth → src/oauth}/session-store.js +125 -5
- 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 +75 -0
- package/dist/src/oauth/storage/factory.js.map +1 -0
- package/dist/src/oauth/storage/file.d.ts +50 -0
- package/dist/src/oauth/storage/file.js +287 -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 +277 -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 +435 -0
- package/dist/src/oauth/storage/postgresql.js.map +1 -0
- package/dist/src/oauth/storage/types.d.ts +67 -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.js.map +1 -0
- package/dist/src/oauth/token-utils.js.map +1 -0
- package/dist/{oauth → src/oauth}/types.d.ts +10 -0
- package/dist/{oauth → src/oauth}/types.js.map +1 -1
- package/dist/src/registry-manager.js.map +1 -0
- package/dist/{server.d.ts → src/server.d.ts} +11 -0
- package/dist/{server.js → src/server.js} +113 -9
- package/dist/src/server.js.map +1 -0
- package/dist/{services → src/services}/ConnectionManager.d.ts +2 -0
- package/dist/{services → src/services}/ConnectionManager.js +99 -7
- package/dist/src/services/ConnectionManager.js.map +1 -0
- package/dist/src/services/GitLabVersionDetector.js.map +1 -0
- package/dist/src/services/SchemaIntrospector.js.map +1 -0
- package/dist/{services → src/services}/ToolAvailability.js +3 -4
- package/dist/src/services/ToolAvailability.js.map +1 -0
- package/dist/src/services/WidgetAvailability.js.map +1 -0
- package/dist/src/types.js.map +1 -0
- package/dist/{utils → src/utils}/fetch.js +9 -0
- package/dist/src/utils/fetch.js.map +1 -0
- package/dist/src/utils/gitlab-api.d.ts +21 -0
- package/dist/src/utils/gitlab-api.js +132 -0
- package/dist/src/utils/gitlab-api.js.map +1 -0
- package/dist/src/utils/idConversion.js.map +1 -0
- package/dist/{utils → src/utils}/namespace.js +1 -5
- package/dist/src/utils/namespace.js.map +1 -0
- package/dist/src/utils/projectIdentifier.js.map +1 -0
- package/dist/{utils → src/utils}/smart-user-search.js +1 -5
- package/dist/src/utils/smart-user-search.js.map +1 -0
- package/dist/src/utils/workItemTypes.js.map +1 -0
- package/dist/structured-world-gitlab-mcp-6.1.0.tgz +0 -0
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +26 -22
- package/dist/config.js.map +0 -1
- package/dist/entities/core/index.js.map +0 -1
- package/dist/entities/core/registry.js +0 -811
- package/dist/entities/core/registry.js.map +0 -1
- package/dist/entities/core/schema-readonly.js +0 -471
- package/dist/entities/core/schema-readonly.js.map +0 -1
- package/dist/entities/core/schema.d.ts +0 -102
- package/dist/entities/core/schema.js +0 -230
- package/dist/entities/core/schema.js.map +0 -1
- package/dist/entities/files/index.js.map +0 -1
- package/dist/entities/files/registry.js +0 -230
- package/dist/entities/files/registry.js.map +0 -1
- package/dist/entities/files/schema-readonly.js.map +0 -1
- package/dist/entities/files/schema.js +0 -38
- package/dist/entities/files/schema.js.map +0 -1
- package/dist/entities/index.js.map +0 -1
- package/dist/entities/labels/index.js.map +0 -1
- package/dist/entities/labels/registry.js.map +0 -1
- package/dist/entities/labels/schema-readonly.js.map +0 -1
- package/dist/entities/labels/schema.js.map +0 -1
- package/dist/entities/milestones/index.js.map +0 -1
- package/dist/entities/milestones/registry.js +0 -333
- package/dist/entities/milestones/registry.js.map +0 -1
- package/dist/entities/milestones/schema-readonly.js.map +0 -1
- package/dist/entities/milestones/schema.js.map +0 -1
- package/dist/entities/mrs/index.js.map +0 -1
- package/dist/entities/mrs/registry.js +0 -664
- package/dist/entities/mrs/registry.js.map +0 -1
- package/dist/entities/mrs/schema-readonly.js +0 -242
- package/dist/entities/mrs/schema-readonly.js.map +0 -1
- package/dist/entities/mrs/schema.js +0 -246
- package/dist/entities/mrs/schema.js.map +0 -1
- package/dist/entities/pipelines/index.js.map +0 -1
- package/dist/entities/pipelines/registry.js.map +0 -1
- package/dist/entities/pipelines/schema-readonly.js.map +0 -1
- package/dist/entities/pipelines/schema.js.map +0 -1
- package/dist/entities/shared.js.map +0 -1
- package/dist/entities/utils.js.map +0 -1
- package/dist/entities/variables/index.js.map +0 -1
- package/dist/entities/variables/registry.js +0 -341
- package/dist/entities/variables/registry.js.map +0 -1
- package/dist/entities/variables/schema-readonly.js.map +0 -1
- package/dist/entities/variables/schema.js.map +0 -1
- package/dist/entities/wiki/index.js.map +0 -1
- package/dist/entities/wiki/registry.js.map +0 -1
- package/dist/entities/wiki/schema-readonly.js.map +0 -1
- package/dist/entities/wiki/schema.js.map +0 -1
- package/dist/entities/workitems/index.js.map +0 -1
- package/dist/entities/workitems/registry.js.map +0 -1
- package/dist/entities/workitems/schema-readonly.js.map +0 -1
- package/dist/entities/workitems/schema.js.map +0 -1
- package/dist/graphql/DynamicWorkItemsQuery.js.map +0 -1
- package/dist/graphql/client.js.map +0 -1
- package/dist/graphql/index.js.map +0 -1
- package/dist/graphql/workItems.js.map +0 -1
- package/dist/handlers.js.map +0 -1
- package/dist/http-client.js.map +0 -1
- package/dist/logger.js.map +0 -1
- package/dist/main.js.map +0 -1
- package/dist/middleware/index.d.ts +0 -1
- package/dist/middleware/index.js +0 -8
- package/dist/middleware/index.js.map +0 -1
- package/dist/middleware/oauth-auth.js.map +0 -1
- package/dist/oauth/config.js.map +0 -1
- package/dist/oauth/endpoints/authorize.js.map +0 -1
- package/dist/oauth/endpoints/index.d.ts +0 -3
- package/dist/oauth/endpoints/index.js +0 -13
- package/dist/oauth/endpoints/index.js.map +0 -1
- package/dist/oauth/endpoints/metadata.js.map +0 -1
- package/dist/oauth/endpoints/token.js.map +0 -1
- package/dist/oauth/gitlab-device-flow.js.map +0 -1
- package/dist/oauth/index.d.ts +0 -8
- package/dist/oauth/index.js.map +0 -1
- package/dist/oauth/session-store.js.map +0 -1
- package/dist/oauth/token-context.js.map +0 -1
- package/dist/oauth/token-utils.js.map +0 -1
- package/dist/registry-manager.js.map +0 -1
- package/dist/server.js.map +0 -1
- package/dist/services/ConnectionManager.js.map +0 -1
- package/dist/services/GitLabVersionDetector.js.map +0 -1
- package/dist/services/SchemaIntrospector.js.map +0 -1
- package/dist/services/ToolAvailability.js.map +0 -1
- package/dist/services/WidgetAvailability.js.map +0 -1
- package/dist/structured-world-gitlab-mcp-5.8.0.tgz +0 -0
- package/dist/types.js.map +0 -1
- package/dist/utils/fetch.js.map +0 -1
- package/dist/utils/idConversion.js.map +0 -1
- package/dist/utils/namespace.js.map +0 -1
- package/dist/utils/projectIdentifier.js.map +0 -1
- package/dist/utils/smart-user-search.js.map +0 -1
- package/dist/utils/workItemTypes.js.map +0 -1
- package/dist/{entities → src/entities}/core/index.d.ts +0 -0
- package/dist/{entities → src/entities}/core/index.js +0 -0
- package/dist/{entities → src/entities}/core/registry.d.ts +0 -0
- package/dist/{entities → src/entities}/files/index.d.ts +0 -0
- package/dist/{entities → src/entities}/files/index.js +0 -0
- package/dist/{entities → src/entities}/files/registry.d.ts +0 -0
- package/dist/{entities → src/entities}/index.d.ts +0 -0
- package/dist/{entities → src/entities}/index.js +0 -0
- package/dist/{entities → src/entities}/labels/index.d.ts +0 -0
- package/dist/{entities → src/entities}/labels/index.js +0 -0
- package/dist/{entities → src/entities}/labels/registry.d.ts +0 -0
- package/dist/{entities → src/entities}/labels/schema-readonly.d.ts +0 -0
- package/dist/{entities → src/entities}/labels/schema-readonly.js +0 -0
- package/dist/{entities → src/entities}/labels/schema.d.ts +0 -0
- package/dist/{entities → src/entities}/labels/schema.js +0 -0
- package/dist/{entities → src/entities}/milestones/index.d.ts +0 -0
- package/dist/{entities → src/entities}/milestones/index.js +0 -0
- package/dist/{entities → src/entities}/milestones/registry.d.ts +0 -0
- package/dist/{entities → src/entities}/milestones/schema-readonly.d.ts +1 -1
- /package/dist/{entities → src/entities}/milestones/schema-readonly.js +0 -0
- /package/dist/{entities → src/entities}/milestones/schema.d.ts +0 -0
- /package/dist/{entities → src/entities}/milestones/schema.js +0 -0
- /package/dist/{entities → src/entities}/mrs/index.d.ts +0 -0
- /package/dist/{entities → src/entities}/mrs/index.js +0 -0
- /package/dist/{entities → src/entities}/mrs/registry.d.ts +0 -0
- /package/dist/{entities → src/entities}/pipelines/index.d.ts +0 -0
- /package/dist/{entities → src/entities}/pipelines/index.js +0 -0
- /package/dist/{entities → src/entities}/pipelines/registry.d.ts +0 -0
- /package/dist/{entities → src/entities}/pipelines/schema-readonly.d.ts +0 -0
- /package/dist/{entities → src/entities}/pipelines/schema-readonly.js +0 -0
- /package/dist/{entities → src/entities}/pipelines/schema.d.ts +0 -0
- /package/dist/{entities → src/entities}/pipelines/schema.js +0 -0
- /package/dist/{entities → src/entities}/shared.d.ts +0 -0
- /package/dist/{entities → src/entities}/shared.js +0 -0
- /package/dist/{entities → src/entities}/utils.d.ts +0 -0
- /package/dist/{entities → src/entities}/utils.js +0 -0
- /package/dist/{entities → src/entities}/variables/index.d.ts +0 -0
- /package/dist/{entities → src/entities}/variables/index.js +0 -0
- /package/dist/{entities → src/entities}/variables/registry.d.ts +0 -0
- /package/dist/{entities → src/entities}/variables/schema-readonly.d.ts +0 -0
- /package/dist/{entities → src/entities}/variables/schema-readonly.js +0 -0
- /package/dist/{entities → src/entities}/variables/schema.d.ts +0 -0
- /package/dist/{entities → src/entities}/variables/schema.js +0 -0
- /package/dist/{entities → src/entities}/wiki/index.d.ts +0 -0
- /package/dist/{entities → src/entities}/wiki/index.js +0 -0
- /package/dist/{entities → src/entities}/wiki/registry.d.ts +0 -0
- /package/dist/{entities → src/entities}/wiki/schema-readonly.d.ts +0 -0
- /package/dist/{entities → src/entities}/wiki/schema-readonly.js +0 -0
- /package/dist/{entities → src/entities}/wiki/schema.d.ts +0 -0
- /package/dist/{entities → src/entities}/wiki/schema.js +0 -0
- /package/dist/{entities → src/entities}/workitems/index.d.ts +0 -0
- /package/dist/{entities → src/entities}/workitems/index.js +0 -0
- /package/dist/{entities → src/entities}/workitems/registry.d.ts +0 -0
- /package/dist/{entities → src/entities}/workitems/registry.js +0 -0
- /package/dist/{entities → src/entities}/workitems/schema-readonly.d.ts +0 -0
- /package/dist/{entities → src/entities}/workitems/schema-readonly.js +0 -0
- /package/dist/{entities → src/entities}/workitems/schema.d.ts +0 -0
- /package/dist/{entities → src/entities}/workitems/schema.js +0 -0
- /package/dist/{graphql → src/graphql}/DynamicWorkItemsQuery.d.ts +0 -0
- /package/dist/{graphql → src/graphql}/DynamicWorkItemsQuery.js +0 -0
- /package/dist/{graphql → src/graphql}/client.d.ts +0 -0
- /package/dist/{graphql → src/graphql}/client.js +0 -0
- /package/dist/{graphql → src/graphql}/index.d.ts +0 -0
- /package/dist/{graphql → src/graphql}/index.js +0 -0
- /package/dist/{graphql → src/graphql}/workItems.d.ts +0 -0
- /package/dist/{graphql → src/graphql}/workItems.js +0 -0
- /package/dist/{handlers.d.ts → src/handlers.d.ts} +0 -0
- /package/dist/{http-client.d.ts → src/http-client.d.ts} +0 -0
- /package/dist/{logger.d.ts → src/logger.d.ts} +0 -0
- /package/dist/{logger.js → src/logger.js} +0 -0
- /package/dist/{main.d.ts → src/main.d.ts} +0 -0
- /package/dist/{main.js → src/main.js} +0 -0
- /package/dist/{middleware → src/middleware}/oauth-auth.d.ts +0 -0
- /package/dist/{oauth → src/oauth}/config.d.ts +0 -0
- /package/dist/{oauth → src/oauth}/config.js +0 -0
- /package/dist/{oauth → src/oauth}/endpoints/authorize.d.ts +0 -0
- /package/dist/{oauth → src/oauth}/endpoints/token.d.ts +0 -0
- /package/dist/{oauth → src/oauth}/endpoints/token.js +0 -0
- /package/dist/{oauth → src/oauth}/token-context.d.ts +0 -0
- /package/dist/{oauth → src/oauth}/token-context.js +0 -0
- /package/dist/{oauth → src/oauth}/token-utils.d.ts +0 -0
- /package/dist/{oauth → src/oauth}/token-utils.js +0 -0
- /package/dist/{oauth → src/oauth}/types.js +0 -0
- /package/dist/{registry-manager.d.ts → src/registry-manager.d.ts} +0 -0
- /package/dist/{registry-manager.js → src/registry-manager.js} +0 -0
- /package/dist/{services → src/services}/GitLabVersionDetector.d.ts +0 -0
- /package/dist/{services → src/services}/GitLabVersionDetector.js +0 -0
- /package/dist/{services → src/services}/SchemaIntrospector.d.ts +0 -0
- /package/dist/{services → src/services}/SchemaIntrospector.js +0 -0
- /package/dist/{services → src/services}/ToolAvailability.d.ts +0 -0
- /package/dist/{services → src/services}/WidgetAvailability.d.ts +0 -0
- /package/dist/{services → src/services}/WidgetAvailability.js +0 -0
- /package/dist/{types.d.ts → src/types.d.ts} +0 -0
- /package/dist/{types.js → src/types.js} +0 -0
- /package/dist/{utils → src/utils}/fetch.d.ts +0 -0
- /package/dist/{utils → src/utils}/idConversion.d.ts +0 -0
- /package/dist/{utils → src/utils}/idConversion.js +0 -0
- /package/dist/{utils → src/utils}/namespace.d.ts +0 -0
- /package/dist/{utils → src/utils}/projectIdentifier.d.ts +0 -0
- /package/dist/{utils → src/utils}/projectIdentifier.js +0 -0
- /package/dist/{utils → src/utils}/smart-user-search.d.ts +0 -0
- /package/dist/{utils → src/utils}/workItemTypes.d.ts +0 -0
- /package/dist/{utils → src/utils}/workItemTypes.js +0 -0
|
@@ -1,664 +0,0 @@
|
|
|
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.mrsToolRegistry = void 0;
|
|
37
|
-
exports.getMrsReadOnlyToolNames = getMrsReadOnlyToolNames;
|
|
38
|
-
exports.getMrsToolDefinitions = getMrsToolDefinitions;
|
|
39
|
-
exports.getFilteredMrsTools = getFilteredMrsTools;
|
|
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 idConversion_1 = require("../../utils/idConversion");
|
|
46
|
-
exports.mrsToolRegistry = new Map([
|
|
47
|
-
[
|
|
48
|
-
"get_branch_diffs",
|
|
49
|
-
{
|
|
50
|
-
name: "get_branch_diffs",
|
|
51
|
-
description: "COMPARE: Get diffs between two branches or commits in a GitLab project. Use when: Reviewing changes before merging, Analyzing code differences, Generating change reports. Supports both direct comparison and merge-base comparison methods.",
|
|
52
|
-
inputSchema: z.toJSONSchema(schema_readonly_1.GetBranchDiffsSchema),
|
|
53
|
-
handler: async (args) => {
|
|
54
|
-
const options = schema_readonly_1.GetBranchDiffsSchema.parse(args);
|
|
55
|
-
const { project_id, from, to, straight } = options;
|
|
56
|
-
const queryParams = new URLSearchParams();
|
|
57
|
-
if (straight !== undefined) {
|
|
58
|
-
queryParams.set("straight", String(straight));
|
|
59
|
-
}
|
|
60
|
-
const apiUrl = `${process.env.GITLAB_API_URL}/api/v4/projects/${(0, projectIdentifier_1.normalizeProjectId)(project_id)}/repository/compare?from=${encodeURIComponent(from)}&to=${encodeURIComponent(to)}&${queryParams}`;
|
|
61
|
-
const response = await (0, fetch_1.enhancedFetch)(apiUrl, {
|
|
62
|
-
headers: {
|
|
63
|
-
Authorization: `Bearer ${process.env.GITLAB_TOKEN}`,
|
|
64
|
-
},
|
|
65
|
-
});
|
|
66
|
-
if (!response.ok) {
|
|
67
|
-
throw new Error(`GitLab API error: ${response.status} ${response.statusText}`);
|
|
68
|
-
}
|
|
69
|
-
const diff = await response.json();
|
|
70
|
-
return (0, idConversion_1.cleanGidsFromObject)(diff);
|
|
71
|
-
},
|
|
72
|
-
},
|
|
73
|
-
],
|
|
74
|
-
[
|
|
75
|
-
"get_merge_request",
|
|
76
|
-
{
|
|
77
|
-
name: "get_merge_request",
|
|
78
|
-
description: "READ: Get comprehensive details of a merge request including status, discussions, and approvals. Use when: Reviewing MR details, Checking merge status, Gathering information for automation. Accepts either MR IID or source branch name for flexibility.",
|
|
79
|
-
inputSchema: z.toJSONSchema(schema_readonly_1.GetMergeRequestSchema),
|
|
80
|
-
handler: async (args) => {
|
|
81
|
-
const options = schema_readonly_1.GetMergeRequestSchema.parse(args);
|
|
82
|
-
const { project_id, merge_request_iid, branch_name } = options;
|
|
83
|
-
let apiUrl;
|
|
84
|
-
if (merge_request_iid) {
|
|
85
|
-
apiUrl = `${process.env.GITLAB_API_URL}/api/v4/projects/${(0, projectIdentifier_1.normalizeProjectId)(project_id)}/merge_requests/${merge_request_iid}`;
|
|
86
|
-
}
|
|
87
|
-
else if (branch_name) {
|
|
88
|
-
apiUrl = `${process.env.GITLAB_API_URL}/api/v4/projects/${(0, projectIdentifier_1.normalizeProjectId)(project_id)}/merge_requests?source_branch=${encodeURIComponent(branch_name)}`;
|
|
89
|
-
}
|
|
90
|
-
else {
|
|
91
|
-
throw new Error("Either merge_request_iid or branch_name must be provided");
|
|
92
|
-
}
|
|
93
|
-
const response = await (0, fetch_1.enhancedFetch)(apiUrl, {
|
|
94
|
-
headers: {
|
|
95
|
-
Authorization: `Bearer ${process.env.GITLAB_TOKEN}`,
|
|
96
|
-
},
|
|
97
|
-
});
|
|
98
|
-
if (!response.ok) {
|
|
99
|
-
throw new Error(`GitLab API error: ${response.status} ${response.statusText}`);
|
|
100
|
-
}
|
|
101
|
-
const result = await response.json();
|
|
102
|
-
if (branch_name) {
|
|
103
|
-
if (Array.isArray(result) && result.length > 0) {
|
|
104
|
-
return result[0];
|
|
105
|
-
}
|
|
106
|
-
else {
|
|
107
|
-
throw new Error("No merge request found for branch");
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
return (0, idConversion_1.cleanGidsFromObject)(result);
|
|
111
|
-
},
|
|
112
|
-
},
|
|
113
|
-
],
|
|
114
|
-
[
|
|
115
|
-
"list_merge_requests",
|
|
116
|
-
{
|
|
117
|
-
name: "list_merge_requests",
|
|
118
|
-
description: "BROWSE: List merge requests in a GitLab project with extensive filtering capabilities. Use when: Finding MRs by state/author/assignee, Complex queries for MR management, Reporting on merge requests. Can search globally or within specific projects.",
|
|
119
|
-
inputSchema: z.toJSONSchema(schema_readonly_1.ListMergeRequestsSchema),
|
|
120
|
-
handler: async (args) => {
|
|
121
|
-
const options = schema_readonly_1.ListMergeRequestsSchema.parse(args);
|
|
122
|
-
const queryParams = new URLSearchParams();
|
|
123
|
-
Object.entries(options).forEach(([key, value]) => {
|
|
124
|
-
if (value !== undefined && value !== null && key !== "project_id") {
|
|
125
|
-
queryParams.set(key, String(value));
|
|
126
|
-
}
|
|
127
|
-
});
|
|
128
|
-
const apiUrl = options.project_id
|
|
129
|
-
? `${process.env.GITLAB_API_URL}/api/v4/projects/${encodeURIComponent(options.project_id)}/merge_requests?${queryParams}`
|
|
130
|
-
: `${process.env.GITLAB_API_URL}/api/v4/merge_requests?${queryParams}`;
|
|
131
|
-
const response = await (0, fetch_1.enhancedFetch)(apiUrl, {
|
|
132
|
-
headers: {
|
|
133
|
-
Authorization: `Bearer ${process.env.GITLAB_TOKEN}`,
|
|
134
|
-
},
|
|
135
|
-
});
|
|
136
|
-
if (!response.ok) {
|
|
137
|
-
throw new Error(`GitLab API error: ${response.status} ${response.statusText}`);
|
|
138
|
-
}
|
|
139
|
-
const mergeRequests = await response.json();
|
|
140
|
-
return (0, idConversion_1.cleanGidsFromObject)(mergeRequests);
|
|
141
|
-
},
|
|
142
|
-
},
|
|
143
|
-
],
|
|
144
|
-
[
|
|
145
|
-
"get_merge_request_diffs",
|
|
146
|
-
{
|
|
147
|
-
name: "get_merge_request_diffs",
|
|
148
|
-
description: "READ: Get all file changes and diffs included in a merge request. Use when: Reviewing code changes, Analyzing modifications, Automating code review processes. Shows actual file differences that would be applied if merged.",
|
|
149
|
-
inputSchema: z.toJSONSchema(schema_readonly_1.GetMergeRequestDiffsSchema),
|
|
150
|
-
handler: async (args) => {
|
|
151
|
-
const options = schema_readonly_1.GetMergeRequestDiffsSchema.parse(args);
|
|
152
|
-
const { project_id, merge_request_iid, page, per_page } = options;
|
|
153
|
-
const queryParams = new URLSearchParams();
|
|
154
|
-
if (page !== undefined) {
|
|
155
|
-
queryParams.set("page", String(page));
|
|
156
|
-
}
|
|
157
|
-
if (per_page !== undefined) {
|
|
158
|
-
queryParams.set("per_page", String(per_page));
|
|
159
|
-
}
|
|
160
|
-
const apiUrl = `${process.env.GITLAB_API_URL}/api/v4/projects/${(0, projectIdentifier_1.normalizeProjectId)(project_id)}/merge_requests/${merge_request_iid}/changes?${queryParams}`;
|
|
161
|
-
const response = await (0, fetch_1.enhancedFetch)(apiUrl, {
|
|
162
|
-
headers: {
|
|
163
|
-
Authorization: `Bearer ${process.env.GITLAB_TOKEN}`,
|
|
164
|
-
},
|
|
165
|
-
});
|
|
166
|
-
if (!response.ok) {
|
|
167
|
-
throw new Error(`GitLab API error: ${response.status} ${response.statusText}`);
|
|
168
|
-
}
|
|
169
|
-
const diffs = await response.json();
|
|
170
|
-
return (0, idConversion_1.cleanGidsFromObject)(diffs);
|
|
171
|
-
},
|
|
172
|
-
},
|
|
173
|
-
],
|
|
174
|
-
[
|
|
175
|
-
"list_merge_request_diffs",
|
|
176
|
-
{
|
|
177
|
-
name: "list_merge_request_diffs",
|
|
178
|
-
description: "BROWSE: List all diffs in a merge request with pagination for large changesets. Use when: Dealing with MRs containing many changes, Managing memory usage, Processing large diffs efficiently. Provides paginated access to file modifications.",
|
|
179
|
-
inputSchema: z.toJSONSchema(schema_readonly_1.ListMergeRequestDiffsSchema),
|
|
180
|
-
handler: async (args) => {
|
|
181
|
-
const options = schema_readonly_1.ListMergeRequestDiffsSchema.parse(args);
|
|
182
|
-
const { project_id, merge_request_iid, page, per_page } = options;
|
|
183
|
-
const queryParams = new URLSearchParams();
|
|
184
|
-
if (page !== undefined) {
|
|
185
|
-
queryParams.set("page", String(page));
|
|
186
|
-
}
|
|
187
|
-
if (per_page !== undefined) {
|
|
188
|
-
queryParams.set("per_page", String(per_page));
|
|
189
|
-
}
|
|
190
|
-
const apiUrl = `${process.env.GITLAB_API_URL}/api/v4/projects/${(0, projectIdentifier_1.normalizeProjectId)(project_id)}/merge_requests/${merge_request_iid}/diffs?${queryParams}`;
|
|
191
|
-
const response = await (0, fetch_1.enhancedFetch)(apiUrl, {
|
|
192
|
-
headers: {
|
|
193
|
-
Authorization: `Bearer ${process.env.GITLAB_TOKEN}`,
|
|
194
|
-
},
|
|
195
|
-
});
|
|
196
|
-
if (!response.ok) {
|
|
197
|
-
throw new Error(`GitLab API error: ${response.status} ${response.statusText}`);
|
|
198
|
-
}
|
|
199
|
-
const diffs = await response.json();
|
|
200
|
-
return (0, idConversion_1.cleanGidsFromObject)(diffs);
|
|
201
|
-
},
|
|
202
|
-
},
|
|
203
|
-
],
|
|
204
|
-
[
|
|
205
|
-
"mr_discussions",
|
|
206
|
-
{
|
|
207
|
-
name: "mr_discussions",
|
|
208
|
-
description: "DISCUSS: List all discussion threads and comments on a merge request. Use when: Tracking code review feedback, Managing conversations, Extracting review insights. Includes both resolved and unresolved discussions with full context.",
|
|
209
|
-
inputSchema: z.toJSONSchema(schema_readonly_1.ListMergeRequestDiscussionsSchema),
|
|
210
|
-
handler: async (args) => {
|
|
211
|
-
const options = schema_readonly_1.ListMergeRequestDiscussionsSchema.parse(args);
|
|
212
|
-
const { project_id, merge_request_iid } = options;
|
|
213
|
-
const queryParams = new URLSearchParams();
|
|
214
|
-
Object.entries(options).forEach(([key, value]) => {
|
|
215
|
-
if (value !== undefined && key !== "project_id" && key !== "merge_request_iid") {
|
|
216
|
-
queryParams.set(key, String(value));
|
|
217
|
-
}
|
|
218
|
-
});
|
|
219
|
-
const apiUrl = `${process.env.GITLAB_API_URL}/api/v4/projects/${(0, projectIdentifier_1.normalizeProjectId)(project_id)}/merge_requests/${merge_request_iid}/discussions?${queryParams}`;
|
|
220
|
-
const response = await (0, fetch_1.enhancedFetch)(apiUrl, {
|
|
221
|
-
headers: {
|
|
222
|
-
Authorization: `Bearer ${process.env.GITLAB_TOKEN}`,
|
|
223
|
-
},
|
|
224
|
-
});
|
|
225
|
-
if (!response.ok) {
|
|
226
|
-
throw new Error(`GitLab API error: ${response.status} ${response.statusText}`);
|
|
227
|
-
}
|
|
228
|
-
const discussions = await response.json();
|
|
229
|
-
return (0, idConversion_1.cleanGidsFromObject)(discussions);
|
|
230
|
-
},
|
|
231
|
-
},
|
|
232
|
-
],
|
|
233
|
-
[
|
|
234
|
-
"get_draft_note",
|
|
235
|
-
{
|
|
236
|
-
name: "get_draft_note",
|
|
237
|
-
description: "DRAFT: Retrieve a specific draft note (unpublished comment) from a merge request. Use when: Reviewing pending feedback before publishing, Managing draft review comments. Draft notes are only visible to their author until published.",
|
|
238
|
-
inputSchema: z.toJSONSchema(schema_readonly_1.GetDraftNoteSchema),
|
|
239
|
-
handler: async (args) => {
|
|
240
|
-
const options = schema_readonly_1.GetDraftNoteSchema.parse(args);
|
|
241
|
-
const { project_id, merge_request_iid, draft_note_id } = options;
|
|
242
|
-
const apiUrl = `${process.env.GITLAB_API_URL}/api/v4/projects/${(0, projectIdentifier_1.normalizeProjectId)(project_id)}/merge_requests/${merge_request_iid}/draft_notes/${draft_note_id}`;
|
|
243
|
-
const response = await (0, fetch_1.enhancedFetch)(apiUrl, {
|
|
244
|
-
headers: {
|
|
245
|
-
Authorization: `Bearer ${process.env.GITLAB_TOKEN}`,
|
|
246
|
-
},
|
|
247
|
-
});
|
|
248
|
-
if (!response.ok) {
|
|
249
|
-
throw new Error(`GitLab API error: ${response.status} ${response.statusText}`);
|
|
250
|
-
}
|
|
251
|
-
const draftNote = await response.json();
|
|
252
|
-
return (0, idConversion_1.cleanGidsFromObject)(draftNote);
|
|
253
|
-
},
|
|
254
|
-
},
|
|
255
|
-
],
|
|
256
|
-
[
|
|
257
|
-
"list_draft_notes",
|
|
258
|
-
{
|
|
259
|
-
name: "list_draft_notes",
|
|
260
|
-
description: "DRAFT: List all draft notes (unpublished comments) for a merge request. Use when: Reviewing all pending feedback before publishing, Managing batch review comments. Draft notes allow reviewers to prepare comprehensive feedback before sharing.",
|
|
261
|
-
inputSchema: z.toJSONSchema(schema_readonly_1.ListDraftNotesSchema),
|
|
262
|
-
handler: async (args) => {
|
|
263
|
-
const options = schema_readonly_1.ListDraftNotesSchema.parse(args);
|
|
264
|
-
const { project_id, merge_request_iid } = options;
|
|
265
|
-
const queryParams = new URLSearchParams();
|
|
266
|
-
Object.entries(options).forEach(([key, value]) => {
|
|
267
|
-
if (value !== undefined && key !== "project_id" && key !== "merge_request_iid") {
|
|
268
|
-
queryParams.set(key, String(value));
|
|
269
|
-
}
|
|
270
|
-
});
|
|
271
|
-
const apiUrl = `${process.env.GITLAB_API_URL}/api/v4/projects/${(0, projectIdentifier_1.normalizeProjectId)(project_id)}/merge_requests/${merge_request_iid}/draft_notes?${queryParams}`;
|
|
272
|
-
const response = await (0, fetch_1.enhancedFetch)(apiUrl, {
|
|
273
|
-
headers: {
|
|
274
|
-
Authorization: `Bearer ${process.env.GITLAB_TOKEN}`,
|
|
275
|
-
},
|
|
276
|
-
});
|
|
277
|
-
if (!response.ok) {
|
|
278
|
-
throw new Error(`GitLab API error: ${response.status} ${response.statusText}`);
|
|
279
|
-
}
|
|
280
|
-
const draftNotes = await response.json();
|
|
281
|
-
return (0, idConversion_1.cleanGidsFromObject)(draftNotes);
|
|
282
|
-
},
|
|
283
|
-
},
|
|
284
|
-
],
|
|
285
|
-
[
|
|
286
|
-
"create_merge_request",
|
|
287
|
-
{
|
|
288
|
-
name: "create_merge_request",
|
|
289
|
-
description: "CREATE: Create a new merge request to propose code changes for review and merging. Use when: Initiating code review process, Proposing features, Submitting fixes. For labels: Use list_labels FIRST to discover existing project taxonomy. Requires source and target branches, supports setting assignees, reviewers, and labels.",
|
|
290
|
-
inputSchema: z.toJSONSchema(schema_1.CreateMergeRequestSchema),
|
|
291
|
-
handler: async (args) => {
|
|
292
|
-
const options = schema_1.CreateMergeRequestSchema.parse(args);
|
|
293
|
-
const body = new URLSearchParams();
|
|
294
|
-
Object.entries(options).forEach(([key, value]) => {
|
|
295
|
-
if (value !== undefined && value !== null) {
|
|
296
|
-
if (Array.isArray(value)) {
|
|
297
|
-
body.set(key, value.join(","));
|
|
298
|
-
}
|
|
299
|
-
else {
|
|
300
|
-
body.set(key, String(value));
|
|
301
|
-
}
|
|
302
|
-
}
|
|
303
|
-
});
|
|
304
|
-
const apiUrl = `${process.env.GITLAB_API_URL}/api/v4/projects/${encodeURIComponent(options.project_id)}/merge_requests`;
|
|
305
|
-
const response = await (0, fetch_1.enhancedFetch)(apiUrl, {
|
|
306
|
-
method: "POST",
|
|
307
|
-
headers: {
|
|
308
|
-
Authorization: `Bearer ${process.env.GITLAB_TOKEN}`,
|
|
309
|
-
"Content-Type": "application/x-www-form-urlencoded",
|
|
310
|
-
},
|
|
311
|
-
body: body.toString(),
|
|
312
|
-
});
|
|
313
|
-
if (!response.ok) {
|
|
314
|
-
throw new Error(`GitLab API error: ${response.status} ${response.statusText}`);
|
|
315
|
-
}
|
|
316
|
-
const mergeRequest = await response.json();
|
|
317
|
-
return (0, idConversion_1.cleanGidsFromObject)(mergeRequest);
|
|
318
|
-
},
|
|
319
|
-
},
|
|
320
|
-
],
|
|
321
|
-
[
|
|
322
|
-
"merge_merge_request",
|
|
323
|
-
{
|
|
324
|
-
name: "merge_merge_request",
|
|
325
|
-
description: "MERGE: Merge an approved merge request into the target branch. Use when: Completing the code review process, Integrating changes. Supports various merge methods (merge commit, squash, rebase) and can delete source branch after merging.",
|
|
326
|
-
inputSchema: z.toJSONSchema(schema_1.MergeMergeRequestSchema),
|
|
327
|
-
handler: async (args) => {
|
|
328
|
-
const options = schema_1.MergeMergeRequestSchema.parse(args);
|
|
329
|
-
const body = new URLSearchParams();
|
|
330
|
-
Object.entries(options).forEach(([key, value]) => {
|
|
331
|
-
if (value !== undefined && key !== "project_id" && key !== "merge_request_iid") {
|
|
332
|
-
body.set(key, String(value));
|
|
333
|
-
}
|
|
334
|
-
});
|
|
335
|
-
const apiUrl = `${process.env.GITLAB_API_URL}/api/v4/projects/${encodeURIComponent(options.project_id)}/merge_requests/${options.merge_request_iid}/merge`;
|
|
336
|
-
const response = await (0, fetch_1.enhancedFetch)(apiUrl, {
|
|
337
|
-
method: "PUT",
|
|
338
|
-
headers: {
|
|
339
|
-
Authorization: `Bearer ${process.env.GITLAB_TOKEN}`,
|
|
340
|
-
"Content-Type": "application/x-www-form-urlencoded",
|
|
341
|
-
},
|
|
342
|
-
body: body.toString(),
|
|
343
|
-
});
|
|
344
|
-
if (!response.ok) {
|
|
345
|
-
throw new Error(`GitLab API error: ${response.status} ${response.statusText}`);
|
|
346
|
-
}
|
|
347
|
-
const result = await response.json();
|
|
348
|
-
return (0, idConversion_1.cleanGidsFromObject)(result);
|
|
349
|
-
},
|
|
350
|
-
},
|
|
351
|
-
],
|
|
352
|
-
[
|
|
353
|
-
"create_note",
|
|
354
|
-
{
|
|
355
|
-
name: "create_note",
|
|
356
|
-
description: "COMMENT: Add a comment to an issue or merge request for discussion or feedback. Use when: Providing code review comments, Asking questions, Documenting decisions. Supports markdown formatting and can trigger notifications to participants.",
|
|
357
|
-
inputSchema: z.toJSONSchema(schema_1.CreateNoteSchema),
|
|
358
|
-
handler: async (args) => {
|
|
359
|
-
const options = schema_1.CreateNoteSchema.parse(args);
|
|
360
|
-
const body = new URLSearchParams();
|
|
361
|
-
body.set("body", options.body);
|
|
362
|
-
if (options.created_at) {
|
|
363
|
-
body.set("created_at", options.created_at);
|
|
364
|
-
}
|
|
365
|
-
if (options.confidential !== undefined) {
|
|
366
|
-
body.set("confidential", String(options.confidential));
|
|
367
|
-
}
|
|
368
|
-
const resourceType = options.noteable_type === "merge_request" ? "merge_requests" : "issues";
|
|
369
|
-
const resourceId = options.noteable_id;
|
|
370
|
-
const apiUrl = `${process.env.GITLAB_API_URL}/api/v4/projects/${encodeURIComponent(options.project_id)}/${resourceType}/${resourceId}/notes`;
|
|
371
|
-
const response = await (0, fetch_1.enhancedFetch)(apiUrl, {
|
|
372
|
-
method: "POST",
|
|
373
|
-
headers: {
|
|
374
|
-
Authorization: `Bearer ${process.env.GITLAB_TOKEN}`,
|
|
375
|
-
"Content-Type": "application/x-www-form-urlencoded",
|
|
376
|
-
},
|
|
377
|
-
body: body.toString(),
|
|
378
|
-
});
|
|
379
|
-
if (!response.ok) {
|
|
380
|
-
throw new Error(`GitLab API error: ${response.status} ${response.statusText}`);
|
|
381
|
-
}
|
|
382
|
-
const note = await response.json();
|
|
383
|
-
return (0, idConversion_1.cleanGidsFromObject)(note);
|
|
384
|
-
},
|
|
385
|
-
},
|
|
386
|
-
],
|
|
387
|
-
[
|
|
388
|
-
"create_draft_note",
|
|
389
|
-
{
|
|
390
|
-
name: "create_draft_note",
|
|
391
|
-
description: "DRAFT: Create a draft note (unpublished comment) on a merge request. Use when: Preparing review feedback that can be refined before publishing. Draft notes are ideal for comprehensive reviews where all comments are published together.",
|
|
392
|
-
inputSchema: z.toJSONSchema(schema_1.CreateDraftNoteSchema),
|
|
393
|
-
handler: async (args) => {
|
|
394
|
-
const options = schema_1.CreateDraftNoteSchema.parse(args);
|
|
395
|
-
const body = new URLSearchParams();
|
|
396
|
-
body.set("note", options.note);
|
|
397
|
-
if (options.position) {
|
|
398
|
-
body.set("position", JSON.stringify(options.position));
|
|
399
|
-
}
|
|
400
|
-
const apiUrl = `${process.env.GITLAB_API_URL}/api/v4/projects/${encodeURIComponent(options.project_id)}/merge_requests/${options.merge_request_iid}/draft_notes`;
|
|
401
|
-
const response = await (0, fetch_1.enhancedFetch)(apiUrl, {
|
|
402
|
-
method: "POST",
|
|
403
|
-
headers: {
|
|
404
|
-
Authorization: `Bearer ${process.env.GITLAB_TOKEN}`,
|
|
405
|
-
"Content-Type": "application/x-www-form-urlencoded",
|
|
406
|
-
},
|
|
407
|
-
body: body.toString(),
|
|
408
|
-
});
|
|
409
|
-
if (!response.ok) {
|
|
410
|
-
throw new Error(`GitLab API error: ${response.status} ${response.statusText}`);
|
|
411
|
-
}
|
|
412
|
-
const draftNote = await response.json();
|
|
413
|
-
return (0, idConversion_1.cleanGidsFromObject)(draftNote);
|
|
414
|
-
},
|
|
415
|
-
},
|
|
416
|
-
],
|
|
417
|
-
[
|
|
418
|
-
"publish_draft_note",
|
|
419
|
-
{
|
|
420
|
-
name: "publish_draft_note",
|
|
421
|
-
description: "DRAFT: Publish a previously created draft note to make it visible to all participants. Use when: Selectively sharing specific review comments when ready. Once published, the note becomes a regular comment and triggers notifications.",
|
|
422
|
-
inputSchema: z.toJSONSchema(schema_1.PublishDraftNoteSchema),
|
|
423
|
-
handler: async (args) => {
|
|
424
|
-
const options = schema_1.PublishDraftNoteSchema.parse(args);
|
|
425
|
-
const apiUrl = `${process.env.GITLAB_API_URL}/api/v4/projects/${encodeURIComponent(options.project_id)}/merge_requests/${options.merge_request_iid}/draft_notes/${options.draft_note_id}/publish`;
|
|
426
|
-
const response = await (0, fetch_1.enhancedFetch)(apiUrl, {
|
|
427
|
-
method: "PUT",
|
|
428
|
-
headers: {
|
|
429
|
-
Authorization: `Bearer ${process.env.GITLAB_TOKEN}`,
|
|
430
|
-
},
|
|
431
|
-
});
|
|
432
|
-
if (!response.ok) {
|
|
433
|
-
throw new Error(`GitLab API error: ${response.status} ${response.statusText}`);
|
|
434
|
-
}
|
|
435
|
-
const result = response.status === 204 ? { published: true } : await response.json();
|
|
436
|
-
return (0, idConversion_1.cleanGidsFromObject)(result);
|
|
437
|
-
},
|
|
438
|
-
},
|
|
439
|
-
],
|
|
440
|
-
[
|
|
441
|
-
"bulk_publish_draft_notes",
|
|
442
|
-
{
|
|
443
|
-
name: "bulk_publish_draft_notes",
|
|
444
|
-
description: "Publish all pending draft notes for a merge request simultaneously. Use to share comprehensive review feedback in one action. Ideal for thorough code reviews where all comments should be seen together for context.",
|
|
445
|
-
inputSchema: z.toJSONSchema(schema_1.BulkPublishDraftNotesSchema),
|
|
446
|
-
handler: async (args) => {
|
|
447
|
-
const options = schema_1.BulkPublishDraftNotesSchema.parse(args);
|
|
448
|
-
const apiUrl = `${process.env.GITLAB_API_URL}/api/v4/projects/${encodeURIComponent(options.project_id)}/merge_requests/${options.merge_request_iid}/draft_notes/bulk_publish`;
|
|
449
|
-
const response = await (0, fetch_1.enhancedFetch)(apiUrl, {
|
|
450
|
-
method: "POST",
|
|
451
|
-
headers: {
|
|
452
|
-
Authorization: `Bearer ${process.env.GITLAB_TOKEN}`,
|
|
453
|
-
},
|
|
454
|
-
});
|
|
455
|
-
if (!response.ok) {
|
|
456
|
-
throw new Error(`GitLab API error: ${response.status} ${response.statusText}`);
|
|
457
|
-
}
|
|
458
|
-
const result = response.status === 204 ? { published: true } : await response.json();
|
|
459
|
-
return (0, idConversion_1.cleanGidsFromObject)(result);
|
|
460
|
-
},
|
|
461
|
-
},
|
|
462
|
-
],
|
|
463
|
-
[
|
|
464
|
-
"update_merge_request",
|
|
465
|
-
{
|
|
466
|
-
name: "update_merge_request",
|
|
467
|
-
description: "UPDATE: Update properties of an existing merge request such as title, description, or assignees. Use when: Refining MR details, Changing reviewers, Updating labels. For labels: Use list_labels FIRST to discover existing taxonomy before updating. Accepts either MR IID or source branch name for identification.",
|
|
468
|
-
inputSchema: z.toJSONSchema(schema_1.UpdateMergeRequestSchema),
|
|
469
|
-
handler: async (args) => {
|
|
470
|
-
const options = schema_1.UpdateMergeRequestSchema.parse(args);
|
|
471
|
-
const body = new URLSearchParams();
|
|
472
|
-
Object.entries(options).forEach(([key, value]) => {
|
|
473
|
-
if (value !== undefined && key !== "project_id" && key !== "merge_request_iid") {
|
|
474
|
-
if (Array.isArray(value)) {
|
|
475
|
-
body.set(key, value.join(","));
|
|
476
|
-
}
|
|
477
|
-
else {
|
|
478
|
-
body.set(key, String(value));
|
|
479
|
-
}
|
|
480
|
-
}
|
|
481
|
-
});
|
|
482
|
-
const apiUrl = `${process.env.GITLAB_API_URL}/api/v4/projects/${encodeURIComponent(options.project_id)}/merge_requests/${options.merge_request_iid}`;
|
|
483
|
-
const response = await (0, fetch_1.enhancedFetch)(apiUrl, {
|
|
484
|
-
method: "PUT",
|
|
485
|
-
headers: {
|
|
486
|
-
Authorization: `Bearer ${process.env.GITLAB_TOKEN}`,
|
|
487
|
-
"Content-Type": "application/x-www-form-urlencoded",
|
|
488
|
-
},
|
|
489
|
-
body: body.toString(),
|
|
490
|
-
});
|
|
491
|
-
if (!response.ok) {
|
|
492
|
-
throw new Error(`GitLab API error: ${response.status} ${response.statusText}`);
|
|
493
|
-
}
|
|
494
|
-
const mergeRequest = await response.json();
|
|
495
|
-
return (0, idConversion_1.cleanGidsFromObject)(mergeRequest);
|
|
496
|
-
},
|
|
497
|
-
},
|
|
498
|
-
],
|
|
499
|
-
[
|
|
500
|
-
"create_merge_request_thread",
|
|
501
|
-
{
|
|
502
|
-
name: "create_merge_request_thread",
|
|
503
|
-
description: "Start a new discussion thread on a merge request for focused conversation. Use to raise specific concerns, ask questions about code sections, or initiate design discussions. Threads can be resolved when addressed.",
|
|
504
|
-
inputSchema: z.toJSONSchema(schema_1.CreateMergeRequestThreadSchema),
|
|
505
|
-
handler: async (args) => {
|
|
506
|
-
const options = schema_1.CreateMergeRequestThreadSchema.parse(args);
|
|
507
|
-
const body = new URLSearchParams();
|
|
508
|
-
body.set("body", options.body);
|
|
509
|
-
if (options.position) {
|
|
510
|
-
body.set("position", JSON.stringify(options.position));
|
|
511
|
-
}
|
|
512
|
-
if (options.commit_id) {
|
|
513
|
-
body.set("commit_id", options.commit_id);
|
|
514
|
-
}
|
|
515
|
-
const apiUrl = `${process.env.GITLAB_API_URL}/api/v4/projects/${encodeURIComponent(options.project_id)}/merge_requests/${options.merge_request_iid}/discussions`;
|
|
516
|
-
const response = await (0, fetch_1.enhancedFetch)(apiUrl, {
|
|
517
|
-
method: "POST",
|
|
518
|
-
headers: {
|
|
519
|
-
Authorization: `Bearer ${process.env.GITLAB_TOKEN}`,
|
|
520
|
-
"Content-Type": "application/x-www-form-urlencoded",
|
|
521
|
-
},
|
|
522
|
-
body: body.toString(),
|
|
523
|
-
});
|
|
524
|
-
if (!response.ok) {
|
|
525
|
-
throw new Error(`GitLab API error: ${response.status} ${response.statusText}`);
|
|
526
|
-
}
|
|
527
|
-
const discussion = await response.json();
|
|
528
|
-
return (0, idConversion_1.cleanGidsFromObject)(discussion);
|
|
529
|
-
},
|
|
530
|
-
},
|
|
531
|
-
],
|
|
532
|
-
[
|
|
533
|
-
"update_merge_request_note",
|
|
534
|
-
{
|
|
535
|
-
name: "update_merge_request_note",
|
|
536
|
-
description: "Edit an existing comment within a merge request discussion thread. Use to correct mistakes, clarify points, or update information in previous comments. Maintains discussion history while allowing content refinement.",
|
|
537
|
-
inputSchema: z.toJSONSchema(schema_1.UpdateMergeRequestNoteSchema),
|
|
538
|
-
handler: async (args) => {
|
|
539
|
-
const options = schema_1.UpdateMergeRequestNoteSchema.parse(args);
|
|
540
|
-
const body = new URLSearchParams();
|
|
541
|
-
body.set("body", options.body);
|
|
542
|
-
const apiUrl = `${process.env.GITLAB_API_URL}/api/v4/projects/${encodeURIComponent(options.project_id)}/merge_requests/${options.merge_request_iid}/notes/${options.note_id}`;
|
|
543
|
-
const response = await (0, fetch_1.enhancedFetch)(apiUrl, {
|
|
544
|
-
method: "PUT",
|
|
545
|
-
headers: {
|
|
546
|
-
Authorization: `Bearer ${process.env.GITLAB_TOKEN}`,
|
|
547
|
-
"Content-Type": "application/x-www-form-urlencoded",
|
|
548
|
-
},
|
|
549
|
-
body: body.toString(),
|
|
550
|
-
});
|
|
551
|
-
if (!response.ok) {
|
|
552
|
-
throw new Error(`GitLab API error: ${response.status} ${response.statusText}`);
|
|
553
|
-
}
|
|
554
|
-
const note = await response.json();
|
|
555
|
-
return (0, idConversion_1.cleanGidsFromObject)(note);
|
|
556
|
-
},
|
|
557
|
-
},
|
|
558
|
-
],
|
|
559
|
-
[
|
|
560
|
-
"create_merge_request_note",
|
|
561
|
-
{
|
|
562
|
-
name: "create_merge_request_note",
|
|
563
|
-
description: "Reply to an existing discussion thread in a merge request. Use to continue conversations, provide answers, or add context to ongoing discussions. Keeps related comments organized in threaded format.",
|
|
564
|
-
inputSchema: z.toJSONSchema(schema_1.CreateMergeRequestNoteSchema),
|
|
565
|
-
handler: async (args) => {
|
|
566
|
-
const options = schema_1.CreateMergeRequestNoteSchema.parse(args);
|
|
567
|
-
const body = new URLSearchParams();
|
|
568
|
-
body.set("body", options.body);
|
|
569
|
-
if (options.created_at) {
|
|
570
|
-
body.set("created_at", options.created_at);
|
|
571
|
-
}
|
|
572
|
-
const apiUrl = `${process.env.GITLAB_API_URL}/api/v4/projects/${encodeURIComponent(options.project_id)}/merge_requests/${options.merge_request_iid}/discussions/${options.discussion_id}/notes`;
|
|
573
|
-
const response = await (0, fetch_1.enhancedFetch)(apiUrl, {
|
|
574
|
-
method: "POST",
|
|
575
|
-
headers: {
|
|
576
|
-
Authorization: `Bearer ${process.env.GITLAB_TOKEN}`,
|
|
577
|
-
"Content-Type": "application/x-www-form-urlencoded",
|
|
578
|
-
},
|
|
579
|
-
body: body.toString(),
|
|
580
|
-
});
|
|
581
|
-
if (!response.ok) {
|
|
582
|
-
throw new Error(`GitLab API error: ${response.status} ${response.statusText}`);
|
|
583
|
-
}
|
|
584
|
-
const note = await response.json();
|
|
585
|
-
return (0, idConversion_1.cleanGidsFromObject)(note);
|
|
586
|
-
},
|
|
587
|
-
},
|
|
588
|
-
],
|
|
589
|
-
[
|
|
590
|
-
"update_draft_note",
|
|
591
|
-
{
|
|
592
|
-
name: "update_draft_note",
|
|
593
|
-
description: "Modify a draft note before publishing to refine review feedback. Use to edit, improve, or correct draft comments based on further code examination. Changes are only visible to the author until the note is published.",
|
|
594
|
-
inputSchema: z.toJSONSchema(schema_1.UpdateDraftNoteSchema),
|
|
595
|
-
handler: async (args) => {
|
|
596
|
-
const options = schema_1.UpdateDraftNoteSchema.parse(args);
|
|
597
|
-
const body = new URLSearchParams();
|
|
598
|
-
body.set("note", options.note);
|
|
599
|
-
if (options.position) {
|
|
600
|
-
body.set("position", JSON.stringify(options.position));
|
|
601
|
-
}
|
|
602
|
-
const apiUrl = `${process.env.GITLAB_API_URL}/api/v4/projects/${encodeURIComponent(options.project_id)}/merge_requests/${options.merge_request_iid}/draft_notes/${options.draft_note_id}`;
|
|
603
|
-
const response = await (0, fetch_1.enhancedFetch)(apiUrl, {
|
|
604
|
-
method: "PUT",
|
|
605
|
-
headers: {
|
|
606
|
-
Authorization: `Bearer ${process.env.GITLAB_TOKEN}`,
|
|
607
|
-
"Content-Type": "application/x-www-form-urlencoded",
|
|
608
|
-
},
|
|
609
|
-
body: body.toString(),
|
|
610
|
-
});
|
|
611
|
-
if (!response.ok) {
|
|
612
|
-
throw new Error(`GitLab API error: ${response.status} ${response.statusText}`);
|
|
613
|
-
}
|
|
614
|
-
const draftNote = await response.json();
|
|
615
|
-
return (0, idConversion_1.cleanGidsFromObject)(draftNote);
|
|
616
|
-
},
|
|
617
|
-
},
|
|
618
|
-
],
|
|
619
|
-
[
|
|
620
|
-
"delete_draft_note",
|
|
621
|
-
{
|
|
622
|
-
name: "delete_draft_note",
|
|
623
|
-
description: "Remove a draft note that is no longer needed or relevant. Use to clean up draft feedback that won't be published or to start fresh with review comments. Only the author can delete their own draft notes.",
|
|
624
|
-
inputSchema: z.toJSONSchema(schema_1.DeleteDraftNoteSchema),
|
|
625
|
-
handler: async (args) => {
|
|
626
|
-
const options = schema_1.DeleteDraftNoteSchema.parse(args);
|
|
627
|
-
const apiUrl = `${process.env.GITLAB_API_URL}/api/v4/projects/${encodeURIComponent(options.project_id)}/merge_requests/${options.merge_request_iid}/draft_notes/${options.draft_note_id}`;
|
|
628
|
-
const response = await (0, fetch_1.enhancedFetch)(apiUrl, {
|
|
629
|
-
method: "DELETE",
|
|
630
|
-
headers: {
|
|
631
|
-
Authorization: `Bearer ${process.env.GITLAB_TOKEN}`,
|
|
632
|
-
},
|
|
633
|
-
});
|
|
634
|
-
if (!response.ok) {
|
|
635
|
-
throw new Error(`GitLab API error: ${response.status} ${response.statusText}`);
|
|
636
|
-
}
|
|
637
|
-
return { success: true, message: "Draft note deleted successfully" };
|
|
638
|
-
},
|
|
639
|
-
},
|
|
640
|
-
],
|
|
641
|
-
]);
|
|
642
|
-
function getMrsReadOnlyToolNames() {
|
|
643
|
-
return [
|
|
644
|
-
"get_branch_diffs",
|
|
645
|
-
"get_merge_request",
|
|
646
|
-
"get_merge_request_diffs",
|
|
647
|
-
"list_merge_request_diffs",
|
|
648
|
-
"mr_discussions",
|
|
649
|
-
"get_draft_note",
|
|
650
|
-
"list_draft_notes",
|
|
651
|
-
"list_merge_requests",
|
|
652
|
-
];
|
|
653
|
-
}
|
|
654
|
-
function getMrsToolDefinitions() {
|
|
655
|
-
return Array.from(exports.mrsToolRegistry.values());
|
|
656
|
-
}
|
|
657
|
-
function getFilteredMrsTools(readOnlyMode = false) {
|
|
658
|
-
if (readOnlyMode) {
|
|
659
|
-
const readOnlyNames = getMrsReadOnlyToolNames();
|
|
660
|
-
return Array.from(exports.mrsToolRegistry.values()).filter(tool => readOnlyNames.includes(tool.name));
|
|
661
|
-
}
|
|
662
|
-
return getMrsToolDefinitions();
|
|
663
|
-
}
|
|
664
|
-
//# sourceMappingURL=registry.js.map
|