@zereight/mcp-gitlab 2.3.28 → 2.3.29-next.249
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 +3 -3
- package/README.md +212 -210
- package/README.pt-BR.md +3 -3
- package/README.zh-CN.md +3 -3
- package/build/index.js +72 -1
- package/build/masking/engine.js +389 -3
- package/build/schemas.js +19 -0
- package/build/server/mcp-help.js +1 -0
- package/build/tools/registry.js +15 -1
- package/build/utils/list-summary.js +6 -2
- package/package.json +2 -2
package/README.zh-CN.md
CHANGED
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
|
|
15
15
|
📖 **[文档 →](https://zereight.github.io/gitlab-mcp/)** · [llms.txt](./llms.txt) · [llms-full.txt](./llms-full.txt)
|
|
16
16
|
|
|
17
|
-
**默认暴露 40 个工具**(38 个 `core` + `discover_tools` + `help`)。总共
|
|
17
|
+
**默认暴露 40 个工具**(38 个 `core` + `discover_tools` + `help`)。总共 290 个(toolset 中 287 个 + `execute_graphql` + `discover_tools` + `help`)。先用精简集,再在本会话中用 `discover_tools` 扩展。
|
|
18
18
|
|
|
19
19
|
> **Token 预算:** MCP 客户端会在会话开始时把整份 `tools/list` 发给模型。请保持默认(约 40 个工具,约 12k schema token)。用 `discover_tools` 为本会话激活类别(仅限本会话;`OAUTH_STATELESS_MODE=true` 时请改用命名的 `GITLAB_TOOLSETS`),或走 [Skill + CLI](./docs/getting-started/cli-without-mcp.md) 以跳过 MCP schema。**不要设置 `GITLAB_TOOLSETS=all`** — 它会加载几乎全部工具,schema 约 73k token。见 [tools/list 体积](#toolslist-体积2026-11-14-实测) 和 [对比](./docs/comparison/index.md)。
|
|
20
20
|
|
|
@@ -148,7 +148,7 @@ GitLab 合并请求、议题和流水线走此 MCP(@zereight/mcp-gitlab)。
|
|
|
148
148
|
|
|
149
149
|
### 为什么使用这个 GitLab MCP?
|
|
150
150
|
|
|
151
|
-
- **默认 40 个工具(38 个 `core` + `discover_tools` + `help`);共
|
|
151
|
+
- **默认 40 个工具(38 个 `core` + `discover_tools` + `help`);共 290 个** — 先精简,再用 `discover_tools` 在本会话扩展。`GITLAB_TOOLSETS=all` 约 73k schema token;按需发现或使用 Skill + CLI
|
|
152
152
|
- **MR 两步审查** — `list_merge_request_changed_files` → 批量 `get_merge_request_file_diff`
|
|
153
153
|
- **内置 Agent Skill** — `skills/gitlab-mcp/` 工作流指南
|
|
154
154
|
- **认证灵活** — Personal Access Token、本地 OAuth2 浏览器流程、MCP OAuth 代理、按请求远程授权
|
|
@@ -162,7 +162,7 @@ GitLab 合并请求、议题和流水线走此 MCP(@zereight/mcp-gitlab)。
|
|
|
162
162
|
| | @zereight/mcp-gitlab | GitLab MCP A(社区 CQRS 型) | GitLab 官方 MCP 服务器 |
|
|
163
163
|
| ------------ | -------------------------------------------------------------------- | ------------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------- |
|
|
164
164
|
| **更适合** | AI 代理工作流 | 企业多实例 / 分组工具 | 内置于 GitLab,无需单独安装 |
|
|
165
|
-
| **工具模型** |
|
|
165
|
+
| **工具模型** | 290 个工具:toolset 中 287 个 + `execute_graphql` + `discover_tools` + `help` | ~50–60 个 `browse_*` / `manage_*` 分组工具 | 用 HTTP 头选择 toolset |
|
|
166
166
|
| **MR 审查** | 两步批量 diff | 因服务器而异 | `get_merge_request` 带 diffs |
|
|
167
167
|
| **Node.js** | >=20.0.0 | 通常 >=24 | stdio 经 `mcp-remote`,需要 Node.js 20+ |
|
|
168
168
|
| **许可证** | MIT | 因服务器而异 | GitLab 的一部分 |
|
package/build/index.js
CHANGED
|
@@ -147,7 +147,7 @@ import { BulkPublishDraftNotesSchema, CancelPipelineJobSchema, ErasePipelineJobS
|
|
|
147
147
|
GitLabDiscussionNoteSchema, // Added
|
|
148
148
|
GitLabDiscussionSchema,
|
|
149
149
|
// Draft Notes Schemas
|
|
150
|
-
GitLabDraftNoteSchema, GitLabForkSchema, GitLabBranchSchema, GitLabProtectedBranchSchema, GitLabGroupSchema, GitLabIssueLinkSchema, GitLabIssueSchema, GitLabIssueWithLinkDetailsSchema, GitLabMarkdownUploadSchema, GitLabMergeRequestPipelineSchema, GitLabMergeRequestSchema, GitLabNamespaceExistsResponseSchema, GitLabNamespaceSchema, GitLabPipelineJobSchema, GitLabDeploymentSchema, GitLabEnvironmentSchema, GitLabPipelineSchema, GitLabPipelineScheduleSchema, GitLabPipelineScheduleVariableSchema, GitLabPipelineSchedulePlayResultSchema, ListPipelineSchedulesSchema, GetPipelineScheduleSchema, ListPipelineSchedulePipelinesSchema, CreatePipelineScheduleSchema, UpdatePipelineScheduleSchema, DeletePipelineScheduleSchema, PlayPipelineScheduleSchema, TakeOwnershipPipelineScheduleSchema, GetPipelineScheduleVariableSchema, CreatePipelineScheduleVariableSchema, UpdatePipelineScheduleVariableSchema, DeletePipelineScheduleVariableSchema, GitLabPipelineTriggerJobSchema, GitLabProjectMemberSchema, GitLabProjectSchema, GitLabTodoSchema, GitLabReferenceSchema, GitLabRepositorySchema, GitLabSearchBlobResultSchema, GitLabSearchResponseSchema, GitLabTreeItemSchema, GitLabUserSchema, GitLabUsersResponseSchema, GroupIteration, ListCommitStatusesSchema, ListBranchesSchema, ListCommitsSchema, ListDraftNotesSchema, ListGroupIterationsSchema, GetGroupIterationSchema, UpdateGroupIterationSchema, CreateGroupIterationSchema, GroupIterationCadence, ListGroupIterationCadencesSchema, DeleteGroupIterationSchema, ListProjectIterationsSchema, CreateGroupIterationCadenceSchema, UpdateGroupIterationCadenceSchema, DeleteGroupIterationCadenceSchema, ListGroupProjectsSchema, GitLabDependencyProxySchema, GitLabDependencyProxyBlobSchema, GetDependencyProxySettingsSchema, UpdateDependencyProxySettingsSchema, ListDependencyProxyBlobsSchema, PurgeDependencyProxyCacheSchema, ListProjectVulnerabilitiesSchema, GetVulnerabilitySchema, DismissVulnerabilitySchema, ConfirmVulnerabilitySchema, ListIssueDiscussionsSchema, ListIssueLinksSchema, ListIssuesSchema, ListTodosSchema, ListMergeRequestDiffsSchema, // Added
|
|
150
|
+
GitLabDraftNoteSchema, GitLabForkSchema, GitLabBranchSchema, GitLabProtectedBranchSchema, GitLabGroupSchema, GitLabIssueLinkSchema, GitLabIssueSchema, GitLabIssueWithLinkDetailsSchema, GitLabResourceLabelEventSchema, GitLabResourceStateEventSchema, GitLabMarkdownUploadSchema, GitLabMergeRequestPipelineSchema, GitLabMergeRequestSchema, GitLabNamespaceExistsResponseSchema, GitLabNamespaceSchema, GitLabPipelineJobSchema, GitLabDeploymentSchema, GitLabEnvironmentSchema, GitLabPipelineSchema, GitLabPipelineScheduleSchema, GitLabPipelineScheduleVariableSchema, GitLabPipelineSchedulePlayResultSchema, ListPipelineSchedulesSchema, GetPipelineScheduleSchema, ListPipelineSchedulePipelinesSchema, CreatePipelineScheduleSchema, UpdatePipelineScheduleSchema, DeletePipelineScheduleSchema, PlayPipelineScheduleSchema, TakeOwnershipPipelineScheduleSchema, GetPipelineScheduleVariableSchema, CreatePipelineScheduleVariableSchema, UpdatePipelineScheduleVariableSchema, DeletePipelineScheduleVariableSchema, GitLabPipelineTriggerJobSchema, GitLabProjectMemberSchema, GitLabProjectSchema, GitLabTodoSchema, GitLabReferenceSchema, GitLabRepositorySchema, GitLabSearchBlobResultSchema, GitLabSearchResponseSchema, GitLabTreeItemSchema, GitLabUserSchema, GitLabUsersResponseSchema, GroupIteration, ListCommitStatusesSchema, ListBranchesSchema, ListCommitsSchema, ListDraftNotesSchema, ListGroupIterationsSchema, GetGroupIterationSchema, UpdateGroupIterationSchema, CreateGroupIterationSchema, GroupIterationCadence, ListGroupIterationCadencesSchema, DeleteGroupIterationSchema, ListProjectIterationsSchema, CreateGroupIterationCadenceSchema, UpdateGroupIterationCadenceSchema, DeleteGroupIterationCadenceSchema, ListGroupProjectsSchema, GitLabDependencyProxySchema, GitLabDependencyProxyBlobSchema, GetDependencyProxySettingsSchema, UpdateDependencyProxySettingsSchema, ListDependencyProxyBlobsSchema, PurgeDependencyProxyCacheSchema, ListProjectVulnerabilitiesSchema, GetVulnerabilitySchema, DismissVulnerabilitySchema, ConfirmVulnerabilitySchema, ListIssueDiscussionsSchema, ListIssueLinksSchema, ListIssueLabelEventsSchema, ListIssueStateEventsSchema, ListIssuesSchema, ListTodosSchema, ListMergeRequestDiffsSchema, // Added
|
|
151
151
|
GetMergeRequestFileDiffSchema, ListMergeRequestChangedFilesSchema, ListMergeRequestDiscussionsSchema, ListMergeRequestPipelinesSchema, ListMergeRequestsSchema, ListGroupMergeRequestsSchema, ListMergeRequestVersionsSchema, GetMergeRequestVersionSchema, GitLabMergeRequestVersionSchema, GitLabMergeRequestVersionDetailSchema, ListNamespacesSchema, ListPipelineJobsSchema, ListPipelinesSchema, ListDeploymentsSchema, ListEnvironmentsSchema, ListProjectRunnersSchema, GetRunnerSchema, ListPipelineTriggerJobsSchema, ValidateCiLintSchema, ValidateProjectCiLintSchema, ListCiCatalogResourcesSchema, GetCiCatalogResourceSchema, ListProjectMembersSchema, ListGroupMembersSchema, ListProjectsSchema, MarkdownUploadSchema, MarkdownUploadRemoteSchema, DownloadAttachmentSchema, DownloadJobArtifactsSchema, GetJobArtifactFileSchema, GitLabArtifactEntrySchema, ListJobArtifactsSchema, MergeMergeRequestSchema, ApproveMergeRequestSchema, UnapproveMergeRequestSchema, RebaseMergeRequestSchema, GetMergeRequestApprovalStateSchema, GetMergeRequestConflictsSchema, GitLabMergeRequestApprovalStateSchema, MyIssuesSchema, OrbitQuerySchema, OrbitSchemaSchema, OrbitStatusSchema, OrbitToolsSchema, MarkAllTodosDoneSchema, MarkTodoDoneSchema, PaginatedDiscussionsResponseSchema, PublishDraftNoteSchema, PlayPipelineJobSchema, PushFilesSchema, RetryPipelineJobSchema, RetryPipelineSchema, SearchCodeSchema, SearchGroupCodeSchema, SearchProjectCodeSchema, SearchRepositoriesSchema, UpdateDraftNoteSchema, UpdateIssueNoteSchema, UpdateIssueSchema, UpdateIssueDescriptionPatchSchema, ReorderIssueSchema, UpdateProjectSchema, UpdateMergeRequestNoteSchema, UpdateMergeRequestDiscussionNoteSchema, UpdateMergeRequestSchema, VerifyNamespaceSchema, GitLabEventSchema, ListEventsSchema, GetProjectEventsSchema, ExecuteGraphQLSchema, GitLabReleaseSchema, ListReleasesSchema, GetReleaseSchema, CreateReleaseSchema, UpdateReleaseSchema, DeleteReleaseSchema, CreateReleaseEvidenceSchema, DownloadReleaseAssetSchema, ListSnippetsSchema, GetSnippetSchema, CreateSnippetSchema, UpdateSnippetSchema, DeleteSnippetSchema, GitLabSnippetSchema, GetMergeRequestNotesSchema, GetMergeRequestNoteSchema, GetMergeRequestDiscussionSchema, DeleteMergeRequestDiscussionNoteSchema, ResolveMergeRequestThreadSchema, GetWorkItemSchema, ListWorkItemsSchema, CreateWorkItemSchema, UpdateWorkItemSchema, ConvertWorkItemTypeSchema, ListWorkItemStatusesSchema, ListWorkItemNotesSchema, CreateWorkItemNoteSchema, CreateWorkItemEmojiReactionSchema, CreateWorkItemNoteEmojiReactionSchema, ListWorkItemEmojiReactionsSchema, ListWorkItemNoteEmojiReactionsSchema, DeleteWorkItemEmojiReactionSchema, DeleteWorkItemNoteEmojiReactionSchema, MoveWorkItemSchema, ListCustomFieldDefinitionsSchema, GetTimelineEventsSchema, CreateTimelineEventSchema, ListWebhooksSchema, CreateWebhookSchema, UpdateWebhookSchema, DeleteWebhookSchema, ListWebhookEventsSchema, GetWebhookEventSchema, HealthCheckSchema, } from "./schemas.js";
|
|
152
152
|
import { createHash, randomUUID, timingSafeEqual } from "node:crypto";
|
|
153
153
|
import { createGraphQLAuditFailure, createToolCallAuditor, graphqlPayloadHasErrors, markToolResultAsAuditFailure, readKnownGitLabUserId, readKnownGitLabUsername, } from "./utils/audit-log.js";
|
|
@@ -3337,6 +3337,63 @@ async function listIssueLinks(projectId, issueIid) {
|
|
|
3337
3337
|
const data = await response.json();
|
|
3338
3338
|
return z.array(GitLabIssueWithLinkDetailsSchema).parse(data);
|
|
3339
3339
|
}
|
|
3340
|
+
/** Reduce an event's author to `{ username }`; null for ghost or system events. */
|
|
3341
|
+
function toLeanEventUser(user) {
|
|
3342
|
+
return user ? { username: user.username } : null;
|
|
3343
|
+
}
|
|
3344
|
+
/** Map a GitLab resource label event to the lean shape; label is null when it was deleted. */
|
|
3345
|
+
function toLeanLabelEvent(event) {
|
|
3346
|
+
return {
|
|
3347
|
+
created_at: event.created_at,
|
|
3348
|
+
user: toLeanEventUser(event.user),
|
|
3349
|
+
action: event.action,
|
|
3350
|
+
label: event.label ? { name: event.label.name } : null,
|
|
3351
|
+
};
|
|
3352
|
+
}
|
|
3353
|
+
/** Map a GitLab resource state event to the lean shape. */
|
|
3354
|
+
function toLeanStateEvent(event) {
|
|
3355
|
+
return {
|
|
3356
|
+
created_at: event.created_at,
|
|
3357
|
+
user: toLeanEventUser(event.user),
|
|
3358
|
+
state: event.state,
|
|
3359
|
+
};
|
|
3360
|
+
}
|
|
3361
|
+
/**
|
|
3362
|
+
* Fetch one page of an issue's resource events (label or state) from GitLab.
|
|
3363
|
+
* Returns the raw JSON; callers parse and map it.
|
|
3364
|
+
*/
|
|
3365
|
+
async function fetchIssueResourceEvents(projectId, issueIid, resource, options) {
|
|
3366
|
+
projectId = decodeURIComponent(projectId);
|
|
3367
|
+
const url = new URL(`${getEffectiveApiUrl()}/projects/${encodeGitLabPathSegment(getEffectiveProjectId(projectId))}/issues/${encodeGitLabPathSegment(issueIid)}/${resource}`);
|
|
3368
|
+
appendFilterParams(url.searchParams, options);
|
|
3369
|
+
const response = await fetch(url.toString(), {
|
|
3370
|
+
...getFetchConfig(),
|
|
3371
|
+
});
|
|
3372
|
+
await handleGitLabError(response);
|
|
3373
|
+
return response.json();
|
|
3374
|
+
}
|
|
3375
|
+
/**
|
|
3376
|
+
* List the label events of an issue (who added or removed which label, when)
|
|
3377
|
+
*
|
|
3378
|
+
* @param {string} projectId - The ID or URL-encoded path of the project
|
|
3379
|
+
* @param {number} issueIid - The internal ID of the project issue
|
|
3380
|
+
* @returns Lean label events in GitLab's order
|
|
3381
|
+
*/
|
|
3382
|
+
async function listIssueLabelEvents(projectId, issueIid, options = {}) {
|
|
3383
|
+
const data = await fetchIssueResourceEvents(projectId, issueIid, "resource_label_events", options);
|
|
3384
|
+
return z.array(GitLabResourceLabelEventSchema).parse(data).map(toLeanLabelEvent);
|
|
3385
|
+
}
|
|
3386
|
+
/**
|
|
3387
|
+
* List the state events of an issue (who closed or reopened it, when)
|
|
3388
|
+
*
|
|
3389
|
+
* @param {string} projectId - The ID or URL-encoded path of the project
|
|
3390
|
+
* @param {number} issueIid - The internal ID of the project issue
|
|
3391
|
+
* @returns Lean state events in GitLab's order
|
|
3392
|
+
*/
|
|
3393
|
+
async function listIssueStateEvents(projectId, issueIid, options = {}) {
|
|
3394
|
+
const data = await fetchIssueResourceEvents(projectId, issueIid, "resource_state_events", options);
|
|
3395
|
+
return z.array(GitLabResourceStateEventSchema).parse(data).map(toLeanStateEvent);
|
|
3396
|
+
}
|
|
3340
3397
|
/**
|
|
3341
3398
|
* Get a specific issue link
|
|
3342
3399
|
* 특정 이슈 관계 조회
|
|
@@ -8874,6 +8931,20 @@ async function handleToolCall(params) {
|
|
|
8874
8931
|
content: [{ type: "text", text: JSON.stringify(links) }],
|
|
8875
8932
|
};
|
|
8876
8933
|
}
|
|
8934
|
+
case "list_issue_label_events": {
|
|
8935
|
+
const { project_id, issue_iid, ...options } = ListIssueLabelEventsSchema.parse(params.arguments);
|
|
8936
|
+
const events = await listIssueLabelEvents(project_id, issue_iid, options);
|
|
8937
|
+
return {
|
|
8938
|
+
content: [{ type: "text", text: JSON.stringify(events) }],
|
|
8939
|
+
};
|
|
8940
|
+
}
|
|
8941
|
+
case "list_issue_state_events": {
|
|
8942
|
+
const { project_id, issue_iid, ...options } = ListIssueStateEventsSchema.parse(params.arguments);
|
|
8943
|
+
const events = await listIssueStateEvents(project_id, issue_iid, options);
|
|
8944
|
+
return {
|
|
8945
|
+
content: [{ type: "text", text: JSON.stringify(events) }],
|
|
8946
|
+
};
|
|
8947
|
+
}
|
|
8877
8948
|
case "list_issue_discussions": {
|
|
8878
8949
|
const args = ListIssueDiscussionsSchema.parse(params.arguments);
|
|
8879
8950
|
const { project_id, issue_iid, ...options } = args;
|
package/build/masking/engine.js
CHANGED
|
@@ -242,6 +242,21 @@ function readJsonStringToken(token) {
|
|
|
242
242
|
}
|
|
243
243
|
return parsed;
|
|
244
244
|
}
|
|
245
|
+
/**
|
|
246
|
+
* GitLab marks CI/CD variables as `masked` or `hidden` (masked and hidden) so
|
|
247
|
+
* their values stay out of job logs and the UI. The variables API still returns
|
|
248
|
+
* the value, so with masking enabled the whole `value` of such a variable
|
|
249
|
+
* object is replaced, whatever it looks like.
|
|
250
|
+
*/
|
|
251
|
+
export const FLAGGED_CI_VARIABLE_REPLACEMENT = "[Masked CI variable value]";
|
|
252
|
+
function isFlaggedGitlabCiVariable(value) {
|
|
253
|
+
const record = value;
|
|
254
|
+
return (typeof record.key === "string" &&
|
|
255
|
+
typeof record.value === "string" &&
|
|
256
|
+
(record.masked === true || record.hidden === true));
|
|
257
|
+
}
|
|
258
|
+
// The literal after a JSON property name, up to the next `,` or `}`.
|
|
259
|
+
const JSON_TRUE_VALUE_GAP = /^\s*:\s*true\s*$/;
|
|
245
260
|
function readGitlabCiAwsSecretKey(value) {
|
|
246
261
|
if (!("key" in value))
|
|
247
262
|
return undefined;
|
|
@@ -265,8 +280,13 @@ function maskStrings(value, mask, parentKey) {
|
|
|
265
280
|
return value.map(item => maskStrings(item, mask, parentKey));
|
|
266
281
|
if (value && typeof value === "object") {
|
|
267
282
|
const ciKey = readGitlabCiAwsSecretKey(value);
|
|
283
|
+
const flaggedCiVariable = isFlaggedGitlabCiVariable(value);
|
|
268
284
|
const output = {};
|
|
269
285
|
for (const [key, item] of Object.entries(value)) {
|
|
286
|
+
if (flaggedCiVariable && key === "value") {
|
|
287
|
+
output[key] = FLAGGED_CI_VARIABLE_REPLACEMENT;
|
|
288
|
+
continue;
|
|
289
|
+
}
|
|
270
290
|
const fieldKey = key === "value" && ciKey !== undefined ? ciKey : key;
|
|
271
291
|
output[key] = maskStrings(item, mask, fieldKey);
|
|
272
292
|
}
|
|
@@ -295,13 +315,27 @@ function maskJsonText(text, mask) {
|
|
|
295
315
|
const scopes = [];
|
|
296
316
|
const stringValues = [];
|
|
297
317
|
const objectCiKeys = new Map();
|
|
318
|
+
// Objects shaped like a GitLab CI variable: a string `key`, and `masked` or
|
|
319
|
+
// `hidden` set to the literal true. Both are collected before any rewrite.
|
|
320
|
+
const objectsWithStringKey = new Set();
|
|
321
|
+
const objectsFlaggedMasked = new Set();
|
|
298
322
|
let nextObjectId = 0;
|
|
323
|
+
let previousTokenEnd = 0;
|
|
299
324
|
for (const match of text.matchAll(JSON_STRING_OR_STRUCTURE_PATTERN)) {
|
|
300
325
|
const token = match[0];
|
|
301
326
|
const index = match.index;
|
|
302
327
|
if (index === undefined)
|
|
303
328
|
continue;
|
|
329
|
+
const gap = text.slice(previousTokenEnd, index);
|
|
330
|
+
previousTokenEnd = index + token.length;
|
|
304
331
|
const scope = scopes[scopes.length - 1];
|
|
332
|
+
if ((token === "," || token === "}") &&
|
|
333
|
+
scope?.isObject &&
|
|
334
|
+
!scope.expectingKey &&
|
|
335
|
+
(scope.fieldName === "masked" || scope.fieldName === "hidden") &&
|
|
336
|
+
JSON_TRUE_VALUE_GAP.test(gap)) {
|
|
337
|
+
objectsFlaggedMasked.add(scope.objectId);
|
|
338
|
+
}
|
|
305
339
|
if (token === "{") {
|
|
306
340
|
scopes.push({
|
|
307
341
|
isObject: true,
|
|
@@ -336,8 +370,10 @@ function maskJsonText(text, mask) {
|
|
|
336
370
|
scope.expectingKey = false;
|
|
337
371
|
continue;
|
|
338
372
|
}
|
|
339
|
-
if (scope?.isObject && scope.fieldName === "key"
|
|
340
|
-
|
|
373
|
+
if (scope?.isObject && scope.fieldName === "key") {
|
|
374
|
+
objectsWithStringKey.add(scope.objectId);
|
|
375
|
+
if (AWS_SECRET_FIELD_NAMES.has(decoded))
|
|
376
|
+
objectCiKeys.set(scope.objectId, decoded);
|
|
341
377
|
}
|
|
342
378
|
stringValues.push({
|
|
343
379
|
index,
|
|
@@ -345,12 +381,21 @@ function maskJsonText(text, mask) {
|
|
|
345
381
|
decoded,
|
|
346
382
|
fieldName: scope?.fieldName,
|
|
347
383
|
objectId: scope?.objectId ?? -1,
|
|
384
|
+
isObjectProperty: scope?.isObject === true,
|
|
348
385
|
});
|
|
349
386
|
}
|
|
350
387
|
let output = "";
|
|
351
388
|
let cursor = 0;
|
|
352
389
|
for (const item of stringValues) {
|
|
353
390
|
output += text.slice(cursor, item.index);
|
|
391
|
+
if (item.isObjectProperty &&
|
|
392
|
+
item.fieldName === "value" &&
|
|
393
|
+
objectsWithStringKey.has(item.objectId) &&
|
|
394
|
+
objectsFlaggedMasked.has(item.objectId)) {
|
|
395
|
+
output += JSON.stringify(FLAGGED_CI_VARIABLE_REPLACEMENT);
|
|
396
|
+
cursor = item.index + item.token.length;
|
|
397
|
+
continue;
|
|
398
|
+
}
|
|
354
399
|
const ciKey = objectCiKeys.get(item.objectId);
|
|
355
400
|
const parentKey = item.fieldName === "value" && ciKey !== undefined ? ciKey : item.fieldName;
|
|
356
401
|
const masked = maskFieldValue(item.decoded, parentKey, mask);
|
|
@@ -359,11 +404,352 @@ function maskJsonText(text, mask) {
|
|
|
359
404
|
}
|
|
360
405
|
return output + text.slice(cursor);
|
|
361
406
|
}
|
|
407
|
+
/**
|
|
408
|
+
* Regex source for a JSON property name in raw text. Each letter may also be
|
|
409
|
+
* written as a JSON Unicode escape (`va\u006cue`), with one backslash in plain
|
|
410
|
+
* JSON or two in JSON printed inside a string, so escaped names still match.
|
|
411
|
+
*/
|
|
412
|
+
function jsonNamePattern(name) {
|
|
413
|
+
return Array.from(name, char => {
|
|
414
|
+
const hex = Array.from(char.charCodeAt(0).toString(16).padStart(4, "0"), digit => /[a-f]/.test(digit) ? `[${digit}${digit.toUpperCase()}]` : digit).join("");
|
|
415
|
+
return `(?:${char}|\\\\{1,2}u${hex})`;
|
|
416
|
+
}).join("");
|
|
417
|
+
}
|
|
418
|
+
const VALUE_NAME_PATTERN = jsonNamePattern("value");
|
|
419
|
+
// A flag literal in raw text. The escaped form covers JSON that is itself a
|
|
420
|
+
// string value inside prose (`\"masked\":true`).
|
|
421
|
+
const FLAG_LITERAL_PATTERN = new RegExp(`\\\\?"(?:${jsonNamePattern("masked")}|${jsonNamePattern("hidden")})\\\\?"\\s*:\\s*true(?![A-Za-z0-9_])`);
|
|
422
|
+
// A `"value"` property with a JSON string value, used only in uncovered text.
|
|
423
|
+
// A value cut off before its closing quote runs to the end of the text.
|
|
424
|
+
const UNCOVERED_VALUE_PATTERN = new RegExp(`("${VALUE_NAME_PATTERN}"\\s*:\\s*)"(?:\\\\.|[^"\\\\])*(?:"|\\\\?$)`, "g");
|
|
425
|
+
// The start of the same property in escaped JSON (`\"value\":\"..."`), e.g. a
|
|
426
|
+
// log line that prints a JSON string. The closing quote is found by
|
|
427
|
+
// findEndOfEscapedJsonString so an embedded `\\\"` cannot end the value.
|
|
428
|
+
const UNCOVERED_ESCAPED_VALUE_START_PATTERN = new RegExp(`\\\\"${VALUE_NAME_PATTERN}\\\\"\\s*:\\s*\\\\"`, "g");
|
|
429
|
+
// A JSON Unicode escape such as `\u0073` in `ma\u0073ked`. Used to skip the
|
|
430
|
+
// text fast path when a flag name may be escaped this way.
|
|
431
|
+
const JSON_UNICODE_ESCAPE_PATTERN = /\\u[0-9a-fA-F]{4}/;
|
|
432
|
+
const FLAGGED_TEXT_SCAN_FACTOR = 8;
|
|
433
|
+
const FLAGGED_TEXT_SCAN_SLACK = 65536;
|
|
434
|
+
/** Index of the `}` closing the `{` at `open`, or -1. Charges the characters it walks. */
|
|
435
|
+
function findClosingBrace(text, open, budget) {
|
|
436
|
+
const limit = Math.min(text.length, open + budget.remaining);
|
|
437
|
+
let depth = 0;
|
|
438
|
+
let inString = false;
|
|
439
|
+
let index = open;
|
|
440
|
+
let close = -1;
|
|
441
|
+
for (; index < limit; index++) {
|
|
442
|
+
const char = text[index];
|
|
443
|
+
if (inString) {
|
|
444
|
+
if (char === "\\")
|
|
445
|
+
index++;
|
|
446
|
+
else if (char === '"')
|
|
447
|
+
inString = false;
|
|
448
|
+
}
|
|
449
|
+
else if (char === '"') {
|
|
450
|
+
inString = true;
|
|
451
|
+
}
|
|
452
|
+
else if (char === "{" || char === "[") {
|
|
453
|
+
depth++;
|
|
454
|
+
}
|
|
455
|
+
else if (char === "}" || char === "]") {
|
|
456
|
+
depth--;
|
|
457
|
+
if (depth === 0) {
|
|
458
|
+
if (char === "}")
|
|
459
|
+
close = index;
|
|
460
|
+
break;
|
|
461
|
+
}
|
|
462
|
+
}
|
|
463
|
+
}
|
|
464
|
+
budget.remaining -= Math.min(index + 1, limit) - open;
|
|
465
|
+
return close;
|
|
466
|
+
}
|
|
467
|
+
/**
|
|
468
|
+
* Index just past the `"` that closes a JSON string whose content starts at
|
|
469
|
+
* `from`, or the end of the text when it never closes. Charges the
|
|
470
|
+
* characters it walks.
|
|
471
|
+
*/
|
|
472
|
+
function findEndOfJsonString(text, from, budget) {
|
|
473
|
+
let index = from;
|
|
474
|
+
for (; index < text.length; index++) {
|
|
475
|
+
const char = text[index];
|
|
476
|
+
if (char === "\\")
|
|
477
|
+
index++;
|
|
478
|
+
else if (char === '"')
|
|
479
|
+
break;
|
|
480
|
+
}
|
|
481
|
+
budget.remaining -= Math.min(index + 1, text.length) - from;
|
|
482
|
+
return index < text.length ? index + 1 : text.length;
|
|
483
|
+
}
|
|
484
|
+
function parsesAsJsonObject(span) {
|
|
485
|
+
try {
|
|
486
|
+
const parsed = JSON.parse(span);
|
|
487
|
+
return typeof parsed === "object" && parsed !== null;
|
|
488
|
+
}
|
|
489
|
+
catch {
|
|
490
|
+
return false;
|
|
491
|
+
}
|
|
492
|
+
}
|
|
493
|
+
/**
|
|
494
|
+
* Index just past the `\"` that closes an escaped JSON string starting at
|
|
495
|
+
* `from` (the first character after the opening `\"`), or -1 if it never
|
|
496
|
+
* closes. `\\` delivers a backslash to the inner string and may start an
|
|
497
|
+
* inner escape; `\"` ends the string unless the inner string is escaping.
|
|
498
|
+
*/
|
|
499
|
+
function findEndOfEscapedJsonString(text, from) {
|
|
500
|
+
let innerEscaped = false;
|
|
501
|
+
for (let index = from; index < text.length; index++) {
|
|
502
|
+
const char = text[index];
|
|
503
|
+
if (char === "\\" && index + 1 < text.length) {
|
|
504
|
+
const next = text[index + 1];
|
|
505
|
+
if (next === "\\") {
|
|
506
|
+
innerEscaped = !innerEscaped;
|
|
507
|
+
index++;
|
|
508
|
+
continue;
|
|
509
|
+
}
|
|
510
|
+
if (next === '"') {
|
|
511
|
+
if (!innerEscaped)
|
|
512
|
+
return index + 2;
|
|
513
|
+
innerEscaped = false;
|
|
514
|
+
index++;
|
|
515
|
+
continue;
|
|
516
|
+
}
|
|
517
|
+
}
|
|
518
|
+
innerEscaped = false;
|
|
519
|
+
}
|
|
520
|
+
return -1;
|
|
521
|
+
}
|
|
522
|
+
function replaceUncoveredEscapedValues(gap) {
|
|
523
|
+
let output = "";
|
|
524
|
+
let cursor = 0;
|
|
525
|
+
UNCOVERED_ESCAPED_VALUE_START_PATTERN.lastIndex = 0;
|
|
526
|
+
for (const match of gap.matchAll(UNCOVERED_ESCAPED_VALUE_START_PATTERN)) {
|
|
527
|
+
const start = match.index;
|
|
528
|
+
if (start === undefined || start < cursor)
|
|
529
|
+
continue;
|
|
530
|
+
const close = findEndOfEscapedJsonString(gap, start + match[0].length);
|
|
531
|
+
output +=
|
|
532
|
+
gap.slice(cursor, start) + match[0].slice(0, -2) + `\\"${FLAGGED_CI_VARIABLE_REPLACEMENT}\\"`;
|
|
533
|
+
// A value cut off before its closing quote runs to the end of the gap.
|
|
534
|
+
cursor = close === -1 ? gap.length : close;
|
|
535
|
+
}
|
|
536
|
+
return output + gap.slice(cursor);
|
|
537
|
+
}
|
|
538
|
+
/**
|
|
539
|
+
* Fallback for text outside any valid JSON object. Only applied when that text
|
|
540
|
+
* also holds a flag literal, so `value` fields in unflagged text are untouched.
|
|
541
|
+
* Over-masks any `value` string in a broken gap that carries a flag.
|
|
542
|
+
*/
|
|
543
|
+
function replaceUncoveredValues(gap) {
|
|
544
|
+
if (!FLAG_LITERAL_PATTERN.test(gap))
|
|
545
|
+
return gap;
|
|
546
|
+
return replaceUncoveredEscapedValues(gap.replace(UNCOVERED_VALUE_PATTERN, (_match, prefix) => prefix + JSON.stringify(FLAGGED_CI_VARIABLE_REPLACEMENT)));
|
|
547
|
+
}
|
|
548
|
+
function newGapStructure(start) {
|
|
549
|
+
return {
|
|
550
|
+
start,
|
|
551
|
+
scanned: start,
|
|
552
|
+
inString: false,
|
|
553
|
+
stringStart: -1,
|
|
554
|
+
escaped: false,
|
|
555
|
+
open: [],
|
|
556
|
+
firstObject: -1,
|
|
557
|
+
last: undefined,
|
|
558
|
+
};
|
|
559
|
+
}
|
|
560
|
+
/** Reads `[structure.scanned, end)` into `structure`. Charges the characters it reads. */
|
|
561
|
+
function advanceGapStructure(structure, text, end, budget) {
|
|
562
|
+
if (end <= structure.scanned)
|
|
563
|
+
return;
|
|
564
|
+
budget.remaining -= end - structure.scanned;
|
|
565
|
+
for (let index = structure.scanned; index < end; index++) {
|
|
566
|
+
const char = text[index];
|
|
567
|
+
if (structure.inString) {
|
|
568
|
+
if (structure.escaped)
|
|
569
|
+
structure.escaped = false;
|
|
570
|
+
else if (char === "\\")
|
|
571
|
+
structure.escaped = true;
|
|
572
|
+
else if (char === '"') {
|
|
573
|
+
structure.inString = false;
|
|
574
|
+
structure.last = '"';
|
|
575
|
+
}
|
|
576
|
+
continue;
|
|
577
|
+
}
|
|
578
|
+
if (/\s/.test(char))
|
|
579
|
+
continue;
|
|
580
|
+
structure.last = char;
|
|
581
|
+
if (char === '"') {
|
|
582
|
+
structure.inString = true;
|
|
583
|
+
structure.stringStart = index;
|
|
584
|
+
}
|
|
585
|
+
else if (char === "{" || char === "[") {
|
|
586
|
+
if (char === "{" && structure.firstObject === -1)
|
|
587
|
+
structure.firstObject = structure.open.length;
|
|
588
|
+
structure.open.push({ char, index });
|
|
589
|
+
}
|
|
590
|
+
else if ((char === "}" || char === "]") && structure.open.length > 0) {
|
|
591
|
+
structure.open.pop();
|
|
592
|
+
if (structure.open.length <= structure.firstObject)
|
|
593
|
+
structure.firstObject = -1;
|
|
594
|
+
}
|
|
595
|
+
}
|
|
596
|
+
structure.scanned = end;
|
|
597
|
+
}
|
|
598
|
+
/** Start and end of each flag literal in `text`, in order. */
|
|
599
|
+
function flagLiteralRanges(text) {
|
|
600
|
+
const pattern = new RegExp(FLAG_LITERAL_PATTERN.source, "g");
|
|
601
|
+
return Array.from(text.matchAll(pattern), match => [
|
|
602
|
+
match.index ?? 0,
|
|
603
|
+
(match.index ?? 0) + match[0].length,
|
|
604
|
+
]);
|
|
605
|
+
}
|
|
606
|
+
/** True when some range lies inside `[start, end)`. `ranges` is sorted. */
|
|
607
|
+
function hasRangeWithin(ranges, start, end) {
|
|
608
|
+
let low = 0;
|
|
609
|
+
let high = ranges.length;
|
|
610
|
+
while (low < high) {
|
|
611
|
+
const middle = (low + high) >> 1;
|
|
612
|
+
if (ranges[middle][0] < start)
|
|
613
|
+
low = middle + 1;
|
|
614
|
+
else
|
|
615
|
+
high = middle;
|
|
616
|
+
}
|
|
617
|
+
return low < ranges.length && ranges[low][1] <= end;
|
|
618
|
+
}
|
|
619
|
+
/**
|
|
620
|
+
* True when the object at `open` is nested inside an incomplete flagged
|
|
621
|
+
* object in the current gap: it is a property value, an array element, or
|
|
622
|
+
* text inside an open string there, and that parent holds a flag before or
|
|
623
|
+
* after `open`. Also true when `open` is text inside a string at gap level
|
|
624
|
+
* (for example an escaped record in a quoted log argument) and the gap holds
|
|
625
|
+
* a flag before that string ends. Such a span must not split the gap, or a
|
|
626
|
+
* value and its flag could land in different gaps. `parentEnd` gives the end
|
|
627
|
+
* of the parent at an index, and `stringEnd` the end of the string opened at
|
|
628
|
+
* an index (the end of the text when either never closes).
|
|
629
|
+
*/
|
|
630
|
+
function isNestedInIncompleteFlaggedObject(structure, flagRanges, open, parentEnd, stringEnd) {
|
|
631
|
+
if (structure.inString &&
|
|
632
|
+
hasRangeWithin(flagRanges, structure.start, stringEnd(structure.stringStart)))
|
|
633
|
+
return true;
|
|
634
|
+
if (structure.firstObject === -1)
|
|
635
|
+
return false;
|
|
636
|
+
const parent = structure.open[structure.firstObject];
|
|
637
|
+
if (!hasRangeWithin(flagRanges, parent.index, parentEnd(parent.index)))
|
|
638
|
+
return false;
|
|
639
|
+
// A brace inside an open string is string content, not a nested object.
|
|
640
|
+
if (structure.inString)
|
|
641
|
+
return true;
|
|
642
|
+
const innermost = structure.open[structure.open.length - 1];
|
|
643
|
+
if (innermost.char === "[")
|
|
644
|
+
return true;
|
|
645
|
+
return structure.last === ":";
|
|
646
|
+
}
|
|
647
|
+
/**
|
|
648
|
+
* Replaces the value of each GitLab CI/CD variable flagged masked or hidden in
|
|
649
|
+
* text that is not pure JSON: JSON in prose, job logs, error messages, and JSON
|
|
650
|
+
* inside a JSON string. Each `{` is tried as the start of a complete object.
|
|
651
|
+
* A span that parses as an object goes through the JSON scanner in flagged-only
|
|
652
|
+
* mode, so every other byte is kept. Text outside those spans goes through
|
|
653
|
+
* replaceUncoveredValues. Limits:
|
|
654
|
+
* - A truncated object cut before its flag cannot be detected, because the
|
|
655
|
+
* flag is not in the text yet.
|
|
656
|
+
* - Text after the scan budget runs out is handled as uncovered text.
|
|
657
|
+
* - In a broken span that carries a flag, the fallback masks any `"value"`
|
|
658
|
+
* string, including values of complete objects nested in that span. Those
|
|
659
|
+
* nested objects also go through maskJsonText first.
|
|
660
|
+
*/
|
|
661
|
+
function maskFlaggedCiVariablesInText(text, budget = {
|
|
662
|
+
remaining: FLAGGED_TEXT_SCAN_FACTOR * text.length + FLAGGED_TEXT_SCAN_SLACK,
|
|
663
|
+
}) {
|
|
664
|
+
if (!FLAG_LITERAL_PATTERN.test(text) && !JSON_UNICODE_ESCAPE_PATTERN.test(text))
|
|
665
|
+
return text;
|
|
666
|
+
const pieces = [];
|
|
667
|
+
let gapStart = 0;
|
|
668
|
+
let structure = newGapStructure(0);
|
|
669
|
+
let flagRanges;
|
|
670
|
+
// Parents start at increasing indexes, so one cached entry scans each once.
|
|
671
|
+
let cachedParent = -1;
|
|
672
|
+
let cachedParentEnd = text.length;
|
|
673
|
+
const parentEnd = (index) => {
|
|
674
|
+
if (index !== cachedParent) {
|
|
675
|
+
const close = findClosingBrace(text, index, budget);
|
|
676
|
+
cachedParent = index;
|
|
677
|
+
cachedParentEnd = close === -1 ? text.length : close + 1;
|
|
678
|
+
}
|
|
679
|
+
return cachedParentEnd;
|
|
680
|
+
};
|
|
681
|
+
// Strings also start at increasing indexes within and across gaps.
|
|
682
|
+
let cachedString = -1;
|
|
683
|
+
let cachedStringEnd = text.length;
|
|
684
|
+
const stringEnd = (index) => {
|
|
685
|
+
if (index !== cachedString) {
|
|
686
|
+
cachedString = index;
|
|
687
|
+
cachedStringEnd = findEndOfJsonString(text, index + 1, budget);
|
|
688
|
+
}
|
|
689
|
+
return cachedStringEnd;
|
|
690
|
+
};
|
|
691
|
+
const maskSpan = (span) => maskJsonText(span, (value) => maskFlaggedCiVariablesInText(value, budget));
|
|
692
|
+
// Complete objects kept inside the current gap, outermost only, in order.
|
|
693
|
+
// They still go through maskJsonText, which decodes escaped property names
|
|
694
|
+
// that the uncovered-text fallback cannot match.
|
|
695
|
+
let retained = [];
|
|
696
|
+
const maskGap = (end) => {
|
|
697
|
+
let gap = "";
|
|
698
|
+
let cursor = gapStart;
|
|
699
|
+
for (const [spanStart, spanEnd] of retained) {
|
|
700
|
+
if (spanEnd > end)
|
|
701
|
+
break;
|
|
702
|
+
budget.remaining -= spanEnd - spanStart;
|
|
703
|
+
gap += text.slice(cursor, spanStart) + maskSpan(text.slice(spanStart, spanEnd));
|
|
704
|
+
cursor = spanEnd;
|
|
705
|
+
}
|
|
706
|
+
retained = [];
|
|
707
|
+
return replaceUncoveredValues(gap + text.slice(cursor, end));
|
|
708
|
+
};
|
|
709
|
+
let open = text.indexOf("{");
|
|
710
|
+
while (open !== -1 && budget.remaining > 0) {
|
|
711
|
+
const close = findClosingBrace(text, open, budget);
|
|
712
|
+
if (close !== -1) {
|
|
713
|
+
const spanLength = close - open + 1;
|
|
714
|
+
if (budget.remaining < spanLength)
|
|
715
|
+
break;
|
|
716
|
+
budget.remaining -= spanLength;
|
|
717
|
+
const span = text.slice(open, close + 1);
|
|
718
|
+
if (parsesAsJsonObject(span)) {
|
|
719
|
+
advanceGapStructure(structure, text, open, budget);
|
|
720
|
+
flagRanges ??= flagLiteralRanges(text);
|
|
721
|
+
if (isNestedInIncompleteFlaggedObject(structure, flagRanges, open, parentEnd, stringEnd)) {
|
|
722
|
+
const previous = retained[retained.length - 1];
|
|
723
|
+
if (previous === undefined || open >= previous[1])
|
|
724
|
+
retained.push([open, close + 1]);
|
|
725
|
+
open = text.indexOf("{", open + 1);
|
|
726
|
+
continue;
|
|
727
|
+
}
|
|
728
|
+
pieces.push(maskGap(open));
|
|
729
|
+
// maskJsonText parses the span again.
|
|
730
|
+
budget.remaining -= spanLength;
|
|
731
|
+
pieces.push(maskSpan(span));
|
|
732
|
+
gapStart = close + 1;
|
|
733
|
+
structure = newGapStructure(gapStart);
|
|
734
|
+
open = text.indexOf("{", close + 1);
|
|
735
|
+
continue;
|
|
736
|
+
}
|
|
737
|
+
}
|
|
738
|
+
open = text.indexOf("{", open + 1);
|
|
739
|
+
}
|
|
740
|
+
pieces.push(maskGap(text.length));
|
|
741
|
+
return pieces.join("");
|
|
742
|
+
}
|
|
362
743
|
function createMaskingEngineFromFile(file, configPath) {
|
|
363
744
|
const builtinRules = mergeBuiltinRules(file);
|
|
364
745
|
const rules = [...(file.rules ?? []), ...builtinRules].map(compileRule);
|
|
365
746
|
const maskedErrors = new WeakSet();
|
|
366
|
-
const maskText = (
|
|
747
|
+
const maskText = (source) => {
|
|
748
|
+
// Flagged variable values are replaced first, so the regex rules below see
|
|
749
|
+
// the replacement text. On the text path that replacement is therefore
|
|
750
|
+
// subject to user keyword rules, while structured and JSON paths emit it
|
|
751
|
+
// verbatim.
|
|
752
|
+
const text = maskFlaggedCiVariablesInText(source);
|
|
367
753
|
const matches = [];
|
|
368
754
|
for (const rule of rules) {
|
|
369
755
|
rule.expression.lastIndex = 0;
|
package/build/schemas.js
CHANGED
|
@@ -4661,6 +4661,25 @@ export const ListWorkItemNoteEmojiReactionsSchema = z.object({
|
|
|
4661
4661
|
.string()
|
|
4662
4662
|
.describe("The GraphQL GID of the note (e.g. 'gid://gitlab/Note/123' from list_work_item_notes)"),
|
|
4663
4663
|
});
|
|
4664
|
+
// --- Resource event schemas (issue label and state history) ---
|
|
4665
|
+
// See https://docs.gitlab.com/api/resource_label_events/ and https://docs.gitlab.com/api/resource_state_events/
|
|
4666
|
+
export const ListIssueLabelEventsSchema = ProjectParamsSchema.extend({
|
|
4667
|
+
issue_iid: z.coerce.string().describe("The IID of an issue"),
|
|
4668
|
+
}).merge(PaginationOptionsSchema);
|
|
4669
|
+
export const ListIssueStateEventsSchema = ListIssueLabelEventsSchema;
|
|
4670
|
+
const GitLabResourceEventUserSchema = z.object({ username: z.string() }).nullable().optional();
|
|
4671
|
+
export const GitLabResourceLabelEventSchema = z.object({
|
|
4672
|
+
created_at: z.string(),
|
|
4673
|
+
action: z.string(), // "add" or "remove"
|
|
4674
|
+
user: GitLabResourceEventUserSchema,
|
|
4675
|
+
// GitLab returns null for a label that was deleted since the event.
|
|
4676
|
+
label: z.object({ name: z.string() }).nullable().optional(),
|
|
4677
|
+
});
|
|
4678
|
+
export const GitLabResourceStateEventSchema = z.object({
|
|
4679
|
+
created_at: z.string(),
|
|
4680
|
+
state: z.string(),
|
|
4681
|
+
user: GitLabResourceEventUserSchema,
|
|
4682
|
+
});
|
|
4664
4683
|
// --- Incident Timeline Event schemas ---
|
|
4665
4684
|
export const GetTimelineEventsSchema = z.object({
|
|
4666
4685
|
project_id: z.coerce.string().describe("Project ID or URL-encoded path"),
|
package/build/server/mcp-help.js
CHANGED
|
@@ -51,6 +51,7 @@ const GUIDES = {
|
|
|
51
51
|
"Write: create_issue, update_issue, create_issue_note, list_issue_discussions.",
|
|
52
52
|
"Small description edits: update_issue_description_patch instead of resending the full body.",
|
|
53
53
|
"Board order: reorder_issue (move_after_id / move_before_id are global issue ids, not iids).",
|
|
54
|
+
"History: list_issue_label_events, list_issue_state_events (label-based board column flow).",
|
|
54
55
|
"project_id is a numeric ID or URL-encoded path.",
|
|
55
56
|
].join("\n"),
|
|
56
57
|
pipelines: [
|