@trishchuk/coolors-mcp 1.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/.claude/settings.local.json +39 -0
- package/.env +2 -0
- package/.github/ISSUE_TEMPLATE/bug_report.md +73 -0
- package/.github/ISSUE_TEMPLATE/feature_request.md +71 -0
- package/.github/pull_request_template.md +97 -0
- package/.github/workflows/ci.yml +127 -0
- package/.github/workflows/deploy-docs.yml +56 -0
- package/.github/workflows/release.yml +99 -0
- package/.mcp.json +12 -0
- package/.prettierignore +1 -0
- package/CLAUDE.md +201 -0
- package/DOCUMENTATION.md +274 -0
- package/GEMINI.md +54 -0
- package/LICENSE +21 -0
- package/README.md +401 -0
- package/demo/content_based_color.png +0 -0
- package/demo/music-player.html +621 -0
- package/demo/podcast-player.html +903 -0
- package/dist/bin/coolors-mcp.d.ts +1 -0
- package/dist/bin/coolors-mcp.js +154 -0
- package/dist/bin/coolors-mcp.js.map +1 -0
- package/dist/bin/server.d.ts +1 -0
- package/dist/bin/server.js +3292 -0
- package/dist/bin/server.js.map +1 -0
- package/dist/chunk-IQ7NN26V.js +114 -0
- package/dist/chunk-IQ7NN26V.js.map +1 -0
- package/dist/chunk-P3ARRKLS.js +1214 -0
- package/dist/chunk-P3ARRKLS.js.map +1 -0
- package/dist/color/index.d.ts +716 -0
- package/dist/color/index.js +153 -0
- package/dist/color/index.js.map +1 -0
- package/dist/coolors-mcp.d.ts +136 -0
- package/dist/coolors-mcp.js +7 -0
- package/dist/coolors-mcp.js.map +1 -0
- package/docs/.vitepress/cache/deps/@braintree_sanitize-url.js +93 -0
- package/docs/.vitepress/cache/deps/@braintree_sanitize-url.js.map +7 -0
- package/docs/.vitepress/cache/deps/_metadata.json +127 -0
- package/docs/.vitepress/cache/deps/chunk-BUSYA2B4.js +9 -0
- package/docs/.vitepress/cache/deps/chunk-BUSYA2B4.js.map +7 -0
- package/docs/.vitepress/cache/deps/chunk-JD3CXNQ6.js +12683 -0
- package/docs/.vitepress/cache/deps/chunk-JD3CXNQ6.js.map +7 -0
- package/docs/.vitepress/cache/deps/chunk-SYPOPCWC.js +9719 -0
- package/docs/.vitepress/cache/deps/chunk-SYPOPCWC.js.map +7 -0
- package/docs/.vitepress/cache/deps/cytoscape-cose-bilkent.js +4710 -0
- package/docs/.vitepress/cache/deps/cytoscape-cose-bilkent.js.map +7 -0
- package/docs/.vitepress/cache/deps/cytoscape.js +30278 -0
- package/docs/.vitepress/cache/deps/cytoscape.js.map +7 -0
- package/docs/.vitepress/cache/deps/dayjs.js +285 -0
- package/docs/.vitepress/cache/deps/dayjs.js.map +7 -0
- package/docs/.vitepress/cache/deps/debug.js +468 -0
- package/docs/.vitepress/cache/deps/debug.js.map +7 -0
- package/docs/.vitepress/cache/deps/package.json +3 -0
- package/docs/.vitepress/cache/deps/prismjs.js +1466 -0
- package/docs/.vitepress/cache/deps/prismjs.js.map +7 -0
- package/docs/.vitepress/cache/deps/prismjs_components_prism-bash.js +228 -0
- package/docs/.vitepress/cache/deps/prismjs_components_prism-bash.js.map +7 -0
- package/docs/.vitepress/cache/deps/prismjs_components_prism-javascript.js +142 -0
- package/docs/.vitepress/cache/deps/prismjs_components_prism-javascript.js.map +7 -0
- package/docs/.vitepress/cache/deps/prismjs_components_prism-json.js +27 -0
- package/docs/.vitepress/cache/deps/prismjs_components_prism-json.js.map +7 -0
- package/docs/.vitepress/cache/deps/prismjs_components_prism-python.js +65 -0
- package/docs/.vitepress/cache/deps/prismjs_components_prism-python.js.map +7 -0
- package/docs/.vitepress/cache/deps/prismjs_components_prism-typescript.js +53 -0
- package/docs/.vitepress/cache/deps/prismjs_components_prism-typescript.js.map +7 -0
- package/docs/.vitepress/cache/deps/prismjs_components_prism-yaml.js +73 -0
- package/docs/.vitepress/cache/deps/prismjs_components_prism-yaml.js.map +7 -0
- package/docs/.vitepress/cache/deps/vitepress___@vue_devtools-api.js +4507 -0
- package/docs/.vitepress/cache/deps/vitepress___@vue_devtools-api.js.map +7 -0
- package/docs/.vitepress/cache/deps/vitepress___@vueuse_core.js +584 -0
- package/docs/.vitepress/cache/deps/vitepress___@vueuse_core.js.map +7 -0
- package/docs/.vitepress/cache/deps/vitepress___@vueuse_integrations_useFocusTrap.js +1146 -0
- package/docs/.vitepress/cache/deps/vitepress___@vueuse_integrations_useFocusTrap.js.map +7 -0
- package/docs/.vitepress/cache/deps/vitepress___mark__js_src_vanilla__js.js +1667 -0
- package/docs/.vitepress/cache/deps/vitepress___mark__js_src_vanilla__js.js.map +7 -0
- package/docs/.vitepress/cache/deps/vitepress___minisearch.js +1814 -0
- package/docs/.vitepress/cache/deps/vitepress___minisearch.js.map +7 -0
- package/docs/.vitepress/cache/deps/vue.js +344 -0
- package/docs/.vitepress/cache/deps/vue.js.map +7 -0
- package/docs/.vitepress/components/ClientGrid.vue +125 -0
- package/docs/.vitepress/components/CodeBlock.vue +231 -0
- package/docs/.vitepress/components/ConfigModal.vue +477 -0
- package/docs/.vitepress/components/DiagramModal.vue +528 -0
- package/docs/.vitepress/components/TroubleshootingModal.vue +472 -0
- package/docs/.vitepress/config.js +162 -0
- package/docs/.vitepress/theme/FundingLayout.vue +251 -0
- package/docs/.vitepress/theme/Layout.vue +134 -0
- package/docs/.vitepress/theme/components/AdBanner.vue +317 -0
- package/docs/.vitepress/theme/components/AdPlaceholder.vue +78 -0
- package/docs/.vitepress/theme/components/FundingEffects.vue +322 -0
- package/docs/.vitepress/theme/components/FundingHero.vue +345 -0
- package/docs/.vitepress/theme/components/SupportSection.vue +511 -0
- package/docs/.vitepress/theme/custom-app.css +339 -0
- package/docs/.vitepress/theme/custom.css +699 -0
- package/docs/.vitepress/theme/index.js +25 -0
- package/docs/README.md +198 -0
- package/docs/concepts/accessibility.md +473 -0
- package/docs/concepts/color-spaces.md +222 -0
- package/docs/concepts/distance-metrics.md +384 -0
- package/docs/concepts/hct.md +261 -0
- package/docs/concepts/image-analysis.md +396 -0
- package/docs/concepts/material-design.md +306 -0
- package/docs/concepts/theme-matching.md +399 -0
- package/docs/examples/basic-colors.md +490 -0
- package/docs/examples/creating-themes.md +898 -0
- package/docs/examples/css-refactoring.md +824 -0
- package/docs/examples/image-extraction.md +882 -0
- package/docs/getting-started.md +366 -0
- package/docs/index.md +190 -0
- package/docs/installation.md +157 -0
- package/docs/tools/README.md +234 -0
- package/docs/tools/accessibility.md +614 -0
- package/docs/tools/color-operations.md +374 -0
- package/docs/tools/image-extraction.md +624 -0
- package/docs/tools/material-design.md +347 -0
- package/docs/tools/theme-matching.md +552 -0
- package/eslint.config.ts +14 -0
- package/examples/theme-matching.md +113 -0
- package/jsr.json +7 -0
- package/mcp-config.json +8 -0
- package/note.md +35 -0
- package/package.json +122 -0
- package/research_results.md +53 -0
- package/src/bin/coolors-mcp.ts +194 -0
- package/src/bin/server.ts +61 -0
- package/src/color/__tests__/conversions-argb.test.ts +198 -0
- package/src/color/__tests__/extract-colors.test.ts +360 -0
- package/src/color/__tests__/image-utils.test.ts +242 -0
- package/src/color/__tests__/reference-colors.test.ts +278 -0
- package/src/color/__tests__/round-trip.test.ts +197 -0
- package/src/color/conversions.test.ts +402 -0
- package/src/color/conversions.ts +393 -0
- package/src/color/dislike/__tests__/dislike-analyzer.test.ts +248 -0
- package/src/color/dislike/dislike-analyzer.ts +114 -0
- package/src/color/extract-colors.ts +228 -0
- package/src/color/hct/__tests__/hct-class.test.ts +232 -0
- package/src/color/hct/harmonization.ts +204 -0
- package/src/color/hct/hct-class.ts +109 -0
- package/src/color/hct/hct-solver.ts +168 -0
- package/src/color/hct/index.ts +39 -0
- package/src/color/hct/tonal-palette.ts +211 -0
- package/src/color/hct/types.ts +88 -0
- package/src/color/image-utils.ts +79 -0
- package/src/color/index.ts +87 -0
- package/src/color/material-theme.ts +157 -0
- package/src/color/metrics.test.ts +276 -0
- package/src/color/metrics.ts +281 -0
- package/src/color/quantize/__tests__/quantizer_celebi.test.ts +195 -0
- package/src/color/quantize/lab_point_provider.ts +55 -0
- package/src/color/quantize/point_provider.ts +27 -0
- package/src/color/quantize/quantizer_celebi.ts +51 -0
- package/src/color/quantize/quantizer_celebi_test.ts +71 -0
- package/src/color/quantize/quantizer_map.ts +47 -0
- package/src/color/quantize/quantizer_wsmeans.ts +232 -0
- package/src/color/quantize/quantizer_wu.ts +472 -0
- package/src/color/score/__tests__/score.test.ts +224 -0
- package/src/color/score/score.ts +175 -0
- package/src/color/types.ts +151 -0
- package/src/color/utils/color_utils.ts +292 -0
- package/src/color/utils/math_utils.ts +145 -0
- package/src/color/utils.test.ts +403 -0
- package/src/color/utils.ts +315 -0
- package/src/constants.ts +5 -0
- package/src/coolors-mcp.ts +37 -0
- package/src/examples/addition.ts +333 -0
- package/src/examples/color-demo.ts +125 -0
- package/src/examples/custom-logger.ts +201 -0
- package/src/examples/oauth-server.ts +113 -0
- package/src/examples/session-context.ts +269 -0
- package/src/session.ts +116 -0
- package/src/theme/__tests__/matcher.test.ts +180 -0
- package/src/theme/__tests__/parser.test.ts +148 -0
- package/src/theme/__tests__/refactor.test.ts +224 -0
- package/src/theme/index.ts +34 -0
- package/src/theme/matcher.ts +395 -0
- package/src/theme/parser.ts +392 -0
- package/src/theme/refactor.ts +360 -0
- package/src/theme/types.ts +152 -0
- package/src/tools/__tests__/gradient-generator.test.ts +206 -0
- package/src/tools/__tests__/palette-with-locks.test.ts +109 -0
- package/src/tools/color-conversion.tool.ts +54 -0
- package/src/tools/color-distance.tool.ts +41 -0
- package/src/tools/colors.ts +31 -0
- package/src/tools/contrast-checker.tool.ts +37 -0
- package/src/tools/dislike-analyzer.tool.ts +247 -0
- package/src/tools/gradient-generator.tool.ts +250 -0
- package/src/tools/image-extraction.tools.ts +289 -0
- package/src/tools/index.ts +39 -0
- package/src/tools/material-theme.tools.ts +250 -0
- package/src/tools/palette-generator.tool.ts +135 -0
- package/src/tools/palette-with-locks.tool.ts +221 -0
- package/src/tools/registry.ts +142 -0
- package/src/tools/simple-tools.ts +37 -0
- package/src/tools/theme-matching.tools.ts +334 -0
- package/src/types.ts +182 -0
- package/src/utils.ts +22 -0
- package/tsconfig.json +8 -0
- package/vitest.config.js +15 -0
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Example demonstrating the color utilities module
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import {
|
|
6
|
+
areColorsSimilar,
|
|
7
|
+
// Distance metrics
|
|
8
|
+
colorDistance,
|
|
9
|
+
darken,
|
|
10
|
+
findMostSimilarColor,
|
|
11
|
+
getContrastRatio,
|
|
12
|
+
|
|
13
|
+
// Utility functions
|
|
14
|
+
getLuminance,
|
|
15
|
+
hexToRgb,
|
|
16
|
+
lighten,
|
|
17
|
+
meetsContrastAA,
|
|
18
|
+
mixColors,
|
|
19
|
+
// Types
|
|
20
|
+
type RGB,
|
|
21
|
+
// Conversion functions
|
|
22
|
+
rgbToHex,
|
|
23
|
+
rgbToHsl,
|
|
24
|
+
rgbToLab,
|
|
25
|
+
} from "../color/index.js";
|
|
26
|
+
|
|
27
|
+
// Example colors
|
|
28
|
+
const red: RGB = { b: 0, g: 0, r: 255 };
|
|
29
|
+
const blue: RGB = { b: 255, g: 0, r: 0 };
|
|
30
|
+
const green: RGB = { b: 0, g: 255, r: 0 };
|
|
31
|
+
const white: RGB = { b: 255, g: 255, r: 255 };
|
|
32
|
+
const black: RGB = { b: 0, g: 0, r: 0 };
|
|
33
|
+
|
|
34
|
+
console.log("=== Color Conversions ===");
|
|
35
|
+
console.log("Red to Hex:", rgbToHex(red)); // #ff0000
|
|
36
|
+
console.log("Hex to RGB:", hexToRgb("#00ff00")); // { r: 0, g: 255, b: 0 }
|
|
37
|
+
console.log("Red to HSL:", rgbToHsl(red)); // { h: 0, s: 100, l: 50 }
|
|
38
|
+
console.log("Red to LAB:", rgbToLab(red)); // L*a*b* color space
|
|
39
|
+
|
|
40
|
+
console.log("\n=== Color Distance Metrics ===");
|
|
41
|
+
console.log("Distance Red-Blue (Delta E 2000):", colorDistance(red, blue));
|
|
42
|
+
console.log("Distance Red-Green (Delta E 2000):", colorDistance(red, green));
|
|
43
|
+
console.log(
|
|
44
|
+
"Are Red and slightly darker Red similar?",
|
|
45
|
+
areColorsSimilar(red, { b: 5, g: 5, r: 250 }),
|
|
46
|
+
);
|
|
47
|
+
|
|
48
|
+
// Find most similar color from a palette
|
|
49
|
+
const palette: RGB[] = [
|
|
50
|
+
{ b: 0, g: 0, r: 200 }, // Dark red
|
|
51
|
+
{ b: 0, g: 200, r: 0 }, // Dark green
|
|
52
|
+
{ b: 200, g: 0, r: 0 }, // Dark blue
|
|
53
|
+
{ b: 100, g: 100, r: 255 }, // Light red
|
|
54
|
+
];
|
|
55
|
+
|
|
56
|
+
const target: RGB = { b: 50, g: 50, r: 255 }; // Reddish color
|
|
57
|
+
const mostSimilar = findMostSimilarColor(target, palette);
|
|
58
|
+
console.log("Most similar to reddish:", mostSimilar);
|
|
59
|
+
|
|
60
|
+
console.log("\n=== Color Utilities ===");
|
|
61
|
+
console.log("Luminance of white:", getLuminance(white)); // ~1.0
|
|
62
|
+
console.log("Luminance of black:", getLuminance(black)); // 0.0
|
|
63
|
+
console.log("Contrast ratio (black/white):", getContrastRatio(black, white)); // 21:1
|
|
64
|
+
console.log("Meets AA standard?", meetsContrastAA(black, white)); // true
|
|
65
|
+
|
|
66
|
+
console.log("\n=== Color Manipulation ===");
|
|
67
|
+
const lightRed = lighten(red, 20);
|
|
68
|
+
console.log("Lightened red:", lightRed);
|
|
69
|
+
|
|
70
|
+
const darkBlue = darken(blue, 30);
|
|
71
|
+
console.log("Darkened blue:", darkBlue);
|
|
72
|
+
|
|
73
|
+
const purple = mixColors(red, blue, 0.5);
|
|
74
|
+
console.log("Mix red and blue (purple):", purple);
|
|
75
|
+
|
|
76
|
+
console.log("\n=== Advanced Examples ===");
|
|
77
|
+
|
|
78
|
+
// Example 1: Check if a text color has enough contrast
|
|
79
|
+
function checkTextContrast(textColor: RGB, backgroundColor: RGB): void {
|
|
80
|
+
const ratio = getContrastRatio(textColor, backgroundColor);
|
|
81
|
+
const meetsAA = meetsContrastAA(textColor, backgroundColor);
|
|
82
|
+
const meetsAAA = ratio >= 7.0; // AAA standard for normal text
|
|
83
|
+
|
|
84
|
+
console.log(`Contrast ratio: ${ratio.toFixed(2)}:1`);
|
|
85
|
+
console.log(`WCAG AA: ${meetsAA ? "✓" : "✗"}`);
|
|
86
|
+
console.log(`WCAG AAA: ${meetsAAA ? "✓" : "✗"}`);
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
console.log("\nChecking dark gray on white:");
|
|
90
|
+
checkTextContrast({ b: 85, g: 85, r: 85 }, white);
|
|
91
|
+
|
|
92
|
+
// Example 2: Find perceptually different colors
|
|
93
|
+
function findDistinctColors(baseColor: RGB, candidates: RGB[]): RGB[] {
|
|
94
|
+
return candidates.filter(
|
|
95
|
+
(color) => colorDistance(baseColor, color, { metric: "deltaE2000" }) > 50,
|
|
96
|
+
);
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
const distinctFromRed = findDistinctColors(red, palette);
|
|
100
|
+
console.log("\nColors distinct from red:", distinctFromRed);
|
|
101
|
+
|
|
102
|
+
// Example 3: Create a color scheme
|
|
103
|
+
function createMonochromaticScheme(baseColor: RGB, steps: number = 5): RGB[] {
|
|
104
|
+
const scheme: RGB[] = [];
|
|
105
|
+
const stepSize = 100 / (steps - 1);
|
|
106
|
+
|
|
107
|
+
for (let i = 0; i < steps; i++) {
|
|
108
|
+
const amount = stepSize * i - 50; // -50 to +50
|
|
109
|
+
if (amount < 0) {
|
|
110
|
+
scheme.push(darken(baseColor, Math.abs(amount)));
|
|
111
|
+
} else if (amount > 0) {
|
|
112
|
+
scheme.push(lighten(baseColor, amount));
|
|
113
|
+
} else {
|
|
114
|
+
scheme.push(baseColor);
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
return scheme;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
const blueScheme = createMonochromaticScheme(blue, 5);
|
|
122
|
+
console.log("\nMonochromatic blue scheme:");
|
|
123
|
+
blueScheme.forEach((color, i) => {
|
|
124
|
+
console.log(` Step ${i + 1}:`, rgbToHex(color));
|
|
125
|
+
});
|
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Example CoolorsMCP server demonstrating custom logger implementations.
|
|
3
|
+
*
|
|
4
|
+
* Features demonstrated:
|
|
5
|
+
* - Simple custom logger implementation
|
|
6
|
+
* - File-based logging example
|
|
7
|
+
* - Winston logger adapter
|
|
8
|
+
* - Pino logger adapter
|
|
9
|
+
*
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
import { z } from "zod";
|
|
13
|
+
|
|
14
|
+
import { CoolorsMcp, Logger } from "../coolors-mcp.js";
|
|
15
|
+
|
|
16
|
+
// Example 1: Simple Custom Logger Implementation
|
|
17
|
+
class SimpleCustomLogger implements Logger {
|
|
18
|
+
debug(...args: unknown[]): void {
|
|
19
|
+
console.log("[CUSTOM DEBUG]", new Date().toISOString(), ...args);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
error(...args: unknown[]): void {
|
|
23
|
+
console.error("[CUSTOM ERROR]", new Date().toISOString(), ...args);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
info(...args: unknown[]): void {
|
|
27
|
+
console.info("[CUSTOM INFO]", new Date().toISOString(), ...args);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
log(...args: unknown[]): void {
|
|
31
|
+
console.log("[CUSTOM LOG]", new Date().toISOString(), ...args);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
warn(...args: unknown[]): void {
|
|
35
|
+
console.warn("[CUSTOM WARN]", new Date().toISOString(), ...args);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
// Example 2: File-based Logger
|
|
40
|
+
// class FileLogger implements Logger {
|
|
41
|
+
// debug(...args: unknown[]): void {
|
|
42
|
+
// this.logToFile('DEBUG', ...args);
|
|
43
|
+
// }
|
|
44
|
+
|
|
45
|
+
// error(...args: unknown[]): void {
|
|
46
|
+
// this.logToFile('ERROR', ...args);
|
|
47
|
+
// }
|
|
48
|
+
|
|
49
|
+
// info(...args: unknown[]): void {
|
|
50
|
+
// this.logToFile('INFO', ...args);
|
|
51
|
+
// }
|
|
52
|
+
|
|
53
|
+
// log(...args: unknown[]): void {
|
|
54
|
+
// this.logToFile('LOG', ...args);
|
|
55
|
+
// }
|
|
56
|
+
|
|
57
|
+
// warn(...args: unknown[]): void {
|
|
58
|
+
// this.logToFile('WARN', ...args);
|
|
59
|
+
// }
|
|
60
|
+
|
|
61
|
+
// private logToFile(level: string, ...args: unknown[]): void {
|
|
62
|
+
// const timestamp = new Date().toISOString();
|
|
63
|
+
// const message = `[${timestamp}] [${level}] ${args.map(arg =>
|
|
64
|
+
// typeof arg === 'object' ? JSON.stringify(arg) : String(arg)
|
|
65
|
+
// ).join(' ')}\n`;
|
|
66
|
+
|
|
67
|
+
// // In a real implementation, you might use fs.appendFile or a logging library
|
|
68
|
+
// console.log(message.trim());
|
|
69
|
+
// }
|
|
70
|
+
// }
|
|
71
|
+
|
|
72
|
+
// Example 3: Winston Logger Adapter
|
|
73
|
+
// To use this example, install winston: npm install winston
|
|
74
|
+
// import winston from 'winston';
|
|
75
|
+
|
|
76
|
+
// class WinstonLoggerAdapter implements Logger {
|
|
77
|
+
// private winston: winston.Logger;
|
|
78
|
+
|
|
79
|
+
// constructor() {
|
|
80
|
+
// this.winston = winston.createLogger({
|
|
81
|
+
// level: 'debug',
|
|
82
|
+
// format: winston.format.combine(
|
|
83
|
+
// winston.format.timestamp(),
|
|
84
|
+
// winston.format.errors({ stack: true }),
|
|
85
|
+
// winston.format.json()
|
|
86
|
+
// ),
|
|
87
|
+
// transports: [
|
|
88
|
+
// new winston.transports.Console({
|
|
89
|
+
// format: winston.format.combine(
|
|
90
|
+
// winston.format.colorize(),
|
|
91
|
+
// winston.format.simple()
|
|
92
|
+
// )
|
|
93
|
+
// }),
|
|
94
|
+
// new winston.transports.File({ filename: 'coolors-mcp.log' })
|
|
95
|
+
// ]
|
|
96
|
+
// });
|
|
97
|
+
// }
|
|
98
|
+
|
|
99
|
+
// debug(...args: unknown[]): void {
|
|
100
|
+
// this.winston.debug(this.formatArgs(args));
|
|
101
|
+
// }
|
|
102
|
+
|
|
103
|
+
// error(...args: unknown[]): void {
|
|
104
|
+
// this.winston.error(this.formatArgs(args));
|
|
105
|
+
// }
|
|
106
|
+
|
|
107
|
+
// info(...args: unknown[]): void {
|
|
108
|
+
// this.winston.info(this.formatArgs(args));
|
|
109
|
+
// }
|
|
110
|
+
|
|
111
|
+
// log(...args: unknown[]): void {
|
|
112
|
+
// this.winston.info(this.formatArgs(args));
|
|
113
|
+
// }
|
|
114
|
+
|
|
115
|
+
// warn(...args: unknown[]): void {
|
|
116
|
+
// this.winston.warn(this.formatArgs(args));
|
|
117
|
+
// }
|
|
118
|
+
|
|
119
|
+
// private formatArgs(args: unknown[]): string {
|
|
120
|
+
// return args.map(arg =>
|
|
121
|
+
// typeof arg === 'object' ? JSON.stringify(arg) : String(arg)
|
|
122
|
+
// ).join(' ');
|
|
123
|
+
// }
|
|
124
|
+
// }
|
|
125
|
+
|
|
126
|
+
// Example 4: Pino Logger Adapter
|
|
127
|
+
// To use this example, install pino: npm install pino
|
|
128
|
+
// import pino from 'pino';
|
|
129
|
+
//
|
|
130
|
+
// class PinoLoggerAdapter implements Logger {
|
|
131
|
+
// private pino: pino.Logger;
|
|
132
|
+
//
|
|
133
|
+
// constructor() {
|
|
134
|
+
// this.pino = pino({
|
|
135
|
+
// level: 'debug',
|
|
136
|
+
// transport: {
|
|
137
|
+
// target: 'pino-pretty',
|
|
138
|
+
// options: {
|
|
139
|
+
// colorize: true,
|
|
140
|
+
// translateTime: 'SYS:standard',
|
|
141
|
+
// ignore: 'pid,hostname'
|
|
142
|
+
// }
|
|
143
|
+
// }
|
|
144
|
+
// });
|
|
145
|
+
// }
|
|
146
|
+
//
|
|
147
|
+
// debug(...args: unknown[]): void {
|
|
148
|
+
// this.pino.debug(this.formatMessage(args));
|
|
149
|
+
// }
|
|
150
|
+
//
|
|
151
|
+
// error(...args: unknown[]): void {
|
|
152
|
+
// this.pino.error(this.formatMessage(args));
|
|
153
|
+
// }
|
|
154
|
+
//
|
|
155
|
+
// info(...args: unknown[]): void {
|
|
156
|
+
// this.pino.info(this.formatMessage(args));
|
|
157
|
+
// }
|
|
158
|
+
//
|
|
159
|
+
// log(...args: unknown[]): void {
|
|
160
|
+
// this.pino.info(this.formatMessage(args));
|
|
161
|
+
// }
|
|
162
|
+
//
|
|
163
|
+
// warn(...args: unknown[]): void {
|
|
164
|
+
// this.pino.warn(this.formatMessage(args));
|
|
165
|
+
// }
|
|
166
|
+
//
|
|
167
|
+
// private formatMessage(args: unknown[]): string {
|
|
168
|
+
// return args.map(arg =>
|
|
169
|
+
// typeof arg === 'object' ? JSON.stringify(arg) : String(arg)
|
|
170
|
+
// ).join(' ');
|
|
171
|
+
// }
|
|
172
|
+
// }
|
|
173
|
+
|
|
174
|
+
// Choose which logger to use (uncomment the one you want to use)
|
|
175
|
+
const logger = new SimpleCustomLogger();
|
|
176
|
+
// const logger = new FileLogger();
|
|
177
|
+
// const logger = new WinstonLoggerAdapter();
|
|
178
|
+
// const logger = new PinoLoggerAdapter();
|
|
179
|
+
|
|
180
|
+
const server = new CoolorsMcp({
|
|
181
|
+
logger: logger,
|
|
182
|
+
name: "custom-logger-example",
|
|
183
|
+
version: "1.0.0",
|
|
184
|
+
});
|
|
185
|
+
|
|
186
|
+
server.addTool({
|
|
187
|
+
description: "A test tool that demonstrates custom logging",
|
|
188
|
+
execute: async (args) => {
|
|
189
|
+
return `Received: ${args.message}`;
|
|
190
|
+
},
|
|
191
|
+
name: "test_tool",
|
|
192
|
+
parameters: z.object({
|
|
193
|
+
message: z.string().describe("A message to log"),
|
|
194
|
+
}),
|
|
195
|
+
});
|
|
196
|
+
|
|
197
|
+
// Start the server with stdio transport
|
|
198
|
+
server.start({ transportType: "stdio" }).catch((error: unknown) => {
|
|
199
|
+
console.error("Failed to start server:", error);
|
|
200
|
+
process.exit(1);
|
|
201
|
+
});
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Example CoolorsMCP server demonstrating OAuth well-known endpoint support.
|
|
3
|
+
*
|
|
4
|
+
* This example shows how to configure CoolorsMCP to serve OAuth discovery endpoints
|
|
5
|
+
* for both authorization server metadata and protected resource metadata.
|
|
6
|
+
*
|
|
7
|
+
* Run with: node dist/examples/oauth-server.js --transport http-stream --port 4111
|
|
8
|
+
* Then visit:
|
|
9
|
+
* - http://localhost:4111/.well-known/oauth-authorization-server
|
|
10
|
+
* - http://localhost:4111/.well-known/oauth-protected-resource
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
import { CoolorsMcp } from "../coolors-mcp.js";
|
|
14
|
+
|
|
15
|
+
const server = new CoolorsMcp({
|
|
16
|
+
name: "OAuth Example Server",
|
|
17
|
+
oauth: {
|
|
18
|
+
authorizationServer: {
|
|
19
|
+
authorizationEndpoint: "https://auth.example.com/oauth/authorize",
|
|
20
|
+
codeChallengeMethodsSupported: ["S256"],
|
|
21
|
+
// DPoP support
|
|
22
|
+
dpopSigningAlgValuesSupported: ["ES256", "RS256"],
|
|
23
|
+
grantTypesSupported: ["authorization_code", "refresh_token"],
|
|
24
|
+
|
|
25
|
+
introspectionEndpoint: "https://auth.example.com/oauth/introspect",
|
|
26
|
+
// Required fields
|
|
27
|
+
issuer: "https://auth.example.com",
|
|
28
|
+
// Optional fields
|
|
29
|
+
jwksUri: "https://auth.example.com/.well-known/jwks.json",
|
|
30
|
+
opPolicyUri: "https://example.com/policy",
|
|
31
|
+
opTosUri: "https://example.com/terms",
|
|
32
|
+
registrationEndpoint: "https://auth.example.com/oauth/register",
|
|
33
|
+
responseModesSupported: ["query", "fragment"],
|
|
34
|
+
responseTypesSupported: ["code"],
|
|
35
|
+
revocationEndpoint: "https://auth.example.com/oauth/revoke",
|
|
36
|
+
scopesSupported: ["read", "write", "admin"],
|
|
37
|
+
serviceDocumentation: "https://docs.example.com/oauth",
|
|
38
|
+
tokenEndpoint: "https://auth.example.com/oauth/token",
|
|
39
|
+
tokenEndpointAuthMethodsSupported: [
|
|
40
|
+
"client_secret_basic",
|
|
41
|
+
"client_secret_post",
|
|
42
|
+
],
|
|
43
|
+
tokenEndpointAuthSigningAlgValuesSupported: ["RS256", "ES256"],
|
|
44
|
+
|
|
45
|
+
uiLocalesSupported: ["en-US", "es-ES"],
|
|
46
|
+
},
|
|
47
|
+
enabled: true,
|
|
48
|
+
protectedResource: {
|
|
49
|
+
authorizationDetailsTypesSupported: [
|
|
50
|
+
"payment_initiation",
|
|
51
|
+
"account_access",
|
|
52
|
+
],
|
|
53
|
+
authorizationServers: ["https://auth.example.com"],
|
|
54
|
+
bearerMethodsSupported: ["header"],
|
|
55
|
+
dpopBoundAccessTokensRequired: false,
|
|
56
|
+
dpopSigningAlgValuesSupported: ["ES256", "RS256"],
|
|
57
|
+
jwksUri: "https://oauth-example-server.example.com/.well-known/jwks.json",
|
|
58
|
+
resource: "mcp://oauth-example-server",
|
|
59
|
+
resourceDocumentation: "https://docs.example.com/mcp-api",
|
|
60
|
+
resourceName: "OAuth Example API",
|
|
61
|
+
resourcePolicyUri: "https://example.com/resource-policy",
|
|
62
|
+
resourceSigningAlgValuesSupported: ["RS256", "ES256"],
|
|
63
|
+
resourceTosUri: "https://example.com/terms-of-service",
|
|
64
|
+
scopesSupported: ["read", "write", "admin"],
|
|
65
|
+
serviceDocumentation: "https://developer.example.com/api-docs",
|
|
66
|
+
tlsClientCertificateBoundAccessTokens: false,
|
|
67
|
+
},
|
|
68
|
+
},
|
|
69
|
+
version: "1.0.0",
|
|
70
|
+
});
|
|
71
|
+
|
|
72
|
+
// Add a simple tool to demonstrate the server functionality
|
|
73
|
+
server.addTool({
|
|
74
|
+
description: "Get information about this OAuth-enabled MCP server",
|
|
75
|
+
execute: async () => {
|
|
76
|
+
return {
|
|
77
|
+
content: [
|
|
78
|
+
{
|
|
79
|
+
text: `This is an OAuth-enabled CoolorsMCP server!
|
|
80
|
+
|
|
81
|
+
OAuth Discovery Endpoints:
|
|
82
|
+
- Authorization Server: /.well-known/oauth-authorization-server
|
|
83
|
+
- Protected Resource: /.well-known/oauth-protected-resource
|
|
84
|
+
|
|
85
|
+
The server demonstrates how to configure OAuth metadata for MCP servers
|
|
86
|
+
that need to integrate with OAuth 2.0 authorization flows.`,
|
|
87
|
+
type: "text",
|
|
88
|
+
},
|
|
89
|
+
],
|
|
90
|
+
};
|
|
91
|
+
},
|
|
92
|
+
name: "get-server-info",
|
|
93
|
+
});
|
|
94
|
+
|
|
95
|
+
// Start the server
|
|
96
|
+
await server.start({
|
|
97
|
+
httpStream: { port: 4111 },
|
|
98
|
+
transportType: "httpStream",
|
|
99
|
+
});
|
|
100
|
+
|
|
101
|
+
console.log(`
|
|
102
|
+
🚀 OAuth Example Server is running!
|
|
103
|
+
|
|
104
|
+
Try these endpoints:
|
|
105
|
+
- MCP (HTTP Stream): http://localhost:4111/mcp
|
|
106
|
+
- MCP (SSE): http://localhost:4111/sse
|
|
107
|
+
- Health: http://localhost:4111/health
|
|
108
|
+
- OAuth Authorization Server: http://localhost:4111/.well-known/oauth-authorization-server
|
|
109
|
+
- OAuth Protected Resource: http://localhost:4111/.well-known/oauth-protected-resource
|
|
110
|
+
|
|
111
|
+
The OAuth endpoints work with both SSE and HTTP Stream transports and return
|
|
112
|
+
JSON metadata following RFC 8414 standards.
|
|
113
|
+
`);
|
|
@@ -0,0 +1,269 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Example demonstrating session context support in CoolorsMCP stdio transport
|
|
3
|
+
*
|
|
4
|
+
* This example demonstrates the fix for issue #144:
|
|
5
|
+
* Session context is now properly passed to tool execution handlers
|
|
6
|
+
* when using stdio transport with an authenticate function.
|
|
7
|
+
*
|
|
8
|
+
* To run this example:
|
|
9
|
+
* npx coolors-mcp dev src/examples/session-context.ts
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
import { z } from "zod";
|
|
13
|
+
|
|
14
|
+
import { CoolorsMcp } from "../coolors-mcp.js";
|
|
15
|
+
|
|
16
|
+
interface UserSession {
|
|
17
|
+
[key: string]: unknown;
|
|
18
|
+
permissions: string[];
|
|
19
|
+
role: "admin" | "guest" | "user";
|
|
20
|
+
userId: string;
|
|
21
|
+
username: string;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
const server = new CoolorsMcp<UserSession>({
|
|
25
|
+
authenticate: async (request) => {
|
|
26
|
+
if (!request) {
|
|
27
|
+
console.log(
|
|
28
|
+
"[Auth] Authenticating stdio transport using environment variables",
|
|
29
|
+
);
|
|
30
|
+
|
|
31
|
+
const userId = process.env.USER_ID || "default-user";
|
|
32
|
+
const username = process.env.USERNAME || "Anonymous";
|
|
33
|
+
const role =
|
|
34
|
+
(process.env.USER_ROLE as "admin" | "guest" | "user") || "guest";
|
|
35
|
+
// Mock permissions based on role
|
|
36
|
+
const permissions =
|
|
37
|
+
role === "admin"
|
|
38
|
+
? ["read", "write", "delete", "admin"]
|
|
39
|
+
: role === "user"
|
|
40
|
+
? ["read", "write"]
|
|
41
|
+
: ["read"];
|
|
42
|
+
const session: UserSession = {
|
|
43
|
+
authenticatedAt: new Date().toISOString(),
|
|
44
|
+
permissions,
|
|
45
|
+
role,
|
|
46
|
+
userId,
|
|
47
|
+
username,
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
console.log(`[Auth] Authenticated user: ${username} (${role})`);
|
|
51
|
+
|
|
52
|
+
return session;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
// For HTTP transport (request contains headers)
|
|
56
|
+
console.log("[Auth] Authenticating HTTP transport using headers");
|
|
57
|
+
|
|
58
|
+
const authHeader = request.headers["authorization"] as string;
|
|
59
|
+
|
|
60
|
+
if (!authHeader || !authHeader.startsWith("Bearer ")) {
|
|
61
|
+
throw new Response("Missing or invalid authorization header", {
|
|
62
|
+
status: 401,
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
const token = authHeader.substring(7);
|
|
67
|
+
|
|
68
|
+
// Mock token validation (in real implementation, validate against your auth service)
|
|
69
|
+
if (token === "admin-token") {
|
|
70
|
+
return {
|
|
71
|
+
authenticatedAt: new Date().toISOString(),
|
|
72
|
+
permissions: ["read", "write", "delete", "admin"],
|
|
73
|
+
role: "admin" as const,
|
|
74
|
+
userId: "admin-001",
|
|
75
|
+
username: "Administrator",
|
|
76
|
+
};
|
|
77
|
+
} else if (token === "user-token") {
|
|
78
|
+
return {
|
|
79
|
+
authenticatedAt: new Date().toISOString(),
|
|
80
|
+
permissions: ["read", "write"],
|
|
81
|
+
role: "user" as const,
|
|
82
|
+
userId: "user-001",
|
|
83
|
+
username: "Regular User",
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
throw new Response("Invalid token", { status: 401 });
|
|
88
|
+
},
|
|
89
|
+
name: "Session Context Demo",
|
|
90
|
+
version: "1.0.0",
|
|
91
|
+
});
|
|
92
|
+
|
|
93
|
+
// Tool that demonstrates session context access
|
|
94
|
+
server.addTool({
|
|
95
|
+
description: "Get information about the current authenticated user",
|
|
96
|
+
execute: async (_args, context) => {
|
|
97
|
+
if (!context.session)
|
|
98
|
+
return "No session context available (this shouldn't happen after the fix!)";
|
|
99
|
+
|
|
100
|
+
const { session } = context;
|
|
101
|
+
|
|
102
|
+
return `✓ Session Context Available!
|
|
103
|
+
|
|
104
|
+
User Info:
|
|
105
|
+
- User ID: ${session.userId}
|
|
106
|
+
- Username: ${session.username}
|
|
107
|
+
- Role: ${session.role}
|
|
108
|
+
- Permissions: ${session.permissions.join(", ")}
|
|
109
|
+
- Authenticated At: ${session.authenticatedAt}`;
|
|
110
|
+
},
|
|
111
|
+
name: "whoami",
|
|
112
|
+
});
|
|
113
|
+
|
|
114
|
+
// Tool that demonstrates role-based access
|
|
115
|
+
server.addTool({
|
|
116
|
+
description: "Perform an admin-only operation (requires admin role)",
|
|
117
|
+
execute: async (args, context) => {
|
|
118
|
+
if (!context.session)
|
|
119
|
+
return "No session context - cannot verify permissions";
|
|
120
|
+
if (context.session.role !== "admin")
|
|
121
|
+
return `Access denied. Current role: ${context.session.role}, required: admin`;
|
|
122
|
+
if (!context.session.permissions.includes("admin"))
|
|
123
|
+
return "Insufficient permissions for admin operations";
|
|
124
|
+
|
|
125
|
+
return `✓ Admin operation "${args.action}" executed successfully by ${context.session.username}`;
|
|
126
|
+
},
|
|
127
|
+
name: "admin-operation",
|
|
128
|
+
parameters: z.object({
|
|
129
|
+
action: z.string().describe("The admin action to perform"),
|
|
130
|
+
}),
|
|
131
|
+
});
|
|
132
|
+
|
|
133
|
+
// Tool that demonstrates permission checks
|
|
134
|
+
server.addTool({
|
|
135
|
+
description: "Check what permissions the current user has",
|
|
136
|
+
execute: async (args, context) => {
|
|
137
|
+
if (!context.session) return "No session context available";
|
|
138
|
+
|
|
139
|
+
const hasPermission = context.session.permissions.includes(args.operation);
|
|
140
|
+
|
|
141
|
+
return `Permission Check for "${args.operation}":
|
|
142
|
+
${hasPermission ? "✓ ALLOWED" : "! DENIED"}
|
|
143
|
+
|
|
144
|
+
Your permissions: ${context.session.permissions.join(", ")}
|
|
145
|
+
Your role: ${context.session.role}`;
|
|
146
|
+
},
|
|
147
|
+
name: "check-permissions",
|
|
148
|
+
parameters: z.object({
|
|
149
|
+
operation: z.string().describe("Operation to check permission for"),
|
|
150
|
+
}),
|
|
151
|
+
});
|
|
152
|
+
|
|
153
|
+
// Resource that uses session context
|
|
154
|
+
server.addResource({
|
|
155
|
+
description: "Get detailed information about the current authenticated user",
|
|
156
|
+
load: async (auth) => {
|
|
157
|
+
if (!auth) {
|
|
158
|
+
return {
|
|
159
|
+
text: JSON.stringify(
|
|
160
|
+
{
|
|
161
|
+
authenticated: false,
|
|
162
|
+
error: "No authentication context available",
|
|
163
|
+
},
|
|
164
|
+
|
|
165
|
+
null,
|
|
166
|
+
2,
|
|
167
|
+
),
|
|
168
|
+
};
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
return {
|
|
172
|
+
text: JSON.stringify(
|
|
173
|
+
{
|
|
174
|
+
authenticated: true,
|
|
175
|
+
user: {
|
|
176
|
+
authenticatedAt: auth.authenticatedAt,
|
|
177
|
+
id: auth.userId,
|
|
178
|
+
permissions: auth.permissions,
|
|
179
|
+
role: auth.role,
|
|
180
|
+
username: auth.username,
|
|
181
|
+
},
|
|
182
|
+
},
|
|
183
|
+
|
|
184
|
+
null,
|
|
185
|
+
2,
|
|
186
|
+
),
|
|
187
|
+
};
|
|
188
|
+
},
|
|
189
|
+
mimeType: "application/json",
|
|
190
|
+
name: "Current User Information",
|
|
191
|
+
uri: "session://current-user",
|
|
192
|
+
});
|
|
193
|
+
|
|
194
|
+
// Prompt that uses session context
|
|
195
|
+
server.addPrompt({
|
|
196
|
+
arguments: [
|
|
197
|
+
{
|
|
198
|
+
description: "Greeting style (formal, casual, friendly)",
|
|
199
|
+
name: "style",
|
|
200
|
+
required: false,
|
|
201
|
+
},
|
|
202
|
+
],
|
|
203
|
+
description: "Generate a personalized greeting based on the current user",
|
|
204
|
+
load: async (args, auth) => {
|
|
205
|
+
const style = args.style || "friendly";
|
|
206
|
+
|
|
207
|
+
if (!auth) {
|
|
208
|
+
return "Hello! I don't have access to your session information.";
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
const greetings = {
|
|
212
|
+
casual: `Hey ${auth.username}! Nice to see you again.`,
|
|
213
|
+
formal: `Good day, ${auth.username}. You are logged in with ${auth.role} privileges.`,
|
|
214
|
+
friendly: `Hello ${auth.username}! 😊 You're logged in as a ${auth.role}. How can I help you today?`,
|
|
215
|
+
};
|
|
216
|
+
|
|
217
|
+
return greetings[style as keyof typeof greetings] || greetings.friendly;
|
|
218
|
+
},
|
|
219
|
+
name: "personalized-greeting",
|
|
220
|
+
});
|
|
221
|
+
|
|
222
|
+
// Start the server
|
|
223
|
+
if (process.argv.includes("--http-stream")) {
|
|
224
|
+
const PORT = process.env.PORT ? parseInt(process.env.PORT, 10) : 3000;
|
|
225
|
+
|
|
226
|
+
server.start({
|
|
227
|
+
httpStream: { port: PORT },
|
|
228
|
+
transportType: "httpStream",
|
|
229
|
+
});
|
|
230
|
+
|
|
231
|
+
console.log(`
|
|
232
|
+
🚀 Session Context Demo server running on HTTP Stream!
|
|
233
|
+
|
|
234
|
+
Try these endpoints:
|
|
235
|
+
- MCP: http://localhost:${PORT}/mcp
|
|
236
|
+
- Health: http://localhost:${PORT}/health
|
|
237
|
+
|
|
238
|
+
Test with curl:
|
|
239
|
+
curl -H "Authorization: Bearer admin-token" \\
|
|
240
|
+
-H "Content-Type: application/json" \\
|
|
241
|
+
-d '{"method":"tools/call","params":{"name":"whoami","arguments":{}}}' \\
|
|
242
|
+
http://localhost:${PORT}/mcp
|
|
243
|
+
`);
|
|
244
|
+
} else {
|
|
245
|
+
server.start({ transportType: "stdio" });
|
|
246
|
+
|
|
247
|
+
console.log(`
|
|
248
|
+
🚀 Session Context Demo server started with stdio transport!
|
|
249
|
+
|
|
250
|
+
Environment variables for authentication:
|
|
251
|
+
- USER_ID=${process.env.USER_ID || "(not set - will use 'default-user')"}
|
|
252
|
+
- USERNAME=${process.env.USERNAME || "(not set - will use 'Anonymous')"}
|
|
253
|
+
- USER_ROLE=${process.env.USER_ROLE || "(not set - will use 'guest')"}
|
|
254
|
+
|
|
255
|
+
To test with different user roles:
|
|
256
|
+
USER_ID=admin001 USERNAME="John Admin" USER_ROLE=admin npx coolors-mcp dev src/examples/session-context.ts
|
|
257
|
+
|
|
258
|
+
Available tools:
|
|
259
|
+
- whoami: Get current user info
|
|
260
|
+
- admin-operation: Test admin permissions
|
|
261
|
+
- check-permissions: Check specific permissions
|
|
262
|
+
|
|
263
|
+
Available resources:
|
|
264
|
+
- session://current-user: Current user JSON data
|
|
265
|
+
|
|
266
|
+
Available prompts:
|
|
267
|
+
- personalized-greeting: Get a personalized greeting
|
|
268
|
+
`);
|
|
269
|
+
}
|