@structured-world/gitlab-mcp 4.0.0 → 4.1.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/README.md +90 -4
- package/dist/entities/core/registry.js +162 -70
- package/dist/entities/core/registry.js.map +1 -1
- package/dist/entities/core/schema-readonly.d.ts +421 -199
- package/dist/entities/core/schema-readonly.js +222 -131
- package/dist/entities/core/schema-readonly.js.map +1 -1
- package/dist/entities/core/schema.d.ts +152 -61
- package/dist/entities/core/schema.js +111 -55
- package/dist/entities/core/schema.js.map +1 -1
- package/dist/entities/files/registry.js +5 -5
- package/dist/entities/files/registry.js.map +1 -1
- package/dist/entities/files/schema-readonly.d.ts +124 -24
- package/dist/entities/files/schema.d.ts +82 -17
- package/dist/entities/labels/registry.js +23 -34
- package/dist/entities/labels/registry.js.map +1 -1
- package/dist/entities/labels/schema-readonly.d.ts +26 -10
- package/dist/entities/labels/schema-readonly.js +5 -15
- package/dist/entities/labels/schema-readonly.js.map +1 -1
- package/dist/entities/labels/schema.d.ts +40 -11
- package/dist/entities/labels/schema.js +8 -23
- package/dist/entities/labels/schema.js.map +1 -1
- package/dist/entities/milestones/registry.js +44 -61
- package/dist/entities/milestones/registry.js.map +1 -1
- package/dist/entities/milestones/schema-readonly.d.ts +105 -30
- package/dist/entities/milestones/schema-readonly.js +7 -15
- package/dist/entities/milestones/schema-readonly.js.map +1 -1
- package/dist/entities/milestones/schema.d.ts +52 -19
- package/dist/entities/milestones/schema.js +8 -28
- package/dist/entities/milestones/schema.js.map +1 -1
- package/dist/entities/mrs/registry.js +20 -20
- package/dist/entities/mrs/registry.js.map +1 -1
- package/dist/entities/mrs/schema-readonly.d.ts +243 -68
- package/dist/entities/mrs/schema-readonly.js +83 -54
- package/dist/entities/mrs/schema-readonly.js.map +1 -1
- package/dist/entities/mrs/schema.d.ts +885 -142
- package/dist/entities/mrs/schema.js +113 -37
- package/dist/entities/mrs/schema.js.map +1 -1
- package/dist/entities/pipelines/registry.js +12 -12
- package/dist/entities/pipelines/registry.js.map +1 -1
- package/dist/entities/pipelines/schema-readonly.d.ts +525 -115
- package/dist/entities/pipelines/schema.d.ts +104 -30
- package/dist/entities/shared.d.ts +787 -110
- package/dist/entities/utils.d.ts +2 -2
- package/dist/entities/variables/registry.js +23 -33
- package/dist/entities/variables/registry.js.map +1 -1
- package/dist/entities/variables/schema-readonly.d.ts +30 -7
- package/dist/entities/variables/schema-readonly.js +4 -13
- package/dist/entities/variables/schema-readonly.js.map +1 -1
- package/dist/entities/variables/schema.d.ts +83 -26
- package/dist/entities/variables/schema.js +6 -21
- package/dist/entities/variables/schema.js.map +1 -1
- package/dist/entities/wiki/registry.js +25 -42
- package/dist/entities/wiki/registry.js.map +1 -1
- package/dist/entities/wiki/schema-readonly.d.ts +37 -8
- package/dist/entities/wiki/schema-readonly.js +4 -13
- package/dist/entities/wiki/schema-readonly.js.map +1 -1
- package/dist/entities/wiki/schema.d.ts +34 -9
- package/dist/entities/wiki/schema.js +6 -21
- package/dist/entities/wiki/schema.js.map +1 -1
- package/dist/entities/workitems/registry.js +94 -13
- package/dist/entities/workitems/registry.js.map +1 -1
- package/dist/entities/workitems/schema-readonly.d.ts +29 -32
- package/dist/entities/workitems/schema-readonly.js +7 -2
- package/dist/entities/workitems/schema-readonly.js.map +1 -1
- package/dist/entities/workitems/schema.d.ts +45 -21
- package/dist/graphql/workItems.d.ts +34 -1
- package/dist/graphql/workItems.js +349 -2
- package/dist/graphql/workItems.js.map +1 -1
- package/dist/handlers.js +44 -0
- package/dist/handlers.js.map +1 -1
- package/dist/registry-manager.d.ts +1 -0
- package/dist/registry-manager.js +54 -0
- package/dist/registry-manager.js.map +1 -1
- package/dist/services/ConnectionManager.js +3 -3
- package/dist/services/ConnectionManager.js.map +1 -1
- package/dist/services/SchemaIntrospector.js +3 -3
- package/dist/services/SchemaIntrospector.js.map +1 -1
- package/dist/services/ToolAvailability.js +30 -1
- package/dist/services/ToolAvailability.js.map +1 -1
- package/dist/structured-world-gitlab-mcp-4.1.1.tgz +0 -0
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/dist/utils/namespace.d.ts +6 -0
- package/dist/utils/namespace.js +52 -0
- package/dist/utils/namespace.js.map +1 -0
- package/package.json +5 -3
- package/dist/structured-world-gitlab-mcp-4.0.0.tgz +0 -0
|
@@ -10,18 +10,49 @@ export declare const GitLabFileContentSchema: z.ZodObject<{
|
|
|
10
10
|
commit_id: z.ZodString;
|
|
11
11
|
last_commit_id: z.ZodString;
|
|
12
12
|
content: z.ZodOptional<z.ZodString>;
|
|
13
|
-
}, z.
|
|
13
|
+
}, "strip", z.ZodTypeAny, {
|
|
14
|
+
commit_id: string;
|
|
15
|
+
file_name: string;
|
|
16
|
+
file_path: string;
|
|
17
|
+
size: number;
|
|
18
|
+
encoding: string;
|
|
19
|
+
blob_id: string;
|
|
20
|
+
last_commit_id: string;
|
|
21
|
+
ref?: string | undefined;
|
|
22
|
+
content_sha256?: string | undefined;
|
|
23
|
+
content?: string | undefined;
|
|
24
|
+
}, {
|
|
25
|
+
commit_id: string;
|
|
26
|
+
file_name: string;
|
|
27
|
+
file_path: string;
|
|
28
|
+
size: number;
|
|
29
|
+
encoding: string;
|
|
30
|
+
blob_id: string;
|
|
31
|
+
last_commit_id: string;
|
|
32
|
+
ref?: string | undefined;
|
|
33
|
+
content_sha256?: string | undefined;
|
|
34
|
+
content?: string | undefined;
|
|
35
|
+
}>;
|
|
14
36
|
export declare const GitLabDirectoryContentSchema: z.ZodObject<{
|
|
15
37
|
id: z.ZodString;
|
|
16
38
|
name: z.ZodString;
|
|
17
|
-
type: z.ZodEnum<
|
|
18
|
-
tree: "tree";
|
|
19
|
-
blob: "blob";
|
|
20
|
-
}>;
|
|
39
|
+
type: z.ZodEnum<["tree", "blob"]>;
|
|
21
40
|
path: z.ZodString;
|
|
22
41
|
mode: z.ZodString;
|
|
23
|
-
}, z.
|
|
24
|
-
|
|
42
|
+
}, "strip", z.ZodTypeAny, {
|
|
43
|
+
name: string;
|
|
44
|
+
path: string;
|
|
45
|
+
mode: string;
|
|
46
|
+
type: "tree" | "blob";
|
|
47
|
+
id: string;
|
|
48
|
+
}, {
|
|
49
|
+
name: string;
|
|
50
|
+
path: string;
|
|
51
|
+
mode: string;
|
|
52
|
+
type: "tree" | "blob";
|
|
53
|
+
id: string;
|
|
54
|
+
}>;
|
|
55
|
+
export declare const GitLabContentSchema: z.ZodUnion<[z.ZodObject<{
|
|
25
56
|
file_name: z.ZodString;
|
|
26
57
|
file_path: z.ZodString;
|
|
27
58
|
size: z.ZodNumber;
|
|
@@ -32,43 +63,112 @@ export declare const GitLabContentSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
|
32
63
|
commit_id: z.ZodString;
|
|
33
64
|
last_commit_id: z.ZodString;
|
|
34
65
|
content: z.ZodOptional<z.ZodString>;
|
|
35
|
-
},
|
|
66
|
+
}, "strip", z.ZodTypeAny, {
|
|
67
|
+
commit_id: string;
|
|
68
|
+
file_name: string;
|
|
69
|
+
file_path: string;
|
|
70
|
+
size: number;
|
|
71
|
+
encoding: string;
|
|
72
|
+
blob_id: string;
|
|
73
|
+
last_commit_id: string;
|
|
74
|
+
ref?: string | undefined;
|
|
75
|
+
content_sha256?: string | undefined;
|
|
76
|
+
content?: string | undefined;
|
|
77
|
+
}, {
|
|
78
|
+
commit_id: string;
|
|
79
|
+
file_name: string;
|
|
80
|
+
file_path: string;
|
|
81
|
+
size: number;
|
|
82
|
+
encoding: string;
|
|
83
|
+
blob_id: string;
|
|
84
|
+
last_commit_id: string;
|
|
85
|
+
ref?: string | undefined;
|
|
86
|
+
content_sha256?: string | undefined;
|
|
87
|
+
content?: string | undefined;
|
|
88
|
+
}>, z.ZodObject<{
|
|
36
89
|
id: z.ZodString;
|
|
37
90
|
name: z.ZodString;
|
|
38
|
-
type: z.ZodEnum<
|
|
39
|
-
tree: "tree";
|
|
40
|
-
blob: "blob";
|
|
41
|
-
}>;
|
|
91
|
+
type: z.ZodEnum<["tree", "blob"]>;
|
|
42
92
|
path: z.ZodString;
|
|
43
93
|
mode: z.ZodString;
|
|
44
|
-
}, z.
|
|
94
|
+
}, "strip", z.ZodTypeAny, {
|
|
95
|
+
name: string;
|
|
96
|
+
path: string;
|
|
97
|
+
mode: string;
|
|
98
|
+
type: "tree" | "blob";
|
|
99
|
+
id: string;
|
|
100
|
+
}, {
|
|
101
|
+
name: string;
|
|
102
|
+
path: string;
|
|
103
|
+
mode: string;
|
|
104
|
+
type: "tree" | "blob";
|
|
105
|
+
id: string;
|
|
106
|
+
}>]>;
|
|
45
107
|
export declare const GitLabCreateUpdateFileResponseSchema: z.ZodObject<{
|
|
46
108
|
file_path: z.ZodString;
|
|
47
109
|
branch: z.ZodString;
|
|
48
|
-
}, z.
|
|
110
|
+
}, "strip", z.ZodTypeAny, {
|
|
111
|
+
branch: string;
|
|
112
|
+
file_path: string;
|
|
113
|
+
}, {
|
|
114
|
+
branch: string;
|
|
115
|
+
file_path: string;
|
|
116
|
+
}>;
|
|
49
117
|
export declare const GitLabTreeSchema: z.ZodObject<{
|
|
50
118
|
id: z.ZodString;
|
|
51
119
|
name: z.ZodString;
|
|
52
|
-
type: z.ZodEnum<
|
|
53
|
-
tree: "tree";
|
|
54
|
-
blob: "blob";
|
|
55
|
-
}>;
|
|
120
|
+
type: z.ZodEnum<["tree", "blob"]>;
|
|
56
121
|
path: z.ZodString;
|
|
57
122
|
mode: z.ZodString;
|
|
58
|
-
}, z.
|
|
123
|
+
}, "strip", z.ZodTypeAny, {
|
|
124
|
+
name: string;
|
|
125
|
+
path: string;
|
|
126
|
+
mode: string;
|
|
127
|
+
type: "tree" | "blob";
|
|
128
|
+
id: string;
|
|
129
|
+
}, {
|
|
130
|
+
name: string;
|
|
131
|
+
path: string;
|
|
132
|
+
mode: string;
|
|
133
|
+
type: "tree" | "blob";
|
|
134
|
+
id: string;
|
|
135
|
+
}>;
|
|
59
136
|
export declare const GetRepositoryTreeSchema: z.ZodObject<{
|
|
60
|
-
project_id: z.
|
|
137
|
+
project_id: z.ZodString;
|
|
61
138
|
path: z.ZodOptional<z.ZodString>;
|
|
62
139
|
ref: z.ZodOptional<z.ZodString>;
|
|
63
|
-
recursive: z.ZodOptional<z.
|
|
140
|
+
recursive: z.ZodOptional<z.ZodEffects<z.ZodBoolean, boolean, unknown>>;
|
|
64
141
|
per_page: z.ZodOptional<z.ZodNumber>;
|
|
65
142
|
page: z.ZodOptional<z.ZodNumber>;
|
|
66
|
-
}, z.
|
|
143
|
+
}, "strip", z.ZodTypeAny, {
|
|
144
|
+
project_id: string;
|
|
145
|
+
path?: string | undefined;
|
|
146
|
+
page?: number | undefined;
|
|
147
|
+
per_page?: number | undefined;
|
|
148
|
+
ref?: string | undefined;
|
|
149
|
+
recursive?: boolean | undefined;
|
|
150
|
+
}, {
|
|
151
|
+
project_id: string;
|
|
152
|
+
path?: string | undefined;
|
|
153
|
+
page?: number | undefined;
|
|
154
|
+
per_page?: number | undefined;
|
|
155
|
+
ref?: string | undefined;
|
|
156
|
+
recursive?: unknown;
|
|
157
|
+
}>;
|
|
67
158
|
export declare const GetFileContentsSchema: z.ZodObject<{
|
|
68
|
-
project_id: z.
|
|
159
|
+
project_id: z.ZodString;
|
|
160
|
+
} & {
|
|
69
161
|
file_path: z.ZodString;
|
|
70
162
|
ref: z.ZodOptional<z.ZodString>;
|
|
71
|
-
}, z.
|
|
163
|
+
}, "strip", z.ZodTypeAny, {
|
|
164
|
+
project_id: string;
|
|
165
|
+
file_path: string;
|
|
166
|
+
ref?: string | undefined;
|
|
167
|
+
}, {
|
|
168
|
+
project_id: string;
|
|
169
|
+
file_path: string;
|
|
170
|
+
ref?: string | undefined;
|
|
171
|
+
}>;
|
|
72
172
|
export type GitLabFileContent = z.infer<typeof GitLabFileContentSchema>;
|
|
73
173
|
export type GitLabDirectoryContent = z.infer<typeof GitLabDirectoryContentSchema>;
|
|
74
174
|
export type GitLabContent = z.infer<typeof GitLabContentSchema>;
|
|
@@ -1,42 +1,107 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
export declare const CreateOrUpdateFileSchema: z.ZodObject<{
|
|
3
|
-
project_id: z.
|
|
3
|
+
project_id: z.ZodString;
|
|
4
|
+
} & {
|
|
4
5
|
file_path: z.ZodString;
|
|
5
6
|
branch: z.ZodString;
|
|
6
7
|
start_branch: z.ZodOptional<z.ZodString>;
|
|
7
|
-
encoding: z.ZodOptional<z.ZodEnum<
|
|
8
|
-
base64: "base64";
|
|
9
|
-
text: "text";
|
|
10
|
-
}>>;
|
|
8
|
+
encoding: z.ZodOptional<z.ZodEnum<["text", "base64"]>>;
|
|
11
9
|
author_email: z.ZodOptional<z.ZodString>;
|
|
12
10
|
author_name: z.ZodOptional<z.ZodString>;
|
|
13
11
|
content: z.ZodString;
|
|
14
12
|
commit_message: z.ZodString;
|
|
15
13
|
last_commit_id: z.ZodOptional<z.ZodString>;
|
|
16
|
-
execute_filemode: z.ZodOptional<z.
|
|
17
|
-
}, z.
|
|
14
|
+
execute_filemode: z.ZodOptional<z.ZodEffects<z.ZodBoolean, boolean, unknown>>;
|
|
15
|
+
}, "strip", z.ZodTypeAny, {
|
|
16
|
+
project_id: string;
|
|
17
|
+
branch: string;
|
|
18
|
+
file_path: string;
|
|
19
|
+
content: string;
|
|
20
|
+
commit_message: string;
|
|
21
|
+
author_name?: string | undefined;
|
|
22
|
+
author_email?: string | undefined;
|
|
23
|
+
encoding?: "base64" | "text" | undefined;
|
|
24
|
+
last_commit_id?: string | undefined;
|
|
25
|
+
start_branch?: string | undefined;
|
|
26
|
+
execute_filemode?: boolean | undefined;
|
|
27
|
+
}, {
|
|
28
|
+
project_id: string;
|
|
29
|
+
branch: string;
|
|
30
|
+
file_path: string;
|
|
31
|
+
content: string;
|
|
32
|
+
commit_message: string;
|
|
33
|
+
author_name?: string | undefined;
|
|
34
|
+
author_email?: string | undefined;
|
|
35
|
+
encoding?: "base64" | "text" | undefined;
|
|
36
|
+
last_commit_id?: string | undefined;
|
|
37
|
+
start_branch?: string | undefined;
|
|
38
|
+
execute_filemode?: unknown;
|
|
39
|
+
}>;
|
|
18
40
|
export declare const PushFilesSchema: z.ZodObject<{
|
|
19
|
-
project_id: z.
|
|
41
|
+
project_id: z.ZodString;
|
|
42
|
+
} & {
|
|
20
43
|
branch: z.ZodString;
|
|
21
44
|
commit_message: z.ZodString;
|
|
22
45
|
files: z.ZodArray<z.ZodObject<{
|
|
23
46
|
file_path: z.ZodString;
|
|
24
47
|
content: z.ZodString;
|
|
25
|
-
encoding: z.ZodOptional<z.ZodEnum<
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
48
|
+
encoding: z.ZodOptional<z.ZodEnum<["text", "base64"]>>;
|
|
49
|
+
execute_filemode: z.ZodOptional<z.ZodEffects<z.ZodBoolean, boolean, unknown>>;
|
|
50
|
+
}, "strip", z.ZodTypeAny, {
|
|
51
|
+
file_path: string;
|
|
52
|
+
content: string;
|
|
53
|
+
encoding?: "base64" | "text" | undefined;
|
|
54
|
+
execute_filemode?: boolean | undefined;
|
|
55
|
+
}, {
|
|
56
|
+
file_path: string;
|
|
57
|
+
content: string;
|
|
58
|
+
encoding?: "base64" | "text" | undefined;
|
|
59
|
+
execute_filemode?: unknown;
|
|
60
|
+
}>, "many">;
|
|
31
61
|
start_branch: z.ZodOptional<z.ZodString>;
|
|
32
62
|
author_email: z.ZodOptional<z.ZodString>;
|
|
33
63
|
author_name: z.ZodOptional<z.ZodString>;
|
|
34
|
-
}, z.
|
|
64
|
+
}, "strip", z.ZodTypeAny, {
|
|
65
|
+
project_id: string;
|
|
66
|
+
branch: string;
|
|
67
|
+
commit_message: string;
|
|
68
|
+
files: {
|
|
69
|
+
file_path: string;
|
|
70
|
+
content: string;
|
|
71
|
+
encoding?: "base64" | "text" | undefined;
|
|
72
|
+
execute_filemode?: boolean | undefined;
|
|
73
|
+
}[];
|
|
74
|
+
author_name?: string | undefined;
|
|
75
|
+
author_email?: string | undefined;
|
|
76
|
+
start_branch?: string | undefined;
|
|
77
|
+
}, {
|
|
78
|
+
project_id: string;
|
|
79
|
+
branch: string;
|
|
80
|
+
commit_message: string;
|
|
81
|
+
files: {
|
|
82
|
+
file_path: string;
|
|
83
|
+
content: string;
|
|
84
|
+
encoding?: "base64" | "text" | undefined;
|
|
85
|
+
execute_filemode?: unknown;
|
|
86
|
+
}[];
|
|
87
|
+
author_name?: string | undefined;
|
|
88
|
+
author_email?: string | undefined;
|
|
89
|
+
start_branch?: string | undefined;
|
|
90
|
+
}>;
|
|
35
91
|
export declare const MarkdownUploadSchema: z.ZodObject<{
|
|
36
|
-
project_id: z.
|
|
92
|
+
project_id: z.ZodString;
|
|
93
|
+
} & {
|
|
37
94
|
file: z.ZodString;
|
|
38
95
|
filename: z.ZodString;
|
|
39
|
-
}, z.
|
|
96
|
+
}, "strip", z.ZodTypeAny, {
|
|
97
|
+
project_id: string;
|
|
98
|
+
filename: string;
|
|
99
|
+
file: string;
|
|
100
|
+
}, {
|
|
101
|
+
project_id: string;
|
|
102
|
+
filename: string;
|
|
103
|
+
file: string;
|
|
104
|
+
}>;
|
|
40
105
|
export type CreateOrUpdateFileOptions = z.infer<typeof CreateOrUpdateFileSchema>;
|
|
41
106
|
export type PushFilesOptions = z.infer<typeof PushFilesSchema>;
|
|
42
107
|
export type MarkdownUploadOptions = z.infer<typeof MarkdownUploadSchema>;
|
|
@@ -8,26 +8,26 @@ const zod_to_json_schema_1 = require("zod-to-json-schema");
|
|
|
8
8
|
const schema_readonly_1 = require("./schema-readonly");
|
|
9
9
|
const schema_1 = require("./schema");
|
|
10
10
|
const fetch_1 = require("../../utils/fetch");
|
|
11
|
+
const namespace_1 = require("../../utils/namespace");
|
|
11
12
|
exports.labelsToolRegistry = new Map([
|
|
12
13
|
[
|
|
13
14
|
'list_labels',
|
|
14
15
|
{
|
|
15
16
|
name: 'list_labels',
|
|
16
|
-
description: '
|
|
17
|
+
description: 'DISCOVER FIRST: Browse all existing labels in a project or group - RUN THIS BEFORE creating new labels! Use when: Choosing labels for issues/MRs, Understanding established taxonomy, Avoiding duplicate label creation. Returns label names, colors, descriptions, and priorities. Group labels are inherited by all projects. See also: create_label (only after checking existing labels).',
|
|
17
18
|
inputSchema: (0, zod_to_json_schema_1.zodToJsonSchema)(schema_readonly_1.ListLabelsSchema),
|
|
18
19
|
handler: async (args) => {
|
|
19
20
|
const options = schema_readonly_1.ListLabelsSchema.parse(args);
|
|
20
|
-
const {
|
|
21
|
-
const isProject =
|
|
21
|
+
const { namespacePath } = options;
|
|
22
|
+
const isProject = namespacePath.includes('/');
|
|
22
23
|
const entityType = isProject ? 'projects' : 'groups';
|
|
23
|
-
const entityId = (isProject ? project_id : group_id);
|
|
24
24
|
const queryParams = new URLSearchParams();
|
|
25
25
|
Object.entries(options).forEach(([key, value]) => {
|
|
26
|
-
if (value !== undefined && key !== '
|
|
26
|
+
if (value !== undefined && key !== 'namespacePath') {
|
|
27
27
|
queryParams.set(key, String(value));
|
|
28
28
|
}
|
|
29
29
|
});
|
|
30
|
-
const apiUrl = `${process.env.GITLAB_API_URL}/api/v4/${entityType}/${encodeURIComponent(
|
|
30
|
+
const apiUrl = `${process.env.GITLAB_API_URL}/api/v4/${entityType}/${encodeURIComponent(namespacePath)}/labels?${queryParams}`;
|
|
31
31
|
const response = await (0, fetch_1.enhancedFetch)(apiUrl, {
|
|
32
32
|
headers: {
|
|
33
33
|
Authorization: `Bearer ${process.env.GITLAB_TOKEN}`,
|
|
@@ -45,15 +45,13 @@ exports.labelsToolRegistry = new Map([
|
|
|
45
45
|
'get_label',
|
|
46
46
|
{
|
|
47
47
|
name: 'get_label',
|
|
48
|
-
description: '
|
|
48
|
+
description: 'READ: Retrieve details of a specific label by ID or name. Use when: Getting full label information including color and description, Checking label usage statistics, Validating label properties. Works for both project-specific and group-inherited labels. See also: list_labels to browse all available labels first.',
|
|
49
49
|
inputSchema: (0, zod_to_json_schema_1.zodToJsonSchema)(schema_readonly_1.GetLabelSchema),
|
|
50
50
|
handler: async (args) => {
|
|
51
51
|
const options = schema_readonly_1.GetLabelSchema.parse(args);
|
|
52
|
-
const {
|
|
53
|
-
const
|
|
54
|
-
const
|
|
55
|
-
const entityId = (isProject ? project_id : group_id);
|
|
56
|
-
const apiUrl = `${process.env.GITLAB_API_URL}/api/v4/${entityType}/${encodeURIComponent(entityId)}/labels/${encodeURIComponent(label_id)}`;
|
|
52
|
+
const { namespacePath, label_id } = options;
|
|
53
|
+
const { entityType, encodedPath } = await (0, namespace_1.resolveNamespaceForAPI)(namespacePath);
|
|
54
|
+
const apiUrl = `${process.env.GITLAB_API_URL}/api/v4/${entityType}/${encodedPath}/labels/${encodeURIComponent(label_id)}`;
|
|
57
55
|
const response = await (0, fetch_1.enhancedFetch)(apiUrl, {
|
|
58
56
|
headers: {
|
|
59
57
|
Authorization: `Bearer ${process.env.GITLAB_TOKEN}`,
|
|
@@ -71,14 +69,12 @@ exports.labelsToolRegistry = new Map([
|
|
|
71
69
|
'create_label',
|
|
72
70
|
{
|
|
73
71
|
name: 'create_label',
|
|
74
|
-
description: '
|
|
72
|
+
description: 'CREATE CAREFULLY: Add a new label ONLY after running list_labels to check existing taxonomy! Use when: Existing labels do not fit your needs, Establishing new project taxonomy. AVOID: Creating duplicates of existing labels with slight variations. Requires name and color (hex format like #FF0000). Group labels automatically become available to all child projects. See also: list_labels (run first to discover existing labels).',
|
|
75
73
|
inputSchema: (0, zod_to_json_schema_1.zodToJsonSchema)(schema_1.CreateLabelSchema),
|
|
76
74
|
handler: async (args) => {
|
|
77
75
|
const options = schema_1.CreateLabelSchema.parse(args);
|
|
78
|
-
const {
|
|
79
|
-
const
|
|
80
|
-
const entityType = isProject ? 'projects' : 'groups';
|
|
81
|
-
const entityId = (isProject ? project_id : group_id);
|
|
76
|
+
const { namespacePath } = options;
|
|
77
|
+
const { entityType, encodedPath } = await (0, namespace_1.resolveNamespaceForAPI)(namespacePath);
|
|
82
78
|
const body = new URLSearchParams();
|
|
83
79
|
body.set('name', options.name);
|
|
84
80
|
body.set('color', options.color);
|
|
@@ -88,7 +84,7 @@ exports.labelsToolRegistry = new Map([
|
|
|
88
84
|
if (options.priority !== undefined) {
|
|
89
85
|
body.set('priority', String(options.priority));
|
|
90
86
|
}
|
|
91
|
-
const apiUrl = `${process.env.GITLAB_API_URL}/api/v4/${entityType}/${
|
|
87
|
+
const apiUrl = `${process.env.GITLAB_API_URL}/api/v4/${entityType}/${encodedPath}/labels`;
|
|
92
88
|
const response = await (0, fetch_1.enhancedFetch)(apiUrl, {
|
|
93
89
|
method: 'POST',
|
|
94
90
|
headers: {
|
|
@@ -109,24 +105,19 @@ exports.labelsToolRegistry = new Map([
|
|
|
109
105
|
'update_label',
|
|
110
106
|
{
|
|
111
107
|
name: 'update_label',
|
|
112
|
-
description: '
|
|
108
|
+
description: 'UPDATE: Modify label properties including name, color, description, or priority. Use when: Refining categorization system, Updating label appearance, Standardizing label naming. Changes apply immediately to all tagged items. Renaming updates all existing references automatically. See also: list_labels to understand current taxonomy before changes.',
|
|
113
109
|
inputSchema: (0, zod_to_json_schema_1.zodToJsonSchema)(schema_1.UpdateLabelSchema),
|
|
114
110
|
handler: async (args) => {
|
|
115
111
|
const options = schema_1.UpdateLabelSchema.parse(args);
|
|
116
|
-
const {
|
|
117
|
-
const
|
|
118
|
-
const entityType = isProject ? 'projects' : 'groups';
|
|
119
|
-
const entityId = (isProject ? project_id : group_id);
|
|
112
|
+
const { namespacePath, label_id } = options;
|
|
113
|
+
const { entityType, encodedPath } = await (0, namespace_1.resolveNamespaceForAPI)(namespacePath);
|
|
120
114
|
const body = new URLSearchParams();
|
|
121
115
|
Object.entries(options).forEach(([key, value]) => {
|
|
122
|
-
if (value !== undefined &&
|
|
123
|
-
key !== 'project_id' &&
|
|
124
|
-
key !== 'group_id' &&
|
|
125
|
-
key !== 'label_id') {
|
|
116
|
+
if (value !== undefined && key !== 'namespacePath' && key !== 'label_id') {
|
|
126
117
|
body.set(key, String(value));
|
|
127
118
|
}
|
|
128
119
|
});
|
|
129
|
-
const apiUrl = `${process.env.GITLAB_API_URL}/api/v4/${entityType}/${
|
|
120
|
+
const apiUrl = `${process.env.GITLAB_API_URL}/api/v4/${entityType}/${encodedPath}/labels/${encodeURIComponent(label_id)}`;
|
|
130
121
|
const response = await (0, fetch_1.enhancedFetch)(apiUrl, {
|
|
131
122
|
method: 'PUT',
|
|
132
123
|
headers: {
|
|
@@ -147,15 +138,13 @@ exports.labelsToolRegistry = new Map([
|
|
|
147
138
|
'delete_label',
|
|
148
139
|
{
|
|
149
140
|
name: 'delete_label',
|
|
150
|
-
description: '
|
|
141
|
+
description: 'DELETE: Remove a label permanently from project or group. Use when: Cleaning up unused labels, Reorganizing taxonomy. WARNING: Removes label from all issues and MRs without replacement. Consider updating items before deletion. Cannot be undone. See also: list_labels to check label usage before deletion.',
|
|
151
142
|
inputSchema: (0, zod_to_json_schema_1.zodToJsonSchema)(schema_1.DeleteLabelSchema),
|
|
152
143
|
handler: async (args) => {
|
|
153
144
|
const options = schema_1.DeleteLabelSchema.parse(args);
|
|
154
|
-
const {
|
|
155
|
-
const
|
|
156
|
-
const
|
|
157
|
-
const entityId = (isProject ? project_id : group_id);
|
|
158
|
-
const apiUrl = `${process.env.GITLAB_API_URL}/api/v4/${entityType}/${encodeURIComponent(entityId)}/labels/${encodeURIComponent(label_id)}`;
|
|
145
|
+
const { namespacePath, label_id } = options;
|
|
146
|
+
const { entityType, encodedPath } = await (0, namespace_1.resolveNamespaceForAPI)(namespacePath);
|
|
147
|
+
const apiUrl = `${process.env.GITLAB_API_URL}/api/v4/${entityType}/${encodedPath}/labels/${encodeURIComponent(label_id)}`;
|
|
159
148
|
const response = await (0, fetch_1.enhancedFetch)(apiUrl, {
|
|
160
149
|
method: 'DELETE',
|
|
161
150
|
headers: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registry.js","sourceRoot":"","sources":["../../../src/entities/labels/registry.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"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AChB,OAAO,EAAE;wBACP,aAAa,EAAE,UAAU,OAAO,CAAC,GAAG,CAAC,YAAY,EAAE;qBACpD;iBACF,CAAC,CAAC;gBAEH,IAAI,CAAC,QAAQ,CAAC,EAAE,EAAE,CAAC;oBACjB,MAAM,IAAI,KAAK,CAAC,qBAAqB,QAAQ,CAAC,MAAM,IAAI,QAAQ,CAAC,UAAU,EAAE,CAAC,CAAC;gBACjF,CAAC;gBAED,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,4BAA4B,EAAE,CAAC;YAClE,CAAC;SACF;KACF;CACF,CAAC,CAAC;AAKH,SAAgB,0BAA0B;IACxC,OAAO,CAAC,aAAa,EAAE,WAAW,CAAC,CAAC;AACtC,CAAC;AAKD,SAAgB,wBAAwB;IACtC,OAAO,KAAK,CAAC,IAAI,CAAC,0BAAkB,CAAC,MAAM,EAAE,CAAC,CAAC;AACjD,CAAC;AAKD,SAAgB,sBAAsB,CAAC,eAAwB,KAAK;IAClE,IAAI,YAAY,EAAE,CAAC;QACjB,MAAM,aAAa,GAAG,0BAA0B,EAAE,CAAC;QACnD,OAAO,KAAK,CAAC,IAAI,CAAC,0BAAkB,CAAC,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAC7D,aAAa,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAClC,CAAC;IACJ,CAAC;IACD,OAAO,wBAAwB,EAAE,CAAC;AACpC,CAAC"}
|
|
@@ -1,16 +1,32 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
export declare const ListLabelsSchema: z.ZodObject<{
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
include_ancestor_groups: z.ZodOptional<z.ZodPipe<z.ZodTransform<boolean, unknown>, z.ZodBoolean>>;
|
|
3
|
+
namespacePath: z.ZodString;
|
|
4
|
+
with_counts: z.ZodOptional<z.ZodEffects<z.ZodBoolean, boolean, unknown>>;
|
|
5
|
+
include_ancestor_groups: z.ZodOptional<z.ZodEffects<z.ZodBoolean, boolean, unknown>>;
|
|
7
6
|
search: z.ZodOptional<z.ZodString>;
|
|
8
|
-
}, z.
|
|
7
|
+
}, "strip", z.ZodTypeAny, {
|
|
8
|
+
namespacePath: string;
|
|
9
|
+
search?: string | undefined;
|
|
10
|
+
with_counts?: boolean | undefined;
|
|
11
|
+
include_ancestor_groups?: boolean | undefined;
|
|
12
|
+
}, {
|
|
13
|
+
namespacePath: string;
|
|
14
|
+
search?: string | undefined;
|
|
15
|
+
with_counts?: unknown;
|
|
16
|
+
include_ancestor_groups?: unknown;
|
|
17
|
+
}>;
|
|
9
18
|
export declare const GetLabelSchema: z.ZodObject<{
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
19
|
+
namespacePath: z.ZodString;
|
|
20
|
+
label_id: z.ZodUnion<[z.ZodString, z.ZodString]>;
|
|
21
|
+
include_ancestor_groups: z.ZodOptional<z.ZodEffects<z.ZodBoolean, boolean, unknown>>;
|
|
22
|
+
}, "strip", z.ZodTypeAny, {
|
|
23
|
+
namespacePath: string;
|
|
24
|
+
label_id: string;
|
|
25
|
+
include_ancestor_groups?: boolean | undefined;
|
|
26
|
+
}, {
|
|
27
|
+
namespacePath: string;
|
|
28
|
+
label_id: string;
|
|
29
|
+
include_ancestor_groups?: unknown;
|
|
30
|
+
}>;
|
|
15
31
|
export type ListLabelsOptions = z.infer<typeof ListLabelsSchema>;
|
|
16
32
|
export type GetLabelOptions = z.infer<typeof GetLabelSchema>;
|
|
@@ -3,27 +3,17 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.GetLabelSchema = exports.ListLabelsSchema = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
5
|
const utils_1 = require("../utils");
|
|
6
|
-
exports.ListLabelsSchema = zod_1.z
|
|
7
|
-
.
|
|
8
|
-
project_id: zod_1.z.coerce.string().optional().describe('Project ID or URL-encoded path'),
|
|
9
|
-
group_id: zod_1.z.coerce.string().optional().describe('Group ID or URL-encoded path'),
|
|
6
|
+
exports.ListLabelsSchema = zod_1.z.object({
|
|
7
|
+
namespacePath: zod_1.z.string().describe('Namespace path (group or project) to list labels from'),
|
|
10
8
|
with_counts: utils_1.flexibleBoolean
|
|
11
9
|
.optional()
|
|
12
10
|
.describe('Whether or not to include issue and merge request counts'),
|
|
13
11
|
include_ancestor_groups: utils_1.flexibleBoolean.optional().describe('Include ancestor groups'),
|
|
14
12
|
search: zod_1.z.string().optional().describe('Keyword to filter labels by'),
|
|
15
|
-
})
|
|
16
|
-
.refine((data) => Boolean(data.project_id) !== Boolean(data.group_id), {
|
|
17
|
-
message: 'Exactly one of project_id or group_id must be provided',
|
|
18
13
|
});
|
|
19
|
-
exports.GetLabelSchema = zod_1.z
|
|
20
|
-
.
|
|
21
|
-
|
|
22
|
-
group_id: zod_1.z.coerce.string().optional().describe('Group ID or URL-encoded path'),
|
|
23
|
-
label_id: zod_1.z.union([zod_1.z.coerce.string(), zod_1.z.string()]).describe('The ID or title of a group label'),
|
|
14
|
+
exports.GetLabelSchema = zod_1.z.object({
|
|
15
|
+
namespacePath: zod_1.z.string().describe('Namespace path (group or project) containing the label'),
|
|
16
|
+
label_id: zod_1.z.union([zod_1.z.coerce.string(), zod_1.z.string()]).describe('The ID or title of the label'),
|
|
24
17
|
include_ancestor_groups: utils_1.flexibleBoolean.optional().describe('Include ancestor groups'),
|
|
25
|
-
})
|
|
26
|
-
.refine((data) => Boolean(data.project_id) !== Boolean(data.group_id), {
|
|
27
|
-
message: 'Exactly one of project_id or group_id must be provided',
|
|
28
18
|
});
|
|
29
19
|
//# sourceMappingURL=schema-readonly.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema-readonly.js","sourceRoot":"","sources":["../../../src/entities/labels/schema-readonly.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AACxB,oCAA2C;AAK9B,QAAA,gBAAgB,GAAG,OAAC
|
|
1
|
+
{"version":3,"file":"schema-readonly.js","sourceRoot":"","sources":["../../../src/entities/labels/schema-readonly.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AACxB,oCAA2C;AAK9B,QAAA,gBAAgB,GAAG,OAAC,CAAC,MAAM,CAAC;IACvC,aAAa,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,uDAAuD,CAAC;IAC3F,WAAW,EAAE,uBAAe;SACzB,QAAQ,EAAE;SACV,QAAQ,CAAC,0DAA0D,CAAC;IACvE,uBAAuB,EAAE,uBAAe,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,yBAAyB,CAAC;IACvF,MAAM,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,6BAA6B,CAAC;CACtE,CAAC,CAAC;AAEU,QAAA,cAAc,GAAG,OAAC,CAAC,MAAM,CAAC;IACrC,aAAa,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,wDAAwD,CAAC;IAC5F,QAAQ,EAAE,OAAC,CAAC,KAAK,CAAC,CAAC,OAAC,CAAC,MAAM,CAAC,MAAM,EAAE,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,8BAA8B,CAAC;IAC3F,uBAAuB,EAAE,uBAAe,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,yBAAyB,CAAC;CACxF,CAAC,CAAC"}
|
|
@@ -1,26 +1,55 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
export declare const CreateLabelSchema: z.ZodObject<{
|
|
3
|
-
|
|
4
|
-
group_id: z.ZodOptional<z.ZodCoercedString<unknown>>;
|
|
3
|
+
namespacePath: z.ZodString;
|
|
5
4
|
name: z.ZodString;
|
|
6
5
|
color: z.ZodString;
|
|
7
6
|
description: z.ZodOptional<z.ZodString>;
|
|
8
7
|
priority: z.ZodOptional<z.ZodNumber>;
|
|
9
|
-
}, z.
|
|
8
|
+
}, "strip", z.ZodTypeAny, {
|
|
9
|
+
name: string;
|
|
10
|
+
color: string;
|
|
11
|
+
namespacePath: string;
|
|
12
|
+
priority?: number | undefined;
|
|
13
|
+
description?: string | undefined;
|
|
14
|
+
}, {
|
|
15
|
+
name: string;
|
|
16
|
+
color: string;
|
|
17
|
+
namespacePath: string;
|
|
18
|
+
priority?: number | undefined;
|
|
19
|
+
description?: string | undefined;
|
|
20
|
+
}>;
|
|
10
21
|
export declare const UpdateLabelSchema: z.ZodObject<{
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
label_id: z.ZodUnion<readonly [z.ZodCoercedString<unknown>, z.ZodString]>;
|
|
22
|
+
namespacePath: z.ZodString;
|
|
23
|
+
label_id: z.ZodUnion<[z.ZodString, z.ZodString]>;
|
|
14
24
|
new_name: z.ZodOptional<z.ZodString>;
|
|
15
25
|
color: z.ZodOptional<z.ZodString>;
|
|
16
26
|
description: z.ZodOptional<z.ZodString>;
|
|
17
27
|
priority: z.ZodOptional<z.ZodNumber>;
|
|
18
|
-
}, z.
|
|
28
|
+
}, "strip", z.ZodTypeAny, {
|
|
29
|
+
namespacePath: string;
|
|
30
|
+
label_id: string;
|
|
31
|
+
priority?: number | undefined;
|
|
32
|
+
description?: string | undefined;
|
|
33
|
+
color?: string | undefined;
|
|
34
|
+
new_name?: string | undefined;
|
|
35
|
+
}, {
|
|
36
|
+
namespacePath: string;
|
|
37
|
+
label_id: string;
|
|
38
|
+
priority?: number | undefined;
|
|
39
|
+
description?: string | undefined;
|
|
40
|
+
color?: string | undefined;
|
|
41
|
+
new_name?: string | undefined;
|
|
42
|
+
}>;
|
|
19
43
|
export declare const DeleteLabelSchema: z.ZodObject<{
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
44
|
+
namespacePath: z.ZodString;
|
|
45
|
+
label_id: z.ZodUnion<[z.ZodString, z.ZodString]>;
|
|
46
|
+
}, "strip", z.ZodTypeAny, {
|
|
47
|
+
namespacePath: string;
|
|
48
|
+
label_id: string;
|
|
49
|
+
}, {
|
|
50
|
+
namespacePath: string;
|
|
51
|
+
label_id: string;
|
|
52
|
+
}>;
|
|
24
53
|
export type CreateLabelOptions = z.infer<typeof CreateLabelSchema>;
|
|
25
54
|
export type UpdateLabelOptions = z.infer<typeof UpdateLabelSchema>;
|
|
26
55
|
export type DeleteLabelOptions = z.infer<typeof DeleteLabelSchema>;
|