@zereight/mcp-gitlab 2.3.29-next.251 → 2.3.30-next.254
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.ko.md +2 -2
- package/README.md +2 -2
- package/README.pt-BR.md +2 -2
- package/README.zh-CN.md +2 -2
- package/build/cli/compact-mcp-result.js +4 -4
- package/build/cli/replay-command.js +54 -18
- package/package.json +1 -1
package/README.ko.md
CHANGED
|
@@ -262,7 +262,7 @@ command = lib.getExe inputs.gitlab-mcp.packages.${system}.default;
|
|
|
262
262
|
|
|
263
263
|
예시는 기존 `mcp-gitlab`보다 충돌 가능성이 낮은 `zereight-mcp-gitlab` 별칭을 사용합니다. MCP 클라이언트가 찾지 못하면 `which zereight-mcp-gitlab`의 절대 경로를 사용하세요.
|
|
264
264
|
|
|
265
|
-
전역 설치를 쓰지 않으려면 `npx -y @zereight/mcp-gitlab@2.3.
|
|
265
|
+
전역 설치를 쓰지 않으려면 `npx -y @zereight/mcp-gitlab@2.3.28`처럼 직전 안정 버전(문서가 권장하는 버전)으로 고정하세요. `GITLAB_MASKING_ENABLED`를 쓴다면 2.3.29 이상(또는 `@latest`)을 사용하세요. 이전 버전은 GitLab이 masked 또는 hidden으로 지정한 CI/CD 변수 값을 평문으로 반환합니다. 항상 최신 버전을 원하면 `npx -y @zereight/mcp-gitlab@latest`를 사용하세요. `main`에 머지된 수정을 다음 안정 버전 전에 확인하려면 프리릴리스 빌드인 `npx -y @zereight/mcp-gitlab@next`를 사용하세요(운영 환경용이 아닙니다). 새 버전이 나오면 서버가 시작 시 stderr로 알려줍니다(`GITLAB_DISABLE_VERSION_CHECK=true`로 비활성화 가능).
|
|
266
266
|
|
|
267
267
|
#### Claude Desktop 원클릭 설치(MCP Bundle)
|
|
268
268
|
|
|
@@ -317,7 +317,7 @@ CLI 인자는 환경 변수보다 우선합니다.
|
|
|
317
317
|
|
|
318
318
|
`zereight-mcp-gitlab auth`는 MCP 서버 플래그가 아니라 서브커맨드입니다. GitLab device flow를 실행한 뒤 종료합니다. [CLI 인자](./docs/getting-started/cli-arguments.md#auth)를 참고하세요.
|
|
319
319
|
|
|
320
|
-
같은 바이너리는 `gh` 스타일 GitLab CLI이기도 합니다 (`tool <name>` 또는 `mr list` 같은 curated 명령). **MCP 등록은 필요 없습니다** — PAT를 설정하거나, `auth`를 실행한 뒤 `GITLAB_USE_OAUTH=true`를 설정하면 됩니다: [MCP 없이 CLI 사용하기](./docs/getting-started/cli-without-mcp.md). `setup --cursor` / `setup --claude`는 클라이언트 설정을 출력하고, `doctor`는 토큰·API URL·toolset·버전을 점검합니다. 전체 페이로드는 터미널에서 이 CLI로 읽습니다. MCP 응답은 대화에 남습니다. `GITLAB_MCP_COMPACT_RESULTS=true`(또는 `--compact-results`)를 켜면 큰 도구 응답이 미리보기와 CLI 명령으로 바뀝니다. Human CLI 자체는 compact 되지 않습니다. permission mode, toolsets, denied-tools regex, tool-policy는 MCP와 같습니다. destructive 도구와 `GITLAB_TOOL_POLICY_APPROVE` 도구는 `--yes`가 필요합니다. [Human CLI](./docs/getting-started/cli-arguments.md#human-cli)를 참고하세요.
|
|
320
|
+
같은 바이너리는 `gh` 스타일 GitLab CLI이기도 합니다 (`tool <name>` 또는 `mr list` 같은 curated 명령). **MCP 등록은 필요 없습니다** — PAT를 설정하거나, `auth`를 실행한 뒤 `GITLAB_USE_OAUTH=true`를 설정하면 됩니다: [MCP 없이 CLI 사용하기](./docs/getting-started/cli-without-mcp.md). `setup --cursor` / `setup --claude`는 클라이언트 설정을 출력하고, `doctor`는 토큰·API URL·toolset·버전을 점검합니다. 전체 페이로드는 터미널에서 이 CLI로 읽습니다. MCP 응답은 대화에 남습니다. `GITLAB_MCP_COMPACT_RESULTS=true`(또는 `--compact-results`)를 켜면 큰 도구 응답이 미리보기와 CLI 명령으로 바뀝니다. 모든 값이 POSIX 셸, cmd.exe, PowerShell 어디서나 셸에 안전할 때만 응답에 `cli` 명령이 들어가고, 그렇지 않으면 셸 없이 실행할 argv 배열 `cli_argv`가 들어갑니다. Human CLI 자체는 compact 되지 않습니다. permission mode, toolsets, denied-tools regex, tool-policy는 MCP와 같습니다. destructive 도구와 `GITLAB_TOOL_POLICY_APPROVE` 도구는 `--yes`가 필요합니다. [Human CLI](./docs/getting-started/cli-arguments.md#human-cli)를 참고하세요.
|
|
321
321
|
|
|
322
322
|
> **세밀한 도구 필터링:** `GITLAB_PERMISSION_MODE=modify`로 생성/수정은 허용하고 모든 삭제 도구와
|
|
323
323
|
> 파괴적인 중단(teardown) 도구(`cancel_pipeline`, `cancel_pipeline_job`, `stop_environment`,
|
package/README.md
CHANGED
|
@@ -267,7 +267,7 @@ The store path is pinned by your lock file; update it with `nix flake update git
|
|
|
267
267
|
|
|
268
268
|
The examples use `zereight-mcp-gitlab`, a less collision-prone alias for the legacy `mcp-gitlab` binary. If your MCP client cannot find it, use the absolute path from `which zereight-mcp-gitlab`.
|
|
269
269
|
|
|
270
|
-
No global install? Pin `npx` to the previous stable release (the version these docs recommend), for example `npx -y @zereight/mcp-gitlab@2.3.
|
|
270
|
+
No global install? Pin `npx` to the previous stable release (the version these docs recommend), for example `npx -y @zereight/mcp-gitlab@2.3.28`. If you set `GITLAB_MASKING_ENABLED`, use 2.3.29 or later (or `@latest`): older releases return the values of CI/CD variables that GitLab flags masked or hidden in plain text. If you always want the newest release, use `npx -y @zereight/mcp-gitlab@latest` instead. To try a fix merged to `main` before the next stable release, use `npx -y @zereight/mcp-gitlab@next`, a pre-release build that is not meant for production. The server prints a notice to stderr on startup when a newer version is available (disable with `GITLAB_DISABLE_VERSION_CHECK=true`).
|
|
271
271
|
|
|
272
272
|
#### Claude Desktop one-click install (MCP Bundle)
|
|
273
273
|
|
|
@@ -322,7 +322,7 @@ CLI arguments take precedence over environment variables.
|
|
|
322
322
|
|
|
323
323
|
`zereight-mcp-gitlab auth` is a subcommand (not an MCP server flag). It runs GitLab device flow and exits. See [CLI Arguments](./docs/getting-started/cli-arguments.md#auth).
|
|
324
324
|
|
|
325
|
-
The same binary is also a `gh`-style GitLab CLI (`tool <name>` or curated forms such as `mr list`). **No MCP registration is needed** — set a PAT, or run `auth` and set `GITLAB_USE_OAUTH=true`: see [CLI without MCP](./docs/getting-started/cli-without-mcp.md). `setup --cursor` / `setup --claude` prints client config; `doctor` checks token, API URL, toolsets, and version. Use it for the full payload in a terminal. MCP replies stay in the chat unless you set `GITLAB_MCP_COMPACT_RESULTS=true` (or `--compact-results`), which replaces oversized tool replies with a preview and a CLI command. Human CLI is never compacted. Same permission mode, toolsets, denied-tools regex, and tool-policy filters. Destructive tools and `GITLAB_TOOL_POLICY_APPROVE` tools need `--yes`. See [Human CLI](./docs/getting-started/cli-arguments.md#human-cli).
|
|
325
|
+
The same binary is also a `gh`-style GitLab CLI (`tool <name>` or curated forms such as `mr list`). **No MCP registration is needed** — set a PAT, or run `auth` and set `GITLAB_USE_OAUTH=true`: see [CLI without MCP](./docs/getting-started/cli-without-mcp.md). `setup --cursor` / `setup --claude` prints client config; `doctor` checks token, API URL, toolsets, and version. Use it for the full payload in a terminal. MCP replies stay in the chat unless you set `GITLAB_MCP_COMPACT_RESULTS=true` (or `--compact-results`), which replaces oversized tool replies with a preview and a CLI command. The reply carries a `cli` command only when every value is shell-safe on POSIX shells, cmd.exe, and PowerShell; otherwise it carries `cli_argv` (an argv array) to run without a shell. Human CLI is never compacted. Same permission mode, toolsets, denied-tools regex, and tool-policy filters. Destructive tools and `GITLAB_TOOL_POLICY_APPROVE` tools need `--yes`. See [Human CLI](./docs/getting-started/cli-arguments.md#human-cli).
|
|
326
326
|
|
|
327
327
|
> **Fine-grained tool filtering:** use `GITLAB_PERMISSION_MODE=modify` to allow create/update while
|
|
328
328
|
> blocking every delete tool and the destructive teardown tools (`cancel_pipeline`,
|
package/README.pt-BR.md
CHANGED
|
@@ -262,7 +262,7 @@ O caminho no store é fixado pelo seu lock file; atualize-o com `nix flake updat
|
|
|
262
262
|
|
|
263
263
|
Os exemplos usam `zereight-mcp-gitlab`, um alias com menor chance de conflito que o binário legado `mcp-gitlab`. Se o seu cliente MCP não o encontrar, use o caminho absoluto retornado por `which zereight-mcp-gitlab`.
|
|
264
264
|
|
|
265
|
-
Não quer instalar globalmente? Fixe o `npx` na versão estável anterior (a versão recomendada por esta documentação), por exemplo `npx -y @zereight/mcp-gitlab@2.3.
|
|
265
|
+
Não quer instalar globalmente? Fixe o `npx` na versão estável anterior (a versão recomendada por esta documentação), por exemplo `npx -y @zereight/mcp-gitlab@2.3.28`. Se você usa `GITLAB_MASKING_ENABLED`, use a 2.3.29 ou posterior (ou `@latest`): versões anteriores retornam em texto puro os valores de variáveis de CI/CD que o GitLab marca como masked ou hidden. Se quiser sempre a versão mais recente, use `npx -y @zereight/mcp-gitlab@latest`. Para testar uma correção já mesclada na `main` antes da próxima versão estável, use `npx -y @zereight/mcp-gitlab@next`, um build de pré-lançamento que não é indicado para produção. O servidor exibe um aviso no stderr durante a inicialização quando existe uma versão mais nova disponível (desative com `GITLAB_DISABLE_VERSION_CHECK=true`).
|
|
266
266
|
|
|
267
267
|
#### Instalação com um clique no Claude Desktop (MCP Bundle)
|
|
268
268
|
|
|
@@ -317,7 +317,7 @@ Os argumentos de CLI têm precedência sobre as variáveis de ambiente.
|
|
|
317
317
|
|
|
318
318
|
`zereight-mcp-gitlab auth` é um subcomando, não uma flag do servidor MCP. Ele executa o device flow do GitLab e encerra. Veja [Argumentos de CLI](./docs/getting-started/cli-arguments.md#auth).
|
|
319
319
|
|
|
320
|
-
O mesmo binário também é uma CLI do GitLab no estilo `gh` (`tool <name>` ou formas curadas como `mr list`). **Não é necessário registrar o MCP** — defina um PAT, ou execute `auth` e defina `GITLAB_USE_OAUTH=true`: veja [CLI sem MCP](./docs/getting-started/cli-without-mcp.md). `setup --cursor` / `setup --claude` imprime a configuração do cliente; `doctor` verifica token, URL da API, toolsets e versão. Use-o para ver a carga completa no terminal. As respostas do MCP permanecem no chat, a menos que você defina `GITLAB_MCP_COMPACT_RESULTS=true` (ou `--compact-results`), o que substitui respostas grandes de ferramentas por uma prévia e um comando CLI. A CLI humana nunca é compactada. Os mesmos filtros de permission mode, toolsets, denied-tools regex e tool-policy se aplicam. Ferramentas destrutivas e ferramentas com `GITLAB_TOOL_POLICY_APPROVE` exigem `--yes`. Consulte [CLI Humana](./docs/getting-started/cli-arguments.md#human-cli).
|
|
320
|
+
O mesmo binário também é uma CLI do GitLab no estilo `gh` (`tool <name>` ou formas curadas como `mr list`). **Não é necessário registrar o MCP** — defina um PAT, ou execute `auth` e defina `GITLAB_USE_OAUTH=true`: veja [CLI sem MCP](./docs/getting-started/cli-without-mcp.md). `setup --cursor` / `setup --claude` imprime a configuração do cliente; `doctor` verifica token, URL da API, toolsets e versão. Use-o para ver a carga completa no terminal. As respostas do MCP permanecem no chat, a menos que você defina `GITLAB_MCP_COMPACT_RESULTS=true` (ou `--compact-results`), o que substitui respostas grandes de ferramentas por uma prévia e um comando CLI. A resposta só traz um comando `cli` quando todos os valores são seguros para shell em shells POSIX, cmd.exe e PowerShell; caso contrário, traz `cli_argv` (um array argv) para executar sem shell. A CLI humana nunca é compactada. Os mesmos filtros de permission mode, toolsets, denied-tools regex e tool-policy se aplicam. Ferramentas destrutivas e ferramentas com `GITLAB_TOOL_POLICY_APPROVE` exigem `--yes`. Consulte [CLI Humana](./docs/getting-started/cli-arguments.md#human-cli).
|
|
321
321
|
|
|
322
322
|
> **Filtragem granular de ferramentas:** use `GITLAB_PERMISSION_MODE=modify` para permitir criação/atualização enquanto
|
|
323
323
|
> bloqueia todas as ferramentas de exclusão e as ferramentas destrutivas de teardown (`cancel_pipeline`,
|
package/README.zh-CN.md
CHANGED
|
@@ -262,7 +262,7 @@ command = lib.getExe inputs.gitlab-mcp.packages.${system}.default;
|
|
|
262
262
|
|
|
263
263
|
示例使用 `zereight-mcp-gitlab`,这是比旧的 `mcp-gitlab` 更不容易冲突的别名。如果 MCP 客户端找不到它,请使用 `which zereight-mcp-gitlab` 输出的绝对路径。
|
|
264
264
|
|
|
265
|
-
如果不想全局安装,请将 `npx` 固定到上一个稳定版本(即文档推荐的版本),例如 `npx -y @zereight/mcp-gitlab@2.3.
|
|
265
|
+
如果不想全局安装,请将 `npx` 固定到上一个稳定版本(即文档推荐的版本),例如 `npx -y @zereight/mcp-gitlab@2.3.28`。如果设置了 `GITLAB_MASKING_ENABLED`,请使用 2.3.29 或更高版本(或 `@latest`):更早的版本会以明文返回 GitLab 标记为 masked 或 hidden 的 CI/CD 变量值。如果始终想使用最新版本,请改用 `npx -y @zereight/mcp-gitlab@latest`。如需在下一个稳定版本发布前试用已合并到 `main` 的修复,请使用 `npx -y @zereight/mcp-gitlab@next`(预发布版本,不适用于生产环境)。有新版本发布时,服务器会在启动时通过 stderr 提示(可用 `GITLAB_DISABLE_VERSION_CHECK=true` 关闭)。
|
|
266
266
|
|
|
267
267
|
#### Claude Desktop 一键安装(MCP Bundle)
|
|
268
268
|
|
|
@@ -317,7 +317,7 @@ CLI 参数优先于环境变量。
|
|
|
317
317
|
|
|
318
318
|
`zereight-mcp-gitlab auth` 是子命令,不是 MCP 服务器参数。它运行 GitLab device flow 后退出。参见 [CLI 参数](./docs/getting-started/cli-arguments.md#auth)。
|
|
319
319
|
|
|
320
|
-
同一二进制也是 `gh` 风格的 GitLab CLI(`tool <name>`,或 `mr list` 这类 curated 命令)。**无需注册 MCP**——设置 PAT,或运行 `auth` 后设置 `GITLAB_USE_OAUTH=true`:参见 [无需 MCP 使用 CLI](./docs/getting-started/cli-without-mcp.md)。`setup --cursor` / `setup --claude` 会打印客户端配置;`doctor` 检查 token、API URL、toolset 和版本。完整结果在终端用 CLI 查看。MCP 回复仍进入对话。设置 `GITLAB_MCP_COMPACT_RESULTS=true`(或 `--compact-results`)后,过大的工具回复会变成预览加上 CLI
|
|
320
|
+
同一二进制也是 `gh` 风格的 GitLab CLI(`tool <name>`,或 `mr list` 这类 curated 命令)。**无需注册 MCP**——设置 PAT,或运行 `auth` 后设置 `GITLAB_USE_OAUTH=true`:参见 [无需 MCP 使用 CLI](./docs/getting-started/cli-without-mcp.md)。`setup --cursor` / `setup --claude` 会打印客户端配置;`doctor` 检查 token、API URL、toolset 和版本。完整结果在终端用 CLI 查看。MCP 回复仍进入对话。设置 `GITLAB_MCP_COMPACT_RESULTS=true`(或 `--compact-results`)后,过大的工具回复会变成预览加上 CLI 命令。仅当每个值在 POSIX shell、cmd.exe 和 PowerShell 中都是 shell 安全的,回复才带 `cli` 命令;否则带 `cli_argv`(argv 数组),不经 shell 直接运行。Human CLI 本身不会被 compact。permission mode、toolsets、denied-tools regex 和 tool-policy 与 MCP 相同。破坏性工具以及 `GITLAB_TOOL_POLICY_APPROVE` 工具需要 `--yes`。参见 [Human CLI](./docs/getting-started/cli-arguments.md#human-cli)。
|
|
321
321
|
|
|
322
322
|
> **细粒度工具过滤:**使用 `GITLAB_PERMISSION_MODE=modify` 允许创建/更新,同时阻止所有删除工具以及
|
|
323
323
|
> 破坏性的拆除(teardown)工具(`cancel_pipeline`、`cancel_pipeline_job`、`stop_environment`、
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { omitInvalidStructuredContent } from "../utils/structured-content.js";
|
|
2
|
-
import {
|
|
2
|
+
import { buildToolReplay } from "./replay-command.js";
|
|
3
3
|
const PREVIEW_ARRAY_ITEMS = 5;
|
|
4
4
|
const PREVIEW_TEXT_CHARS = 1500;
|
|
5
5
|
const PREVIEW_JSON_CHARS = 2000;
|
|
@@ -24,14 +24,14 @@ export function compactMcpToolResult(input) {
|
|
|
24
24
|
if (text.length <= input.maxChars) {
|
|
25
25
|
return toolResultRecord(input.result);
|
|
26
26
|
}
|
|
27
|
-
const
|
|
27
|
+
const replay = buildToolReplay(input.toolName, input.args, input.inputSchema);
|
|
28
28
|
const compact = {
|
|
29
29
|
compact: true,
|
|
30
30
|
tool: input.toolName,
|
|
31
31
|
original_chars: text.length,
|
|
32
32
|
...buildPreview(text),
|
|
33
|
-
//
|
|
34
|
-
...
|
|
33
|
+
// `cli` or `cli_argv`; neither when the arguments cannot be replayed, and the preview stays.
|
|
34
|
+
...replay,
|
|
35
35
|
};
|
|
36
36
|
return {
|
|
37
37
|
content: [{ type: "text", text: JSON.stringify(compact) }],
|
|
@@ -1,7 +1,15 @@
|
|
|
1
1
|
import { readObjectSchema, snakeToKebab } from "./args.js";
|
|
2
2
|
const BINARY = "zereight-mcp-gitlab";
|
|
3
|
-
//
|
|
4
|
-
|
|
3
|
+
// The `cli` line must give the same argv in POSIX sh, cmd.exe (including the .cmd
|
|
4
|
+
// shim npm installs on Windows) and PowerShell, and they do not agree on quoting:
|
|
5
|
+
// cmd and PowerShell do not read single quotes as POSIX does, cmd expands `%` and
|
|
6
|
+
// `!` even inside double quotes, and PowerShell reads `$`, backticks, and Unicode
|
|
7
|
+
// quote and dash look-alikes. So no value is escaped. A token goes in the line bare
|
|
8
|
+
// or in double quotes, made only of characters none of the three treat specially;
|
|
9
|
+
// for any other value the reply carries the argv (`cli_argv`) instead.
|
|
10
|
+
const BARE_WORD = /^[A-Za-z0-9._:/=+-]+$/;
|
|
11
|
+
const DOUBLE_QUOTED_WORD = /^[A-Za-z0-9 ._:/=+,-]+$/;
|
|
12
|
+
const PORTABLE_LINE = /^[A-Za-z0-9 ._:/=+,"-]+$/;
|
|
5
13
|
const TOOL_NAME = /^[a-z][a-z0-9_]*$/;
|
|
6
14
|
const ARGUMENT_NAME = /^[a-z][a-z0-9_]*$/;
|
|
7
15
|
const LONE_SURROGATE = /[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?<![\uD800-\uDBFF])[\uDC00-\uDFFF]/;
|
|
@@ -17,18 +25,28 @@ export const SECRET_ARGUMENT_NAMES = new Set([
|
|
|
17
25
|
"authorization",
|
|
18
26
|
]);
|
|
19
27
|
/**
|
|
20
|
-
* Builds the `zereight-mcp-gitlab tool ...`
|
|
21
|
-
* undefined when
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
* the same argv, and names such as `api_url` would then change its configuration.
|
|
28
|
+
* Builds the `zereight-mcp-gitlab tool ...` replay for a compacted reply, or returns
|
|
29
|
+
* undefined when the arguments cannot be replayed. Only keys that the tool's input
|
|
30
|
+
* schema declares become flags; the CLI reads any other flag from the same argv, and
|
|
31
|
+
* names such as `api_url` would then change its configuration.
|
|
25
32
|
*/
|
|
26
|
-
export function
|
|
33
|
+
export function buildToolReplay(toolName, args, inputSchema) {
|
|
34
|
+
const words = buildReplayWords(toolName, args, inputSchema);
|
|
35
|
+
if (words === undefined) {
|
|
36
|
+
return undefined;
|
|
37
|
+
}
|
|
38
|
+
const cli = portableCommand(words);
|
|
39
|
+
if (cli !== undefined) {
|
|
40
|
+
return { cli };
|
|
41
|
+
}
|
|
42
|
+
return { cli_argv: words.map(word => word.prefix + word.value) };
|
|
43
|
+
}
|
|
44
|
+
function buildReplayWords(toolName, args, inputSchema) {
|
|
27
45
|
if (!TOOL_NAME.test(toolName)) {
|
|
28
46
|
return undefined;
|
|
29
47
|
}
|
|
30
48
|
const declared = new Set(Object.keys(readObjectSchema(inputSchema).properties ?? {}));
|
|
31
|
-
const
|
|
49
|
+
const words = [BINARY, "tool", toolName].map(plainWord);
|
|
32
50
|
const nested = {};
|
|
33
51
|
if (args !== undefined) {
|
|
34
52
|
for (const key of Object.keys(args)) {
|
|
@@ -48,16 +66,16 @@ export function buildToolReplayCommand(toolName, args, inputSchema) {
|
|
|
48
66
|
if (text.includes("\0") || LONE_SURROGATE.test(text)) {
|
|
49
67
|
return undefined;
|
|
50
68
|
}
|
|
51
|
-
|
|
69
|
+
words.push(...flagWords(snakeToKebab(key), text));
|
|
52
70
|
continue;
|
|
53
71
|
}
|
|
54
72
|
nested[key] = value;
|
|
55
73
|
}
|
|
56
74
|
}
|
|
57
75
|
if (Object.keys(nested).length > 0) {
|
|
58
|
-
|
|
76
|
+
words.push(plainWord("--args-json"), plainWord(JSON.stringify(nested)));
|
|
59
77
|
}
|
|
60
|
-
return
|
|
78
|
+
return words;
|
|
61
79
|
}
|
|
62
80
|
function shouldOmitReplayArgument(name) {
|
|
63
81
|
if (name.startsWith("_")) {
|
|
@@ -68,17 +86,35 @@ function shouldOmitReplayArgument(name) {
|
|
|
68
86
|
function isScalarReplayValue(value) {
|
|
69
87
|
return typeof value === "string" || typeof value === "number" || typeof value === "boolean";
|
|
70
88
|
}
|
|
71
|
-
function
|
|
89
|
+
function plainWord(value) {
|
|
90
|
+
return { prefix: "", value };
|
|
91
|
+
}
|
|
92
|
+
function flagWords(flag, value) {
|
|
72
93
|
// The CLI reads `--flag -x` as a missing value, so a value that starts with a
|
|
73
94
|
// dash goes in the `--flag=value` form, which it parses as one token.
|
|
74
95
|
if (value.startsWith("-")) {
|
|
75
|
-
return [`--${flag}
|
|
96
|
+
return [{ prefix: `--${flag}=`, value }];
|
|
76
97
|
}
|
|
77
|
-
return [`--${flag}
|
|
98
|
+
return [plainWord(`--${flag}`), plainWord(value)];
|
|
78
99
|
}
|
|
79
|
-
function
|
|
80
|
-
|
|
100
|
+
function portableCommand(words) {
|
|
101
|
+
const tokens = [];
|
|
102
|
+
for (const word of words) {
|
|
103
|
+
const text = portableWord(word.value);
|
|
104
|
+
if (text === undefined) {
|
|
105
|
+
return undefined;
|
|
106
|
+
}
|
|
107
|
+
tokens.push(word.prefix + text);
|
|
108
|
+
}
|
|
109
|
+
const line = tokens.join(" ");
|
|
110
|
+
return PORTABLE_LINE.test(line) ? line : undefined;
|
|
111
|
+
}
|
|
112
|
+
function portableWord(value) {
|
|
113
|
+
if (BARE_WORD.test(value)) {
|
|
81
114
|
return value;
|
|
82
115
|
}
|
|
83
|
-
|
|
116
|
+
if (DOUBLE_QUOTED_WORD.test(value)) {
|
|
117
|
+
return `"${value}"`;
|
|
118
|
+
}
|
|
119
|
+
return undefined;
|
|
84
120
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zereight/mcp-gitlab",
|
|
3
|
-
"version": "2.3.
|
|
3
|
+
"version": "2.3.30-next.254",
|
|
4
4
|
"mcpName": "io.github.zereight/gitlab-mcp",
|
|
5
5
|
"description": "GitLab MCP server for projects, merge requests, issues, pipelines, wiki, releases, and more",
|
|
6
6
|
"keywords": [
|