@identitate-md/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/dist/data.d.ts +11 -0
- package/dist/data.d.ts.map +1 -0
- package/dist/data.js +69 -0
- package/dist/data.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +28 -0
- package/dist/index.js.map +1 -0
- package/dist/resources/index.d.ts +3 -0
- package/dist/resources/index.d.ts.map +1 -0
- package/dist/resources/index.js +47 -0
- package/dist/resources/index.js.map +1 -0
- package/dist/tools/get-brand-colors.d.ts +3 -0
- package/dist/tools/get-brand-colors.d.ts.map +1 -0
- package/dist/tools/get-brand-colors.js +85 -0
- package/dist/tools/get-brand-colors.js.map +1 -0
- package/dist/tools/get-institution.d.ts +3 -0
- package/dist/tools/get-institution.d.ts.map +1 -0
- package/dist/tools/get-institution.js +59 -0
- package/dist/tools/get-institution.js.map +1 -0
- package/dist/tools/get-logo.d.ts +3 -0
- package/dist/tools/get-logo.d.ts.map +1 -0
- package/dist/tools/get-logo.js +94 -0
- package/dist/tools/get-logo.js.map +1 -0
- package/dist/tools/list-categories.d.ts +3 -0
- package/dist/tools/list-categories.d.ts.map +1 -0
- package/dist/tools/list-categories.js +15 -0
- package/dist/tools/list-categories.js.map +1 -0
- package/dist/tools/search.d.ts +3 -0
- package/dist/tools/search.d.ts.map +1 -0
- package/dist/tools/search.js +90 -0
- package/dist/tools/search.js.map +1 -0
- package/dist/types.d.ts +118 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +3 -0
- package/dist/types.js.map +1 -0
- package/package.json +54 -0
package/dist/data.d.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Institution, InstitutionsIndex, CategoryEntry } from "./types.js";
|
|
2
|
+
export declare function init(): void;
|
|
3
|
+
export declare function getAll(): Institution[];
|
|
4
|
+
export declare function getById(id: string): Institution | undefined;
|
|
5
|
+
export declare function getCategories(): CategoryEntry[];
|
|
6
|
+
export declare function getIndex(): InstitutionsIndex;
|
|
7
|
+
/** Resolve the local filesystem path for a logo file.
|
|
8
|
+
* logoPath looks like "/logos/md-age/symbol/color.svg"
|
|
9
|
+
*/
|
|
10
|
+
export declare function resolveLogoPath(logoPath: string): string;
|
|
11
|
+
//# sourceMappingURL=data.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"data.d.ts","sourceRoot":"","sources":["../src/data.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,WAAW,EAAE,iBAAiB,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AA8BhF,wBAAgB,IAAI,IAAI,IAAI,CAK3B;AAED,wBAAgB,MAAM,IAAI,WAAW,EAAE,CAGtC;AAED,wBAAgB,OAAO,CAAC,EAAE,EAAE,MAAM,GAAG,WAAW,GAAG,SAAS,CAG3D;AAED,wBAAgB,aAAa,IAAI,aAAa,EAAE,CAG/C;AAED,wBAAgB,QAAQ,IAAI,iBAAiB,CAG5C;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAcxD"}
|
package/dist/data.js
ADDED
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { createRequire } from "module";
|
|
2
|
+
import { readFileSync } from "fs";
|
|
3
|
+
import { resolve, dirname } from "path";
|
|
4
|
+
import { fileURLToPath } from "url";
|
|
5
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
6
|
+
const __dirname = dirname(__filename);
|
|
7
|
+
const req = createRequire(import.meta.url);
|
|
8
|
+
let _institutions = null;
|
|
9
|
+
let _categories = null;
|
|
10
|
+
let _index = null;
|
|
11
|
+
function loadIndexSync() {
|
|
12
|
+
// Prefer bundled data shipped with @identitate-md/logos
|
|
13
|
+
try {
|
|
14
|
+
const data = req("@identitate-md/logos/institutions-index");
|
|
15
|
+
if (data && Array.isArray(data.institutions)) {
|
|
16
|
+
return data;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
catch {
|
|
20
|
+
// fall through to local dev path
|
|
21
|
+
}
|
|
22
|
+
// Local dev / monorepo: load directly from website data
|
|
23
|
+
const fallback = resolve(__dirname, "../../../website/src/data/institutions-index.json");
|
|
24
|
+
return JSON.parse(readFileSync(fallback, "utf-8"));
|
|
25
|
+
}
|
|
26
|
+
export function init() {
|
|
27
|
+
const data = loadIndexSync();
|
|
28
|
+
_index = data;
|
|
29
|
+
_institutions = new Map(data.institutions.map((i) => [i.id, i]));
|
|
30
|
+
_categories = data.categories;
|
|
31
|
+
}
|
|
32
|
+
export function getAll() {
|
|
33
|
+
if (!_institutions)
|
|
34
|
+
throw new Error("Data not initialized. Call init() first.");
|
|
35
|
+
return Array.from(_institutions.values());
|
|
36
|
+
}
|
|
37
|
+
export function getById(id) {
|
|
38
|
+
if (!_institutions)
|
|
39
|
+
throw new Error("Data not initialized. Call init() first.");
|
|
40
|
+
return _institutions.get(id);
|
|
41
|
+
}
|
|
42
|
+
export function getCategories() {
|
|
43
|
+
if (!_categories)
|
|
44
|
+
throw new Error("Data not initialized. Call init() first.");
|
|
45
|
+
return _categories;
|
|
46
|
+
}
|
|
47
|
+
export function getIndex() {
|
|
48
|
+
if (!_index)
|
|
49
|
+
throw new Error("Data not initialized. Call init() first.");
|
|
50
|
+
return _index;
|
|
51
|
+
}
|
|
52
|
+
/** Resolve the local filesystem path for a logo file.
|
|
53
|
+
* logoPath looks like "/logos/md-age/symbol/color.svg"
|
|
54
|
+
*/
|
|
55
|
+
export function resolveLogoPath(logoPath) {
|
|
56
|
+
let logosRoot;
|
|
57
|
+
try {
|
|
58
|
+
const logosPackagePath = req.resolve("@identitate-md/logos/package.json");
|
|
59
|
+
logosRoot = dirname(logosPackagePath);
|
|
60
|
+
}
|
|
61
|
+
catch {
|
|
62
|
+
// Local dev: use monorepo packages/logos
|
|
63
|
+
logosRoot = resolve(__dirname, "../../../packages/logos");
|
|
64
|
+
}
|
|
65
|
+
// Strip leading "/logos/" prefix → "md-age/symbol/color.svg"
|
|
66
|
+
const relative = logoPath.replace(/^\/logos\//, "");
|
|
67
|
+
return resolve(logosRoot, "logos", relative);
|
|
68
|
+
}
|
|
69
|
+
//# sourceMappingURL=data.js.map
|
package/dist/data.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"data.js","sourceRoot":"","sources":["../src/data.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AACvC,OAAO,EAAE,YAAY,EAAE,MAAM,IAAI,CAAC;AAClC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AACxC,OAAO,EAAE,aAAa,EAAE,MAAM,KAAK,CAAC;AAGpC,MAAM,UAAU,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAClD,MAAM,SAAS,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;AAEtC,MAAM,GAAG,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAE3C,IAAI,aAAa,GAAoC,IAAI,CAAC;AAC1D,IAAI,WAAW,GAA2B,IAAI,CAAC;AAC/C,IAAI,MAAM,GAA6B,IAAI,CAAC;AAE5C,SAAS,aAAa;IACpB,wDAAwD;IACxD,IAAI,CAAC;QACH,MAAM,IAAI,GAAG,GAAG,CAAC,yCAAyC,CAAsB,CAAC;QACjF,IAAI,IAAI,IAAI,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,YAAY,CAAC,EAAE,CAAC;YAC7C,OAAO,IAAI,CAAC;QACd,CAAC;IACH,CAAC;IAAC,MAAM,CAAC;QACP,iCAAiC;IACnC,CAAC;IAED,wDAAwD;IACxD,MAAM,QAAQ,GAAG,OAAO,CACtB,SAAS,EACT,mDAAmD,CACpD,CAAC;IACF,OAAO,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,QAAQ,E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ACP,yCAAyC;QACzC,SAAS,GAAG,OAAO,CAAC,SAAS,EAAE,yBAAyB,CAAC,CAAC;IAC5D,CAAC;IAED,6DAA6D;IAC7D,MAAM,QAAQ,GAAG,QAAQ,CAAC,OAAO,CAAC,YAAY,EAAE,EAAE,CAAC,CAAC;IACpD,OAAO,OAAO,CAAC,SAAS,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAC;AAC/C,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":""}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
3
|
+
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
4
|
+
import { init } from "./data.js";
|
|
5
|
+
import { registerSearch } from "./tools/search.js";
|
|
6
|
+
import { registerGetInstitution } from "./tools/get-institution.js";
|
|
7
|
+
import { registerGetLogo } from "./tools/get-logo.js";
|
|
8
|
+
import { registerGetBrandColors } from "./tools/get-brand-colors.js";
|
|
9
|
+
import { registerListCategories } from "./tools/list-categories.js";
|
|
10
|
+
import { registerResources } from "./resources/index.js";
|
|
11
|
+
// Load data into memory once at startup
|
|
12
|
+
init();
|
|
13
|
+
const server = new McpServer({
|
|
14
|
+
name: "identitate-md",
|
|
15
|
+
version: "1.0.0",
|
|
16
|
+
});
|
|
17
|
+
// Register tools
|
|
18
|
+
registerSearch(server);
|
|
19
|
+
registerGetInstitution(server);
|
|
20
|
+
registerGetLogo(server);
|
|
21
|
+
registerGetBrandColors(server);
|
|
22
|
+
registerListCategories(server);
|
|
23
|
+
// Register resources
|
|
24
|
+
registerResources(server);
|
|
25
|
+
// Start stdio transport
|
|
26
|
+
const transport = new StdioServerTransport();
|
|
27
|
+
await server.connect(transport);
|
|
28
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AACpE,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AACrE,OAAO,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AACpE,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAEzD,wCAAwC;AACxC,IAAI,EAAE,CAAC;AAEP,MAAM,MAAM,GAAG,IAAI,SAAS,CAAC;IAC3B,IAAI,EAAE,eAAe;IACrB,OAAO,EAAE,OAAO;CACjB,CAAC,CAAC;AAEH,iBAAiB;AACjB,cAAc,CAAC,MAAM,CAAC,CAAC;AACvB,sBAAsB,CAAC,MAAM,CAAC,CAAC;AAC/B,eAAe,CAAC,MAAM,CAAC,CAAC;AACxB,sBAAsB,CAAC,MAAM,CAAC,CAAC;AAC/B,sBAAsB,CAAC,MAAM,CAAC,CAAC;AAE/B,qBAAqB;AACrB,iBAAiB,CAAC,MAAM,CAAC,CAAC;AAE1B,wBAAwB;AACxB,MAAM,SAAS,GAAG,IAAI,oBAAoB,EAAE,CAAC;AAC7C,MAAM,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/resources/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAIpE,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,SAAS,GAAG,IAAI,CAwDzD"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { ResourceTemplate } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
2
|
+
import { getIndex, getById } from "../data.js";
|
|
3
|
+
export function registerResources(server) {
|
|
4
|
+
// Full institutions index
|
|
5
|
+
server.resource("institutions-index", "identitate-md://institutions", {
|
|
6
|
+
description: "Full IdentitateMD institutions index with all brand data",
|
|
7
|
+
mimeType: "application/json",
|
|
8
|
+
}, async () => ({
|
|
9
|
+
contents: [
|
|
10
|
+
{
|
|
11
|
+
uri: "identitate-md://institutions",
|
|
12
|
+
text: JSON.stringify(getIndex(), null, 2),
|
|
13
|
+
mimeType: "application/json",
|
|
14
|
+
},
|
|
15
|
+
],
|
|
16
|
+
}));
|
|
17
|
+
// Per-institution resource
|
|
18
|
+
server.resource("institution", new ResourceTemplate("identitate-md://institutions/{id}", {
|
|
19
|
+
list: () => ({
|
|
20
|
+
resources: getIndex().institutions.map((i) => ({
|
|
21
|
+
uri: `identitate-md://institutions/${i.id}`,
|
|
22
|
+
name: i.name,
|
|
23
|
+
description: `Brand data for ${i.name}`,
|
|
24
|
+
mimeType: "application/json",
|
|
25
|
+
})),
|
|
26
|
+
}),
|
|
27
|
+
}), {
|
|
28
|
+
description: "Brand data for a single institution",
|
|
29
|
+
mimeType: "application/json",
|
|
30
|
+
}, async (args) => {
|
|
31
|
+
const id = args.id;
|
|
32
|
+
const inst = getById(id);
|
|
33
|
+
if (!inst) {
|
|
34
|
+
throw new Error(`Institution '${id}' not found`);
|
|
35
|
+
}
|
|
36
|
+
return {
|
|
37
|
+
contents: [
|
|
38
|
+
{
|
|
39
|
+
uri: `identitate-md://institutions/${id}`,
|
|
40
|
+
text: JSON.stringify(inst, null, 2),
|
|
41
|
+
mimeType: "application/json",
|
|
42
|
+
},
|
|
43
|
+
],
|
|
44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AE;QACb,MAAM,EAAE,GAAI,IAA0C,CAAC,EAAE,CAAC;QAC1D,MAAM,IAAI,GAAG,OAAO,CAAC,EAAE,CAAC,CAAC;QAEzB,IAAI,CAAC,IAAI,EAAE,CAAC;YACV,MAAM,IAAI,KAAK,CAAC,gBAAgB,EAAE,aAAa,CAAC,CAAC;QACnD,CAAC;QAED,OAAO;YACL,QAAQ,EAAE;gBACR;oBACE,GAAG,EAAE,gCAAgC,EAAE,EAAE;oBACzC,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;oBACnC,QAAQ,EAAE,kBAAkB;iBAC7B;aACF;SACF,CAAC;IACJ,CAAC,CACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-brand-colors.d.ts","sourceRoot":"","sources":["../../src/tools/get-brand-colors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAoCpE,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,SAAS,GAAG,IAAI,CAwE9D"}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { getById } from "../data.js";
|
|
3
|
+
function toRgbString(rgb) {
|
|
4
|
+
return `rgb(${rgb[0]}, ${rgb[1]}, ${rgb[2]})`;
|
|
5
|
+
}
|
|
6
|
+
function toCssVar(name) {
|
|
7
|
+
return "--color-" + name.toLowerCase().replace(/\s+/g, "-").replace(/[^a-z0-9-]/g, "");
|
|
8
|
+
}
|
|
9
|
+
function formatColor(color, format) {
|
|
10
|
+
const base = {
|
|
11
|
+
name: color.name,
|
|
12
|
+
usage: color.usage,
|
|
13
|
+
};
|
|
14
|
+
if (format === "hex") {
|
|
15
|
+
base.hex = color.hex;
|
|
16
|
+
}
|
|
17
|
+
else if (format === "rgb") {
|
|
18
|
+
base.rgb = color.rgb ? toRgbString(color.rgb) : null;
|
|
19
|
+
base.hex = color.hex; // include hex too for reference
|
|
20
|
+
}
|
|
21
|
+
else {
|
|
22
|
+
// css: emit as CSS custom property
|
|
23
|
+
base.cssVar = `${toCssVar(color.name)}: ${color.hex}`;
|
|
24
|
+
base.hex = color.hex;
|
|
25
|
+
}
|
|
26
|
+
return base;
|
|
27
|
+
}
|
|
28
|
+
export function registerGetBrandColors(server) {
|
|
29
|
+
server.tool("get_brand_colors", "Get brand colors for a Moldovan government institution. Returns palette optionally formatted as hex, rgb, or CSS custom properties.", {
|
|
30
|
+
id: z.string().describe("Institution ID, e.g. 'md-age'"),
|
|
31
|
+
format: z
|
|
32
|
+
.enum(["hex", "rgb", "css"])
|
|
33
|
+
.default("hex")
|
|
34
|
+
.describe("Output format: hex (default), rgb, or css (CSS custom properties)"),
|
|
35
|
+
usage: z
|
|
36
|
+
.enum(["primary", "secondary", "accent", "neutral"])
|
|
37
|
+
.optional()
|
|
38
|
+
.describe("Filter colors by usage type"),
|
|
39
|
+
}, ({ id, format, usage }) => {
|
|
40
|
+
const inst = getById(id);
|
|
41
|
+
if (!inst) {
|
|
42
|
+
return {
|
|
43
|
+
content: [{ type: "text", text: JSON.stringify({ error: `Institution '${id}' not found.` }) }],
|
|
44
|
+
isError: true,
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
if (!inst.colors || inst.colors.length === 0) {
|
|
48
|
+
return {
|
|
49
|
+
content: [
|
|
50
|
+
{
|
|
51
|
+
type: "text",
|
|
52
|
+
text: JSON.stringify({
|
|
53
|
+
id: inst.id,
|
|
54
|
+
name: inst.name,
|
|
55
|
+
colors: [],
|
|
56
|
+
note: "No brand colors defined for this institution.",
|
|
57
|
+
}),
|
|
58
|
+
},
|
|
59
|
+
],
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
let colors = inst.colors;
|
|
63
|
+
if (usage) {
|
|
64
|
+
colors = colors.filter((c) => c.usage === usage);
|
|
65
|
+
}
|
|
66
|
+
const formatted = colors.map((c) => formatColor(c, format));
|
|
67
|
+
const cssBlock = format === "css"
|
|
68
|
+
? `:root {\n${formatted.map((c) => ` ${c.cssVar}`).join(";\n")};\n}`
|
|
69
|
+
: undefined;
|
|
70
|
+
return {
|
|
71
|
+
content: [
|
|
72
|
+
{
|
|
73
|
+
type: "text",
|
|
74
|
+
text: JSON.stringify({
|
|
75
|
+
id: inst.id,
|
|
76
|
+
name: inst.name,
|
|
77
|
+
colors: formatted,
|
|
78
|
+
...(cssBlock ? { cssBlock } : {}),
|
|
79
|
+
}, null, 2),
|
|
80
|
+
},
|
|
81
|
+
],
|
|
82
|
+
};
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
//# sourceMappingURL=get-brand-colors.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-brand-colors.js","sourceRoot":"","sources":["../../src/tools/get-brand-colors.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAGrC,SAAS,WAAW,CAAC,GAA6B;IAChD,OAAO,OAAO,GAAG,CAAC,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC;AAChD,CAAC;AAED,SAAS,QAAQ,CAAC,IAAY;IAC5B,OAAO,UAAU,GAAG,IAAI,CAAC,WAAW,EAAE,CAAC,OAAO,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,OAAO,CAAC,aAAa,EAAE,EAAE,CAAC,CAAC;AACzF,CAAC;AAED,SAAS,WAAW,CAClB,KAAY,EACZ,MAA6B;IAE7B,MAAM,IAAI,GAA4B;QACpC,IAAI,EAAE,KAAK,CAAC,IAAI;QAChB,KAAK,EAAE,KAAK,CAAC,KAAK;KACnB,CAAC;IAEF,IAAI,MAAM,KAAK,KAAK,EAAE,CAAC;QACrB,IAAI,CAAC,GAAG,GAAG,KAAK,CAAC,GAAG,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ACf,MAAM,EAAE,SAAS;wBACjB,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;qBAClC,EACD,IAAI,EACJ,CAAC,CACF;iBACF;aACF;SACF,CAAC;IACJ,CAAC,CACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-institution.d.ts","sourceRoot":"","sources":["../../src/tools/get-institution.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAkBpE,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,SAAS,GAAG,IAAI,CAqD9D"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { getById } from "../data.js";
|
|
3
|
+
/** Resolve an AssetUrls value to a local path string or null */
|
|
4
|
+
function assetToLocal(asset) {
|
|
5
|
+
if (!asset)
|
|
6
|
+
return null;
|
|
7
|
+
if (typeof asset === "string")
|
|
8
|
+
return asset;
|
|
9
|
+
return asset.local;
|
|
10
|
+
}
|
|
11
|
+
function toAbsoluteUrl(path) {
|
|
12
|
+
if (!path)
|
|
13
|
+
return null;
|
|
14
|
+
return path.startsWith("http") ? path : `https://identitate.md${path}`;
|
|
15
|
+
}
|
|
16
|
+
export function registerGetInstitution(server) {
|
|
17
|
+
server.tool("get_institution", "Get full brand data for a Moldovan government institution by its ID (e.g. 'md-age', 'md-mj').", {
|
|
18
|
+
id: z.string().describe("Institution ID, e.g. 'md-age' or 'md-mj'"),
|
|
19
|
+
}, ({ id }) => {
|
|
20
|
+
const inst = getById(id);
|
|
21
|
+
if (!inst) {
|
|
22
|
+
return {
|
|
23
|
+
content: [
|
|
24
|
+
{
|
|
25
|
+
type: "text",
|
|
26
|
+
text: JSON.stringify({ error: `Institution '${id}' not found.` }, null, 2),
|
|
27
|
+
},
|
|
28
|
+
],
|
|
29
|
+
isError: true,
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
// Build enriched response with absolute logo URLs
|
|
33
|
+
const logoUrls = {};
|
|
34
|
+
for (const [groupKey, group] of Object.entries(inst.assets)) {
|
|
35
|
+
if (typeof group !== "object" || !group || typeof group === "string")
|
|
36
|
+
continue;
|
|
37
|
+
const g = group;
|
|
38
|
+
const variants = {};
|
|
39
|
+
for (const variant of ["color", "white", "black", "monochrome", "dark_mode"]) {
|
|
40
|
+
const v = g[variant];
|
|
41
|
+
if (v !== undefined) {
|
|
42
|
+
variants[variant] = toAbsoluteUrl(assetToLocal(v));
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
if (Object.keys(variants).length > 0) {
|
|
46
|
+
logoUrls[groupKey] = variants;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
return {
|
|
50
|
+
content: [
|
|
51
|
+
{
|
|
52
|
+
type: "text",
|
|
53
|
+
text: JSON.stringify({ ...inst, logoUrls }, null, 2),
|
|
54
|
+
},
|
|
55
|
+
],
|
|
56
|
+
};
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
//# sourceMappingURL=get-institution.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-institution.js","sourceRoot":"","sources":["../../src/tools/get-institution.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAErC,gEAAgE;AAChE,SAAS,YAAY,CACnB,KAA0F;IAE1F,IAAI,CAAC,KAAK;QAAE,OAAO,IAAI,CAAC;IACxB,IAAI,OAAO,KAAK,KAAK,QAAQ;QAAE,OAAO,KAAK,CAAC;IAC5C,OAAO,KAAK,CAAC,KAAK,CAAC;AACrB,CAAC;AAED,SAAS,aAAa,CAAC,IAAmB;IACxC,IAAI,CAAC,IAAI;QAAE,OAAO,IAAI,CAAC;IACvB,OAAO,IAAI,CAAC,UAAU,CAAC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AAa,CAAC,YAAY,CAAC,CAA+B,CAAC,CAAC,CAAC;gBACnF,CAAC;YACH,CAAC;YACD,IAAI,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;gBACrC,QAAQ,CAAC,QAAQ,CAAC,GAAG,QAAQ,CAAC;YAChC,CAAC;QACH,CAAC;QAED,OAAO;YACL,OAAO,EAAE;gBACP;oBACE,IAAI,EAAE,MAAM;oBACZ,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,EAAE,GAAG,IAAI,EAAE,QAAQ,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC;iBACrD;aACF;SACF,CAAC;IACJ,CAAC,CACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-logo.d.ts","sourceRoot":"","sources":["../../src/tools/get-logo.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAmBpE,wBAAgB,eAAe,CAAC,MAAM,EAAE,SAAS,GAAG,IAAI,CA+FvD"}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { readFileSync, existsSync } from "fs";
|
|
3
|
+
import { getById, resolveLogoPath } from "../data.js";
|
|
4
|
+
function assetToLocal(asset) {
|
|
5
|
+
if (!asset)
|
|
6
|
+
return null;
|
|
7
|
+
if (typeof asset === "string")
|
|
8
|
+
return asset;
|
|
9
|
+
return asset.local;
|
|
10
|
+
}
|
|
11
|
+
/** Given a local path like "/logos/md-age/symbol/color.svg", return the CDN URL */
|
|
12
|
+
function toCdnUrl(localPath) {
|
|
13
|
+
return localPath.startsWith("http")
|
|
14
|
+
? localPath
|
|
15
|
+
: `https://identitate.md${localPath}`;
|
|
16
|
+
}
|
|
17
|
+
export function registerGetLogo(server) {
|
|
18
|
+
server.tool("get_logo", "Get a logo URL (and optionally the SVG content) for a specific institution, layout, and color variant.", {
|
|
19
|
+
id: z.string().describe("Institution ID, e.g. 'md-age'"),
|
|
20
|
+
layout: z
|
|
21
|
+
.enum(["main", "horizontal", "vertical", "symbol"])
|
|
22
|
+
.default("main")
|
|
23
|
+
.describe("Logo layout (default: main)"),
|
|
24
|
+
variant: z
|
|
25
|
+
.enum(["color", "white", "black", "monochrome", "dark_mode"])
|
|
26
|
+
.default("color")
|
|
27
|
+
.describe("Color variant (default: color)"),
|
|
28
|
+
fetch_svg: z
|
|
29
|
+
.boolean()
|
|
30
|
+
.default(false)
|
|
31
|
+
.describe("If true, include the raw SVG content in the response (read from bundled package — no network request)"),
|
|
32
|
+
}, ({ id, layout, variant, fetch_svg }) => {
|
|
33
|
+
const inst = getById(id);
|
|
34
|
+
if (!inst) {
|
|
35
|
+
return {
|
|
36
|
+
content: [{ type: "text", text: JSON.stringify({ error: `Institution '${id}' not found.` }) }],
|
|
37
|
+
isError: true,
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
const group = inst.assets[layout];
|
|
41
|
+
if (!group) {
|
|
42
|
+
return {
|
|
43
|
+
content: [
|
|
44
|
+
{
|
|
45
|
+
type: "text",
|
|
46
|
+
text: JSON.stringify({
|
|
47
|
+
error: `Layout '${layout}' not available for '${id}'. Available layouts: ${Object.keys(inst.assets).join(", ")}`,
|
|
48
|
+
}),
|
|
49
|
+
},
|
|
50
|
+
],
|
|
51
|
+
isError: true,
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
const localPath = assetToLocal(group[variant]);
|
|
55
|
+
if (!localPath) {
|
|
56
|
+
const available = ["color", "white", "black", "monochrome", "dark_mode"].filter((v) => group[v] != null);
|
|
57
|
+
return {
|
|
58
|
+
content: [
|
|
59
|
+
{
|
|
60
|
+
type: "text",
|
|
61
|
+
text: JSON.stringify({
|
|
62
|
+
error: `Variant '${variant}' not available for '${id}' '${layout}'. Available variants: ${available.join(", ")}`,
|
|
63
|
+
}),
|
|
64
|
+
},
|
|
65
|
+
],
|
|
66
|
+
isError: true,
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
const url = toCdnUrl(localPath);
|
|
70
|
+
let svg;
|
|
71
|
+
if (fetch_svg) {
|
|
72
|
+
const fsPath = resolveLogoPath(localPath);
|
|
73
|
+
if (existsSync(fsPath)) {
|
|
74
|
+
svg = readFileSync(fsPath, "utf-8");
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
return {
|
|
78
|
+
content: [
|
|
79
|
+
{
|
|
80
|
+
type: "text",
|
|
81
|
+
text: JSON.stringify({
|
|
82
|
+
url,
|
|
83
|
+
layout: group.type,
|
|
84
|
+
variant,
|
|
85
|
+
institution: inst.name,
|
|
86
|
+
institutionId: inst.id,
|
|
87
|
+
...(svg !== undefined ? { svg } : {}),
|
|
88
|
+
}, null, 2),
|
|
89
|
+
},
|
|
90
|
+
],
|
|
91
|
+
};
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
//# sourceMappingURL=get-logo.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-logo.js","sourceRoot":"","sources":["../../src/tools/get-logo.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,IAAI,CAAC;AAC9C,OAAO,EAAE,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAGtD,SAAS,YAAY,CAAC,KAA4B;IAChD,IAAI,CAAC,KAAK;QAAE,OAAO,IAAI,CAAC;IACxB,IAAI,OAAO,KAAK,KAAK,QAAQ;QAAE,OAAO,KAAK,CAAC;IAC5C,OAAO,KAAK,CAAC,KAAK,CAAC;AACrB,CAAC;AAED,mFAAmF;AACnF,SAAS,QAAQ,CAAC,SAAiB;IACjC,OAAO,SAAS,CAAC,UAAU,CAAC,MAAM,CAAC;QACjC,CAAC,CAAC,SAAS;QACX,CAAC,CAAC,wBAAwB,SAAS,EAAE,CAAC;A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;wBACP,WAAW,EAAE,IAAI,CAAC,IAAI;wBACtB,aAAa,EAAE,IAAI,CAAC,EAAE;wBACtB,GAAG,CAAC,GAAG,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;qBACtC,EACD,IAAI,EACJ,CAAC,CACF;iBACF;aACF;SACF,CAAC;IACJ,CAAC,CACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list-categories.d.ts","sourceRoot":"","sources":["../../src/tools/list-categories.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAGpE,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,SAAS,GAAG,IAAI,CAiB9D"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { getCategories } from "../data.js";
|
|
2
|
+
export function registerListCategories(server) {
|
|
3
|
+
server.tool("list_categories", "List all institution categories with their labels and institution counts.", {}, () => {
|
|
4
|
+
const categories = getCategories();
|
|
5
|
+
return {
|
|
6
|
+
content: [
|
|
7
|
+
{
|
|
8
|
+
type: "text",
|
|
9
|
+
text: JSON.stringify(categories, null, 2),
|
|
10
|
+
},
|
|
11
|
+
],
|
|
12
|
+
};
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=list-categories.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list-categories.js","sourceRoot":"","sources":["../../src/tools/list-categories.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAE3C,MAAM,UAAU,sBAAsB,CAAC,MAAiB;IACtD,MAAM,CAAC,IAAI,CACT,iBAAiB,EACjB,2EAA2E,EAC3E,EAAE,EACF,GAAG,EAAE;QACH,MAAM,UAAU,GAAG,aAAa,EAAE,CAAC;QACnC,OAAO;YACL,OAAO,EAAE;gBACP;oBACE,IAAI,EAAE,MAAM;oBACZ,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,UAAU,EAAE,IAAI,EAAE,CAAC,CAAC;iBAC1C;aACF;SACF,CAAC;IACJ,CAAC,CACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"search.d.ts","sourceRoot":"","sources":["../../src/tools/search.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AA6BpE,wBAAgB,cAAc,CAAC,MAAM,EAAE,SAAS,GAAG,IAAI,CA8DtD"}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { getAll } from "../data.js";
|
|
3
|
+
/** Normalize diacritics: ș→s, ț→t, ă→a, î→i, â→a etc. */
|
|
4
|
+
function normalize(s) {
|
|
5
|
+
return s
|
|
6
|
+
.toLowerCase()
|
|
7
|
+
.normalize("NFD")
|
|
8
|
+
.replace(/\p{Diacritic}/gu, "");
|
|
9
|
+
}
|
|
10
|
+
function score(inst, query) {
|
|
11
|
+
const q = normalize(query);
|
|
12
|
+
const id = normalize(inst.id);
|
|
13
|
+
const name = normalize(inst.name);
|
|
14
|
+
const short = normalize(inst.shortname ?? "");
|
|
15
|
+
const keywords = (inst.meta.keywords ?? []).map(normalize);
|
|
16
|
+
if (id === q)
|
|
17
|
+
return 100;
|
|
18
|
+
if (short === q)
|
|
19
|
+
return 80;
|
|
20
|
+
if (id.includes(q))
|
|
21
|
+
return 70;
|
|
22
|
+
if (short.includes(q))
|
|
23
|
+
return 65;
|
|
24
|
+
if (name.includes(q))
|
|
25
|
+
return 50;
|
|
26
|
+
if (keywords.some((k) => k.includes(q)))
|
|
27
|
+
return 30;
|
|
28
|
+
return 0;
|
|
29
|
+
}
|
|
30
|
+
export function registerSearch(server) {
|
|
31
|
+
server.tool("search_institutions", "Search Moldovan government institutions by name, keyword, or category. Returns ranked matches.", {
|
|
32
|
+
query: z
|
|
33
|
+
.string()
|
|
34
|
+
.optional()
|
|
35
|
+
.describe("Name, keyword, or partial ID to search for"),
|
|
36
|
+
category: z
|
|
37
|
+
.string()
|
|
38
|
+
.optional()
|
|
39
|
+
.describe("Filter by category ID: guvern, minister, directie, agentie, primarie, institutie-cultura, consilii, servicii, parlament, altele"),
|
|
40
|
+
limit: z
|
|
41
|
+
.number()
|
|
42
|
+
.int()
|
|
43
|
+
.min(1)
|
|
44
|
+
.max(50)
|
|
45
|
+
.default(10)
|
|
46
|
+
.describe("Maximum number of results to return (default 10)"),
|
|
47
|
+
}, ({ query, category, limit }) => {
|
|
48
|
+
let institutions = getAll();
|
|
49
|
+
if (category) {
|
|
50
|
+
institutions = institutions.filter((i) => i.category === category);
|
|
51
|
+
}
|
|
52
|
+
if (query) {
|
|
53
|
+
const scored = institutions
|
|
54
|
+
.map((i) => ({ inst: i, score: score(i, query) }))
|
|
55
|
+
.filter((x) => x.score > 0)
|
|
56
|
+
.sort((a, b) => b.score - a.score);
|
|
57
|
+
institutions = scored.slice(0, limit).map((x) => x.inst);
|
|
58
|
+
}
|
|
59
|
+
else {
|
|
60
|
+
institutions = institutions.slice(0, limit);
|
|
61
|
+
}
|
|
62
|
+
return {
|
|
63
|
+
content: [
|
|
64
|
+
{
|
|
65
|
+
type: "text",
|
|
66
|
+
text: JSON.stringify(institutions.map((i) => ({
|
|
67
|
+
id: i.id,
|
|
68
|
+
name: i.name,
|
|
69
|
+
shortname: i.shortname,
|
|
70
|
+
category: i.category,
|
|
71
|
+
description: i.description,
|
|
72
|
+
mainLogoUrl: resolveMainLogoUrl(i),
|
|
73
|
+
})), null, 2),
|
|
74
|
+
},
|
|
75
|
+
],
|
|
76
|
+
};
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
function resolveMainLogoUrl(inst) {
|
|
80
|
+
const main = inst.assets.main;
|
|
81
|
+
const path = typeof main.color === "string"
|
|
82
|
+
? main.color
|
|
83
|
+
: typeof main.color === "object"
|
|
84
|
+
? main.color.local
|
|
85
|
+
: null;
|
|
86
|
+
if (!path)
|
|
87
|
+
return null;
|
|
88
|
+
return `https://identitate.md${path}`;
|
|
89
|
+
}
|
|
90
|
+
//# sourceMappingURL=search.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"search.js","sourceRoot":"","sources":["../../src/tools/search.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AAGpC,yDAAyD;AACzD,SAAS,SAAS,CAAC,CAAS;IAC1B,OAAO,CAAC;SACL,WAAW,EAAE;SACb,SAAS,CAAC,KAAK,CAAC;SAChB,OAAO,CAAC,iBAAiB,EAAE,EAAE,CAAC,CAAC;AACpC,CAAC;AAED,SAAS,KAAK,CAAC,IAAiB,EAAE,KAAa;IAC7C,MAAM,CAAC,GAAG,SAAS,CAAC,KAAK,CAAC,CAAC;IAC3B,MAAM,EAAE,GAAG,SAAS,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IAC9B,MAAM,IAAI,GAAG,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAClC,MAAM,KAAK,GAAG,SAAS,CAAC,IAAI,CAAC,SAAS,IAAI,EAAE,CAAC,CAAC;IAC9C,MAAM,QAAQ,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;IAE3D,IAAI,EAAE,KAAK,CAAC;QAAE,OAAO,GAAG,CAAC;IACzB,IAAI,KAAK,KAAK,CAAC;QAAE,OAAO,EAAE,CAAC;IAC3B,IAAI,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC;QAAE,OAAO,EAAE,CAAC;IAC9B,IAAI,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC;QAAE,OAAO,EAAE,CAAC;IACjC,IAAI,IAAI,CAAC,QAAQ,CAA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AI,CAAC;IACvB,OAAO,wBAAwB,IAAI,EAAE,CAAC;AACxC,CAAC"}
|
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
export type InstitutionCategory = "guvern" | "minister" | "directie" | "primarie" | "consiliu-judetean" | "prefectura" | "agentie" | "autoritate" | "proiect-ue" | "institutie-cultura" | "consilii" | "servicii" | "parlament" | "altele";
|
|
2
|
+
export type LogoColorVariant = "color" | "dark_mode" | "white" | "black" | "monochrome";
|
|
3
|
+
export type LogoLayout = "horizontal" | "vertical" | "symbol";
|
|
4
|
+
export type ColorUsage = "primary" | "secondary" | "accent" | "neutral";
|
|
5
|
+
export interface Location {
|
|
6
|
+
country_code: string;
|
|
7
|
+
county?: string;
|
|
8
|
+
city?: string;
|
|
9
|
+
}
|
|
10
|
+
export interface Color {
|
|
11
|
+
name: string;
|
|
12
|
+
hex: string;
|
|
13
|
+
rgb?: [number, number, number];
|
|
14
|
+
cmyk?: [number, number, number, number];
|
|
15
|
+
pantone?: string;
|
|
16
|
+
usage?: ColorUsage;
|
|
17
|
+
}
|
|
18
|
+
export interface Typography {
|
|
19
|
+
primary: {
|
|
20
|
+
family: string;
|
|
21
|
+
url?: string;
|
|
22
|
+
weights?: number[];
|
|
23
|
+
};
|
|
24
|
+
secondary?: {
|
|
25
|
+
family: string;
|
|
26
|
+
url?: string;
|
|
27
|
+
weights?: number[];
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
export type AssetUrls = string | {
|
|
31
|
+
cdn_primary?: string;
|
|
32
|
+
cdn_fallback?: string;
|
|
33
|
+
local: string;
|
|
34
|
+
};
|
|
35
|
+
export interface LogoAssetGroup {
|
|
36
|
+
type: LogoLayout;
|
|
37
|
+
color?: AssetUrls;
|
|
38
|
+
dark_mode?: AssetUrls;
|
|
39
|
+
white?: AssetUrls;
|
|
40
|
+
black?: AssetUrls;
|
|
41
|
+
monochrome?: AssetUrls;
|
|
42
|
+
alternatives?: Array<{
|
|
43
|
+
label: string;
|
|
44
|
+
path: AssetUrls;
|
|
45
|
+
preview?: "checkerboard" | "dark";
|
|
46
|
+
}>;
|
|
47
|
+
png?: {
|
|
48
|
+
path: AssetUrls;
|
|
49
|
+
width: number;
|
|
50
|
+
height: number;
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
export interface Assets {
|
|
54
|
+
main: LogoAssetGroup;
|
|
55
|
+
horizontal?: LogoAssetGroup;
|
|
56
|
+
vertical?: LogoAssetGroup;
|
|
57
|
+
symbol?: LogoAssetGroup;
|
|
58
|
+
favicon?: string;
|
|
59
|
+
[key: string]: LogoAssetGroup | string | undefined;
|
|
60
|
+
}
|
|
61
|
+
export interface Resources {
|
|
62
|
+
website?: string;
|
|
63
|
+
branding_manual?: string;
|
|
64
|
+
contact?: {
|
|
65
|
+
phone?: string;
|
|
66
|
+
email?: string;
|
|
67
|
+
};
|
|
68
|
+
social_media?: {
|
|
69
|
+
facebook?: string;
|
|
70
|
+
twitter?: string;
|
|
71
|
+
linkedin?: string;
|
|
72
|
+
instagram?: string;
|
|
73
|
+
youtube?: string;
|
|
74
|
+
};
|
|
75
|
+
wikidata_id?: string;
|
|
76
|
+
wikipedia_url?: string;
|
|
77
|
+
}
|
|
78
|
+
export interface Meta {
|
|
79
|
+
version: string;
|
|
80
|
+
last_updated: string;
|
|
81
|
+
keywords: string[];
|
|
82
|
+
quality?: "verified" | "community" | "draft";
|
|
83
|
+
seo_title?: string;
|
|
84
|
+
seo_description?: string;
|
|
85
|
+
}
|
|
86
|
+
export interface Institution {
|
|
87
|
+
id: string;
|
|
88
|
+
slug: string;
|
|
89
|
+
name: string;
|
|
90
|
+
shortname?: string;
|
|
91
|
+
category: InstitutionCategory;
|
|
92
|
+
meta: Meta;
|
|
93
|
+
location?: Location;
|
|
94
|
+
description?: string;
|
|
95
|
+
usage_notes?: string;
|
|
96
|
+
colors?: Color[];
|
|
97
|
+
typography?: Typography;
|
|
98
|
+
assets: Assets;
|
|
99
|
+
resources?: Resources;
|
|
100
|
+
}
|
|
101
|
+
export interface CategoryEntry {
|
|
102
|
+
id: string;
|
|
103
|
+
label: string;
|
|
104
|
+
count: number;
|
|
105
|
+
}
|
|
106
|
+
export interface InstitutionsIndex {
|
|
107
|
+
schemaVersion: string;
|
|
108
|
+
generatedAt: string;
|
|
109
|
+
total: number;
|
|
110
|
+
stats: {
|
|
111
|
+
byCategory: Record<string, number>;
|
|
112
|
+
withManual: number;
|
|
113
|
+
withSvg: number;
|
|
114
|
+
};
|
|
115
|
+
categories: CategoryEntry[];
|
|
116
|
+
institutions: Institution[];
|
|
117
|
+
}
|
|
118
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,mBAAmB,GAC3B,QAAQ,GACR,UAAU,GACV,UAAU,GACV,UAAU,GACV,mBAAmB,GACnB,YAAY,GACZ,SAAS,GACT,YAAY,GACZ,YAAY,GACZ,oBAAoB,GACpB,UAAU,GACV,UAAU,GACV,WAAW,GACX,QAAQ,CAAC;AAEb,MAAM,MAAM,gBAAgB,GACxB,OAAO,GACP,WAAW,GACX,OAAO,GACP,OAAO,GACP,YAAY,CAAC;AAEjB,MAAM,MAAM,UAAU,GAAG,YAAY,GAAG,UAAU,GAAG,QAAQ,CAAC;AAE9D,MAAM,MAAM,UAAU,GAAG,SAAS,GAAG,WAAW,GAAG,QAAQ,GAAG,SAAS,CAAC;AAExE,MAAM,WAAW,QAAQ;IACvB,YAAY,EAAE,MAAM,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,KAAK;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;I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C,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,CAAC,EAAE,KAAK,EAAE,CAAC;IACjB,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,SAAS,CAAC;CACvB;AAED,MAAM,WAAW,aAAa;IAC5B,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,iBAAiB;IAChC,aAAa,EAAE,MAAM,CAAC;IACtB,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE;QACL,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;QACnC,UAAU,EAAE,MAAM,CAAC;QACnB,OAAO,EAAE,MAAM,CAAC;KACjB,CAAC;IACF,UAAU,EAAE,aAAa,EAAE,CAAC;IAC5B,YAAY,EAAE,WAAW,EAAE,CAAC;CAC7B"}
|
package/dist/types.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,yDAAyD"}
|
package/package.json
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@identitate-md/mcp",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "MCP server for IdentitateMD — query Moldovan government institution logos and brand colors from AI coding assistants",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"author": "IdentitateMD Contributors",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "https://github.com/identitate-md/identitate-md",
|
|
10
|
+
"directory": "packages/mcp"
|
|
11
|
+
},
|
|
12
|
+
"homepage": "https://identitate.md",
|
|
13
|
+
"keywords": [
|
|
14
|
+
"moldova",
|
|
15
|
+
"mcp",
|
|
16
|
+
"model-context-protocol",
|
|
17
|
+
"logos",
|
|
18
|
+
"institutions",
|
|
19
|
+
"government",
|
|
20
|
+
"branding",
|
|
21
|
+
"ai"
|
|
22
|
+
],
|
|
23
|
+
"type": "module",
|
|
24
|
+
"main": "dist/index.js",
|
|
25
|
+
"bin": {
|
|
26
|
+
"identitate-md-mcp": "dist/index.js"
|
|
27
|
+
},
|
|
28
|
+
"files": [
|
|
29
|
+
"dist/**/*",
|
|
30
|
+
"README.md",
|
|
31
|
+
"LICENSE"
|
|
32
|
+
],
|
|
33
|
+
"scripts": {
|
|
34
|
+
"build": "tsc",
|
|
35
|
+
"dev": "tsc --watch",
|
|
36
|
+
"start": "node dist/index.js",
|
|
37
|
+
"prepublishOnly": "npm run build"
|
|
38
|
+
},
|
|
39
|
+
"dependencies": {
|
|
40
|
+
"@identitate-md/logos": "*",
|
|
41
|
+
"@modelcontextprotocol/sdk": "^1.0.0",
|
|
42
|
+
"zod": "^3.25.76"
|
|
43
|
+
},
|
|
44
|
+
"publishConfig": {
|
|
45
|
+
"access": "public"
|
|
46
|
+
},
|
|
47
|
+
"engines": {
|
|
48
|
+
"node": ">=20"
|
|
49
|
+
},
|
|
50
|
+
"devDependencies": {
|
|
51
|
+
"@types/node": "^20.19.37",
|
|
52
|
+
"typescript": "^5.9.3"
|
|
53
|
+
}
|
|
54
|
+
}
|