@structured-world/gitlab-mcp 6.2.2 → 6.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (55) hide show
  1. package/dist/src/entities/core/registry.js +51 -47
  2. package/dist/src/entities/core/registry.js.map +1 -1
  3. package/dist/src/entities/core/schema-readonly.d.ts +38 -93
  4. package/dist/src/entities/core/schema-readonly.js +69 -70
  5. package/dist/src/entities/core/schema-readonly.js.map +1 -1
  6. package/dist/src/entities/core/schema.d.ts +17 -27
  7. package/dist/src/entities/core/schema.js +44 -31
  8. package/dist/src/entities/core/schema.js.map +1 -1
  9. package/dist/src/entities/files/registry.js +25 -15
  10. package/dist/src/entities/files/registry.js.map +1 -1
  11. package/dist/src/entities/files/schema-readonly.d.ts +7 -23
  12. package/dist/src/entities/files/schema-readonly.js +24 -30
  13. package/dist/src/entities/files/schema-readonly.js.map +1 -1
  14. package/dist/src/entities/files/schema.d.ts +14 -62
  15. package/dist/src/entities/files/schema.js +73 -63
  16. package/dist/src/entities/files/schema.js.map +1 -1
  17. package/dist/src/entities/milestones/registry.js +77 -125
  18. package/dist/src/entities/milestones/registry.js.map +1 -1
  19. package/dist/src/entities/milestones/schema-readonly.d.ts +11 -27
  20. package/dist/src/entities/milestones/schema-readonly.js +22 -18
  21. package/dist/src/entities/milestones/schema-readonly.js.map +1 -1
  22. package/dist/src/entities/milestones/schema.d.ts +9 -21
  23. package/dist/src/entities/milestones/schema.js +21 -21
  24. package/dist/src/entities/milestones/schema.js.map +1 -1
  25. package/dist/src/entities/mrs/registry.js +58 -32
  26. package/dist/src/entities/mrs/registry.js.map +1 -1
  27. package/dist/src/entities/mrs/schema-readonly.d.ts +21 -160
  28. package/dist/src/entities/mrs/schema-readonly.js +306 -197
  29. package/dist/src/entities/mrs/schema-readonly.js.map +1 -1
  30. package/dist/src/entities/mrs/schema.d.ts +34 -394
  31. package/dist/src/entities/mrs/schema.js +234 -227
  32. package/dist/src/entities/mrs/schema.js.map +1 -1
  33. package/dist/src/entities/pipelines/registry.js +30 -14
  34. package/dist/src/entities/pipelines/registry.js.map +1 -1
  35. package/dist/src/entities/pipelines/schema-readonly.d.ts +16 -32
  36. package/dist/src/entities/pipelines/schema-readonly.js +54 -52
  37. package/dist/src/entities/pipelines/schema-readonly.js.map +1 -1
  38. package/dist/src/entities/pipelines/schema.d.ts +16 -23
  39. package/dist/src/entities/pipelines/schema.js +24 -37
  40. package/dist/src/entities/pipelines/schema.js.map +1 -1
  41. package/dist/src/entities/utils.d.ts +1 -0
  42. package/dist/src/entities/utils.js +6 -0
  43. package/dist/src/entities/utils.js.map +1 -1
  44. package/dist/src/entities/workitems/registry.js +30 -21
  45. package/dist/src/entities/workitems/registry.js.map +1 -1
  46. package/dist/src/entities/workitems/schema-readonly.d.ts +7 -35
  47. package/dist/src/entities/workitems/schema-readonly.js +15 -41
  48. package/dist/src/entities/workitems/schema-readonly.js.map +1 -1
  49. package/dist/src/entities/workitems/schema.d.ts +10 -52
  50. package/dist/src/entities/workitems/schema.js +26 -48
  51. package/dist/src/entities/workitems/schema.js.map +1 -1
  52. package/dist/structured-world-gitlab-mcp-6.3.0.tgz +0 -0
  53. package/dist/tsconfig.build.tsbuildinfo +1 -1
  54. package/package.json +1 -1
  55. package/dist/structured-world-gitlab-mcp-6.2.2.tgz +0 -0
@@ -1,9 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.BrowseFilesSchema = exports.GetFileContentsSchema = exports.GetRepositoryTreeSchema = exports.GitLabTreeSchema = exports.GitLabCreateUpdateFileResponseSchema = exports.GitLabContentSchema = exports.GitLabDirectoryContentSchema = exports.GitLabFileContentSchema = void 0;
3
+ exports.BrowseFilesSchema = exports.GitLabTreeSchema = exports.GitLabCreateUpdateFileResponseSchema = exports.GitLabContentSchema = exports.GitLabDirectoryContentSchema = exports.GitLabFileContentSchema = void 0;
4
4
  const zod_1 = require("zod");
5
5
  const utils_1 = require("../utils");
