@mcp-graph-workflow/mcp-graph 5.31.1 → 5.33.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.
Files changed (152) hide show
  1. package/README.md +1 -1
  2. package/dist/api/router.d.ts.map +1 -1
  3. package/dist/api/router.js +2 -0
  4. package/dist/api/router.js.map +1 -1
  5. package/dist/api/routes/davinci.d.ts +3 -0
  6. package/dist/api/routes/davinci.d.ts.map +1 -0
  7. package/dist/api/routes/davinci.js +188 -0
  8. package/dist/api/routes/davinci.js.map +1 -0
  9. package/dist/api/routes/translation-project.js +2 -2
  10. package/dist/api/routes/translation-project.js.map +1 -1
  11. package/dist/api/routes/translation.js +2 -2
  12. package/dist/api/routes/translation.js.map +1 -1
  13. package/dist/core/davinci/build-runner.d.ts +37 -0
  14. package/dist/core/davinci/build-runner.d.ts.map +1 -0
  15. package/dist/core/davinci/build-runner.js +239 -0
  16. package/dist/core/davinci/build-runner.js.map +1 -0
  17. package/dist/core/davinci/davinci-parser.d.ts +6 -0
  18. package/dist/core/davinci/davinci-parser.d.ts.map +1 -0
  19. package/dist/core/davinci/davinci-parser.js +218 -0
  20. package/dist/core/davinci/davinci-parser.js.map +1 -0
  21. package/dist/core/davinci/davinci-store.d.ts +49 -0
  22. package/dist/core/davinci/davinci-store.d.ts.map +1 -0
  23. package/dist/core/davinci/davinci-store.js +121 -0
  24. package/dist/core/davinci/davinci-store.js.map +1 -0
  25. package/dist/core/davinci/davinci-types.d.ts +241 -0
  26. package/dist/core/davinci/davinci-types.d.ts.map +1 -0
  27. package/dist/core/davinci/davinci-types.js +123 -0
  28. package/dist/core/davinci/davinci-types.js.map +1 -0
  29. package/dist/core/davinci/davinci-validators.d.ts +16 -0
  30. package/dist/core/davinci/davinci-validators.d.ts.map +1 -0
  31. package/dist/core/davinci/davinci-validators.js +86 -0
  32. package/dist/core/davinci/davinci-validators.js.map +1 -0
  33. package/dist/core/davinci/descriptor-generator.d.ts +19 -0
  34. package/dist/core/davinci/descriptor-generator.d.ts.map +1 -0
  35. package/dist/core/davinci/descriptor-generator.js +52 -0
  36. package/dist/core/davinci/descriptor-generator.js.map +1 -0
  37. package/dist/core/davinci/plugin-generator.d.ts +29 -0
  38. package/dist/core/davinci/plugin-generator.d.ts.map +1 -0
  39. package/dist/core/davinci/plugin-generator.js +86 -0
  40. package/dist/core/davinci/plugin-generator.js.map +1 -0
  41. package/dist/core/davinci/plugin-type-detector.d.ts +15 -0
  42. package/dist/core/davinci/plugin-type-detector.d.ts.map +1 -0
  43. package/dist/core/davinci/plugin-type-detector.js +114 -0
  44. package/dist/core/davinci/plugin-type-detector.js.map +1 -0
  45. package/dist/core/davinci/pom-generator.d.ts +4 -0
  46. package/dist/core/davinci/pom-generator.d.ts.map +1 -0
  47. package/dist/core/davinci/pom-generator.js +179 -0
  48. package/dist/core/davinci/pom-generator.js.map +1 -0
  49. package/dist/core/davinci/template-registry.d.ts +25 -0
  50. package/dist/core/davinci/template-registry.d.ts.map +1 -0
  51. package/dist/core/davinci/template-registry.js +280 -0
  52. package/dist/core/davinci/template-registry.js.map +1 -0
  53. package/dist/core/davinci/variable-resolver.d.ts +9 -0
  54. package/dist/core/davinci/variable-resolver.d.ts.map +1 -0
  55. package/dist/core/davinci/variable-resolver.js +62 -0
  56. package/dist/core/davinci/variable-resolver.js.map +1 -0
  57. package/dist/core/parser/read-swagger.d.ts.map +1 -1
  58. package/dist/core/parser/read-swagger.js +6 -0
  59. package/dist/core/parser/read-swagger.js.map +1 -1
  60. package/dist/core/siebel/sif-parser.d.ts.map +1 -1
  61. package/dist/core/siebel/sif-parser.js +6 -0
  62. package/dist/core/siebel/sif-parser.js.map +1 -1
  63. package/dist/core/siebel/wsdl-parser.d.ts.map +1 -1
  64. package/dist/core/siebel/wsdl-parser.js +6 -0
  65. package/dist/core/siebel/wsdl-parser.js.map +1 -1
  66. package/dist/core/translation/generators/ast-placeholder-extractor.d.ts +20 -0
  67. package/dist/core/translation/generators/ast-placeholder-extractor.d.ts.map +1 -0
  68. package/dist/core/translation/generators/ast-placeholder-extractor.js +215 -0
  69. package/dist/core/translation/generators/ast-placeholder-extractor.js.map +1 -0
  70. package/dist/core/translation/generators/placeholder-resolver.d.ts +18 -0
  71. package/dist/core/translation/generators/placeholder-resolver.d.ts.map +1 -0
  72. package/dist/core/translation/generators/placeholder-resolver.js +487 -0
  73. package/dist/core/translation/generators/placeholder-resolver.js.map +1 -0
  74. package/dist/core/translation/generators/source-text-extractor.d.ts +20 -0
  75. package/dist/core/translation/generators/source-text-extractor.d.ts.map +1 -0
  76. package/dist/core/translation/generators/source-text-extractor.js +190 -0
  77. package/dist/core/translation/generators/source-text-extractor.js.map +1 -0
  78. package/dist/core/translation/generators/universal-generator.d.ts +23 -0
  79. package/dist/core/translation/generators/universal-generator.d.ts.map +1 -0
  80. package/dist/core/translation/generators/universal-generator.js +315 -0
  81. package/dist/core/translation/generators/universal-generator.js.map +1 -0
  82. package/dist/core/translation/language-detect.d.ts.map +1 -1
  83. package/dist/core/translation/language-detect.js +37 -14
  84. package/dist/core/translation/language-detect.js.map +1 -1
  85. package/dist/core/translation/parsers/parser-adapter.d.ts +4 -0
  86. package/dist/core/translation/parsers/parser-adapter.d.ts.map +1 -1
  87. package/dist/core/translation/project-translation-orchestrator.d.ts +3 -3
  88. package/dist/core/translation/project-translation-orchestrator.d.ts.map +1 -1
  89. package/dist/core/translation/project-translation-orchestrator.js +4 -4
  90. package/dist/core/translation/project-translation-orchestrator.js.map +1 -1
  91. package/dist/core/translation/prompt-builder.d.ts +4 -0
  92. package/dist/core/translation/prompt-builder.d.ts.map +1 -1
  93. package/dist/core/translation/prompt-builder.js +13 -3
  94. package/dist/core/translation/prompt-builder.js.map +1 -1
  95. package/dist/core/translation/translation-orchestrator.d.ts +2 -1
  96. package/dist/core/translation/translation-orchestrator.d.ts.map +1 -1
  97. package/dist/core/translation/translation-orchestrator.js +21 -2
  98. package/dist/core/translation/translation-orchestrator.js.map +1 -1
  99. package/dist/docs-manifest.json +64 -2
  100. package/dist/mcp/app-factory.js +1 -1
  101. package/dist/mcp/app-factory.js.map +1 -1
  102. package/dist/mcp/tools/davinci-analyze.d.ts +4 -0
  103. package/dist/mcp/tools/davinci-analyze.d.ts.map +1 -0
  104. package/dist/mcp/tools/davinci-analyze.js +31 -0
  105. package/dist/mcp/tools/davinci-analyze.js.map +1 -0
  106. package/dist/mcp/tools/davinci-build.d.ts +4 -0
  107. package/dist/mcp/tools/davinci-build.d.ts.map +1 -0
  108. package/dist/mcp/tools/davinci-build.js +43 -0
  109. package/dist/mcp/tools/davinci-build.js.map +1 -0
  110. package/dist/mcp/tools/davinci-convert.d.ts +4 -0
  111. package/dist/mcp/tools/davinci-convert.d.ts.map +1 -0
  112. package/dist/mcp/tools/davinci-convert.js +61 -0
  113. package/dist/mcp/tools/davinci-convert.js.map +1 -0
  114. package/dist/mcp/tools/index.d.ts.map +1 -1
  115. package/dist/mcp/tools/index.js +8 -0
  116. package/dist/mcp/tools/index.js.map +1 -1
  117. package/dist/mcp/tools/translate-code.js +1 -1
  118. package/dist/mcp/tools/translate-code.js.map +1 -1
  119. package/dist/web/dashboard/dist/assets/{benchmark-tab-GHO9Ji5M.js → benchmark-tab-BezNQCQh.js} +1 -1
  120. package/dist/web/dashboard/dist/assets/{circle-alert-CfDAmNcO.js → circle-alert-DKsqBTgC.js} +1 -1
  121. package/dist/web/dashboard/dist/assets/{context-tab-B_6B65lw.js → context-tab-Cmar9i-X.js} +1 -1
  122. package/dist/web/dashboard/dist/assets/davinci-tab-CkWYkDsy.js +10 -0
  123. package/dist/web/dashboard/dist/assets/{docs-tab-Dq7rtZol.js → docs-tab-CYpDJ3Rl.js} +1 -1
  124. package/dist/web/dashboard/dist/assets/file-code-B0t0xVTk.js +11 -0
  125. package/dist/web/dashboard/dist/assets/{gitnexus-tab-DAPpyAe_.js → gitnexus-tab-COEhhMeC.js} +1 -1
  126. package/dist/web/dashboard/dist/assets/{graph-section-O0mwo9kz.js → graph-section-CheOuwv_.js} +1 -1
  127. package/dist/web/dashboard/dist/assets/{graph-tab-CAx8lu7Z.js → graph-tab-B52UV5KP.js} +1 -1
  128. package/dist/web/dashboard/dist/assets/{graph-utils-BwdXFM9h.js → graph-utils-D5HpaYbf.js} +1 -1
  129. package/dist/web/dashboard/dist/assets/{index-f0wNMEe_.js → index--SYA0Gq0.js} +1 -1
  130. package/dist/web/dashboard/dist/assets/index-BcMjWikL.css +1 -0
  131. package/dist/web/dashboard/dist/assets/{index-BxYtgAYc.js → index-DFMBuNWV.js} +1 -1
  132. package/dist/web/dashboard/dist/assets/{index-D_SBClB-.js → index-DdenFaJ5.js} +24 -19
  133. package/dist/web/dashboard/dist/assets/{insights-tab-DfH4O_Gj.js → insights-tab-sPgv-iwt.js} +1 -1
  134. package/dist/web/dashboard/dist/assets/{journey-tab-D2_EXArZ.js → journey-tab-CS416bwg.js} +1 -1
  135. package/dist/web/dashboard/dist/assets/languages-tab-CcB_s-Ic.js +108 -0
  136. package/dist/web/dashboard/dist/assets/{loader-circle-D5Z5DuF4.js → loader-circle-BSNUICqd.js} +1 -1
  137. package/dist/web/dashboard/dist/assets/{logs-tab-DwVCJxNs.js → logs-tab-BbDXtvmz.js} +1 -1
  138. package/dist/web/dashboard/dist/assets/{lsp-tab-D_3asNom.js → lsp-tab-BrytF6mP.js} +3 -3
  139. package/dist/web/dashboard/dist/assets/{memories-tab-BVe3nUf6.js → memories-tab-qCFdXJIV.js} +1 -1
  140. package/dist/web/dashboard/dist/assets/{prd-backlog-tab-DmeNjNES.js → prd-backlog-tab-BiNvyICT.js} +1 -1
  141. package/dist/web/dashboard/dist/assets/{refresh-cw-dY_ihv6e.js → refresh-cw-CqVWFFCW.js} +1 -1
  142. package/dist/web/dashboard/dist/assets/{siebel-tab-CUO3fUiF.js → siebel-tab-DFNHIBbS.js} +3 -3
  143. package/dist/web/dashboard/dist/assets/{sif-parse.worker-DZrybOHz.js → sif-parse.worker-Cty_N-lP.js} +3 -3
  144. package/dist/web/dashboard/dist/assets/{skills-tab-lUKwXrZi.js → skills-tab-DlInZCyj.js} +1 -1
  145. package/dist/web/dashboard/dist/assets/{style-Chqa3iIg.js → style-B4jQtUGE.js} +1 -1
  146. package/dist/web/dashboard/dist/assets/triangle-alert-CqXtIU3H.js +16 -0
  147. package/dist/web/dashboard/dist/assets/upload-Cb3pIYT5.js +16 -0
  148. package/dist/web/dashboard/dist/index.html +2 -2
  149. package/package.json +2 -2
  150. package/dist/web/dashboard/dist/assets/index-BVhCKhGJ.css +0 -1
  151. package/dist/web/dashboard/dist/assets/languages-tab-Cs-EF0mT.js +0 -123
  152. package/dist/web/dashboard/dist/assets/triangle-alert-CkVvjxDP.js +0 -26
