@crypto512/jicon-mcp 1.3.0 → 2.0.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/README.md +68 -85
- package/TOOL_LIST.md +704 -87
- package/dist/config/constants.d.ts +18 -7
- package/dist/config/constants.d.ts.map +1 -1
- package/dist/config/constants.js +21 -8
- package/dist/config/constants.js.map +1 -1
- package/dist/config/loader.d.ts +11 -11
- package/dist/config/loader.d.ts.map +1 -1
- package/dist/config/loader.js +53 -93
- package/dist/config/loader.js.map +1 -1
- package/dist/config/types.d.ts +3 -6
- package/dist/config/types.d.ts.map +1 -1
- package/dist/config/types.js +2 -4
- package/dist/config/types.js.map +1 -1
- package/dist/confluence/formatters.js +1 -1
- package/dist/confluence/formatters.js.map +1 -1
- package/dist/confluence/tools.d.ts +4 -0
- package/dist/confluence/tools.d.ts.map +1 -1
- package/dist/confluence/tools.js +180 -125
- package/dist/confluence/tools.js.map +1 -1
- package/dist/index.js +17 -26
- package/dist/index.js.map +1 -1
- package/dist/jira/formatters.d.ts +1 -0
- package/dist/jira/formatters.d.ts.map +1 -1
- package/dist/jira/formatters.js +13 -12
- package/dist/jira/formatters.js.map +1 -1
- package/dist/jira/tools.d.ts +4 -0
- package/dist/jira/tools.d.ts.map +1 -1
- package/dist/jira/tools.js +189 -50
- package/dist/jira/tools.js.map +1 -1
- package/dist/permissions/tool-registry.d.ts +2 -2
- package/dist/permissions/tool-registry.d.ts.map +1 -1
- package/dist/permissions/tool-registry.js +4 -2
- package/dist/permissions/tool-registry.js.map +1 -1
- package/dist/permissions/write-home-validator.d.ts.map +1 -1
- package/dist/permissions/write-home-validator.js +13 -3
- package/dist/permissions/write-home-validator.js.map +1 -1
- package/dist/tempo/defaults.d.ts +17 -0
- package/dist/tempo/defaults.d.ts.map +1 -0
- package/dist/tempo/defaults.js +26 -0
- package/dist/tempo/defaults.js.map +1 -0
- package/dist/tempo/tools.d.ts +5 -0
- package/dist/tempo/tools.d.ts.map +1 -1
- package/dist/tempo/tools.js +108 -34
- package/dist/tempo/tools.js.map +1 -1
- package/dist/utils/buffer-pipeline/index.d.ts +30 -0
- package/dist/utils/buffer-pipeline/index.d.ts.map +1 -0
- package/dist/utils/buffer-pipeline/index.js +317 -0
- package/dist/utils/buffer-pipeline/index.js.map +1 -0
- package/dist/utils/buffer-pipeline/output/csv.d.ts +20 -0
- package/dist/utils/buffer-pipeline/output/csv.d.ts.map +1 -0
- package/dist/utils/buffer-pipeline/output/csv.js +117 -0
- package/dist/utils/buffer-pipeline/output/csv.js.map +1 -0
- package/dist/utils/buffer-pipeline/output/json.d.ts +16 -0
- package/dist/utils/buffer-pipeline/output/json.d.ts.map +1 -0
- package/dist/utils/buffer-pipeline/output/json.js +48 -0
- package/dist/utils/buffer-pipeline/output/json.js.map +1 -0
- package/dist/utils/buffer-pipeline/output/markdown.d.ts +15 -0
- package/dist/utils/buffer-pipeline/output/markdown.d.ts.map +1 -0
- package/dist/utils/buffer-pipeline/output/markdown.js +105 -0
- package/dist/utils/buffer-pipeline/output/markdown.js.map +1 -0
- package/dist/utils/buffer-pipeline/output/xhtml-list.d.ts +16 -0
- package/dist/utils/buffer-pipeline/output/xhtml-list.d.ts.map +1 -0
- package/dist/utils/buffer-pipeline/output/xhtml-list.js +81 -0
- package/dist/utils/buffer-pipeline/output/xhtml-list.js.map +1 -0
- package/dist/utils/buffer-pipeline/output/xhtml-table.d.ts +15 -0
- package/dist/utils/buffer-pipeline/output/xhtml-table.d.ts.map +1 -0
- package/dist/utils/buffer-pipeline/output/xhtml-table.js +176 -0
- package/dist/utils/buffer-pipeline/output/xhtml-table.js.map +1 -0
- package/dist/utils/buffer-pipeline/schema.d.ts +1878 -0
- package/dist/utils/buffer-pipeline/schema.d.ts.map +1 -0
- package/dist/utils/buffer-pipeline/schema.js +168 -0
- package/dist/utils/buffer-pipeline/schema.js.map +1 -0
- package/dist/utils/buffer-pipeline/stages/filter.d.ts +32 -0
- package/dist/utils/buffer-pipeline/stages/filter.d.ts.map +1 -0
- package/dist/utils/buffer-pipeline/stages/filter.js +208 -0
- package/dist/utils/buffer-pipeline/stages/filter.js.map +1 -0
- package/dist/utils/buffer-pipeline/stages/format.d.ts +45 -0
- package/dist/utils/buffer-pipeline/stages/format.d.ts.map +1 -0
- package/dist/utils/buffer-pipeline/stages/format.js +160 -0
- package/dist/utils/buffer-pipeline/stages/format.js.map +1 -0
- package/dist/utils/buffer-pipeline/stages/group-by.d.ts +25 -0
- package/dist/utils/buffer-pipeline/stages/group-by.d.ts.map +1 -0
- package/dist/utils/buffer-pipeline/stages/group-by.js +190 -0
- package/dist/utils/buffer-pipeline/stages/group-by.js.map +1 -0
- package/dist/utils/buffer-pipeline/stages/select.d.ts +54 -0
- package/dist/utils/buffer-pipeline/stages/select.d.ts.map +1 -0
- package/dist/utils/buffer-pipeline/stages/select.js +228 -0
- package/dist/utils/buffer-pipeline/stages/select.js.map +1 -0
- package/dist/utils/buffer-pipeline/stages/sort.d.ts +20 -0
- package/dist/utils/buffer-pipeline/stages/sort.d.ts.map +1 -0
- package/dist/utils/buffer-pipeline/stages/sort.js +96 -0
- package/dist/utils/buffer-pipeline/stages/sort.js.map +1 -0
- package/dist/utils/buffer-pipeline/types.d.ts +277 -0
- package/dist/utils/buffer-pipeline/types.d.ts.map +1 -0
- package/dist/utils/buffer-pipeline/types.js +8 -0
- package/dist/utils/buffer-pipeline/types.js.map +1 -0
- package/dist/utils/buffer-tools.d.ts +749 -19
- package/dist/utils/buffer-tools.d.ts.map +1 -1
- package/dist/utils/buffer-tools.js +738 -491
- package/dist/utils/buffer-tools.js.map +1 -1
- package/dist/utils/content-buffer.d.ts +55 -4
- package/dist/utils/content-buffer.d.ts.map +1 -1
- package/dist/utils/content-buffer.js +107 -9
- package/dist/utils/content-buffer.js.map +1 -1
- package/dist/utils/jicon-help.d.ts +1 -1
- package/dist/utils/jicon-help.d.ts.map +1 -1
- package/dist/utils/jicon-help.js +253 -28
- package/dist/utils/jicon-help.js.map +1 -1
- package/dist/utils/json-structure.d.ts +121 -0
- package/dist/utils/json-structure.d.ts.map +1 -0
- package/dist/utils/json-structure.js +637 -0
- package/dist/utils/json-structure.js.map +1 -0
- package/dist/utils/plantuml/include-expander.d.ts +31 -30
- package/dist/utils/plantuml/include-expander.d.ts.map +1 -1
- package/dist/utils/plantuml/include-expander.js +167 -133
- package/dist/utils/plantuml/include-expander.js.map +1 -1
- package/dist/utils/plantuml/index.d.ts +3 -3
- package/dist/utils/plantuml/index.d.ts.map +1 -1
- package/dist/utils/plantuml/index.js +4 -4
- package/dist/utils/plantuml/index.js.map +1 -1
- package/dist/utils/plantuml/service.d.ts +13 -24
- package/dist/utils/plantuml/service.d.ts.map +1 -1
- package/dist/utils/plantuml/service.js +49 -99
- package/dist/utils/plantuml/service.js.map +1 -1
- package/dist/utils/plantuml/tools.d.ts.map +1 -1
- package/dist/utils/plantuml/tools.js +33 -72
- package/dist/utils/plantuml/tools.js.map +1 -1
- package/dist/utils/plantuml/types.d.ts +1 -35
- package/dist/utils/plantuml/types.d.ts.map +1 -1
- package/dist/utils/plantuml/types.js +1 -11
- package/dist/utils/plantuml/types.js.map +1 -1
- package/dist/utils/plantuml/validation-helper.d.ts +1 -1
- package/dist/utils/plantuml/validation-helper.js +12 -12
- package/dist/utils/plantuml/validation-helper.js.map +1 -1
- package/dist/utils/response-formatter.d.ts +61 -6
- package/dist/utils/response-formatter.d.ts.map +1 -1
- package/dist/utils/response-formatter.js +174 -91
- package/dist/utils/response-formatter.js.map +1 -1
- package/dist/utils/url-tools.d.ts.map +1 -1
- package/dist/utils/url-tools.js +22 -0
- package/dist/utils/url-tools.js.map +1 -1
- package/dist/utils/xhtml/error-locator.js +2 -2
- package/dist/utils/xhtml/error-locator.js.map +1 -1
- package/dist/utils/xhtml/index.d.ts +1 -1
- package/dist/utils/xhtml/index.d.ts.map +1 -1
- package/dist/utils/xhtml/index.js +1 -1
- package/dist/utils/xhtml/index.js.map +1 -1
- package/dist/utils/xhtml/parser.d.ts +34 -5
- package/dist/utils/xhtml/parser.d.ts.map +1 -1
- package/dist/utils/xhtml/parser.js +66 -11
- package/dist/utils/xhtml/parser.js.map +1 -1
- package/dist/utils/xhtml/plantuml.d.ts.map +1 -1
- package/dist/utils/xhtml/plantuml.js +5 -3
- package/dist/utils/xhtml/plantuml.js.map +1 -1
- package/dist/utils/xhtml/serializer.d.ts.map +1 -1
- package/dist/utils/xhtml/serializer.js +12 -15
- package/dist/utils/xhtml/serializer.js.map +1 -1
- package/package.json +12 -4
- package/crypto512-jicon-mcp-1.3.0.tgz +0 -0
|
@@ -1,47 +1,48 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* PlantUML Include
|
|
2
|
+
* PlantUML Include Converter
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
* This
|
|
6
|
-
|
|
7
|
-
export declare const ALLOWED_INCLUDE_URLS: string[];
|
|
8
|
-
/**
|
|
9
|
-
* Expand !include directives in PlantUML code
|
|
4
|
+
* Converts !include directives from GitHub URLs to PlantUML stdlib syntax.
|
|
5
|
+
* This enables diagrams to work with PlantUML's built-in standard library
|
|
6
|
+
* without requiring HTTP fetching.
|
|
10
7
|
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
8
|
+
* Example: !include https://raw.githubusercontent.com/plantuml-stdlib/C4-PlantUML/master/C4_Context.puml
|
|
9
|
+
* -> !include <C4/C4_Context>
|
|
13
10
|
*/
|
|
14
|
-
export declare function expandIncludes(code: string, depth?: number): Promise<string>;
|
|
15
11
|
/**
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
* Finds all PlantUML macros in XHTML and expands !include directives
|
|
19
|
-
* in their CDATA content before sending to Confluence.
|
|
12
|
+
* Error thrown when an HTTP include URL cannot be converted to stdlib syntax.
|
|
20
13
|
*/
|
|
21
|
-
export declare
|
|
14
|
+
export declare class IncludeConversionError extends Error {
|
|
15
|
+
readonly url: string;
|
|
16
|
+
readonly suggestion: string;
|
|
17
|
+
constructor(url: string, suggestion: string);
|
|
18
|
+
}
|
|
22
19
|
/**
|
|
23
|
-
*
|
|
20
|
+
* Convert a GitHub URL to PlantUML stdlib syntax if possible.
|
|
21
|
+
* Returns null if the URL doesn't match any known pattern.
|
|
24
22
|
*/
|
|
25
|
-
export declare function
|
|
23
|
+
export declare function urlToStdlib(url: string): string | null;
|
|
26
24
|
/**
|
|
27
|
-
*
|
|
25
|
+
* Find all HTTP include URLs in PlantUML code that cannot be converted.
|
|
26
|
+
* Returns an array of unconvertible URLs.
|
|
28
27
|
*/
|
|
29
|
-
export declare function
|
|
30
|
-
size: number;
|
|
31
|
-
urls: string[];
|
|
32
|
-
};
|
|
28
|
+
export declare function findUnconvertibleIncludes(code: string): string[];
|
|
33
29
|
/**
|
|
34
|
-
*
|
|
30
|
+
* Convert !include directives from GitHub URLs to stdlib syntax.
|
|
31
|
+
* Throws IncludeConversionError if any HTTP URL cannot be converted.
|
|
35
32
|
*
|
|
36
|
-
*
|
|
37
|
-
*
|
|
33
|
+
* @param code - PlantUML code with !include directives
|
|
34
|
+
* @returns PlantUML code with converted includes
|
|
35
|
+
* @throws IncludeConversionError if an HTTP URL cannot be converted
|
|
38
36
|
*/
|
|
39
|
-
export declare function
|
|
37
|
+
export declare function convertIncludes(code: string): string;
|
|
40
38
|
/**
|
|
41
|
-
*
|
|
39
|
+
* Convert PlantUML includes within XHTML content.
|
|
40
|
+
* Throws IncludeConversionError if any HTTP URL cannot be converted.
|
|
41
|
+
*
|
|
42
|
+
* Finds all PlantUML macros in XHTML and converts !include directives
|
|
43
|
+
* in their CDATA content.
|
|
42
44
|
*
|
|
43
|
-
*
|
|
44
|
-
* back to !include directives when reading from Confluence.
|
|
45
|
+
* @throws IncludeConversionError if an HTTP URL cannot be converted
|
|
45
46
|
*/
|
|
46
|
-
export declare function
|
|
47
|
+
export declare function convertPlantUmlIncludesInXhtml(xhtml: string): string;
|
|
47
48
|
//# sourceMappingURL=include-expander.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"include-expander.d.ts","sourceRoot":"","sources":["../../../src/utils/plantuml/include-expander.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"include-expander.d.ts","sourceRoot":"","sources":["../../../src/utils/plantuml/include-expander.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH;;GAEG;AACH,qBAAa,sBAAuB,SAAQ,KAAK;aAE7B,GAAG,EAAE,MAAM;aACX,UAAU,EAAE,MAAM;gBADlB,GAAG,EAAE,MAAM,EACX,UAAU,EAAE,MAAM;CASrC;AAiHD;;;GAGG;AACH,wBAAgB,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAQtD;AAED;;;GAGG;AACH,wBAAgB,yBAAyB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,CAahE;AAED;;;;;;;GAOG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAmBpD;AAED;;;;;;;;GAQG;AACH,wBAAgB,8BAA8B,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CA6BpE"}
|
|
@@ -1,168 +1,202 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* PlantUML Include
|
|
2
|
+
* PlantUML Include Converter
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
* This
|
|
4
|
+
* Converts !include directives from GitHub URLs to PlantUML stdlib syntax.
|
|
5
|
+
* This enables diagrams to work with PlantUML's built-in standard library
|
|
6
|
+
* without requiring HTTP fetching.
|
|
7
|
+
*
|
|
8
|
+
* Example: !include https://raw.githubusercontent.com/plantuml-stdlib/C4-PlantUML/master/C4_Context.puml
|
|
9
|
+
* -> !include <C4/C4_Context>
|
|
6
10
|
*/
|
|
7
|
-
// Whitelisted URL prefixes - only these are allowed
|
|
8
|
-
export const ALLOWED_INCLUDE_URLS = [
|
|
9
|
-
"https://raw.githubusercontent.com/plantuml-stdlib/", // C4, Azure, Kubernetes, etc.
|
|
10
|
-
"https://raw.githubusercontent.com/plantuml/", // Official stdlib
|
|
11
|
-
"https://raw.githubusercontent.com/awslabs/aws-icons-for-plantuml/", // AWS icons
|
|
12
|
-
];
|
|
13
|
-
const MAX_DEPTH = 5; // Maximum recursion depth for nested includes
|
|
14
|
-
const MAX_SIZE = 100_000; // 100KB max per include file
|
|
15
|
-
const FETCH_TIMEOUT = 5000; // 5 second timeout per fetch
|
|
16
|
-
// In-memory cache (cleared on process restart)
|
|
17
|
-
const cache = new Map();
|
|
18
11
|
/**
|
|
19
|
-
*
|
|
12
|
+
* Error thrown when an HTTP include URL cannot be converted to stdlib syntax.
|
|
20
13
|
*/
|
|
21
|
-
|
|
22
|
-
|
|
14
|
+
export class IncludeConversionError extends Error {
|
|
15
|
+
url;
|
|
16
|
+
suggestion;
|
|
17
|
+
constructor(url, suggestion) {
|
|
18
|
+
super(`Cannot convert include URL to stdlib syntax: ${url}\n\n` +
|
|
19
|
+
`The PlantUML server cannot fetch external URLs. You must use PlantUML's built-in stdlib syntax.\n\n` +
|
|
20
|
+
`${suggestion}`);
|
|
21
|
+
this.url = url;
|
|
22
|
+
this.suggestion = suggestion;
|
|
23
|
+
this.name = "IncludeConversionError";
|
|
24
|
+
}
|
|
23
25
|
}
|
|
24
26
|
/**
|
|
25
|
-
*
|
|
27
|
+
* URL pattern to stdlib mapping rules.
|
|
28
|
+
* Order matters - more specific patterns should come first.
|
|
26
29
|
*/
|
|
27
|
-
|
|
28
|
-
//
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
30
|
+
const STDLIB_MAPPINGS = [
|
|
31
|
+
// C4-PlantUML: plantuml-stdlib/C4-PlantUML/*/C4_*.puml -> <C4/C4_*>
|
|
32
|
+
{
|
|
33
|
+
pattern: /^https:\/\/raw\.githubusercontent\.com\/plantuml-stdlib\/C4-PlantUML\/[^/]+\/(.+)\.puml$/,
|
|
34
|
+
transform: (m) => `<C4/${m[1]}>`,
|
|
35
|
+
},
|
|
36
|
+
// AWS Icons (awslabs): awslabs/aws-icons-for-plantuml/*/dist/* -> <awslib/*>
|
|
37
|
+
{
|
|
38
|
+
pattern: /^https:\/\/raw\.githubusercontent\.com\/awslabs\/aws-icons-for-plantuml\/[^/]+\/dist\/(.+)\.puml$/,
|
|
39
|
+
transform: (m) => `<awslib/${m[1]}>`,
|
|
40
|
+
},
|
|
41
|
+
// Azure: plantuml-stdlib/Azure-PlantUML/*/* -> <azure/*>
|
|
42
|
+
{
|
|
43
|
+
pattern: /^https:\/\/raw\.githubusercontent\.com\/plantuml-stdlib\/Azure-PlantUML\/[^/]+\/(.+)\.puml$/,
|
|
44
|
+
transform: (m) => `<azure/${m[1]}>`,
|
|
45
|
+
},
|
|
46
|
+
// Kubernetes: plantuml-stdlib/plantuml-kubernetes-sprites/*/* -> <kubernetes/*>
|
|
47
|
+
{
|
|
48
|
+
pattern: /^https:\/\/raw\.githubusercontent\.com\/plantuml-stdlib\/plantuml-kubernetes-sprites\/[^/]+\/(.+)\.puml$/,
|
|
49
|
+
transform: (m) => `<kubernetes/${m[1]}>`,
|
|
50
|
+
},
|
|
51
|
+
// ArchiMate: plantuml/plantuml-stdlib/master/stdlib/archimate/* -> <archimate/*>
|
|
52
|
+
{
|
|
53
|
+
pattern: /^https:\/\/raw\.githubusercontent\.com\/plantuml\/plantuml-stdlib\/[^/]+\/stdlib\/archimate\/(.+)\.puml$/,
|
|
54
|
+
transform: (m) => `<archimate/${m[1]}>`,
|
|
55
|
+
},
|
|
56
|
+
// Generic plantuml-stdlib libraries (fallback for other stdlib repos)
|
|
57
|
+
{
|
|
58
|
+
pattern: /^https:\/\/raw\.githubusercontent\.com\/plantuml-stdlib\/([^/]+)\/[^/]+\/(.+)\.puml$/,
|
|
59
|
+
transform: (m) => {
|
|
60
|
+
// Map known library names to their stdlib equivalents
|
|
61
|
+
const libMap = {
|
|
62
|
+
"Cloudogu-Icons": "cloudogu",
|
|
63
|
+
"EIP-PlantUML": "eip",
|
|
64
|
+
"gilbarbara-plantuml-sprites": "logos",
|
|
65
|
+
"tupadr3-plantuml-sprites": "tupadr3",
|
|
66
|
+
"office-plantuml": "office",
|
|
67
|
+
};
|
|
68
|
+
const lib = libMap[m[1]] || m[1].toLowerCase();
|
|
69
|
+
return `<${lib}/${m[2]}>`;
|
|
70
|
+
},
|
|
71
|
+
},
|
|
72
|
+
];
|
|
46
73
|
/**
|
|
47
|
-
*
|
|
48
|
-
*
|
|
49
|
-
* Only expands URLs that match the whitelist.
|
|
50
|
-
* Recursively expands nested includes up to MAX_DEPTH.
|
|
74
|
+
* Generate a helpful suggestion for fixing an unconvertible include URL.
|
|
51
75
|
*/
|
|
52
|
-
|
|
53
|
-
//
|
|
54
|
-
if (
|
|
55
|
-
return
|
|
76
|
+
function getSuggestionForUrl(url) {
|
|
77
|
+
// Check if it looks like a known library but wrong format
|
|
78
|
+
if (url.includes("C4-PlantUML") || url.includes("C4_")) {
|
|
79
|
+
return (`For C4 diagrams, use the stdlib syntax:\n` +
|
|
80
|
+
` !include <C4/C4_Context>\n` +
|
|
81
|
+
` !include <C4/C4_Container>\n` +
|
|
82
|
+
` !include <C4/C4_Component>\n` +
|
|
83
|
+
` !include <C4/C4_Deployment>\n` +
|
|
84
|
+
` !include <C4/C4_Dynamic>`);
|
|
56
85
|
}
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
86
|
+
if (url.includes("aws-icons") || url.includes("awslabs")) {
|
|
87
|
+
return (`For AWS diagrams, use the stdlib syntax:\n` +
|
|
88
|
+
` !include <awslib/AWSCommon>\n` +
|
|
89
|
+
` !include <awslib/AWSSimplified>\n` +
|
|
90
|
+
` !include <awslib/Compute/EC2>\n` +
|
|
91
|
+
` !include <awslib/Storage/SimpleStorageService>`);
|
|
62
92
|
}
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
continue;
|
|
69
|
-
}
|
|
70
|
-
try {
|
|
71
|
-
const content = await fetchInclude(url);
|
|
72
|
-
// Recursively expand nested includes
|
|
73
|
-
const expanded = await expandIncludes(content, depth + 1);
|
|
74
|
-
// Wrap expanded content in comments with original include line preserved
|
|
75
|
-
// This allows easy removal by deleting from opening to closing comment
|
|
76
|
-
const wrapped = `${indent}' <<<< EXPANDED: ${directive} ${url}\n${expanded}\n${indent}' >>>> END EXPANDED`;
|
|
77
|
-
result = result.replace(fullMatch, wrapped);
|
|
78
|
-
}
|
|
79
|
-
catch (error) {
|
|
80
|
-
// Re-throw with context
|
|
81
|
-
const message = error instanceof Error ? error.message : String(error);
|
|
82
|
-
throw new Error(`Failed to expand include: ${message}`);
|
|
83
|
-
}
|
|
93
|
+
if (url.includes("Azure") || url.includes("azure")) {
|
|
94
|
+
return (`For Azure diagrams, use the stdlib syntax:\n` +
|
|
95
|
+
` !include <azure/AzureCommon>\n` +
|
|
96
|
+
` !include <azure/Compute/VirtualMachine>\n` +
|
|
97
|
+
` !include <azure/Storage/StorageAccounts>`);
|
|
84
98
|
}
|
|
85
|
-
|
|
99
|
+
if (url.includes("kubernetes") || url.includes("k8s")) {
|
|
100
|
+
return (`For Kubernetes diagrams, use the stdlib syntax:\n` +
|
|
101
|
+
` !include <kubernetes/k8s>`);
|
|
102
|
+
}
|
|
103
|
+
// Generic suggestion
|
|
104
|
+
return (`Supported stdlib libraries:\n` +
|
|
105
|
+
` - C4: !include <C4/C4_Context>\n` +
|
|
106
|
+
` - AWS: !include <awslib/AWSCommon>\n` +
|
|
107
|
+
` - Azure: !include <azure/AzureCommon>\n` +
|
|
108
|
+
` - Kubernetes: !include <kubernetes/k8s>\n` +
|
|
109
|
+
` - ArchiMate: !include <archimate/Archimate>\n\n` +
|
|
110
|
+
`If you need a custom library, you must inline the definitions directly in your diagram.`);
|
|
86
111
|
}
|
|
87
112
|
/**
|
|
88
|
-
*
|
|
89
|
-
*
|
|
90
|
-
* Finds all PlantUML macros in XHTML and expands !include directives
|
|
91
|
-
* in their CDATA content before sending to Confluence.
|
|
113
|
+
* Convert a GitHub URL to PlantUML stdlib syntax if possible.
|
|
114
|
+
* Returns null if the URL doesn't match any known pattern.
|
|
92
115
|
*/
|
|
93
|
-
export
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
return xhtml;
|
|
99
|
-
}
|
|
100
|
-
let result = xhtml;
|
|
101
|
-
for (const match of matches) {
|
|
102
|
-
const [fullMatch, prefix, code, suffix] = match;
|
|
103
|
-
// Only process if contains !include or !includeurl
|
|
104
|
-
if (code.includes("!include")) { // matches both !include and !includeurl
|
|
105
|
-
try {
|
|
106
|
-
const expanded = await expandIncludes(code);
|
|
107
|
-
result = result.replace(fullMatch, prefix + expanded + suffix);
|
|
108
|
-
}
|
|
109
|
-
catch (error) {
|
|
110
|
-
// Log error but don't fail - let Confluence show the error
|
|
111
|
-
console.error("PlantUML include expansion failed:", error);
|
|
112
|
-
}
|
|
116
|
+
export function urlToStdlib(url) {
|
|
117
|
+
for (const mapping of STDLIB_MAPPINGS) {
|
|
118
|
+
const match = url.match(mapping.pattern);
|
|
119
|
+
if (match) {
|
|
120
|
+
return mapping.transform(match);
|
|
113
121
|
}
|
|
114
122
|
}
|
|
115
|
-
return
|
|
123
|
+
return null;
|
|
116
124
|
}
|
|
117
125
|
/**
|
|
118
|
-
*
|
|
126
|
+
* Find all HTTP include URLs in PlantUML code that cannot be converted.
|
|
127
|
+
* Returns an array of unconvertible URLs.
|
|
119
128
|
*/
|
|
120
|
-
export function
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
129
|
+
export function findUnconvertibleIncludes(code) {
|
|
130
|
+
const includePattern = /^(\s*)(!include(?:url)?)\s+(https?:\/\/\S+)/gm;
|
|
131
|
+
const unconvertible = [];
|
|
132
|
+
let match;
|
|
133
|
+
while ((match = includePattern.exec(code)) !== null) {
|
|
134
|
+
const url = match[3];
|
|
135
|
+
if (urlToStdlib(url) === null) {
|
|
136
|
+
unconvertible.push(url);
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
return unconvertible;
|
|
131
140
|
}
|
|
132
141
|
/**
|
|
133
|
-
*
|
|
142
|
+
* Convert !include directives from GitHub URLs to stdlib syntax.
|
|
143
|
+
* Throws IncludeConversionError if any HTTP URL cannot be converted.
|
|
134
144
|
*
|
|
135
|
-
*
|
|
136
|
-
*
|
|
145
|
+
* @param code - PlantUML code with !include directives
|
|
146
|
+
* @returns PlantUML code with converted includes
|
|
147
|
+
* @throws IncludeConversionError if an HTTP URL cannot be converted
|
|
137
148
|
*/
|
|
138
|
-
export function
|
|
139
|
-
//
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
149
|
+
export function convertIncludes(code) {
|
|
150
|
+
// First, check for unconvertible URLs
|
|
151
|
+
const unconvertible = findUnconvertibleIncludes(code);
|
|
152
|
+
if (unconvertible.length > 0) {
|
|
153
|
+
const url = unconvertible[0];
|
|
154
|
+
throw new IncludeConversionError(url, getSuggestionForUrl(url));
|
|
155
|
+
}
|
|
156
|
+
// All URLs are convertible, proceed with conversion
|
|
157
|
+
const includePattern = /^(\s*)(!include(?:url)?)\s+(https?:\/\/\S+)/gm;
|
|
158
|
+
return code.replace(includePattern, (fullMatch, indent, _directive, url) => {
|
|
159
|
+
const stdlibPath = urlToStdlib(url);
|
|
160
|
+
if (stdlibPath) {
|
|
161
|
+
return `${indent}!include ${stdlibPath}`;
|
|
162
|
+
}
|
|
163
|
+
// This shouldn't happen since we checked above, but keep for safety
|
|
164
|
+
return fullMatch;
|
|
165
|
+
});
|
|
143
166
|
}
|
|
144
167
|
/**
|
|
145
|
-
*
|
|
168
|
+
* Convert PlantUML includes within XHTML content.
|
|
169
|
+
* Throws IncludeConversionError if any HTTP URL cannot be converted.
|
|
170
|
+
*
|
|
171
|
+
* Finds all PlantUML macros in XHTML and converts !include directives
|
|
172
|
+
* in their CDATA content.
|
|
146
173
|
*
|
|
147
|
-
*
|
|
148
|
-
* back to !include directives when reading from Confluence.
|
|
174
|
+
* @throws IncludeConversionError if an HTTP URL cannot be converted
|
|
149
175
|
*/
|
|
150
|
-
export function
|
|
176
|
+
export function convertPlantUmlIncludesInXhtml(xhtml) {
|
|
151
177
|
// Match PlantUML macro CDATA content
|
|
152
178
|
const macroPattern = /(<ac:plain-text-body><!\[CDATA\[)([\s\S]*?)(\]\]><\/ac:plain-text-body>)/g;
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
result = result.replace(fullMatch, prefix + collapsed + suffix);
|
|
179
|
+
// First pass: check for unconvertible includes in all macros
|
|
180
|
+
let match;
|
|
181
|
+
while ((match = macroPattern.exec(xhtml)) !== null) {
|
|
182
|
+
const code = match[2];
|
|
183
|
+
if (code.includes("!include") && code.includes("http")) {
|
|
184
|
+
const unconvertible = findUnconvertibleIncludes(code);
|
|
185
|
+
if (unconvertible.length > 0) {
|
|
186
|
+
const url = unconvertible[0];
|
|
187
|
+
throw new IncludeConversionError(url, getSuggestionForUrl(url));
|
|
188
|
+
}
|
|
164
189
|
}
|
|
165
190
|
}
|
|
166
|
-
|
|
191
|
+
// Reset regex for second pass
|
|
192
|
+
macroPattern.lastIndex = 0;
|
|
193
|
+
// Second pass: convert all includes
|
|
194
|
+
return xhtml.replace(macroPattern, (fullMatch, prefix, code, suffix) => {
|
|
195
|
+
if (code.includes("!include") && code.includes("http")) {
|
|
196
|
+
const converted = convertIncludes(code);
|
|
197
|
+
return prefix + converted + suffix;
|
|
198
|
+
}
|
|
199
|
+
return fullMatch;
|
|
200
|
+
});
|
|
167
201
|
}
|
|
168
202
|
//# sourceMappingURL=include-expander.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"include-expander.js","sourceRoot":"","sources":["../../../src/utils/plantuml/include-expander.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"include-expander.js","sourceRoot":"","sources":["../../../src/utils/plantuml/include-expander.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH;;GAEG;AACH,MAAM,OAAO,sBAAuB,SAAQ,KAAK;IAE7B;IACA;IAFlB,YACkB,GAAW,EACX,UAAkB;QAElC,KAAK,CACH,gDAAgD,GAAG,MAAM;YACvD,qGAAqG;YACrG,GAAG,UAAU,EAAE,CAClB,CAAC;QAPc,QAAG,GAAH,GAAG,CAAQ;QACX,eAAU,GAAV,UAAU,CAAQ;QAOlC,IAAI,CAAC,IAAI,GAAG,wBAAwB,CAAC;IACvC,CAAC;CACF;AAED;;;GAGG;AACH,MAAM,eAAe,GAGhB;IACH,oEAAoE;IACpE;QACE,OAAO,EACL,0FAA0F;QAC5F,SAAS,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,GAAG;KACjC;IACD,6EAA6E;IAC7E;QACE,OAAO,EACL,mGAAmG;QACrG,SAAS,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,GAAG;KACrC;IACD,yDAAyD;IACzD;QACE,OAAO,EACL,6FAA6F;QAC/F,SAAS,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,GAAG;KACpC;IACD,gFAAgF;IAChF;QACE,OAAO,EACL,0GAA0G;QAC5G,SAAS,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,GAAG;KACzC;IACD,iFAAiF;IACjF;QACE,OAAO,EAC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AAI,sBAAsB,CAAC,GAAG,EAAE,mBAAmB,CAAC,GAAG,CAAC,CAAC,CAAC;YAClE,CAAC;QACH,CAAC;IACH,CAAC;IAED,8BAA8B;IAC9B,YAAY,CAAC,SAAS,GAAG,CAAC,CAAC;IAE3B,oCAAoC;IACpC,OAAO,KAAK,CAAC,OAAO,CAAC,YAAY,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE;QACrE,IAAI,IAAI,CAAC,QAAQ,CAAC,UAAU,CAAC,IAAI,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC;YACvD,MAAM,SAAS,GAAG,eAAe,CAAC,IAAI,CAAC,CAAC;YACxC,OAAO,MAAM,GAAG,SAAS,GAAG,MAAM,CAAC;QACrC,CAAC;QACD,OAAO,SAAS,CAAC;IACnB,CAAC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* PlantUML Module Exports
|
|
3
3
|
*
|
|
4
|
-
*
|
|
4
|
+
* PlantUML validation and rendering service using external PlantUML server.
|
|
5
5
|
*/
|
|
6
6
|
export * from "./types.js";
|
|
7
|
-
export { validate, render, isAvailable, getStatus, shutdown,
|
|
8
|
-
export {
|
|
7
|
+
export { validate, render, isAvailable, getStatus, shutdown, normalizePlantUml, detectDiagramType, initializePlantUml, getUnavailableReason, convertPlantUmlIncludesInXhtml, } from "./service.js";
|
|
8
|
+
export { IncludeConversionError } from "./include-expander.js";
|
|
9
9
|
export { PlantUmlClient, encodePlantUml } from "./client.js";
|
|
10
10
|
export { createPlantUmlTools, PLANTUML_TOOLS } from "./tools.js";
|
|
11
11
|
export { validatePlantUmlWithFallback, type PlantUmlValidation, type PlantUmlValidationResult, type PlantUmlValidationError, } from "./validation-helper.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utils/plantuml/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,cAAc,YAAY,CAAC;AAG3B,OAAO,EACL,QAAQ,EACR,MAAM,EACN,WAAW,EACX,SAAS,EACT,QAAQ,EACR,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utils/plantuml/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,cAAc,YAAY,CAAC;AAG3B,OAAO,EACL,QAAQ,EACR,MAAM,EACN,WAAW,EACX,SAAS,EACT,QAAQ,EACR,iBAAiB,EACjB,iBAAiB,EACjB,kBAAkB,EAClB,oBAAoB,EACpB,8BAA8B,GAC/B,MAAM,cAAc,CAAC;AAGtB,OAAO,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AAG/D,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAG7D,OAAO,EAAE,mBAAmB,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAGjE,OAAO,EACL,4BAA4B,EAC5B,KAAK,kBAAkB,EACvB,KAAK,wBAAwB,EAC7B,KAAK,uBAAuB,GAC7B,MAAM,wBAAwB,CAAC"}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* PlantUML Module Exports
|
|
3
3
|
*
|
|
4
|
-
*
|
|
4
|
+
* PlantUML validation and rendering service using external PlantUML server.
|
|
5
5
|
*/
|
|
6
6
|
// Types
|
|
7
7
|
export * from "./types.js";
|
|
8
8
|
// Service (main API)
|
|
9
|
-
export { validate, render, isAvailable, getStatus, shutdown,
|
|
10
|
-
//
|
|
11
|
-
export {
|
|
9
|
+
export { validate, render, isAvailable, getStatus, shutdown, normalizePlantUml, detectDiagramType, initializePlantUml, getUnavailableReason, convertPlantUmlIncludesInXhtml, } from "./service.js";
|
|
10
|
+
// Include converter error (for error handling in tools)
|
|
11
|
+
export { IncludeConversionError } from "./include-expander.js";
|
|
12
12
|
// HTTP client (for direct access if needed)
|
|
13
13
|
export { PlantUmlClient, encodePlantUml } from "./client.js";
|
|
14
14
|
// MCP Tools
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/utils/plantuml/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,QAAQ;AACR,cAAc,YAAY,CAAC;AAE3B,qBAAqB;AACrB,OAAO,EACL,QAAQ,EACR,MAAM,EACN,WAAW,EACX,SAAS,EACT,QAAQ,EACR,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/utils/plantuml/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,QAAQ;AACR,cAAc,YAAY,CAAC;AAE3B,qBAAqB;AACrB,OAAO,EACL,QAAQ,EACR,MAAM,EACN,WAAW,EACX,SAAS,EACT,QAAQ,EACR,iBAAiB,EACjB,iBAAiB,EACjB,kBAAkB,EAClB,oBAAoB,EACpB,8BAA8B,GAC/B,MAAM,cAAc,CAAC;AAEtB,wDAAwD;AACxD,OAAO,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AAE/D,4CAA4C;AAC5C,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAE7D,YAAY;AACZ,OAAO,EAAE,mBAAmB,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAEjE,0CAA0C;AAC1C,OAAO,EACL,4BAA4B,GAI7B,MAAM,wBAAwB,CAAC"}
|
|
@@ -2,29 +2,21 @@
|
|
|
2
2
|
* PlantUML Service
|
|
3
3
|
*
|
|
4
4
|
* Unified service facade for PlantUML operations.
|
|
5
|
-
*
|
|
6
|
-
* Does NOT auto-restart if container dies - requires MCP restart.
|
|
5
|
+
* Connects to an external PlantUML server configured via JICON_PLANTUML_SERVER_URL.
|
|
7
6
|
*/
|
|
8
7
|
import { normalizePlantUml, detectDiagramType } from "./client.js";
|
|
9
|
-
import type {
|
|
8
|
+
import type { PlantUmlValidationResult, PlantUmlRenderResult, RenderFormat } from "./types.js";
|
|
10
9
|
/**
|
|
11
|
-
*
|
|
12
|
-
|
|
13
|
-
export declare function configure(config: PlantUmlConfig & {
|
|
14
|
-
includeExpansion?: boolean;
|
|
15
|
-
}): void;
|
|
16
|
-
/**
|
|
17
|
-
* Initialize PlantUML service at MCP startup.
|
|
18
|
-
* Returns success/failure status. Does not throw.
|
|
10
|
+
* Initialize PlantUML service with external server URL.
|
|
11
|
+
* Called at MCP startup.
|
|
19
12
|
*/
|
|
20
13
|
export declare function initializePlantUml(options?: {
|
|
21
|
-
|
|
14
|
+
serverUrl?: string;
|
|
22
15
|
}): Promise<{
|
|
23
16
|
success: boolean;
|
|
24
17
|
disabled?: boolean;
|
|
25
18
|
error?: string;
|
|
26
|
-
|
|
27
|
-
port?: number;
|
|
19
|
+
serverUrl?: string;
|
|
28
20
|
}>;
|
|
29
21
|
/**
|
|
30
22
|
* Check if PlantUML service can be used.
|
|
@@ -33,16 +25,16 @@ export declare function initializePlantUml(options?: {
|
|
|
33
25
|
export declare function getUnavailableReason(): string | null;
|
|
34
26
|
/**
|
|
35
27
|
* Validate PlantUML syntax
|
|
36
|
-
*
|
|
28
|
+
* Converts !include URLs to stdlib syntax for validation but returns original code
|
|
37
29
|
*/
|
|
38
30
|
export declare function validate(code: string): Promise<PlantUmlValidationResult>;
|
|
39
31
|
/**
|
|
40
32
|
* Render PlantUML diagram to specified format
|
|
41
|
-
*
|
|
33
|
+
* Converts !include URLs to stdlib syntax before rendering
|
|
42
34
|
*/
|
|
43
35
|
export declare function render(code: string, format: RenderFormat): Promise<PlantUmlRenderResult>;
|
|
44
36
|
/**
|
|
45
|
-
* Check if PlantUML service is available
|
|
37
|
+
* Check if PlantUML service is available
|
|
46
38
|
*/
|
|
47
39
|
export declare function isAvailable(): boolean;
|
|
48
40
|
/**
|
|
@@ -51,20 +43,17 @@ export declare function isAvailable(): boolean;
|
|
|
51
43
|
export declare function getStatus(): {
|
|
52
44
|
available: boolean;
|
|
53
45
|
disabled?: boolean;
|
|
54
|
-
|
|
55
|
-
containerDied?: boolean;
|
|
46
|
+
serverDied?: boolean;
|
|
56
47
|
error?: string;
|
|
57
|
-
|
|
58
|
-
port?: number;
|
|
59
|
-
baseUrl?: string;
|
|
48
|
+
serverUrl?: string;
|
|
60
49
|
};
|
|
61
50
|
/**
|
|
62
|
-
* Shutdown the PlantUML service (
|
|
51
|
+
* Shutdown the PlantUML service (cleanup client)
|
|
63
52
|
*/
|
|
64
53
|
export declare function shutdown(): Promise<void>;
|
|
65
54
|
/**
|
|
66
55
|
* Re-export utility functions for convenience
|
|
67
56
|
*/
|
|
68
57
|
export { normalizePlantUml, detectDiagramType };
|
|
69
|
-
export {
|
|
58
|
+
export { convertPlantUmlIncludesInXhtml } from "./include-expander.js";
|
|
70
59
|
//# sourceMappingURL=service.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"service.d.ts","sourceRoot":"","sources":["../../../src/utils/plantuml/service.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"service.d.ts","sourceRoot":"","sources":["../../../src/utils/plantuml/service.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAkB,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAEnF,OAAO,KAAK,EACV,wBAAwB,EACxB,oBAAoB,EACpB,YAAY,EACb,MAAM,YAAY,CAAC;AAkBpB;;;GAGG;AACH,wBAAsB,kBAAkB,CAAC,OAAO,GAAE;IAAE,SAAS,CAAC,EAAE,MAAM,CAAA;CAAO,GAAG,OAAO,CAAC;IACtF,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC,CAYD;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,IAAI,MAAM,GAAG,IAAI,CAQpD;AAsCD;;;GAGG;AACH,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