6
- const shared_1 = require("../shared");
7
6
  exports.GitLabFileContentSchema = zod_1.z.object({
8
7
  file_name: zod_1.z.string(),
9
8
  file_path: zod_1.z.string(),
@@ -35,35 +34,30 @@ exports.GitLabTreeSchema = zod_1.z.object({
35
34
  path: zod_1.z.string(),
36
35
  mode: zod_1.z.string(),
37
36
  });
38
- exports.GetRepositoryTreeSchema = zod_1.z.object({
39
- project_id: utils_1.requiredId.describe("Project ID or URL-encoded path"),
40
- path: zod_1.z.string().optional().describe("The path inside repository"),
41
- ref: zod_1.z.string().optional().describe("The name of a repository branch or tag"),
42
- recursive: utils_1.flexibleBoolean.optional().describe("Boolean value used to get a recursive tree"),
43
- per_page: zod_1.z.number().int().min(1).max(100).optional().describe("Number of results per page"),
44
- page: zod_1.z.number().int().min(1).optional().describe("Page number"),
45
- });
46
- exports.GetFileContentsSchema = shared_1.ProjectParamsSchema.extend({
47
- file_path: zod_1.z.string().describe("URL-encoded full path to the file"),
48
- ref: zod_1.z.string().optional().describe("The name of branch, tag or commit"),
49
- });
50
- const BrowseFilesBaseSchema = zod_1.z.object({
37
+ exports.BrowseFilesSchema = zod_1.z
38
+ .object({
39
+ action: zod_1.z.enum(["tree", "content"]).describe("Action to perform: tree or content"),
51
40
  project_id: utils_1.requiredId.describe("Project ID or URL-encoded path"),
52
41
  ref: zod_1.z.string().optional().describe("Branch, tag, or commit SHA"),
42
+ path: zod_1.z.string().optional().describe("Directory path to list. For 'tree' action."),
43
+ recursive: utils_1.flexibleBoolean
44
+ .optional()
45
+ .describe("Include nested directories. For 'tree' action."),
46
+ per_page: zod_1.z
47
+ .number()
48
+ .int()
49
+ .min(1)
50
+ .max(100)
51
+ .optional()
52
+ .describe("Results per page (max 100). For 'tree' action."),
53
+ page: zod_1.z.number().int().min(1).optional().describe("Page number. For 'tree' action."),
54
+ file_path: zod_1.z
55
+ .string()
56
+ .optional()
57
+ .describe("Path to the file to read. Required for 'content' action."),
58
+ })
59
+ .refine(data => data.action !== "content" || data.file_path !== undefined, {
60
+ message: "file_path is required for 'content' action",
61
+ path: ["file_path"],
53
62
  });
54
- const BrowseFilesTreeSchema = BrowseFilesBaseSchema.extend({
55
- action: zod_1.z.literal("tree"),
56
- path: zod_1.z.string().optional().describe("Directory path to list"),
57
- recursive: utils_1.flexibleBoolean.optional().describe("Include nested directories"),
58
- per_page: zod_1.z.number().int().min(1).max(100).optional().describe("Results per page (max 100)"),
59
- page: zod_1.z.number().int().min(1).optional().describe("Page number"),
60
- });
61
- const BrowseFilesContentSchema = BrowseFilesBaseSchema.extend({
62
- action: zod_1.z.literal("content"),
63
- file_path: zod_1.z.string().describe("Path to the file to read"),
64
- });
65
- exports.BrowseFilesSchema = zod_1.z.discriminatedUnion("action", [
66
- BrowseFilesTreeSchema,
67
- BrowseFilesContentSchema,
68
- ]);
69
63
  //# sourceMappingURL=schema-readonly.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"schema-readonly.js","sourceRoot":"","sources":["../../../../src/entities/files/schema-readonly.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AACxB,oCAAuD;AACvD,sCAAgD;AAKnC,QAAA,uBAAuB,GAAG,OAAC,CAAC,MAAM,CAAC;IAC9C,SAAS,EAAE,OAAC,CAAC,MAAM,EAAE;IACrB,SAAS,EAAE,OAAC,CAAC,MAAM,EAAE;IACrB,IAAI,EAAE,OAAC,CAAC,MAAM,EAAE;IAChB,QAAQ,EAAE,OAAC,CAAC,MAAM,EAAE;IACpB,cAAc,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACrC,GAAG,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC1B,OAAO,EAAE,OAAC,CAAC,MAAM,EAAE;IACnB,SAAS,EAAE,OAAC,CAAC,MAAM,EAAE;IACrB,cAAc,EAAE,OAAC,CAAC,MAAM,EAAE;IAC1B,OAAO,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CAC/B,CAAC,CAAC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EAAE,CAAC,QAAQ,CAAC,4CAA4C,CAAC;IAClF,SAAS,EAAE,uBAAe;SACvB,QAAQ,EAAE;SACV,QAAQ,CAAC,gDAAgD,CAAC;IAC7D,QAAQ,EAAE,OAAC;SACR,MAAM,EAAE;SACR,GAAG,EAAE;SACL,GAAG,CAAC,CAAC,CAAC;SACN,GAAG,CAAC,GAAG,CAAC;SACR,QAAQ,EAAE;SACV,QAAQ,CAAC,gDAAgD,CAAC;IAC7D,IAAI,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,iCAAiC,CAAC;IAEpF,SAAS,EAAE,OAAC;SACT,MAAM,EAAE;SACR,QAAQ,EAAE;SACV,QAAQ,CAAC,0DAA0D,CAAC;CACxE,CAAC;KACD,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,MAAM,KAAK,SAAS,IAAI,IAAI,CAAC,SAAS,KAAK,SAAS,EAAE;IACzE,OAAO,EAAE,4CAA4C;IACrD,IAAI,EAAE,CAAC,WAAW,CAAC;CACpB,CAAC,CAAC"}
@@ -1,8 +1,15 @@
1
1
  import { z } from "zod";
2
- export declare const CreateOrUpdateFileSchema: z.ZodObject<{
2
+ export declare const ManageFilesSchema: z.ZodObject<{
3
+ action: z.ZodEnum<{
4
+ single: "single";
5
+ batch: "batch";
6
+ upload: "upload";
7
+ }>;
3
8
  project_id: z.ZodPipe<z.ZodTransform<{}, unknown>, z.ZodCoercedString<unknown>>;
4
- file_path: z.ZodString;
5
- branch: z.ZodString;
9
+ file_path: z.ZodOptional<z.ZodString>;
10
+ content: z.ZodOptional<z.ZodString>;
11
+ commit_message: z.ZodOptional<z.ZodString>;
12
+ branch: z.ZodOptional<z.ZodString>;
6
13
  start_branch: z.ZodOptional<z.ZodString>;
7
14
  encoding: z.ZodOptional<z.ZodEnum<{
8
15
  base64: "base64";
@@ -10,16 +17,9 @@ export declare const CreateOrUpdateFileSchema: z.ZodObject<{
10
17
  }>>;
11
18
  author_email: z.ZodOptional<z.ZodString>;
12
19
  author_name: z.ZodOptional<z.ZodString>;
13
- content: z.ZodString;
14
- commit_message: z.ZodString;
15
20
  last_commit_id: z.ZodOptional<z.ZodString>;
16
21
  execute_filemode: z.ZodOptional<z.ZodPipe<z.ZodTransform<boolean, unknown>, z.ZodBoolean>>;
17
- }, z.core.$strip>;
18
- export declare const PushFilesSchema: z.ZodObject<{
19
- project_id: z.ZodPipe<z.ZodTransform<{}, unknown>, z.ZodCoercedString<unknown>>;
20
- branch: z.ZodString;
21
- commit_message: z.ZodString;
22
- files: z.ZodArray<z.ZodObject<{
22
+ files: z.ZodOptional<z.ZodArray<z.ZodObject<{
23
23
  file_path: z.ZodString;
24
24
  content: z.ZodString;
25
25
  encoding: z.ZodOptional<z.ZodEnum<{
@@ -27,56 +27,8 @@ export declare const PushFilesSchema: z.ZodObject<{
27
27
  text: "text";
28
28
  }>>;
29
29
  execute_filemode: z.ZodOptional<z.ZodPipe<z.ZodTransform<boolean, unknown>, z.ZodBoolean>>;
30
- }, z.core.$strip>>;
31
- start_branch: z.ZodOptional<z.ZodString>;
32
- author_email: z.ZodOptional<z.ZodString>;
33
- author_name: z.ZodOptional<z.ZodString>;
34
- }, z.core.$strip>;
35
- export declare const MarkdownUploadSchema: z.ZodObject<{
36
- project_id: z.ZodPipe<z.ZodTransform<{}, unknown>, z.ZodCoercedString<unknown>>;
37
- file: z.ZodString;
38
- filename: z.ZodString;
30
+ }, z.core.$strip>>>;
31
+ file: z.ZodOptional<z.ZodString>;
32
+ filename: z.ZodOptional<z.ZodString>;
39
33
  }, z.core.$strip>;
40
- export declare const ManageFilesSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
41
- project_id: z.ZodPipe<z.ZodTransform<{}, unknown>, z.ZodCoercedString<unknown>>;
42
- action: z.ZodLiteral<"single">;
43
- file_path: z.ZodString;
44
- content: z.ZodString;
45
- commit_message: z.ZodString;
46
- branch: z.ZodString;
47
- start_branch: z.ZodOptional<z.ZodString>;
48
- encoding: z.ZodOptional<z.ZodEnum<{
49
- base64: "base64";
50
- text: "text";
51
- }>>;
52
- author_email: z.ZodOptional<z.ZodString>;
53
- author_name: z.ZodOptional<z.ZodString>;
54
- last_commit_id: z.ZodOptional<z.ZodString>;
55
- execute_filemode: z.ZodOptional<z.ZodPipe<z.ZodTransform<boolean, unknown>, z.ZodBoolean>>;
56
- }, z.core.$strip>, z.ZodObject<{
57
- project_id: z.ZodPipe<z.ZodTransform<{}, unknown>, z.ZodCoercedString<unknown>>;
58
- action: z.ZodLiteral<"batch">;
59
- branch: z.ZodString;
60
- commit_message: z.ZodString;
61
- files: z.ZodArray<z.ZodObject<{
62
- file_path: z.ZodString;
63
- content: z.ZodString;
64
- encoding: z.ZodOptional<z.ZodEnum<{
65
- base64: "base64";
66
- text: "text";
67
- }>>;
68
- execute_filemode: z.ZodOptional<z.ZodPipe<z.ZodTransform<boolean, unknown>, z.ZodBoolean>>;
69
- }, z.core.$strip>>;
70
- start_branch: z.ZodOptional<z.ZodString>;
71
- author_email: z.ZodOptional<z.ZodString>;
72
- author_name: z.ZodOptional<z.ZodString>;
73
- }, z.core.$strip>, z.ZodObject<{
74
- project_id: z.ZodPipe<z.ZodTransform<{}, unknown>, z.ZodCoercedString<unknown>>;
75
- action: z.ZodLiteral<"upload">;
76
- file: z.ZodString;
77
- filename: z.ZodString;
78
- }, z.core.$strip>], "action">;
79
- export type CreateOrUpdateFileOptions = z.infer<typeof CreateOrUpdateFileSchema>;
80
- export type PushFilesOptions = z.infer<typeof PushFilesSchema>;
81
- export type MarkdownUploadOptions = z.infer<typeof MarkdownUploadSchema>;
82
34
  export type ManageFilesInput = z.infer<typeof ManageFilesSchema>;
@@ -1,79 +1,89 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ManageFilesSchema = exports.MarkdownUploadSchema = exports.PushFilesSchema = exports.CreateOrUpdateFileSchema = void 0;
3
+ exports.ManageFilesSchema = void 0;
4
4
  const zod_1 = require("zod");
5
5
  const utils_1 = require("../utils");
6
- const shared_1 = require("../shared");
7
- exports.CreateOrUpdateFileSchema = shared_1.ProjectParamsSchema.extend({
8
- file_path: zod_1.z.string().describe("URL-encoded full path to the file"),
9
- branch: zod_1.z.string().describe("Name of the new branch to create"),
10
- start_branch: zod_1.z.string().optional().describe("Name of the base branch to start from"),
11
- encoding: zod_1.z.enum(["text", "base64"]).optional().describe("Change encoding"),
12
- author_email: zod_1.z.string().optional().describe("Author email for the commit"),
13
- author_name: zod_1.z.string().optional().describe("Author name for the commit"),
14
- content: zod_1.z.string().describe("File content"),
15
- commit_message: zod_1.z.string().describe("Commit message"),
16
- last_commit_id: zod_1.z.string().optional().describe("Last known file commit id"),
17
- execute_filemode: utils_1.flexibleBoolean.optional().describe("Execute file mode"),
18
- });
19
- exports.PushFilesSchema = shared_1.ProjectParamsSchema.extend({
20
- branch: zod_1.z.string().describe("Target branch name"),
21
- commit_message: zod_1.z.string().describe("Commit message"),
22
- files: zod_1.z
23
- .array(zod_1.z.object({
24
- file_path: zod_1.z.string(),
25
- content: zod_1.z.string(),
26
- encoding: zod_1.z.enum(["text", "base64"]).optional(),
27
- execute_filemode: utils_1.flexibleBoolean.optional(),
28
- }))
29
- .describe("Array of files to push"),
30
- start_branch: zod_1.z.string().optional().describe("Start branch name"),
31
- author_email: zod_1.z.string().optional().describe("Author email"),
32
- author_name: zod_1.z.string().optional().describe("Author name"),
33
- });
34
- exports.MarkdownUploadSchema = shared_1.ProjectParamsSchema.extend({
35
- file: zod_1.z.string().describe("Base64 encoded file content or file path"),
36
- filename: zod_1.z.string().describe("Name of the file"),
37
- });
38
- const ManageFilesSingleSchema = zod_1.z.object({
39
- project_id: utils_1.requiredId.describe("Project ID or URL-encoded path"),
40
- action: zod_1.z.literal("single"),
41
- file_path: zod_1.z.string().describe("Path to the file"),
42
- content: zod_1.z.string().describe("File content (text or base64 encoded)"),
43
- commit_message: zod_1.z.string().describe("Commit message"),
44
- branch: zod_1.z.string().describe("Target branch name"),
45
- start_branch: zod_1.z.string().optional().describe("Base branch to start from"),
46
- encoding: zod_1.z.enum(["text", "base64"]).optional().describe("Content encoding (default: text)"),
47
- author_email: zod_1.z.string().optional().describe("Commit author email"),
48
- author_name: zod_1.z.string().optional().describe("Commit author name"),
49
- last_commit_id: zod_1.z.string().optional().describe("Last known commit ID for conflict detection"),
50
- execute_filemode: utils_1.flexibleBoolean.optional().describe("Set executable permission"),
51
- });
52
6
  const BatchFileActionSchema = zod_1.z.object({
53
7
  file_path: zod_1.z.string().describe("Path to the file"),
54
8
  content: zod_1.z.string().describe("File content"),
55
9
  encoding: zod_1.z.enum(["text", "base64"]).optional().describe("Content encoding"),
56
10
  execute_filemode: utils_1.flexibleBoolean.optional().describe("Set executable permission"),
57
11
  });
58
- const ManageFilesBatchSchema = zod_1.z.object({
12
+ exports.ManageFilesSchema = zod_1.z
13
+ .object({
14
+ action: zod_1.z.enum(["single", "batch", "upload"]).describe("Action to perform"),
59
15
  project_id: utils_1.requiredId.describe("Project ID or URL-encoded path"),
60
- action: zod_1.z.literal("batch"),
61
- branch: zod_1.z.string().describe("Target branch name"),
62
- commit_message: zod_1.z.string().describe("Commit message"),
63
- files: zod_1.z.array(BatchFileActionSchema).min(1).describe("Files to commit"),
16
+ file_path: zod_1.z.string().optional().describe("Path to the file. Required for 'single' action."),
17
+ content: zod_1.z
18
+ .string()
19
+ .optional()
20
+ .describe("File content (text or base64 encoded). Required for 'single' action."),
21
+ commit_message: zod_1.z
22
+ .string()
23
+ .optional()
24
+ .describe("Commit message. Required for 'single' and 'batch' actions."),
25
+ branch: zod_1.z
26
+ .string()
27
+ .optional()
28
+ .describe("Target branch name. Required for 'single' and 'batch' actions."),
64
29
  start_branch: zod_1.z.string().optional().describe("Base branch to start from"),
30
+ encoding: zod_1.z
31
+ .enum(["text", "base64"])
32
+ .optional()
33
+ .describe("Content encoding (default: text). For 'single' action."),
65
34
  author_email: zod_1.z.string().optional().describe("Commit author email"),
66
35
  author_name: zod_1.z.string().optional().describe("Commit author name"),
36
+ last_commit_id: zod_1.z
37
+ .string()
38
+ .optional()
39
+ .describe("Last known commit ID for conflict detection. For 'single' action."),
40
+ execute_filemode: utils_1.flexibleBoolean
41
+ .optional()
42
+ .describe("Set executable permission. For 'single' action."),
43
+ files: zod_1.z
44
+ .array(BatchFileActionSchema)
45
+ .optional()
46
+ .describe("Files to commit. Required for 'batch' action."),
47
+ file: zod_1.z
48
+ .string()
49
+ .optional()
50
+ .describe("Base64 encoded file content. Required for 'upload' action."),
51
+ filename: zod_1.z.string().optional().describe("Name of the file. Required for 'upload' action."),
52
+ })
53
+ .refine(data => data.action !== "single" || data.file_path !== undefined, {
54
+ message: "file_path is required for 'single' action",
55
+ path: ["file_path"],
56
+ })
57
+ .refine(data => data.action !== "single" || data.content !== undefined, {
58
+ message: "content is required for 'single' action",
59
+ path: ["content"],
60
+ })
61
+ .refine(data => data.action !== "single" || data.commit_message !== undefined, {
62
+ message: "commit_message is required for 'single' action",
63
+ path: ["commit_message"],
64
+ })
65
+ .refine(data => data.action !== "single" || data.branch !== undefined, {
66
+ message: "branch is required for 'single' action",
67
+ path: ["branch"],
68
+ })
69
+ .refine(data => data.action !== "batch" || data.branch !== undefined, {
70
+ message: "branch is required for 'batch' action",
71
+ path: ["branch"],
72
+ })
73
+ .refine(data => data.action !== "batch" || data.commit_message !== undefined, {
74
+ message: "commit_message is required for 'batch' action",
75
+ path: ["commit_message"],
76
+ })
77
+ .refine(data => data.action !== "batch" || (data.files && data.files.length > 0), {
78
+ message: "files array with at least one file is required for 'batch' action",
79
+ path: ["files"],
80
+ })
81
+ .refine(data => data.action !== "upload" || data.file !== undefined, {
82
+ message: "file is required for 'upload' action",
83
+ path: ["file"],
84
+ })
85
+ .refine(data => data.action !== "upload" || data.filename !== undefined, {
86
+ message: "filename is required for 'upload' action",
87
+ path: ["filename"],
67
88
  });
68
- const ManageFilesUploadSchema = zod_1.z.object({
69
- project_id: utils_1.requiredId.describe("Project ID or URL-encoded path"),
70
- action: zod_1.z.literal("upload"),
71
- file: zod_1.z.string().describe("Base64 encoded file content"),
72
- filename: zod_1.z.string().describe("Name of the file"),
73
- });
74
- exports.ManageFilesSchema = zod_1.z.discriminatedUnion("action", [
75
- ManageFilesSingleSchema,
76
- ManageFilesBatchSchema,
77
- ManageFilesUploadSchema,
78
- ]);
79
89
  //# sourceMappingURL=schema.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"schema.js","sourceRoot":"","sources":["../../../../src/entities/files/schema.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AACxB,oCAAuD;AACvD,sCAAgD;AAKnC,QAAA,wBAAwB,GAAG,4BAAmB,CAAC,MAAM,CAAC;IACjE,SAAS,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,mCAAmC,CAAC;IACnE,MAAM,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,kCAAkC,CAAC;IAC/D,YAAY,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,uCAAuC,CAAC;IACrF,QAAQ,EAAE,OAAC,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,iBAAiB,CAAC;IAC3E,YAAY,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,6BAA6B,CAAC;IAC3E,WAAW,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,4BAA4B,CAAC;IACzE,OAAO,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,cAAc,CAAC;IAC5C,cAAc,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,gBAAgB,CAAC;IACrD,cAAc,EAAE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AAC;CAChB,CAAC;KACD,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,MAAM,KAAK,QAAQ,IAAI,IAAI,CAAC,IAAI,KAAK,SAAS,EAAE;IACnE,OAAO,EAAE,sCAAsC;IAC/C,IAAI,EAAE,CAAC,MAAM,CAAC;CACf,CAAC;KACD,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,MAAM,KAAK,QAAQ,IAAI,IAAI,CAAC,QAAQ,KAAK,SAAS,EAAE;IACvE,OAAO,EAAE,0CAA0C;IACnD,IAAI,EAAE,CAAC,UAAU,CAAC;CACnB,CAAC,CAAC"}
@@ -42,147 +42,99 @@ const schema_readonly_1 = require("./schema-readonly");
42
42
  const schema_1 = require("./schema");
43
43
  const gitlab_api_1 = require("../../utils/gitlab-api");
44
44
  const namespace_1 = require("../../utils/namespace");
45
+ const utils_1 = require("../utils");
45
46
  exports.milestonesToolRegistry = new Map([
46
47
  [
47
- "list_milestones",
48
+ "browse_milestones",
48
49
  {
49
- name: "list_milestones",
50
- description: "Browse release milestones for planning and tracking. Use to see upcoming releases, sprint cycles, or project phases. Supports filtering by state (active/closed) and timeframe. Returns milestone titles, dates, progress statistics. Group milestones apply across all projects.",
51
- inputSchema: z.toJSONSchema(schema_readonly_1.ListProjectMilestonesSchema),
50
+ name: "browse_milestones",
51
+ description: 'BROWSE milestones. Actions: "list" shows milestones with filtering, "get" retrieves single milestone, "issues" lists issues in milestone, "merge_requests" lists MRs in milestone, "burndown" gets burndown chart data.',
52
+ inputSchema: z.toJSONSchema(schema_readonly_1.BrowseMilestonesSchema),
52
53
  handler: async (args) => {
53
- const options = schema_readonly_1.ListProjectMilestonesSchema.parse(args);
54
- const { entityType, encodedPath } = await (0, namespace_1.resolveNamespaceForAPI)(options.namespace);
55
- return gitlab_api_1.gitlab.get(`${entityType}/${encodedPath}/milestones`, {
56
- query: (0, gitlab_api_1.toQuery)(options, ["namespace"]),
57
- });
58
- },
59
- },
60
- ],
61
- [
62
- "get_milestone",
63
- {
64
- name: "get_milestone",
65
- description: "Retrieve comprehensive milestone information including dates, description, and progress metrics. Use to track release status, see associated work, or analyze milestone completion. Shows open/closed issue counts and completion percentage.",
66
- inputSchema: z.toJSONSchema(schema_readonly_1.GetProjectMilestoneSchema),
67
- handler: async (args) => {
68
- const options = schema_readonly_1.GetProjectMilestoneSchema.parse(args);
69
- const { entityType, encodedPath } = await (0, namespace_1.resolveNamespaceForAPI)(options.namespace);
70
- return gitlab_api_1.gitlab.get(`${entityType}/${encodedPath}/milestones/${options.milestone_id}`);
71
- },
72
- },
73
- ],
74
- [
75
- "get_milestone_issue",
76
- {
77
- name: "get_milestone_issue",
78
- description: "List all issues targeted for a milestone release. Use to track milestone progress, identify blockers, or plan work. Returns issue details with status, assignees, and labels. Essential for release management and sprint planning.",
79
- inputSchema: z.toJSONSchema(schema_readonly_1.GetMilestoneIssuesSchema),
80
- handler: async (args) => {
81
- const options = schema_readonly_1.GetMilestoneIssuesSchema.parse(args);
82
- const { entityType, encodedPath } = await (0, namespace_1.resolveNamespaceForAPI)(options.namespace);
83
- return gitlab_api_1.gitlab.get(`${entityType}/${encodedPath}/milestones/${options.milestone_id}/issues`, { query: (0, gitlab_api_1.toQuery)(options, ["namespace", "milestone_id"]) });
84
- },
85
- },
86
- ],
87
- [
88
- "get_milestone_merge_requests",
89
- {
90
- name: "get_milestone_merge_requests",
91
- description: "List merge requests scheduled for a milestone. Use to track feature completion, review code changes for release, or identify pending work. Shows MR status, approvals, and pipeline status. Critical for release readiness assessment.",
92
- inputSchema: z.toJSONSchema(schema_readonly_1.GetMilestoneMergeRequestsSchema),
93
- handler: async (args) => {
94
- const options = schema_readonly_1.GetMilestoneMergeRequestsSchema.parse(args);
95
- const { entityType, encodedPath } = await (0, namespace_1.resolveNamespaceForAPI)(options.namespace);
96
- return gitlab_api_1.gitlab.get(`${entityType}/${encodedPath}/milestones/${options.milestone_id}/merge_requests`, { query: (0, gitlab_api_1.toQuery)(options, ["namespace", "milestone_id"]) });
97
- },
98
- },
99
- ],
100
- [
101
- "get_milestone_burndown_events",
102
- {
103
- name: "get_milestone_burndown_events",
104
- description: "Track milestone progress with burndown chart data. Use for agile metrics, velocity tracking, and sprint analysis. Returns time-series events showing work completion rate. Premium/Ultimate feature for advanced project analytics.",
105
- inputSchema: z.toJSONSchema(schema_readonly_1.GetMilestoneBurndownEventsSchema),
106
- handler: async (args) => {
107
- const options = schema_readonly_1.GetMilestoneBurndownEventsSchema.parse(args);
108
- const { entityType, encodedPath } = await (0, namespace_1.resolveNamespaceForAPI)(options.namespace);
109
- return gitlab_api_1.gitlab.get(`${entityType}/${encodedPath}/milestones/${options.milestone_id}/burndown_events`, { query: (0, gitlab_api_1.toQuery)(options, ["namespace", "milestone_id"]) });
110
- },
111
- },
112
- ],
113
- [
114
- "create_milestone",
115
- {
116
- name: "create_milestone",
117
- description: "Define a new release milestone or sprint cycle. Use to establish delivery targets, organize work phases, or plan releases. Set title, description, start/due dates. Group milestones coordinate releases across multiple projects.",
118
- inputSchema: z.toJSONSchema(schema_1.CreateProjectMilestoneSchema),
119
- handler: async (args) => {
120
- const options = schema_1.CreateProjectMilestoneSchema.parse(args);
121
- const { entityType, encodedPath } = await (0, namespace_1.resolveNamespaceForAPI)(options.namespace);
122
- const { namespace: _namespace, ...body } = options;
123
- return gitlab_api_1.gitlab.post(`${entityType}/${encodedPath}/milestones`, {
124
- body,
125
- contentType: "json",
126
- });
127
- },
128
- },
129
- ],
130
- [
131
- "edit_milestone",
132
- {
133
- name: "edit_milestone",
134
- description: "Update milestone properties like dates, description, or state. Use to adjust release schedules, extend sprints, or close completed milestones. Changes apply immediately to all associated issues and MRs.",
135
- inputSchema: z.toJSONSchema(schema_1.EditProjectMilestoneSchema),
136
- handler: async (args) => {
137
- const options = schema_1.EditProjectMilestoneSchema.parse(args);
138
- const { entityType, encodedPath } = await (0, namespace_1.resolveNamespaceForAPI)(options.namespace);
139
- const { namespace: _namespace, milestone_id, ...body } = options;
140
- return gitlab_api_1.gitlab.put(`${entityType}/${encodedPath}/milestones/${milestone_id}`, {
141
- body,
142
- contentType: "json",
143
- });
144
- },
145
- },
146
- ],
147
- [
148
- "delete_milestone",
149
- {
150
- name: "delete_milestone",
151
- description: "Remove a milestone permanently. Use to clean up cancelled releases or obsolete milestones. Warning: removes milestone association from all issues and MRs. Consider closing instead of deleting for historical tracking.",
152
- inputSchema: z.toJSONSchema(schema_1.DeleteProjectMilestoneSchema),
153
- handler: async (args) => {
154
- const options = schema_1.DeleteProjectMilestoneSchema.parse(args);
155
- const { entityType, encodedPath } = await (0, namespace_1.resolveNamespaceForAPI)(options.namespace);
156
- await gitlab_api_1.gitlab.delete(`${entityType}/${encodedPath}/milestones/${options.milestone_id}`);
157
- return { deleted: true };
54
+ const input = schema_readonly_1.BrowseMilestonesSchema.parse(args);
55
+ const { entityType, encodedPath } = await (0, namespace_1.resolveNamespaceForAPI)(input.namespace);
56
+ switch (input.action) {
57
+ case "list": {
58
+ const { action: _action, namespace: _namespace, ...rest } = input;
59
+ const query = (0, gitlab_api_1.toQuery)(rest, []);
60
+ return gitlab_api_1.gitlab.get(`${entityType}/${encodedPath}/milestones`, { query });
61
+ }
62
+ case "get": {
63
+ (0, utils_1.assertDefined)(input.milestone_id, "milestone_id");
64
+ return gitlab_api_1.gitlab.get(`${entityType}/${encodedPath}/milestones/${input.milestone_id}`);
65
+ }
66
+ case "issues": {
67
+ (0, utils_1.assertDefined)(input.milestone_id, "milestone_id");
68
+ const { action: _action, namespace: _namespace, milestone_id, ...rest } = input;
69
+ const query = (0, gitlab_api_1.toQuery)(rest, []);
70
+ return gitlab_api_1.gitlab.get(`${entityType}/${encodedPath}/milestones/${milestone_id}/issues`, {
71
+ query,
72
+ });
73
+ }
74
+ case "merge_requests": {
75
+ (0, utils_1.assertDefined)(input.milestone_id, "milestone_id");
76
+ const { action: _action, namespace: _namespace, milestone_id, ...rest } = input;
77
+ const query = (0, gitlab_api_1.toQuery)(rest, []);
78
+ return gitlab_api_1.gitlab.get(`${entityType}/${encodedPath}/milestones/${milestone_id}/merge_requests`, { query });
79
+ }
80
+ case "burndown": {
81
+ (0, utils_1.assertDefined)(input.milestone_id, "milestone_id");
82
+ const { action: _action, namespace: _namespace, milestone_id, ...rest } = input;
83
+ const query = (0, gitlab_api_1.toQuery)(rest, []);
84
+ return gitlab_api_1.gitlab.get(`${entityType}/${encodedPath}/milestones/${milestone_id}/burndown_events`, { query });
85
+ }
86
+ default:
87
+ throw new Error(`Unknown action: ${input.action}`);
88
+ }
158
89
  },
159
90
  },
160
91
  ],
161
92
  [
162
- "promote_milestone",
93
+ "manage_milestone",
163
94
  {
164
- name: "promote_milestone",
165
- description: "Elevate project milestone to group level for cross-project coordination. Use when a milestone needs to span multiple projects. Consolidates related project milestones into single group milestone. Useful for organizational release planning.",
166
- inputSchema: z.toJSONSchema(schema_1.PromoteProjectMilestoneSchema),
95
+ name: "manage_milestone",
96
+ description: 'MANAGE milestones. Actions: "create" creates new milestone, "update" modifies existing milestone, "delete" removes milestone, "promote" elevates project milestone to group level.',
97
+ inputSchema: z.toJSONSchema(schema_1.ManageMilestoneSchema),
167
98
  handler: async (args) => {
168
- const options = schema_1.PromoteProjectMilestoneSchema.parse(args);
169
- const { entityType, encodedPath } = await (0, namespace_1.resolveNamespaceForAPI)(options.namespace);
170
- if (entityType !== "projects") {
171
- throw new Error("Milestone promotion is only available for projects, not groups");
99
+ const input = schema_1.ManageMilestoneSchema.parse(args);
100
+ const { entityType, encodedPath } = await (0, namespace_1.resolveNamespaceForAPI)(input.namespace);
101
+ switch (input.action) {
102
+ case "create": {
103
+ const { action: _action, namespace: _namespace, ...body } = input;
104
+ return gitlab_api_1.gitlab.post(`${entityType}/${encodedPath}/milestones`, {
105
+ body,
106
+ contentType: "json",
107
+ });
108
+ }
109
+ case "update": {
110
+ (0, utils_1.assertDefined)(input.milestone_id, "milestone_id");
111
+ const { action: _action, namespace: _namespace, milestone_id, ...body } = input;
112
+ return gitlab_api_1.gitlab.put(`${entityType}/${encodedPath}/milestones/${milestone_id}`, {
113
+ body,
114
+ contentType: "json",
115
+ });
116
+ }
117
+ case "delete": {
118
+ (0, utils_1.assertDefined)(input.milestone_id, "milestone_id");
119
+ await gitlab_api_1.gitlab.delete(`${entityType}/${encodedPath}/milestones/${input.milestone_id}`);
120
+ return { deleted: true };
121
+ }
122
+ case "promote": {
123
+ (0, utils_1.assertDefined)(input.milestone_id, "milestone_id");
124
+ if (entityType !== "projects") {
125
+ throw new Error("Milestone promotion is only available for projects, not groups");
126
+ }
127
+ return gitlab_api_1.gitlab.post(`projects/${encodedPath}/milestones/${encodeURIComponent(input.milestone_id)}/promote`);
128
+ }
129
+ default:
130
+ throw new Error(`Unknown action: ${input.action}`);
172
131
  }
173
- return gitlab_api_1.gitlab.post(`projects/${encodedPath}/milestones/${encodeURIComponent(options.milestone_id)}/promote`);
174
132
  },
175
133
  },
176
134
  ],
177
135
  ]);
178
136
  function getMilestonesReadOnlyToolNames() {
179
- return [
180
- "list_milestones",
181
- "get_milestone",
182
- "get_milestone_issue",
183
- "get_milestone_merge_requests",
184
- "get_milestone_burndown_events",
185
- ];
137
+ return ["browse_milestones"];
186
138
  }
187
139
  function getMilestonesToolDefinitions() {
188
140
  return Array.from(exports.milestonesToolRegistry.values());