@@ -0,0 +1,52 @@
1
+ import { PF_INF_DIRECTORY_MAP } from "./davinci-types.js";
2
+ export function generateGuiDescriptor(variables) {
3
+ const configVars = variables.filter((v) => v.kind !== "local");
4
+ const seen = new Set();
5
+ const declarations = [];
6
+ const registrations = [];
7
+ const instanceFields = [];
8
+ for (const v of configVars) {
9
+ if (seen.has(v.fieldName))
10
+ continue;
11
+ seen.add(v.fieldName);
12
+ declarations.push(` TextFieldDescriptor ${v.fieldName}Field = new TextFieldDescriptor("${v.fieldName}", "DaVinci variable: ${v.fieldName}");`);
13
+ registrations.push(` guiDescriptor.addField(${v.fieldName}Field);`);
14
+ instanceFields.push(` private String ${v.fieldName};`);
15
+ }
16
+ return {
17
+ fieldDeclarations: declarations.join("\n"),
18
+ fieldRegistrations: registrations.join("\n"),
19
+ instanceFields: instanceFields.join("\n"),
20
+ };
21
+ }
22
+ // ── Attribute Contract Generation ─────────────────────────────────────
23
+ export function generateAttributeContract(attributes) {
24
+ if (attributes.length === 0) {
25
+ return " Set<String> contract = new HashSet<>();";
26
+ }
27
+ const lines = [
28
+ " Set<String> contract = new HashSet<>();",
29
+ ...attributes.map((a) => ` contract.add("${a}");`),
30
+ ];
31
+ return lines.join("\n");
32
+ }
33
+ export function generatePfInfDescriptor(pluginType, packageName, className) {
34
+ const fqcn = `${packageName}.${className}`;
35
+ // PingFederate uses PF_INF_DIRECTORY_MAP
36
+ const pfDirectory = PF_INF_DIRECTORY_MAP[pluginType];
37
+ // PingAccess uses META-INF/services/{interface}
38
+ const directoryName = pfDirectory ?? pluginType;
39
+ return {
40
+ directoryName,
41
+ content: fqcn,
42
+ fullPath: `PF-INF/${directoryName}`,
43
+ };
44
+ }
45
+ // ── META-INF/services for PingAccess ──────────────────────────────────
46
+ export function generateMetaInfServices(serviceInterface, packageName, className) {
47
+ return {
48
+ filePath: `META-INF/services/${serviceInterface}`,
49
+ content: `${packageName}.${className}`,
50
+ };
51
+ }
52
+ //# sourceMappingURL=descriptor-generator.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"descriptor-generator.js","sourceRoot":"","sources":["../../../src/core/davinci/descriptor-generator.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAW1D,MAAM,UAAU,qBAAqB,CACnC,SAA4B;IAE5B,MAAM,UAAU,GAAG,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,OAAO,CAAC,CAAC;IAC/D,MAAM,IAAI,GAAG,IAAI,GAAG,EAAU,CAAC;IAC/B,MAAM,YAAY,GAAa,EAAE,CAAC;IAClC,MAAM,aAAa,GAAa,EAAE,CAAC;IACnC,MAAM,cAAc,GAAa,EAAE,CAAC;IAEpC,KAAK,MAAM,CAAC,IAAI,UAAU,EAAE,CAAC;QAC3B,IAAI,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,SAAS,CAAC;YAAE,SAAS;QACpC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;QAEtB,YAAY,CAAC,IAAI,CACf,+BAA+B,CAAC,CAAC,SAAS,oCAAoC,CAAC,CAAC,SAAS,yBAAyB,CAAC,CAAC,SAAS,KAAK,CACnI,CAAC;QACF,aAAa,C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AAE,GAAG,WAAW,IAAI,SAAS,EAAE;KACvC,CAAC;AACJ,CAAC"}
@@ -0,0 +1,29 @@
1
+ import type { TargetSdk } from "./pom-generator.js";
2
+ export interface GeneratePluginOptions {
3
+ code: string;
4
+ pluginName: string;
5
+ packageName: string;
6
+ className: string;
7
+ targetSdk: TargetSdk;
8
+ pluginType?: string;
9
+ codeLocation?: "custom_function" | "code_snippet" | "html_template";
10
+ attributeContract?: string[];
11
+ javaVersion?: string;
12
+ sdkPath?: string;
13
+ }
14
+ export interface GeneratePluginResult {
15
+ javaCode: string;
16
+ pomXml: string;
17
+ pfInfContent: string;
18
+ pfInfType: string;
19
+ pluginType: string;
20
+ confidence: number;
21
+ warnings: string[];
22
+ analysis: {
23
+ variableCount: number;
24
+ apiCallCount: number;
25
+ flowLogic: Record<string, boolean>;
26
+ };
27
+ }
28
+ export declare function generatePlugin(options: GeneratePluginOptions): GeneratePluginResult;
29
+ //# sourceMappingURL=plugin-generator.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugin-generator.d.ts","sourceRoot":"","sources":["../../../src/core/davinci/plugin-generator.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAIpD,MAAM,WAAW,qBAAqB;IACpC,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,SAAS,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,YAAY,CAAC,EAAE,iBAAiB,GAAG,cAAc,GAAG,eAAe,CAAC;IACpE,iBAAiB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC7B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,oBAAoB;IACnC,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,YAAY,EAAE,MAAM,CAAC;IACrB,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,QAAQ,EAAE;QACR,aAAa,EAAE,MAAM,CAAC;QACtB,YAAY,EAAE,MAAM,CAAC;QACrB,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;KACpC,CAAC;CACH;AAID,wBAAgB,cAAc,CAAC,OAAO,EAAE,qBAAqB,GAAG,oBAAoB,CAkGnF"}
@@ -0,0 +1,86 @@
1
+ import { parseDaVinciCode } from "./davinci-parser.js";
2
+ import { resolveVariables } from "./variable-resolver.js";
3
+ import { detectPluginType } from "./plugin-type-detector.js";
4
+ import { getTemplate, renderTemplate } from "./template-registry.js";
5
+ import { generatePom } from "./pom-generator.js";
6
+ // ── Main Entry Point ──────────────────────────────────────────────────
7
+ export function generatePlugin(options) {
8
+ const { code, pluginName, packageName, className, targetSdk, codeLocation, attributeContract = [], javaVersion, sdkPath, } = options;
9
+ // 1. Parse DaVinci code
10
+ const analysis = parseDaVinciCode(code, {
11
+ codeLocation: codeLocation ?? undefined,
12
+ });
13
+ // 2. Resolve variables
14
+ const resolved = resolveVariables(analysis.variables);
15
+ // 3. Detect plugin type
16
+ const detection = detectPluginType(analysis, targetSdk, {
17
+ sourceCode: code,
18
+ override: options.pluginType,
19
+ });
20
+ // 4. Get template
21
+ const template = getTemplate(detection.pluginType, targetSdk);
22
+ if (!template) {
23
+ return {
24
+ javaCode: `// No template available for plugin type: ${detection.pluginType} (${targetSdk})`,
25
+ pomXml: "",
26
+ pfInfContent: "",
27
+ pfInfType: "",
28
+ pluginType: detection.pluginType,
29
+ confidence: detection.confidence,
30
+ warnings: [...analysis.warnings, ...detection.warnings, `No template for ${detection.pluginType}`],
31
+ analysis: {
32
+ variableCount: analysis.variables.length,
33
+ apiCallCount: analysis.apiCalls.length,
34
+ flowLogic: analysis.flowLogic,
35
+ },
36
+ };
37
+ }
38
+ // 5. Build GUI fields code
39
+ const guiFieldLines = resolved
40
+ .filter((v) => v.guiFieldCode)
41
+ .map((v) => ` ${v.guiFieldCode}`)
42
+ .join("\n");
43
+ // 6. Build configure() body
44
+ const configureLines = resolved
45
+ .filter((v) => v.configureCode)
46
+ .map((v) => ` ${v.configureCode}`)
47
+ .join("\n");
48
+ // 7. Render Java class
49
+ const javaCode = renderTemplate(template, {
50
+ className,
51
+ packageName,
52
+ pluginName,
53
+ guiFields: guiFieldLines,
54
+ configureBody: configureLines,
55
+ mainMethodBody: ` // TODO: Translate DaVinci logic to Java\n // Source had ${analysis.apiCalls.length} API calls, ${analysis.variables.length} variables`,
56
+ attributeContract,
57
+ });
58
+ // 8. Generate POM
59
+ const pomXml = generatePom({
60
+ pluginName,
61
+ packageName,
62
+ className,
63
+ pluginType: detection.pluginType,
64
+ attributeContract,
65
+ javaVersion: javaVersion ?? (targetSdk === "pingaccess" ? "17" : "11"),
66
+ sdkPath,
67
+ }, targetSdk);
68
+ // 9. PF-INF descriptor
69
+ const pfInfContent = `${packageName}.${className}`;
70
+ const pfInfType = template.pfInfType;
71
+ return {
72
+ javaCode,
73
+ pomXml,
74
+ pfInfContent,
75
+ pfInfType,
76
+ pluginType: detection.pluginType,
77
+ confidence: detection.confidence,
78
+ warnings: [...analysis.warnings, ...detection.warnings],
79
+ analysis: {
80
+ variableCount: analysis.variables.length,
81
+ apiCallCount: analysis.apiCalls.length,
82
+ flowLogic: analysis.flowLogic,
83
+ },
84
+ };
85
+ }
86
+ //# sourceMappingURL=plugin-generator.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugin-generator.js","sourceRoot":"","sources":["../../../src/core/davinci/plugin-generator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAEvD,OAAO,EAAE,gBAAgB,EAAE,MAAM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AAC,CAAC;IAEd,uBAAuB;IACvB,MAAM,YAAY,GAAG,GAAG,WAAW,IAAI,SAAS,EAAE,CAAC;IACnD,MAAM,SAAS,GAAG,QAAQ,CAAC,SAAS,CAAC;IAErC,OAAO;QACL,QAAQ;QACR,MAAM;QACN,YAAY;QACZ,SAAS;QACT,UAAU,EAAE,SAAS,CAAC,UAAU;QAChC,UAAU,EAAE,SAAS,CAAC,UAAU;QAChC,QAAQ,EAAE,CAAC,GAAG,QAAQ,CAAC,QAAQ,EAAE,GAAG,SAAS,CAAC,QAAQ,CAAC;QACvD,QAAQ,EAAE;YACR,aAAa,EAAE,QAAQ,CAAC,SAAS,CAAC,MAAM;YACxC,YAAY,EAAE,QAAQ,CAAC,QAAQ,CAAC,MAAM;YACtC,SAAS,EAAE,QAAQ,CAAC,SAA+C;SACpE;KACF,CAAC;AACJ,CAAC"}
@@ -0,0 +1,15 @@
1
+ import type { DaVinciAnalysis, PfPluginType } from "./davinci-types.js";
2
+ export type TargetSdkMode = "pingfederate" | "pingaccess";
3
+ export type PaPluginType = "rule" | "identity-mapping" | "load-balancing" | "site-authenticator";
4
+ export interface DetectionResult {
5
+ pluginType: PfPluginType | PaPluginType;
6
+ confidence: number;
7
+ warnings: string[];
8
+ scores: Record<string, number>;
9
+ }
10
+ export interface DetectionOptions {
11
+ override?: string;
12
+ sourceCode?: string;
13
+ }
14
+ export declare function detectPluginType(analysis: DaVinciAnalysis, mode: TargetSdkMode, options?: DetectionOptions): DetectionResult;
15
+ //# sourceMappingURL=plugin-type-detector.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugin-type-detector.d.ts","sourceRoot":"","sources":["../../../src/core/davinci/plugin-type-detector.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAIxE,MAAM,MAAM,aAAa,GAAG,cAAc,GAAG,YAAY,CAAC;AAE1D,MAAM,MAAM,YAAY,GAAG,MAAM,GAAG,kBAAkB,GAAG,gBAAgB,GAAG,oBAAoB,CAAC;AAEjG,MAAM,WAAW,eAAe;IAC9B,UAAU,EAAE,YAAY,GAAG,YAAY,CAAC;IACxC,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAChC;AAED,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAID,wBAAgB,gBAAgB,CAC9B,QAAQ,EAAE,eAAe,EACzB,IAAI,EAAE,aAAa,EACnB,OAAO,GAAE,gBAAqB,GAC7B,eAAe,CAgBjB"}
@@ -0,0 +1,114 @@
1
+ // ── Main Entry Point ──────────────────────────────────────────────────
2
+ export function detectPluginType(analysis, mode, options = {}) {
3
+ if (options.override) {
4
+ return {
5
+ pluginType: options.override,
6
+ confidence: 1,
7
+ warnings: [],
8
+ scores: { [options.override]: 1 },
9
+ };
10
+ }
11
+ const sourceCode = options.sourceCode ?? "";
12
+ if (mode === "pingaccess") {
13
+ return detectPingAccessType(analysis, sourceCode);
14
+ }
15
+ return detectPingFederateType(analysis, sourceCode);
16
+ }
17
+ // ── PingFederate Detection ────────────────────────────────────────────
18
+ function detectPingFederateType(analysis, sourceCode) {
19
+ const scores = {};
20
+ const code = sourceCode || reconstructCode(analysis);
21
+ // HTTP calls → idp-adapter
22
+ if (analysis.apiCalls.length > 0) {
23
+ scores["idp-adapter"] = (scores["idp-adapter"] ?? 0) + 0.4;
24
+ }
25
+ // JWT/token patterns → token-generator
26
+ if (/\b(jwt|token|sign|verify|encode|decode)\b/i.test(code)) {
27
+ scores["token-generator"] = (scores["token-generator"] ?? 0) + 0.5;
28
+ }
29
+ // Password/credential patterns → password-credential-validator
30
+ if (/\b(password|credential|authenticate|login)\b/i.test(code)) {
31
+ scores["password-credential-validator"] = (scores["password-credential-validator"] ?? 0) + 0.5;
32
+ }
33
+ // Storage/persistence patterns → access-grant-manager
34
+ if (/\b(save|store|persist|getByClientId|grant)\b/i.test(code)) {
35
+ scores["access-grant-manager"] = (scores["access-grant-manager"] ?? 0) + 0.4;
36
+ }
37
+ // Notification/webhook patterns → notification-publisher
38
+ if (/\b(notify|notification|webhook|email|event)\b/i.test(code)) {
39
+ scores["notification-publisher"] = (scores["notification-publisher"] ?? 0) + 0.5;
40
+ }
41
+ // Secret/vault/env patterns → secret-manager
42
+ if (/\b(secret|vault|getenv|environment)\b/i.test(code)) {
43
+ scores["secret-manager"] = (scores["secret-manager"] ?? 0) + 0.4;
44
+ }
45
+ // LDAP/DB query patterns → custom-data-store
46
+ if (/\b(ldap|query|search|datastore|db\.)\b/i.test(code)) {
47
+ scores["custom-data-store"] = (scores["custom-data-store"] ?? 0) + 0.4;
48
+ }
49
+ return buildResult(scores, "idp-adapter");
50
+ }
51
+ // ── PingAccess Detection ──────────────────────────────────────────────
52
+ function detectPingAccessType(analysis, sourceCode) {
53
+ const scores = {};
54
+ const code = sourceCode || reconstructCode(analysis);
55
+ // HTTP request/response manipulation → rule
56
+ if (/\b(httpRequest|getHeader|statusCode|allowed|forbidden|request\.get)\b/i.test(code)) {
57
+ scores["rule"] = (scores["rule"] ?? 0) + 0.5;
58
+ }
59
+ // Token extraction / identity mapping
60
+ if (/\b(identity|mappedIdentity|subject|accessToken|decoded|mapping)\b/i.test(code)) {
61
+ scores["identity-mapping"] = (scores["identity-mapping"] ?? 0) + 0.5;
62
+ }
63
+ // Server selection / load balancing
64
+ if (/\b(server|backend|loadBalance|roundRobin|weight)\b/i.test(code)) {
65
+ scores["load-balancing"] = (scores["load-balancing"] ?? 0) + 0.5;
66
+ }
67
+ // Site authentication
68
+ if (/\b(siteAuth|basicAuth|formAuth|siteCredential)\b/i.test(code)) {
69
+ scores["site-authenticator"] = (scores["site-authenticator"] ?? 0) + 0.5;
70
+ }
71
+ return buildResult(scores, "rule");
72
+ }
73
+ // ── Helpers ───────────────────────────────────────────────────────────
74
+ function reconstructCode(analysis) {
75
+ // Use variables and other analysis data to reconstruct code context
76
+ const parts = [];
77
+ for (const v of analysis.variables) {
78
+ parts.push(v.rawTemplate);
79
+ }
80
+ for (const call of analysis.apiCalls) {
81
+ parts.push(call.url ?? "");
82
+ parts.push(call.method);
83
+ }
84
+ // Also check warnings for additional context
85
+ for (const w of analysis.warnings) {
86
+ parts.push(w);
87
+ }
88
+ return parts.join(" ");
89
+ }
90
+ function buildResult(scores, fallbackType) {
91
+ const warnings = [];
92
+ // Find best match
93
+ let bestType = fallbackType;
94
+ let bestScore = 0;
95
+ for (const [type, score] of Object.entries(scores)) {
96
+ if (score > bestScore) {
97
+ bestType = type;
98
+ bestScore = score;
99
+ }
100
+ }
101
+ // Check for ambiguity (multiple types with similar scores)
102
+ const significantTypes = Object.entries(scores).filter(([, s]) => s >= 0.3);
103
+ if (significantTypes.length > 2) {
104
+ warnings.push(`Ambiguous: ${significantTypes.length} plugin types detected with similar scores: ${significantTypes.map(([t]) => t).join(", ")}. Consider manual override.`);
105
+ }
106
+ const confidence = bestScore > 0 ? Math.min(bestScore + 0.2, 1) : 0.3;
107
+ return {
108
+ pluginType: bestType,
109
+ confidence,
110
+ warnings,
111
+ scores,
112
+ };
113
+ }
114
+ //# sourceMappingURL=plugin-type-detector.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugin-type-detector.js","sourceRoot":"","sources":["../../../src/core/davinci/plugin-type-detector.ts"],"names":[],"mappings":"AAoBA,yEAAyE;AAEzE,MAAM,UAAU,gBAAgB,CAC9B,QAAyB,EACzB,IAAmB,EACnB,UAA4B,EAAE;IAE9B,IAAI,OAAO,CAAC,QAAQ,EAAE,CAAC;QACrB,OAAO;YACL,UAAU,EAAE,OAAO,CAAC,QAAuC;YAC3D,UAAU,EAAE,CAAC;YACb,QAAQ,EAAE,EAAE;YACZ,MAAM,EAAE,EAAE,CAAC,OAAO,CAAC,QAAQ,CAAC,E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I,SAAS,GAAG,CAAC,CAAC;IAElB,KAAK,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC;QACnD,IAAI,KAAK,GAAG,SAAS,EAAE,CAAC;YACtB,QAAQ,GAAG,IAAI,CAAC;YAChB,SAAS,GAAG,KAAK,CAAC;QACpB,CAAC;IACH,CAAC;IAED,2DAA2D;IAC3D,MAAM,gBAAgB,GAAG,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,IAAI,GAAG,CAAC,CAAC;IAC5E,IAAI,gBAAgB,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAChC,QAAQ,CAAC,IAAI,CACX,cAAc,gBAAgB,CAAC,MAAM,+CAA+C,gBAAgB,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,6BAA6B,CAC7J,CAAC;IACJ,CAAC;IAED,MAAM,UAAU,GAAG,SAAS,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,SAAS,GAAG,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC;IAEtE,OAAO;QACL,UAAU,EAAE,QAAuC;QACnD,UAAU;QACV,QAAQ;QACR,MAAM;KACP,CAAC;AACJ,CAAC"}
@@ -0,0 +1,4 @@
1
+ import type { PluginGenerationConfig } from "./davinci-types.js";
2
+ export type TargetSdk = "pingfederate" | "pingaccess";
3
+ export declare function generatePom(config: PluginGenerationConfig, targetSdk: TargetSdk): string;
4
+ //# sourceMappingURL=pom-generator.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pom-generator.d.ts","sourceRoot":"","sources":["../../../src/core/davinci/pom-generator.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAEjE,MAAM,MAAM,SAAS,GAAG,cAAc,GAAG,YAAY,CAAC;AAEtD,wBAAgB,WAAW,CACzB,MAAM,EAAE,sBAAsB,EAC9B,SAAS,EAAE,SAAS,GACnB,MAAM,CAKR"}
@@ -0,0 +1,179 @@
1
+ export function generatePom(config, targetSdk) {
2
+ if (targetSdk === "pingaccess") {
3
+ return generatePingAccessPom(config);
4
+ }
5
+ return generatePingFederatePom(config);
6
+ }
7
+ // ── PingFederate POM ──────────────────────────────────────────────────
8
+ function generatePingFederatePom(config) {
9
+ const sdkPath = config.sdkPath ?? "${project.basedir}/sdk/lib";
10
+ return `<?xml version="1.0" encoding="UTF-8"?>
11
+ <project xmlns="http://maven.apache.org/POM/4.0.0"
12
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
13
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
14
+ <modelVersion>4.0.0</modelVersion>
15
+
16
+ <groupId>${config.packageName}</groupId>
17
+ <artifactId>${config.pluginName}</artifactId>
18
+ <version>1.0.0</version>
19
+ <packaging>jar</packaging>
20
+ <name>PingFederate Plugin :: ${config.className}</name>
21
+
22
+ <properties>
23
+ <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
24
+ </properties>
25
+
26
+ <dependencies>
27
+ <dependency>
28
+ <groupId>com.pingidentity</groupId>
29
+ <artifactId>pf-sdk</artifactId>
30
+ <version>1.0.0</version>
31
+ <scope>system</scope>
32
+ <systemPath>${sdkPath}/servlet-api.jar</systemPath>
33
+ </dependency>
34
+ <dependency>
35
+ <groupId>com.pingidentity</groupId>
36
+ <artifactId>pf-tasks</artifactId>
37
+ <version>1.0.0</version>
38
+ <scope>system</scope>
39
+ <systemPath>${sdkPath}/tasks.jar</systemPath>
40
+ </dependency>
41
+ </dependencies>
42
+
43
+
44
+ <build>
45
+ <plugins>
46
+ <plugin>
47
+ <groupId>org.apache.maven.plugins</groupId>
48
+ <artifactId>maven-compiler-plugin</artifactId>
49
+ <version>3.11.0</version>
50
+ <configuration>
51
+ <source>${config.javaVersion}</source>
52
+ <target>${config.javaVersion}</target>
53
+ </configuration>
54
+ </plugin>
55
+ <plugin>
56
+ <groupId>org.apache.maven.plugins</groupId>
57
+ <artifactId>maven-jar-plugin</artifactId>
58
+ <version>3.3.0</version>
59
+ <configuration>
60
+ <archive>
61
+ <addMavenDescriptor>false</addMavenDescriptor>
62
+ </archive>
63
+ </configuration>
64
+ </plugin>
65
+ </plugins>
66
+ <resources>
67
+ <resource>
68
+ <directory>src/main/resources</directory>
69
+ <includes>
70
+ <include>PF-INF/**</include>
71
+ </includes>
72
+ </resource>
73
+ </resources>
74
+ </build>
75
+ </project>
76
+ `;
77
+ }
78
+ // ── PingAccess POM ────────────────────────────────────────────────────
79
+ function generatePingAccessPom(config) {
80
+ const javaVersion = config.javaVersion === "11" ? "17" : config.javaVersion;
81
+ return `<?xml version="1.0" encoding="UTF-8"?>
82
+ <project xmlns="http://maven.apache.org/POM/4.0.0"
83
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
84
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
85
+ <modelVersion>4.0.0</modelVersion>
86
+
87
+ <groupId>com.pingidentity.pingaccess</groupId>
88
+ <artifactId>${config.pluginName}</artifactId>
89
+ <version>1.0.0</version>
90
+ <packaging>jar</packaging>
91
+ <name>PingAccess Plugin :: ${config.className}</name>
92
+
93
+ <properties>
94
+ <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
95
+ <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
96
+ <javac.source>${javaVersion}</javac.source>
97
+ <javac.target>${javaVersion}</javac.target>
98
+ <jar.to.copy>target/\${project.build.finalName}.\${project.packaging}</jar.to.copy>
99
+ <jar.destination>../../../deploy</jar.destination>
100
+ </properties>
101
+
102
+ <repositories>
103
+ <repository>
104
+ <releases>
105
+ <enabled>true</enabled>
106
+ <updatePolicy>always</updatePolicy>
107
+ <checksumPolicy>warn</checksumPolicy>
108
+ </releases>
109
+ <id>PingIdentityMaven</id>
110
+ <name>PingIdentity Release</name>
111
+ <url>https://maven.pingidentity.com/release/</url>
112
+ <layout>default</layout>
113
+ </repository>
114
+ </repositories>
115
+
116
+ <dependencies>
117
+ <dependency>
118
+ <groupId>com.pingidentity.pingaccess</groupId>
119
+ <artifactId>pingaccess-sdk</artifactId>
120
+ <version>9.0.1.0</version>
121
+ </dependency>
122
+ <dependency>
123
+ <groupId>jakarta.validation</groupId>
124
+ <artifactId>jakarta.validation-api</artifactId>
125
+ <version>3.1.1</version>
126
+ </dependency>
127
+ <dependency>
128
+ <groupId>jakarta.inject</groupId>
129
+ <artifactId>jakarta.inject-api</artifactId>
130
+ <version>2.0.1</version>
131
+ </dependency>
132
+ </dependencies>
133
+
134
+ <build>
135
+ <plugins>
136
+ <plugin>
137
+ <groupId>org.apache.maven.plugins</groupId>
138
+ <artifactId>maven-compiler-plugin</artifactId>
139
+ <version>2.5.1</version>
140
+ <configuration>
141
+ <source>${javaVersion}</source>
142
+ <target>${javaVersion}</target>
143
+ </configuration>
144
+ </plugin>
145
+ <plugin>
146
+ <groupId>org.apache.maven.plugins</groupId>
147
+ <artifactId>maven-antrun-plugin</artifactId>
148
+ <version>1.7</version>
149
+ <executions>
150
+ <execution>
151
+ <phase>install</phase>
152
+ <goals>
153
+ <goal>run</goal>
154
+ </goals>
155
+ <configuration>
156
+ <target>
157
+ <copy todir="\${jar.destination}">
158
+ <fileset file="\${jar.to.copy}" />
159
+ </copy>
160
+ </target>
161
+ </configuration>
162
+ </execution>
163
+ </executions>
164
+ </plugin>
165
+ <plugin>
166
+ <artifactId>maven-surefire-plugin</artifactId>
167
+ <version>2.18</version>
168
+ <configuration>
169
+ <argLine>
170
+ --add-opens java.base/java.lang=ALL-UNNAMED
171
+ </argLine>
172
+ </configuration>
173
+ </plugin>
174
+ </plugins>
175
+ </build>
176
+ </project>
177
+ `;
178
+ }
179
+ //# sourceMappingURL=pom-generator.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pom-generator.js","sourceRoot":"","sources":["../../../src/core/davinci/pom-generator.ts"],"names":[],"mappings":"AAIA,MAAM,UAAU,WAAW,CACzB,MAA8B,EAC9B,SAAoB;IAEpB,IAAI,SAAS,KAAK,YAAY,EAAE,CAAC;QAC/B,OAAO,qBAAqB,CAAC,MAAM,CAAC,CAAC;IACvC,CAAC;IACD,OAAO,uBAAuB,CAAC,MAAM,CAAC,CAAC;AACzC,CAAC;AAED,yEAAyE;AAEzE,SAAS,uBAAuB,CAAC,MAA8B;IAC7D,MAAM,OAAO,GAAG,MAAM,CAAC,OAAO,IAAI,4BAA4B,CAAC;IAE/D,OAAO;;;;;;eAMM,MAAM,CAAC,WAAW;kBACf,MAAM,CAAC,UAAU;;;mCAGA,MAAM,CAAC,SAAS;;;;;;;;;;;;0BAYzB,OAAO;;;;;;;0BAOP,OAAO;;;;;;;;;;;;8BAYH,MAAM,CAAC,WAAW;8BAClB,MAAM,CAAC,WAAW;;;;;;;;;;;;;;;;;;;;;;;;CAwB/C,CAAC;AACF,CAAC;AAED,yEAAyE;AAEzE,SAAS,qBAAqB,CAAC,MAA8B;IAC3D,MAAM,WAAW,GAAG,MAAM,CAAC,WAAW,KAAK,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,WAAW,CAAC;IAE5E,OAAO;;;;;;;kBAOS,MAAM,CAAC,UAAU;;;iCAGF,MAAM,CAAC,SAAS;;;;;wBAKzB,WAAW;wBACX,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8BA4CL,WAAW;8BACX,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAmCxC,CAAC;AACF,CAAC"}
@@ -0,0 +1,25 @@
1
+ export interface PluginTemplate {
2
+ pluginType: string;
3
+ sdk: "pingfederate" | "pingaccess";
4
+ interfaceName: string;
5
+ descriptorClass: string;
6
+ imports: string[];
7
+ constructorPattern: string;
8
+ configurePattern: string;
9
+ mainMethodSignature: string;
10
+ mainMethodBody: string;
11
+ pfInfType: string;
12
+ }
13
+ export interface TemplateContext {
14
+ className: string;
15
+ packageName: string;
16
+ pluginName: string;
17
+ guiFields: string;
18
+ configureBody: string;
19
+ mainMethodBody: string;
20
+ attributeContract: string[];
21
+ }
22
+ export declare function getTemplate(pluginType: string, sdk: "pingfederate" | "pingaccess"): PluginTemplate | undefined;
23
+ export declare function listTemplates(sdk: "pingfederate" | "pingaccess"): PluginTemplate[];
24
+ export declare function renderTemplate(template: PluginTemplate, context: TemplateContext): string;
25
+ //# sourceMappingURL=template-registry.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"template-registry.d.ts","sourceRoot":"","sources":["../../../src/core/davinci/template-registry.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,cAAc;IAC7B,UAAU,EAAE,MAAM,CAAC;IACnB,GAAG,EAAE,cAAc,GAAG,YAAY,CAAC;IACnC,aAAa,EAAE,MAAM,CAAC;IACtB,eAAe,EAAE,MAAM,CAAC;IACxB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,gBAAgB,EAAE,MAAM,CAAC;IACzB,mBAAmB,EAAE,MAAM,CAAC;IAC5B,cAAc,EAAE,MAAM,CAAC;IACvB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,eAAe;IAC9B,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,MAAM,CAAC;IACtB,cAAc,EAAE,MAAM,CAAC;IACvB,iBAAiB,EAAE,MAAM,EAAE,CAAC;CAC7B;AAiMD,wBAAgB,WAAW,CACzB,UAAU,EAAE,MAAM,EAClB,GAAG,EAAE,cAAc,GAAG,YAAY,GACjC,cAAc,GAAG,SAAS,CAK5B;AAED,wBAAgB,aAAa,CAC3B,GAAG,EAAE,cAAc,GAAG,YAAY,GACjC,cAAc,EAAE,CAKlB;AAED,wBAAgB,cAAc,CAC5B,QAAQ,EAAE,cAAc,EACxB,OAAO,EAAE,eAAe,GACvB,MAAM,CAKR"}