@structured-world/gitlab-mcp 6.3.0 → 6.4.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.
- package/dist/src/entities/wiki/registry.js +51 -65
- package/dist/src/entities/wiki/registry.js.map +1 -1
- package/dist/src/entities/wiki/schema-readonly.d.ts +8 -8
- package/dist/src/entities/wiki/schema-readonly.js +16 -9
- package/dist/src/entities/wiki/schema-readonly.js.map +1 -1
- package/dist/src/entities/wiki/schema.d.ts +14 -16
- package/dist/src/entities/wiki/schema.js +30 -17
- package/dist/src/entities/wiki/schema.js.map +1 -1
- package/dist/structured-world-gitlab-mcp-6.4.0.tgz +0 -0
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/dist/structured-world-gitlab-mcp-6.3.0.tgz +0 -0
|
@@ -42,86 +42,72 @@ 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.wikiToolRegistry = new Map([
|
|
46
47
|
[
|
|
47
|
-
"
|
|
48
|
+
"browse_wiki",
|
|
48
49
|
{
|
|
49
|
-
name: "
|
|
50
|
-
description:
|
|
51
|
-
inputSchema: z.toJSONSchema(schema_readonly_1.
|
|
50
|
+
name: "browse_wiki",
|
|
51
|
+
description: 'BROWSE wiki pages. Actions: "list" shows all wiki pages in project/group, "get" retrieves single wiki page content by slug.',
|
|
52
|
+
inputSchema: z.toJSONSchema(schema_readonly_1.BrowseWikiSchema),
|
|
52
53
|
handler: async (args) => {
|
|
53
|
-
const
|
|
54
|
-
const { entityType, encodedPath } = await (0, namespace_1.resolveNamespaceForAPI)(
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
54
|
+
const input = schema_readonly_1.BrowseWikiSchema.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}/wikis`, { query });
|
|
61
|
+
}
|
|
62
|
+
case "get": {
|
|
63
|
+
(0, utils_1.assertDefined)(input.slug, "slug");
|
|
64
|
+
return gitlab_api_1.gitlab.get(`${entityType}/${encodedPath}/wikis/${encodeURIComponent(input.slug)}`);
|
|
65
|
+
}
|
|
66
|
+
default:
|
|
67
|
+
throw new Error(`Unknown action: ${input.action}`);
|
|
68
|
+
}
|
|
58
69
|
},
|
|
59
70
|
},
|
|
60
71
|
],
|
|
61
72
|
[
|
|
62
|
-
"
|
|
73
|
+
"manage_wiki",
|
|
63
74
|
{
|
|
64
|
-
name: "
|
|
65
|
-
description:
|
|
66
|
-
inputSchema: z.toJSONSchema(
|
|
75
|
+
name: "manage_wiki",
|
|
76
|
+
description: 'MANAGE wiki pages. Actions: "create" adds new wiki page, "update" modifies existing page, "delete" removes wiki page permanently.',
|
|
77
|
+
inputSchema: z.toJSONSchema(schema_1.ManageWikiSchema),
|
|
67
78
|
handler: async (args) => {
|
|
68
|
-
const
|
|
69
|
-
const { entityType, encodedPath } = await (0, namespace_1.resolveNamespaceForAPI)(
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
name: "update_wiki_page",
|
|
95
|
-
description: "UPDATE: Modify existing wiki page content or properties. Use when: Updating documentation with new information, Fixing errors or improving clarity, Reorganizing content structure. Maintains complete version history with change tracking. Supports collaborative editing with author attribution and diff viewing.",
|
|
96
|
-
inputSchema: z.toJSONSchema(schema_1.UpdateWikiPageSchema),
|
|
97
|
-
handler: async (args) => {
|
|
98
|
-
const options = schema_1.UpdateWikiPageSchema.parse(args);
|
|
99
|
-
const { entityType, encodedPath } = await (0, namespace_1.resolveNamespaceForAPI)(options.namespace);
|
|
100
|
-
const { namespace: _namespace, slug, ...body } = options;
|
|
101
|
-
return gitlab_api_1.gitlab.put(`${entityType}/${encodedPath}/wikis/${encodeURIComponent(slug)}`, {
|
|
102
|
-
body,
|
|
103
|
-
contentType: "json",
|
|
104
|
-
});
|
|
105
|
-
},
|
|
106
|
-
},
|
|
107
|
-
],
|
|
108
|
-
[
|
|
109
|
-
"delete_wiki_page",
|
|
110
|
-
{
|
|
111
|
-
name: "delete_wiki_page",
|
|
112
|
-
description: "DELETE: Permanently remove wiki page from documentation. Use when: Cleaning up outdated or obsolete content, Removing duplicate or incorrect pages, Reorganizing wiki structure. WARNING: Deletes page and ALL version history permanently - cannot be undone. Consider archiving important content first.",
|
|
113
|
-
inputSchema: z.toJSONSchema(schema_1.DeleteWikiPageSchema),
|
|
114
|
-
handler: async (args) => {
|
|
115
|
-
const options = schema_1.DeleteWikiPageSchema.parse(args);
|
|
116
|
-
const { entityType, encodedPath } = await (0, namespace_1.resolveNamespaceForAPI)(options.namespace);
|
|
117
|
-
await gitlab_api_1.gitlab.delete(`${entityType}/${encodedPath}/wikis/${encodeURIComponent(options.slug)}`);
|
|
118
|
-
return { deleted: true };
|
|
79
|
+
const input = schema_1.ManageWikiSchema.parse(args);
|
|
80
|
+
const { entityType, encodedPath } = await (0, namespace_1.resolveNamespaceForAPI)(input.namespace);
|
|
81
|
+
switch (input.action) {
|
|
82
|
+
case "create": {
|
|
83
|
+
const { action: _action, namespace: _namespace, ...body } = input;
|
|
84
|
+
return gitlab_api_1.gitlab.post(`${entityType}/${encodedPath}/wikis`, {
|
|
85
|
+
body,
|
|
86
|
+
contentType: "json",
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
case "update": {
|
|
90
|
+
(0, utils_1.assertDefined)(input.slug, "slug");
|
|
91
|
+
const { action: _action, namespace: _namespace, slug, ...body } = input;
|
|
92
|
+
return gitlab_api_1.gitlab.put(`${entityType}/${encodedPath}/wikis/${encodeURIComponent(slug)}`, {
|
|
93
|
+
body,
|
|
94
|
+
contentType: "json",
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
case "delete": {
|
|
98
|
+
(0, utils_1.assertDefined)(input.slug, "slug");
|
|
99
|
+
await gitlab_api_1.gitlab.delete(`${entityType}/${encodedPath}/wikis/${encodeURIComponent(input.slug)}`);
|
|
100
|
+
return { deleted: true };
|
|
101
|
+
}
|
|
102
|
+
default:
|
|
103
|
+
throw new Error(`Unknown action: ${input.action}`);
|
|
104
|
+
}
|
|
119
105
|
},
|
|
120
106
|
},
|
|
121
107
|
],
|
|
122
108
|
]);
|
|
123
109
|
function getWikiReadOnlyToolNames() {
|
|
124
|
-
return ["
|
|
110
|
+
return ["browse_wiki"];
|
|
125
111
|
}
|
|
126
112
|
function getWikiToolDefinitions() {
|
|
127
113
|
return Array.from(exports.wikiToolRegistry.values());
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registry.js","sourceRoot":"","sources":["../../../../src/entities/wiki/registry.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"registry.js","sourceRoot":"","sources":["../../../../src/entities/wiki/registry.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8GA,4DAEC;AAKD,wDAEC;AAKD,oDAMC;AAlID,uCAAyB;AACzB,uDAAqD;AACrD,qCAA4C;AAC5C,uDAAyD;AACzD,qDAA+D;AAE/D,oCAAyC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F,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;oBAC3B,CAAC;oBAGD;wBACE,MAAM,IAAI,KAAK,CAAC,mBAAoB,KAA4B,CAAC,MAAM,EAAE,CAAC,CAAC;gBAC/E,CAAC;YACH,CAAC;SACF;KACF;CACF,CAAC,CAAC;AAKH,SAAgB,wBAAwB;IACtC,OAAO,CAAC,aAAa,CAAC,CAAC;AACzB,CAAC;AAKD,SAAgB,sBAAsB;IACpC,OAAO,KAAK,CAAC,IAAI,CAAC,wBAAgB,CAAC,MAAM,EAAE,CAAC,CAAC;AAC/C,CAAC;AAKD,SAAgB,oBAAoB,CAAC,eAAwB,KAAK;IAChE,IAAI,YAAY,EAAE,CAAC;QACjB,MAAM,aAAa,GAAG,wBAAwB,EAAE,CAAC;QACjD,OAAO,KAAK,CAAC,IAAI,CAAC,wBAAgB,CAAC,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,aAAa,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;IACjG,CAAC;IACD,OAAO,sBAAsB,EAAE,CAAC;AAClC,CAAC"}
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
export declare const
|
|
2
|
+
export declare const BrowseWikiSchema: z.ZodObject<{
|
|
3
|
+
action: z.ZodEnum<{
|
|
4
|
+
list: "list";
|
|
5
|
+
get: "get";
|
|
6
|
+
}>;
|
|
3
7
|
namespace: z.ZodString;
|
|
8
|
+
slug: z.ZodOptional<z.ZodString>;
|
|
4
9
|
with_content: z.ZodOptional<z.ZodPipe<z.ZodTransform<boolean, unknown>, z.ZodBoolean>>;
|
|
10
|
+
per_page: z.ZodOptional<z.ZodNumber>;
|
|
5
11
|
page: z.ZodOptional<z.ZodNumber>;
|
|
6
|
-
per_page: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
7
|
-
}, z.core.$strip>;
|
|
8
|
-
export declare const GetWikiPageSchema: z.ZodObject<{
|
|
9
|
-
namespace: z.ZodString;
|
|
10
|
-
slug: z.ZodString;
|
|
11
12
|
}, z.core.$strip>;
|
|
12
13
|
export declare const GitLabWikiPageSchema: z.ZodObject<{
|
|
13
14
|
title: z.ZodString;
|
|
@@ -17,6 +18,5 @@ export declare const GitLabWikiPageSchema: z.ZodObject<{
|
|
|
17
18
|
created_at: z.ZodOptional<z.ZodString>;
|
|
18
19
|
updated_at: z.ZodOptional<z.ZodString>;
|
|
19
20
|
}, z.core.$strip>;
|
|
20
|
-
export type
|
|
21
|
-
export type GetWikiPageOptions = z.infer<typeof GetWikiPageSchema>;
|
|
21
|
+
export type BrowseWikiInput = z.infer<typeof BrowseWikiSchema>;
|
|
22
22
|
export type GitLabWikiPage = z.infer<typeof GitLabWikiPageSchema>;
|
|
@@ -1,18 +1,25 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.GitLabWikiPageSchema = exports.
|
|
3
|
+
exports.GitLabWikiPageSchema = exports.BrowseWikiSchema = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
|
-
const shared_1 = require("../shared");
|
|
6
5
|
const utils_1 = require("../utils");
|
|
7
|
-
exports.
|
|
6
|
+
exports.BrowseWikiSchema = zod_1.z
|
|
8
7
|
.object({
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
action: zod_1.z.enum(["list", "get"]).describe("Action to perform"),
|
|
9
|
+
namespace: zod_1.z.string().describe("Namespace path (group or project)"),
|
|
10
|
+
slug: zod_1.z
|
|
11
|
+
.string()
|
|
12
|
+
.optional()
|
|
13
|
+
.describe("URL-encoded slug of the wiki page. Required for 'get' action."),
|
|
14
|
+
with_content: utils_1.flexibleBoolean
|
|
15
|
+
.optional()
|
|
16
|
+
.describe("For 'list': include content of the wiki pages"),
|
|
17
|
+
per_page: zod_1.z.number().optional().describe("Number of items per page"),
|
|
18
|
+
page: zod_1.z.number().optional().describe("Page number"),
|
|
11
19
|
})
|
|
12
|
-
.
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
slug: zod_1.z.string().describe("URL-encoded slug of the wiki page"),
|
|
20
|
+
.refine(data => data.action !== "get" || data.slug !== undefined, {
|
|
21
|
+
message: "slug is required for 'get' action",
|
|
22
|
+
path: ["slug"],
|
|
16
23
|
});
|
|
17
24
|
exports.GitLabWikiPageSchema = zod_1.z.object({
|
|
18
25
|
title: zod_1.z.string(),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema-readonly.js","sourceRoot":"","sources":["../../../../src/entities/wiki/schema-readonly.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AACxB,
|
|
1
|
+
{"version":3,"file":"schema-readonly.js","sourceRoot":"","sources":["../../../../src/entities/wiki/schema-readonly.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AACxB,oCAA2C;AAS9B,QAAA,gBAAgB,GAAG,OAAC;KAC9B,MAAM,CAAC;IACN,MAAM,EAAE,OAAC,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC,CAAC,QAAQ,CAAC,mBAAmB,CAAC;IAC7D,SAAS,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,mCAAmC,CAAC;IAEnE,IAAI,EAAE,OAAC;SACJ,MAAM,EAAE;SACR,QAAQ,EAAE;SACV,QAAQ,CAAC,+DAA+D,CAAC;IAE5E,YAAY,EAAE,uBAAe;SAC1B,QAAQ,EAAE;SACV,QAAQ,CAAC,+CAA+C,CAAC;IAE5D,QAAQ,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,0BAA0B,CAAC;IACpE,IAAI,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,aAAa,CAAC;CACpD,CAAC;KACD,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,MAAM,KAAK,KAAK,IAAI,IAAI,CAAC,IAAI,KAAK,SAAS,EAAE;IAChE,OAAO,EAAE,mCAAmC;IAC5C,IAAI,EAAE,CAAC,MAAM,CAAC;CACf,CAAC,CAAC;AAMQ,QAAA,oBAAoB,GAAG,OAAC,CAAC,MAAM,CAAC;IAC3C,KAAK,EAAE,OAAC,CAAC,MAAM,EAAE;IACjB,IAAI,EAAE,OAAC,CAAC,MAAM,EAAE;IAChB,MAAM,EAAE,OAAC,CAAC,MAAM,EAAE;IAClB,OAAO,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC9B,UAAU,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACjC,UAAU,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CAClC,CAAC,CAAC"}
|
|
@@ -1,21 +1,19 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
export declare const
|
|
2
|
+
export declare const ManageWikiSchema: z.ZodObject<{
|
|
3
|
+
action: z.ZodEnum<{
|
|
4
|
+
create: "create";
|
|
5
|
+
update: "update";
|
|
6
|
+
delete: "delete";
|
|
7
|
+
}>;
|
|
3
8
|
namespace: z.ZodString;
|
|
4
|
-
|
|
5
|
-
content: z.ZodString;
|
|
6
|
-
format: z.ZodOptional<z.ZodString>;
|
|
7
|
-
}, z.core.$strip>;
|
|
8
|
-
export declare const UpdateWikiPageSchema: z.ZodObject<{
|
|
9
|
-
namespace: z.ZodString;
|
|
10
|
-
slug: z.ZodString;
|
|
9
|
+
slug: z.ZodOptional<z.ZodString>;
|
|
11
10
|
title: z.ZodOptional<z.ZodString>;
|
|
12
11
|
content: z.ZodOptional<z.ZodString>;
|
|
13
|
-
format: z.ZodOptional<z.
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
12
|
+
format: z.ZodOptional<z.ZodEnum<{
|
|
13
|
+
markdown: "markdown";
|
|
14
|
+
rdoc: "rdoc";
|
|
15
|
+
asciidoc: "asciidoc";
|
|
16
|
+
org: "org";
|
|
17
|
+
}>>;
|
|
18
18
|
}, z.core.$strip>;
|
|
19
|
-
export type
|
|
20
|
-
export type UpdateWikiPageOptions = z.infer<typeof UpdateWikiPageSchema>;
|
|
21
|
-
export type DeleteWikiPageOptions = z.infer<typeof DeleteWikiPageSchema>;
|
|
19
|
+
export type ManageWikiInput = z.infer<typeof ManageWikiSchema>;
|
|
@@ -1,22 +1,35 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.ManageWikiSchema = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
|
-
exports.
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
5
|
+
exports.ManageWikiSchema = zod_1.z
|
|
6
|
+
.object({
|
|
7
|
+
action: zod_1.z.enum(["create", "update", "delete"]).describe("Action to perform"),
|
|
8
|
+
namespace: zod_1.z.string().describe("Namespace path (group or project)"),
|
|
9
|
+
slug: zod_1.z
|
|
10
|
+
.string()
|
|
11
|
+
.optional()
|
|
12
|
+
.describe("URL-encoded slug of the wiki page. Required for 'update' and 'delete' actions."),
|
|
13
|
+
title: zod_1.z.string().optional().describe("Title of the wiki page. Required for 'create' action."),
|
|
14
|
+
content: zod_1.z
|
|
15
|
+
.string()
|
|
16
|
+
.optional()
|
|
17
|
+
.describe("Content of the wiki page. Required for 'create' action."),
|
|
18
|
+
format: zod_1.z
|
|
19
|
+
.enum(["markdown", "rdoc", "asciidoc", "org"])
|
|
20
|
+
.optional()
|
|
21
|
+
.describe("Content format (markdown, rdoc, asciidoc, org). Defaults to markdown."),
|
|
22
|
+
})
|
|
23
|
+
.refine(data => data.action === "create" || data.slug !== undefined, {
|
|
24
|
+
message: "slug is required for 'update' and 'delete' actions",
|
|
25
|
+
path: ["slug"],
|
|
26
|
+
})
|
|
27
|
+
.refine(data => data.action !== "create" || data.title !== undefined, {
|
|
28
|
+
message: "title is required for 'create' action",
|
|
29
|
+
path: ["title"],
|
|
30
|
+
})
|
|
31
|
+
.refine(data => data.action !== "create" || data.content !== undefined, {
|
|
32
|
+
message: "content is required for 'create' action",
|
|
33
|
+
path: ["content"],
|
|
21
34
|
});
|
|
22
35
|
//# sourceMappingURL=schema.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.js","sourceRoot":"","sources":["../../../../src/entities/wiki/schema.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;
|
|
1
|
+
{"version":3,"file":"schema.js","sourceRoot":"","sources":["../../../../src/entities/wiki/schema.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AASX,QAAA,gBAAgB,GAAG,OAAC;KAC9B,MAAM,CAAC;IACN,MAAM,EAAE,OAAC,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE,QAAQ,EAAE,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,mBAAmB,CAAC;IAC5E,SAAS,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,mCAAmC,CAAC;IAEnE,IAAI,EAAE,OAAC;SACJ,MAAM,EAAE;SACR,QAAQ,EAAE;SACV,QAAQ,CAAC,gFAAgF,CAAC;IAE7F,KAAK,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,uDAAuD,CAAC;IAC9F,OAAO,EAAE,OAAC;SACP,MAAM,EAAE;SACR,QAAQ,EAAE;SACV,QAAQ,CAAC,yDAAyD,CAAC;IACtE,MAAM,EAAE,OAAC;SACN,IAAI,CAAC,CAAC,UAAU,EAAE,MAAM,EAAE,UAAU,EAAE,KAAK,CAAC,CAAC;SAC7C,QAAQ,EAAE;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