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,725 @@
|
|
|
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.workitemsToolRegistry = void 0;
|
|
37
|
+
exports.getWorkitemsReadOnlyToolNames = getWorkitemsReadOnlyToolNames;
|
|
38
|
+
exports.getWorkitemsToolDefinitions = getWorkitemsToolDefinitions;
|
|
39
|
+
exports.getFilteredWorkitemsTools = getFilteredWorkitemsTools;
|
|
40
|
+
const z = __importStar(require("zod"));
|
|
41
|
+
const schema_readonly_1 = require("./schema-readonly");
|
|
42
|
+
const schema_1 = require("./schema");
|
|
43
|
+
const ConnectionManager_1 = require("../../services/ConnectionManager");
|
|
44
|
+
const config_1 = require("../../config");
|
|
45
|
+
const workItemTypes_1 = require("../../utils/workItemTypes");
|
|
46
|
+
const idConversion_1 = require("../../utils/idConversion");
|
|
47
|
+
const WidgetAvailability_1 = require("../../services/WidgetAvailability");
|
|
48
|
+
const error_handler_1 = require("../../utils/error-handler");
|
|
49
|
+
const workItems_1 = require("../../graphql/workItems");
|
|
50
|
+
const simplifyWorkItem = (workItem, simple) => {
|
|
51
|
+
if (!simple)
|
|
52
|
+
return workItem;
|
|
53
|
+
const simplified = {
|
|
54
|
+
id: workItem.id,
|
|
55
|
+
iid: workItem.iid,
|
|
56
|
+
title: workItem.title,
|
|
57
|
+
state: workItem.state,
|
|
58
|
+
workItemType: typeof workItem.workItemType === "string"
|
|
59
|
+
? workItem.workItemType
|
|
60
|
+
: workItem.workItemType?.name || "Unknown",
|
|
61
|
+
webUrl: workItem.webUrl,
|
|
62
|
+
createdAt: workItem.createdAt,
|
|
63
|
+
updatedAt: workItem.updatedAt,
|
|
64
|
+
};
|
|
65
|
+
if (workItem.description && typeof workItem.description === "string") {
|
|
66
|
+
simplified.description =
|
|
67
|
+
workItem.description.length > 200
|
|
68
|
+
? workItem.description.substring(0, 200) + "..."
|
|
69
|
+
: workItem.description;
|
|
70
|
+
}
|
|
71
|
+
if (workItem.widgets && Array.isArray(workItem.widgets)) {
|
|
72
|
+
const essentialWidgets = [];
|
|
73
|
+
for (const widget of workItem.widgets) {
|
|
74
|
+
const flexWidget = widget;
|
|
75
|
+
switch (flexWidget.type) {
|
|
76
|
+
case "ASSIGNEES":
|
|
77
|
+
if (flexWidget.assignees?.nodes && flexWidget.assignees.nodes.length > 0) {
|
|
78
|
+
essentialWidgets.push({
|
|
79
|
+
type: "ASSIGNEES",
|
|
80
|
+
assignees: flexWidget.assignees.nodes.map(assignee => ({
|
|
81
|
+
id: assignee.id,
|
|
82
|
+
username: assignee.username,
|
|
83
|
+
name: assignee.name,
|
|
84
|
+
})),
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
break;
|
|
88
|
+
case "LABELS":
|
|
89
|
+
if (flexWidget.labels?.nodes && flexWidget.labels.nodes.length > 0) {
|
|
90
|
+
essentialWidgets.push({
|
|
91
|
+
type: "LABELS",
|
|
92
|
+
labels: flexWidget.labels.nodes.map(label => ({
|
|
93
|
+
id: label.id,
|
|
94
|
+
title: label.title,
|
|
95
|
+
color: label.color,
|
|
96
|
+
})),
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
break;
|
|
100
|
+
case "MILESTONE":
|
|
101
|
+
if (flexWidget.milestone) {
|
|
102
|
+
essentialWidgets.push({
|
|
103
|
+
type: "MILESTONE",
|
|
104
|
+
milestone: {
|
|
105
|
+
id: flexWidget.milestone.id,
|
|
106
|
+
title: flexWidget.milestone.title,
|
|
107
|
+
state: flexWidget.milestone.state,
|
|
108
|
+
},
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
break;
|
|
112
|
+
case "HIERARCHY":
|
|
113
|
+
if (flexWidget.parent || flexWidget.hasChildren) {
|
|
114
|
+
essentialWidgets.push({
|
|
115
|
+
type: "HIERARCHY",
|
|
116
|
+
parent: flexWidget.parent
|
|
117
|
+
? {
|
|
118
|
+
id: flexWidget.parent.id,
|
|
119
|
+
iid: flexWidget.parent.iid,
|
|
120
|
+
title: flexWidget.parent.title,
|
|
121
|
+
workItemType: flexWidget.parent.workItemType,
|
|
122
|
+
}
|
|
123
|
+
: null,
|
|
124
|
+
hasChildren: flexWidget.hasChildren,
|
|
125
|
+
});
|
|
126
|
+
}
|
|
127
|
+
break;
|
|
128
|
+
case "TIME_TRACKING":
|
|
129
|
+
if (flexWidget.timeEstimate !== undefined || flexWidget.totalTimeSpent !== undefined) {
|
|
130
|
+
essentialWidgets.push({
|
|
131
|
+
type: "TIME_TRACKING",
|
|
132
|
+
timeEstimate: flexWidget.timeEstimate,
|
|
133
|
+
totalTimeSpent: flexWidget.totalTimeSpent,
|
|
134
|
+
});
|
|
135
|
+
}
|
|
136
|
+
break;
|
|
137
|
+
case "VERIFICATION_STATUS":
|
|
138
|
+
if (flexWidget.verificationStatus) {
|
|
139
|
+
essentialWidgets.push({
|
|
140
|
+
type: "VERIFICATION_STATUS",
|
|
141
|
+
verificationStatus: flexWidget.verificationStatus,
|
|
142
|
+
});
|
|
143
|
+
}
|
|
144
|
+
break;
|
|
145
|
+
case "TEST_REPORTS":
|
|
146
|
+
if (flexWidget.testReports?.nodes && flexWidget.testReports.nodes.length > 0) {
|
|
147
|
+
essentialWidgets.push({
|
|
148
|
+
type: "TEST_REPORTS",
|
|
149
|
+
testReports: flexWidget.testReports.nodes.map(report => ({
|
|
150
|
+
id: report.id,
|
|
151
|
+
state: report.state,
|
|
152
|
+
createdAt: report.createdAt,
|
|
153
|
+
author: report.author?.username,
|
|
154
|
+
})),
|
|
155
|
+
});
|
|
156
|
+
}
|
|
157
|
+
break;
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
if (essentialWidgets && essentialWidgets.length > 0) {
|
|
161
|
+
simplified.widgets = essentialWidgets;
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
return simplified;
|
|
165
|
+
};
|
|
166
|
+
exports.workitemsToolRegistry = new Map([
|
|
167
|
+
[
|
|
168
|
+
"browse_work_items",
|
|
169
|
+
{
|
|
170
|
+
name: "browse_work_items",
|
|
171
|
+
description: "Find and inspect issues, epics, tasks, and other work items. Actions: list (groups return epics, projects return issues/tasks, filter by type/state/labels), get (by numeric ID or namespace+iid from URL path). Related: manage_work_item to create/update/delete.",
|
|
172
|
+
inputSchema: z.toJSONSchema(schema_readonly_1.BrowseWorkItemsSchema),
|
|
173
|
+
gate: { envVar: "USE_WORKITEMS", defaultValue: true },
|
|
174
|
+
handler: async (args) => {
|
|
175
|
+
const input = schema_readonly_1.BrowseWorkItemsSchema.parse(args);
|
|
176
|
+
if ((0, config_1.isActionDenied)("browse_work_items", input.action)) {
|
|
177
|
+
throw new Error(`Action '${input.action}' is not allowed for browse_work_items tool`);
|
|
178
|
+
}
|
|
179
|
+
switch (input.action) {
|
|
180
|
+
case "list": {
|
|
181
|
+
const { namespace, types, state, first, after, simple } = input;
|
|
182
|
+
const namespacePath = namespace;
|
|
183
|
+
const connectionManager = ConnectionManager_1.ConnectionManager.getInstance();
|
|
184
|
+
const client = connectionManager.getClient();
|
|
185
|
+
const resolvedTypes = types;
|
|
186
|
+
const workItemsResponse = await client.request(workItems_1.GET_NAMESPACE_WORK_ITEMS, {
|
|
187
|
+
namespacePath,
|
|
188
|
+
types: resolvedTypes,
|
|
189
|
+
first: first || 20,
|
|
190
|
+
after: after,
|
|
191
|
+
});
|
|
192
|
+
const workItemsData = workItemsResponse.namespace?.workItems;
|
|
193
|
+
const allItems = workItemsData?.nodes ?? [];
|
|
194
|
+
const pageInfo = {
|
|
195
|
+
hasNextPage: workItemsData?.pageInfo?.hasNextPage ?? false,
|
|
196
|
+
endCursor: workItemsData?.pageInfo?.endCursor ?? null,
|
|
197
|
+
};
|
|
198
|
+
const filteredItems = allItems.filter((item) => {
|
|
199
|
+
return state.includes(item.state);
|
|
200
|
+
});
|
|
201
|
+
const finalResults = filteredItems.map((item) => {
|
|
202
|
+
const cleanedItem = (0, idConversion_1.cleanWorkItemResponse)(item);
|
|
203
|
+
return simplifyWorkItem(cleanedItem, simple);
|
|
204
|
+
});
|
|
205
|
+
return {
|
|
206
|
+
items: finalResults,
|
|
207
|
+
hasMore: pageInfo.hasNextPage ?? false,
|
|
208
|
+
endCursor: pageInfo.endCursor ?? null,
|
|
209
|
+
};
|
|
210
|
+
}
|
|
211
|
+
case "get": {
|
|
212
|
+
const { namespace, iid, id } = input;
|
|
213
|
+
const connectionManager = ConnectionManager_1.ConnectionManager.getInstance();
|
|
214
|
+
const client = connectionManager.getClient();
|
|
215
|
+
if (namespace !== undefined && iid !== undefined) {
|
|
216
|
+
const response = await client.request(workItems_1.GET_WORK_ITEM_BY_IID, {
|
|
217
|
+
namespacePath: namespace,
|
|
218
|
+
iid: iid,
|
|
219
|
+
});
|
|
220
|
+
if (!response.namespace?.workItem) {
|
|
221
|
+
throw new Error(`Work item with IID "${iid}" not found in namespace "${namespace}"`);
|
|
222
|
+
}
|
|
223
|
+
return (0, idConversion_1.cleanWorkItemResponse)(response.namespace.workItem);
|
|
224
|
+
}
|
|
225
|
+
else if (id !== undefined) {
|
|
226
|
+
const workItemGid = (0, idConversion_1.toGid)(id, "WorkItem");
|
|
227
|
+
const response = await client.request(workItems_1.GET_WORK_ITEM, { id: workItemGid });
|
|
228
|
+
if (!response.workItem) {
|
|
229
|
+
throw new Error(`Work item with ID "${id}" not found`);
|
|
230
|
+
}
|
|
231
|
+
return (0, idConversion_1.cleanWorkItemResponse)(response.workItem);
|
|
232
|
+
}
|
|
233
|
+
else {
|
|
234
|
+
throw new Error("Either 'id' (global ID) or both 'namespace' and 'iid' (from URL) must be provided");
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
default:
|
|
238
|
+
throw new Error(`Unknown action: ${input.action}`);
|
|
239
|
+
}
|
|
240
|
+
},
|
|
241
|
+
},
|
|
242
|
+
],
|
|
243
|
+
[
|
|
244
|
+
"manage_work_item",
|
|
245
|
+
{
|
|
246
|
+
name: "manage_work_item",
|
|
247
|
+
description: "Create, update, delete, or link work items (issues, epics, tasks). Actions: create (epics need GROUP namespace, issues/tasks need PROJECT), update (widgets: dates, time tracking, weight, iterations, health, progress, hierarchy), delete (permanent), delete_timelog (remove a time tracking entry by its global ID), add_link/remove_link (BLOCKS/BLOCKED_BY/RELATED). Related: browse_work_items for discovery.",
|
|
248
|
+
inputSchema: z.toJSONSchema(schema_1.ManageWorkItemSchema),
|
|
249
|
+
gate: { envVar: "USE_WORKITEMS", defaultValue: true },
|
|
250
|
+
handler: async (args) => {
|
|
251
|
+
const input = schema_1.ManageWorkItemSchema.parse(args);
|
|
252
|
+
if ((0, config_1.isActionDenied)("manage_work_item", input.action)) {
|
|
253
|
+
throw new Error(`Action '${input.action}' is not allowed for manage_work_item tool`);
|
|
254
|
+
}
|
|
255
|
+
switch (input.action) {
|
|
256
|
+
case "create": {
|
|
257
|
+
const { namespace, title, workItemType, description, assigneeIds, labelIds, milestoneId, startDate, dueDate, parentId, childrenIds, timeEstimate, isFixed, weight, iterationId, progressCurrentValue, healthStatus, color, } = input;
|
|
258
|
+
const namespacePath = namespace;
|
|
259
|
+
const workItemTitle = title;
|
|
260
|
+
const workItemTypeName = workItemType;
|
|
261
|
+
const widgetParams = {
|
|
262
|
+
description,
|
|
263
|
+
milestoneId,
|
|
264
|
+
startDate,
|
|
265
|
+
dueDate,
|
|
266
|
+
parentId,
|
|
267
|
+
childrenIds,
|
|
268
|
+
timeEstimate,
|
|
269
|
+
isFixed,
|
|
270
|
+
weight,
|
|
271
|
+
iterationId,
|
|
272
|
+
progressCurrentValue,
|
|
273
|
+
healthStatus,
|
|
274
|
+
color,
|
|
275
|
+
};
|
|
276
|
+
if (assigneeIds && assigneeIds.length > 0) {
|
|
277
|
+
widgetParams.assigneeIds = assigneeIds;
|
|
278
|
+
}
|
|
279
|
+
if (labelIds && labelIds.length > 0) {
|
|
280
|
+
widgetParams.labelIds = labelIds;
|
|
281
|
+
}
|
|
282
|
+
const validationFailure = WidgetAvailability_1.WidgetAvailability.validateWidgetParams(widgetParams);
|
|
283
|
+
if (validationFailure) {
|
|
284
|
+
throw new error_handler_1.StructuredToolError((0, error_handler_1.createVersionRestrictedError)("manage_work_item", "create", validationFailure.widget, validationFailure.parameter, validationFailure.requiredVersion, validationFailure.detectedVersion, (0, error_handler_1.normalizeTier)(validationFailure.requiredTier), (0, error_handler_1.normalizeTier)(validationFailure.currentTier)));
|
|
285
|
+
}
|
|
286
|
+
const connectionManager = ConnectionManager_1.ConnectionManager.getInstance();
|
|
287
|
+
const client = connectionManager.getClient();
|
|
288
|
+
const workItemTypes = await (0, workItemTypes_1.getWorkItemTypes)(namespacePath);
|
|
289
|
+
const workItemTypeObj = workItemTypes.find((t) => t.name.toUpperCase().replace(/\s+/g, "_") ===
|
|
290
|
+
workItemTypeName.toUpperCase().replace(/\s+/g, "_"));
|
|
291
|
+
if (!workItemTypeObj) {
|
|
292
|
+
throw new Error(`Work item type "${workItemTypeName}" not found in namespace "${namespacePath}". Available types: ${workItemTypes.map(t => t.name).join(", ")}`);
|
|
293
|
+
}
|
|
294
|
+
const createInput = {
|
|
295
|
+
namespacePath,
|
|
296
|
+
title: workItemTitle,
|
|
297
|
+
workItemTypeId: workItemTypeObj.id,
|
|
298
|
+
};
|
|
299
|
+
if (description !== undefined) {
|
|
300
|
+
createInput.description = description;
|
|
301
|
+
}
|
|
302
|
+
if (assigneeIds !== undefined && assigneeIds.length > 0) {
|
|
303
|
+
createInput.assigneesWidget = { assigneeIds: (0, idConversion_1.toGids)(assigneeIds, "User") };
|
|
304
|
+
}
|
|
305
|
+
if (labelIds !== undefined && labelIds.length > 0) {
|
|
306
|
+
createInput.labelsWidget = { labelIds: (0, idConversion_1.toGids)(labelIds, "Label") };
|
|
307
|
+
}
|
|
308
|
+
if (milestoneId !== undefined) {
|
|
309
|
+
createInput.milestoneWidget = { milestoneId: (0, idConversion_1.toGid)(milestoneId, "Milestone") };
|
|
310
|
+
}
|
|
311
|
+
if (startDate !== undefined || dueDate !== undefined || isFixed !== undefined) {
|
|
312
|
+
createInput.startAndDueDateWidget = {};
|
|
313
|
+
if (startDate !== undefined)
|
|
314
|
+
createInput.startAndDueDateWidget.startDate = startDate;
|
|
315
|
+
if (dueDate !== undefined)
|
|
316
|
+
createInput.startAndDueDateWidget.dueDate = dueDate;
|
|
317
|
+
if (isFixed !== undefined)
|
|
318
|
+
createInput.startAndDueDateWidget.isFixed = isFixed;
|
|
319
|
+
}
|
|
320
|
+
if (parentId !== undefined || (childrenIds !== undefined && childrenIds.length > 0)) {
|
|
321
|
+
createInput.hierarchyWidget = {};
|
|
322
|
+
if (parentId !== undefined) {
|
|
323
|
+
createInput.hierarchyWidget.parentId = (0, idConversion_1.toGid)(parentId, "WorkItem");
|
|
324
|
+
}
|
|
325
|
+
if (childrenIds !== undefined && childrenIds.length > 0) {
|
|
326
|
+
createInput.hierarchyWidget.childrenIds = (0, idConversion_1.toGids)(childrenIds, "WorkItem");
|
|
327
|
+
}
|
|
328
|
+
}
|
|
329
|
+
if (weight !== undefined) {
|
|
330
|
+
createInput.weightWidget = { weight };
|
|
331
|
+
}
|
|
332
|
+
if (iterationId !== undefined) {
|
|
333
|
+
createInput.iterationWidget = {
|
|
334
|
+
iterationId: (0, idConversion_1.toGid)(iterationId, "Iteration"),
|
|
335
|
+
};
|
|
336
|
+
}
|
|
337
|
+
if (healthStatus !== undefined) {
|
|
338
|
+
createInput.healthStatusWidget = { healthStatus };
|
|
339
|
+
}
|
|
340
|
+
if (progressCurrentValue !== undefined) {
|
|
341
|
+
createInput.progressWidget = { currentValue: progressCurrentValue };
|
|
342
|
+
}
|
|
343
|
+
if (color !== undefined) {
|
|
344
|
+
createInput.colorWidget = { color };
|
|
345
|
+
}
|
|
346
|
+
const response = await client.request(workItems_1.CREATE_WORK_ITEM_WITH_WIDGETS, {
|
|
347
|
+
input: createInput,
|
|
348
|
+
});
|
|
349
|
+
if (response.workItemCreate?.errors?.length &&
|
|
350
|
+
response.workItemCreate.errors.length > 0) {
|
|
351
|
+
throw new Error(`GitLab GraphQL errors: ${response.workItemCreate.errors.join(", ")}`);
|
|
352
|
+
}
|
|
353
|
+
if (!response.workItemCreate?.workItem) {
|
|
354
|
+
throw new Error("Work item creation failed - no work item returned");
|
|
355
|
+
}
|
|
356
|
+
const createdWorkItem = response.workItemCreate.workItem;
|
|
357
|
+
if (timeEstimate !== undefined) {
|
|
358
|
+
try {
|
|
359
|
+
const updateInput = {
|
|
360
|
+
id: createdWorkItem.id,
|
|
361
|
+
timeTrackingWidget: { timeEstimate },
|
|
362
|
+
};
|
|
363
|
+
const updateResponse = await client.request(workItems_1.UPDATE_WORK_ITEM, {
|
|
364
|
+
input: updateInput,
|
|
365
|
+
});
|
|
366
|
+
if (updateResponse.workItemUpdate?.errors?.length &&
|
|
367
|
+
updateResponse.workItemUpdate.errors.length > 0) {
|
|
368
|
+
const cleanedResult = (0, idConversion_1.cleanWorkItemResponse)(createdWorkItem);
|
|
369
|
+
return {
|
|
370
|
+
...cleanedResult,
|
|
371
|
+
_warning: {
|
|
372
|
+
message: "Work item created successfully, but some properties could not be applied",
|
|
373
|
+
failedProperties: {
|
|
374
|
+
timeEstimate: {
|
|
375
|
+
requestedValue: timeEstimate,
|
|
376
|
+
error: updateResponse.workItemUpdate.errors.join(", "),
|
|
377
|
+
},
|
|
378
|
+
},
|
|
379
|
+
},
|
|
380
|
+
};
|
|
381
|
+
}
|
|
382
|
+
if (updateResponse.workItemUpdate?.workItem) {
|
|
383
|
+
return (0, idConversion_1.cleanWorkItemResponse)(updateResponse.workItemUpdate.workItem);
|
|
384
|
+
}
|
|
385
|
+
const cleanedResult = (0, idConversion_1.cleanWorkItemResponse)(createdWorkItem);
|
|
386
|
+
return {
|
|
387
|
+
...cleanedResult,
|
|
388
|
+
_warning: {
|
|
389
|
+
message: "Work item created successfully, but some properties could not be applied",
|
|
390
|
+
failedProperties: {
|
|
391
|
+
timeEstimate: {
|
|
392
|
+
requestedValue: timeEstimate,
|
|
393
|
+
error: "Time estimate update returned no work item",
|
|
394
|
+
},
|
|
395
|
+
},
|
|
396
|
+
},
|
|
397
|
+
};
|
|
398
|
+
}
|
|
399
|
+
catch (updateError) {
|
|
400
|
+
const cleanedResult = (0, idConversion_1.cleanWorkItemResponse)(createdWorkItem);
|
|
401
|
+
return {
|
|
402
|
+
...cleanedResult,
|
|
403
|
+
_warning: {
|
|
404
|
+
message: "Work item created successfully, but some properties could not be applied",
|
|
405
|
+
failedProperties: {
|
|
406
|
+
timeEstimate: {
|
|
407
|
+
requestedValue: timeEstimate,
|
|
408
|
+
error: updateError instanceof Error
|
|
409
|
+
? updateError.message
|
|
410
|
+
: "Unknown error applying time estimate",
|
|
411
|
+
},
|
|
412
|
+
},
|
|
413
|
+
},
|
|
414
|
+
};
|
|
415
|
+
}
|
|
416
|
+
}
|
|
417
|
+
return (0, idConversion_1.cleanWorkItemResponse)(createdWorkItem);
|
|
418
|
+
}
|
|
419
|
+
case "update": {
|
|
420
|
+
const { id, title, description, state, assigneeIds, labelIds, addLabelIds, removeLabelIds, milestoneId, startDate, dueDate, parentId, childrenIds, timeEstimate, timeSpent, timeSpentAt, timeSpentSummary, isFixed, weight, iterationId, progressCurrentValue, healthStatus, color, verificationStatus, linkType, targetId, } = input;
|
|
421
|
+
const workItemId = id;
|
|
422
|
+
if ((linkType !== undefined) !== (targetId !== undefined)) {
|
|
423
|
+
throw new Error("Both linkType and targetId must be provided together to create a linked item relationship");
|
|
424
|
+
}
|
|
425
|
+
if (labelIds !== undefined &&
|
|
426
|
+
(addLabelIds !== undefined || removeLabelIds !== undefined)) {
|
|
427
|
+
throw new Error("labelIds (replace all) cannot be used together with addLabelIds or removeLabelIds. " +
|
|
428
|
+
"Use labelIds to set exact labels, or use addLabelIds/removeLabelIds for incremental changes.");
|
|
429
|
+
}
|
|
430
|
+
const widgetParams = {
|
|
431
|
+
description,
|
|
432
|
+
assigneeIds,
|
|
433
|
+
labelIds,
|
|
434
|
+
addLabelIds,
|
|
435
|
+
removeLabelIds,
|
|
436
|
+
milestoneId,
|
|
437
|
+
startDate,
|
|
438
|
+
dueDate,
|
|
439
|
+
parentId,
|
|
440
|
+
childrenIds,
|
|
441
|
+
timeEstimate,
|
|
442
|
+
timeSpent,
|
|
443
|
+
isFixed,
|
|
444
|
+
weight,
|
|
445
|
+
iterationId,
|
|
446
|
+
progressCurrentValue,
|
|
447
|
+
healthStatus,
|
|
448
|
+
color,
|
|
449
|
+
verificationStatus,
|
|
450
|
+
linkType,
|
|
451
|
+
targetId,
|
|
452
|
+
};
|
|
453
|
+
const validationFailure = WidgetAvailability_1.WidgetAvailability.validateWidgetParams(widgetParams);
|
|
454
|
+
if (validationFailure) {
|
|
455
|
+
throw new error_handler_1.StructuredToolError((0, error_handler_1.createVersionRestrictedError)("manage_work_item", "update", validationFailure.widget, validationFailure.parameter, validationFailure.requiredVersion, validationFailure.detectedVersion, (0, error_handler_1.normalizeTier)(validationFailure.requiredTier), (0, error_handler_1.normalizeTier)(validationFailure.currentTier)));
|
|
456
|
+
}
|
|
457
|
+
const connectionManager = ConnectionManager_1.ConnectionManager.getInstance();
|
|
458
|
+
const client = connectionManager.getClient();
|
|
459
|
+
const workItemGid = (0, idConversion_1.toGid)(workItemId, "WorkItem");
|
|
460
|
+
const updateInput = { id: workItemGid };
|
|
461
|
+
if (title !== undefined)
|
|
462
|
+
updateInput.title = title;
|
|
463
|
+
if (state !== undefined)
|
|
464
|
+
updateInput.stateEvent = state;
|
|
465
|
+
if (description !== undefined) {
|
|
466
|
+
updateInput.descriptionWidget = { description };
|
|
467
|
+
}
|
|
468
|
+
if (assigneeIds !== undefined) {
|
|
469
|
+
updateInput.assigneesWidget = { assigneeIds: (0, idConversion_1.toGids)(assigneeIds, "User") };
|
|
470
|
+
}
|
|
471
|
+
if (labelIds !== undefined) {
|
|
472
|
+
const currentWorkItem = await client.request(workItems_1.GET_WORK_ITEM, { id: workItemGid });
|
|
473
|
+
const currentLabels = (currentWorkItem.workItem?.widgets || [])
|
|
474
|
+
.find(w => w.type === "LABELS")
|
|
475
|
+
?.labels?.nodes?.map(l => l.id) ?? [];
|
|
476
|
+
const newLabelGids = (0, idConversion_1.toGids)(labelIds, "Label");
|
|
477
|
+
const labelsToRemove = currentLabels.filter(id => !newLabelGids.includes(id));
|
|
478
|
+
const labelsToAdd = newLabelGids.filter(id => !currentLabels.includes(id));
|
|
479
|
+
if (labelsToRemove.length > 0 || labelsToAdd.length > 0) {
|
|
480
|
+
updateInput.labelsWidget = {};
|
|
481
|
+
if (labelsToRemove.length > 0) {
|
|
482
|
+
updateInput.labelsWidget.removeLabelIds = labelsToRemove;
|
|
483
|
+
}
|
|
484
|
+
if (labelsToAdd.length > 0) {
|
|
485
|
+
updateInput.labelsWidget.addLabelIds = labelsToAdd;
|
|
486
|
+
}
|
|
487
|
+
}
|
|
488
|
+
}
|
|
489
|
+
else if (addLabelIds !== undefined || removeLabelIds !== undefined) {
|
|
490
|
+
updateInput.labelsWidget = {};
|
|
491
|
+
if (addLabelIds !== undefined && addLabelIds.length > 0) {
|
|
492
|
+
updateInput.labelsWidget.addLabelIds = (0, idConversion_1.toGids)(addLabelIds, "Label");
|
|
493
|
+
}
|
|
494
|
+
if (removeLabelIds !== undefined && removeLabelIds.length > 0) {
|
|
495
|
+
updateInput.labelsWidget.removeLabelIds = (0, idConversion_1.toGids)(removeLabelIds, "Label");
|
|
496
|
+
}
|
|
497
|
+
}
|
|
498
|
+
if (updateInput.labelsWidget?.addLabelIds && updateInput.labelsWidget?.removeLabelIds) {
|
|
499
|
+
const addSet = new Set(updateInput.labelsWidget.addLabelIds);
|
|
500
|
+
const removeSet = new Set(updateInput.labelsWidget.removeLabelIds);
|
|
501
|
+
const intersection = [...addSet].filter(id => removeSet.has(id));
|
|
502
|
+
if (intersection.length > 0) {
|
|
503
|
+
throw new Error(`Invalid label operation: cannot add and remove the same labels simultaneously: ${intersection.join(", ")}`);
|
|
504
|
+
}
|
|
505
|
+
}
|
|
506
|
+
if (milestoneId !== undefined) {
|
|
507
|
+
updateInput.milestoneWidget = { milestoneId: (0, idConversion_1.toGid)(milestoneId, "Milestone") };
|
|
508
|
+
}
|
|
509
|
+
if (startDate !== undefined || dueDate !== undefined || isFixed !== undefined) {
|
|
510
|
+
updateInput.startAndDueDateWidget = {};
|
|
511
|
+
if (startDate !== undefined)
|
|
512
|
+
updateInput.startAndDueDateWidget.startDate = startDate;
|
|
513
|
+
if (dueDate !== undefined)
|
|
514
|
+
updateInput.startAndDueDateWidget.dueDate = dueDate;
|
|
515
|
+
if (isFixed !== undefined)
|
|
516
|
+
updateInput.startAndDueDateWidget.isFixed = isFixed;
|
|
517
|
+
}
|
|
518
|
+
if (parentId !== undefined || (childrenIds !== undefined && childrenIds.length > 0)) {
|
|
519
|
+
updateInput.hierarchyWidget = {};
|
|
520
|
+
if (parentId !== undefined) {
|
|
521
|
+
updateInput.hierarchyWidget.parentId =
|
|
522
|
+
parentId === null ? null : (0, idConversion_1.toGid)(parentId, "WorkItem");
|
|
523
|
+
}
|
|
524
|
+
if (childrenIds !== undefined && childrenIds.length > 0) {
|
|
525
|
+
updateInput.hierarchyWidget.childrenIds = (0, idConversion_1.toGids)(childrenIds, "WorkItem");
|
|
526
|
+
}
|
|
527
|
+
}
|
|
528
|
+
if ((timeSpentAt !== undefined || timeSpentSummary !== undefined) &&
|
|
529
|
+
timeSpent === undefined) {
|
|
530
|
+
throw new Error("timeSpentAt and timeSpentSummary require timeSpent to be specified (they are timelog entry properties)");
|
|
531
|
+
}
|
|
532
|
+
if (timeEstimate !== undefined || timeSpent !== undefined) {
|
|
533
|
+
updateInput.timeTrackingWidget = {};
|
|
534
|
+
if (timeEstimate !== undefined) {
|
|
535
|
+
updateInput.timeTrackingWidget.timeEstimate = timeEstimate;
|
|
536
|
+
}
|
|
537
|
+
if (timeSpent !== undefined) {
|
|
538
|
+
updateInput.timeTrackingWidget.timelog = {
|
|
539
|
+
timeSpent,
|
|
540
|
+
...(timeSpentAt !== undefined && { spentAt: timeSpentAt }),
|
|
541
|
+
...(timeSpentSummary !== undefined && { summary: timeSpentSummary }),
|
|
542
|
+
};
|
|
543
|
+
}
|
|
544
|
+
}
|
|
545
|
+
if (weight !== undefined) {
|
|
546
|
+
updateInput.weightWidget = { weight };
|
|
547
|
+
}
|
|
548
|
+
if (iterationId !== undefined) {
|
|
549
|
+
updateInput.iterationWidget = {
|
|
550
|
+
iterationId: iterationId === null ? null : (0, idConversion_1.toGid)(iterationId, "Iteration"),
|
|
551
|
+
};
|
|
552
|
+
}
|
|
553
|
+
if (healthStatus !== undefined) {
|
|
554
|
+
updateInput.healthStatusWidget = { healthStatus };
|
|
555
|
+
}
|
|
556
|
+
if (progressCurrentValue !== undefined) {
|
|
557
|
+
updateInput.progressWidget = { currentValue: progressCurrentValue };
|
|
558
|
+
}
|
|
559
|
+
if (color !== undefined) {
|
|
560
|
+
updateInput.colorWidget = { color };
|
|
561
|
+
}
|
|
562
|
+
if (verificationStatus !== undefined) {
|
|
563
|
+
updateInput.verificationStatusWidget = { verificationStatus };
|
|
564
|
+
}
|
|
565
|
+
const response = await client.request(workItems_1.UPDATE_WORK_ITEM, { input: updateInput });
|
|
566
|
+
if (response.workItemUpdate?.errors?.length &&
|
|
567
|
+
response.workItemUpdate.errors.length > 0) {
|
|
568
|
+
throw new Error(`GitLab GraphQL errors: ${response.workItemUpdate.errors.join(", ")}`);
|
|
569
|
+
}
|
|
570
|
+
if (!response.workItemUpdate?.workItem) {
|
|
571
|
+
throw new Error("Work item update failed - no work item returned");
|
|
572
|
+
}
|
|
573
|
+
const updatedWorkItem = response.workItemUpdate.workItem;
|
|
574
|
+
if (linkType !== undefined && targetId !== undefined) {
|
|
575
|
+
try {
|
|
576
|
+
const linkResponse = await client.request(workItems_1.WORK_ITEM_ADD_LINKED_ITEMS, {
|
|
577
|
+
input: {
|
|
578
|
+
id: workItemGid,
|
|
579
|
+
workItemsIds: [(0, idConversion_1.toGid)(targetId, "WorkItem")],
|
|
580
|
+
linkType,
|
|
581
|
+
},
|
|
582
|
+
});
|
|
583
|
+
if (linkResponse.workItemAddLinkedItems?.errors?.length &&
|
|
584
|
+
linkResponse.workItemAddLinkedItems.errors.length > 0) {
|
|
585
|
+
const cleanedResult = (0, idConversion_1.cleanWorkItemResponse)(updatedWorkItem);
|
|
586
|
+
return {
|
|
587
|
+
...cleanedResult,
|
|
588
|
+
_warning: {
|
|
589
|
+
message: "Work item updated successfully, but linked item could not be added",
|
|
590
|
+
failedProperties: {
|
|
591
|
+
linkedItem: {
|
|
592
|
+
targetId,
|
|
593
|
+
linkType,
|
|
594
|
+
error: linkResponse.workItemAddLinkedItems.errors.join(", "),
|
|
595
|
+
},
|
|
596
|
+
},
|
|
597
|
+
},
|
|
598
|
+
};
|
|
599
|
+
}
|
|
600
|
+
if (linkResponse.workItemAddLinkedItems?.workItem) {
|
|
601
|
+
return (0, idConversion_1.cleanWorkItemResponse)(linkResponse.workItemAddLinkedItems.workItem);
|
|
602
|
+
}
|
|
603
|
+
const cleanedResult = (0, idConversion_1.cleanWorkItemResponse)(updatedWorkItem);
|
|
604
|
+
return {
|
|
605
|
+
...cleanedResult,
|
|
606
|
+
_warning: {
|
|
607
|
+
message: "Work item updated successfully, but linked item could not be added",
|
|
608
|
+
failedProperties: {
|
|
609
|
+
linkedItem: {
|
|
610
|
+
targetId,
|
|
611
|
+
linkType,
|
|
612
|
+
error: "Add linked item returned no work item",
|
|
613
|
+
},
|
|
614
|
+
},
|
|
615
|
+
},
|
|
616
|
+
};
|
|
617
|
+
}
|
|
618
|
+
catch (linkError) {
|
|
619
|
+
const cleanedResult = (0, idConversion_1.cleanWorkItemResponse)(updatedWorkItem);
|
|
620
|
+
return {
|
|
621
|
+
...cleanedResult,
|
|
622
|
+
_warning: {
|
|
623
|
+
message: "Work item updated successfully, but linked item could not be added",
|
|
624
|
+
failedProperties: {
|
|
625
|
+
linkedItem: {
|
|
626
|
+
targetId,
|
|
627
|
+
linkType,
|
|
628
|
+
error: linkError instanceof Error
|
|
629
|
+
? linkError.message
|
|
630
|
+
: "Unknown error adding linked item",
|
|
631
|
+
},
|
|
632
|
+
},
|
|
633
|
+
},
|
|
634
|
+
};
|
|
635
|
+
}
|
|
636
|
+
}
|
|
637
|
+
return (0, idConversion_1.cleanWorkItemResponse)(updatedWorkItem);
|
|
638
|
+
}
|
|
639
|
+
case "delete": {
|
|
640
|
+
const workItemId = input.id;
|
|
641
|
+
const connectionManager = ConnectionManager_1.ConnectionManager.getInstance();
|
|
642
|
+
const client = connectionManager.getClient();
|
|
643
|
+
const workItemGid = (0, idConversion_1.toGid)(workItemId, "WorkItem");
|
|
644
|
+
const response = await client.request(workItems_1.DELETE_WORK_ITEM, { id: workItemGid });
|
|
645
|
+
if (response.workItemDelete?.errors?.length &&
|
|
646
|
+
response.workItemDelete.errors.length > 0) {
|
|
647
|
+
throw new Error(`GitLab GraphQL errors: ${response.workItemDelete.errors.join(", ")}`);
|
|
648
|
+
}
|
|
649
|
+
return { deleted: true };
|
|
650
|
+
}
|
|
651
|
+
case "delete_timelog": {
|
|
652
|
+
const { timelogId } = input;
|
|
653
|
+
const connectionManager = ConnectionManager_1.ConnectionManager.getInstance();
|
|
654
|
+
const client = connectionManager.getClient();
|
|
655
|
+
const timelogGid = (0, idConversion_1.toGid)(timelogId, "Timelog");
|
|
656
|
+
const response = await client.request(workItems_1.TIMELOG_DELETE, { id: timelogGid });
|
|
657
|
+
if (response.timelogDelete?.errors?.length &&
|
|
658
|
+
response.timelogDelete.errors.length > 0) {
|
|
659
|
+
throw new Error(`GitLab GraphQL errors: ${response.timelogDelete.errors.join(", ")}`);
|
|
660
|
+
}
|
|
661
|
+
return {
|
|
662
|
+
deleted: true,
|
|
663
|
+
timelog: response.timelogDelete?.timelog ?? null,
|
|
664
|
+
};
|
|
665
|
+
}
|
|
666
|
+
case "add_link": {
|
|
667
|
+
const { id, targetId, linkType } = input;
|
|
668
|
+
const connectionManager = ConnectionManager_1.ConnectionManager.getInstance();
|
|
669
|
+
const client = connectionManager.getClient();
|
|
670
|
+
const response = await client.request(workItems_1.WORK_ITEM_ADD_LINKED_ITEMS, {
|
|
671
|
+
input: {
|
|
672
|
+
id: (0, idConversion_1.toGid)(id, "WorkItem"),
|
|
673
|
+
workItemsIds: [(0, idConversion_1.toGid)(targetId, "WorkItem")],
|
|
674
|
+
linkType,
|
|
675
|
+
},
|
|
676
|
+
});
|
|
677
|
+
if (response.workItemAddLinkedItems?.errors?.length &&
|
|
678
|
+
response.workItemAddLinkedItems.errors.length > 0) {
|
|
679
|
+
throw new Error(`GitLab GraphQL errors: ${response.workItemAddLinkedItems.errors.join(", ")}`);
|
|
680
|
+
}
|
|
681
|
+
if (!response.workItemAddLinkedItems?.workItem) {
|
|
682
|
+
throw new Error("Add linked item failed - no work item returned");
|
|
683
|
+
}
|
|
684
|
+
return (0, idConversion_1.cleanWorkItemResponse)(response.workItemAddLinkedItems.workItem);
|
|
685
|
+
}
|
|
686
|
+
case "remove_link": {
|
|
687
|
+
const { id, targetId } = input;
|
|
688
|
+
const connectionManager = ConnectionManager_1.ConnectionManager.getInstance();
|
|
689
|
+
const client = connectionManager.getClient();
|
|
690
|
+
const response = await client.request(workItems_1.WORK_ITEM_REMOVE_LINKED_ITEMS, {
|
|
691
|
+
input: {
|
|
692
|
+
id: (0, idConversion_1.toGid)(id, "WorkItem"),
|
|
693
|
+
workItemsIds: [(0, idConversion_1.toGid)(targetId, "WorkItem")],
|
|
694
|
+
},
|
|
695
|
+
});
|
|
696
|
+
if (response.workItemRemoveLinkedItems?.errors?.length &&
|
|
697
|
+
response.workItemRemoveLinkedItems.errors.length > 0) {
|
|
698
|
+
throw new Error(`GitLab GraphQL errors: ${response.workItemRemoveLinkedItems.errors.join(", ")}`);
|
|
699
|
+
}
|
|
700
|
+
if (!response.workItemRemoveLinkedItems?.workItem) {
|
|
701
|
+
throw new Error("Remove linked item failed - no work item returned");
|
|
702
|
+
}
|
|
703
|
+
return (0, idConversion_1.cleanWorkItemResponse)(response.workItemRemoveLinkedItems.workItem);
|
|
704
|
+
}
|
|
705
|
+
default:
|
|
706
|
+
throw new Error(`Unknown action: ${input.action}`);
|
|
707
|
+
}
|
|
708
|
+
},
|
|
709
|
+
},
|
|
710
|
+
],
|
|
711
|
+
]);
|
|
712
|
+
function getWorkitemsReadOnlyToolNames() {
|
|
713
|
+
return ["browse_work_items"];
|
|
714
|
+
}
|
|
715
|
+
function getWorkitemsToolDefinitions() {
|
|
716
|
+
return Array.from(exports.workitemsToolRegistry.values());
|
|
717
|
+
}
|
|
718
|
+
function getFilteredWorkitemsTools(readOnlyMode = false) {
|
|
719
|
+
if (readOnlyMode) {
|
|
720
|
+
const readOnlyNames = getWorkitemsReadOnlyToolNames();
|
|
721
|
+
return Array.from(exports.workitemsToolRegistry.values()).filter(tool => readOnlyNames.includes(tool.name));
|
|
722
|
+
}
|
|
723
|
+
return getWorkitemsToolDefinitions();
|
|
724
|
+
}
|
|
725
|
+
//# sourceMappingURL=registry.js.map
|