@qinisolabs/qiniso 0.1.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/http.d.ts ADDED
@@ -0,0 +1 @@
1
+ #!/usr/bin/env node
package/dist/http.js ADDED
@@ -0,0 +1,35 @@
1
+ #!/usr/bin/env node
2
+ import {
3
+ LOGO_SVG,
4
+ handleRpc
5
+ } from "./chunk-TDQYIG3R.js";
6
+
7
+ // src/http.ts
8
+ import { createServer } from "http";
9
+ var PORT = Number(process.env.PORT ?? 8787);
10
+ var server = createServer((req, res) => {
11
+ const send = (status, body) => res.writeHead(status, { "content-type": "application/json" }).end(body);
12
+ if (req.method === "GET" && req.url === "/health") return send(200, '{"status":"ok"}');
13
+ if (req.method === "GET" && (req.url === "/icon.svg" || req.url === "/favicon.ico")) {
14
+ return res.writeHead(200, { "content-type": "image/svg+xml" }).end(LOGO_SVG);
15
+ }
16
+ if (req.method !== "POST") return send(405, '{"error":"method not allowed"}');
17
+ let raw = "";
18
+ req.on("data", (c) => raw += c);
19
+ req.on("end", () => {
20
+ let payload;
21
+ try {
22
+ payload = JSON.parse(raw);
23
+ } catch {
24
+ return send(400, '{"error":"invalid json"}');
25
+ }
26
+ if (Array.isArray(payload)) {
27
+ const out = payload.map(handleRpc).filter(Boolean);
28
+ return send(200, JSON.stringify(out));
29
+ }
30
+ const r = handleRpc(payload);
31
+ if (r === null) return res.writeHead(202).end();
32
+ return send(200, JSON.stringify(r));
33
+ });
34
+ });
35
+ server.listen(PORT, () => console.error(`qiniso HTTP MCP listening on :${PORT}/mcp`));
@@ -0,0 +1,58 @@
1
+ export * from '@qiniso/identifiers';
2
+ export * from '@qiniso/network';
3
+ export * from '@qiniso/finance';
4
+ export * from '@qiniso/crypto';
5
+ export * from '@qiniso/national-id';
6
+ export * from '@qiniso/academic';
7
+ export * from '@qiniso/locale';
8
+ export * from '@qiniso/vat';
9
+
10
+ interface ToolArg {
11
+ name: string;
12
+ description: string;
13
+ optional?: boolean;
14
+ }
15
+ interface ToolSpec {
16
+ name: string;
17
+ description: string;
18
+ argName?: string;
19
+ argDescription?: string;
20
+ run?: (value: string) => unknown;
21
+ args?: ToolArg[];
22
+ runArgs?: (a: Record<string, string | undefined>) => unknown;
23
+ }
24
+ /** Every checkable-fact tool the layer exposes. New modules append here. */
25
+ declare const TOOLS: ToolSpec[];
26
+ declare const SERVER_INFO: {
27
+ readonly name: "qiniso";
28
+ readonly version: "0.1.0";
29
+ };
30
+ declare function listTools(): {
31
+ name: string;
32
+ description: string;
33
+ inputSchema: {
34
+ type: string;
35
+ properties: Record<string, unknown>;
36
+ required: string[];
37
+ additionalProperties: boolean;
38
+ };
39
+ }[];
40
+ declare function callTool(name: string, args: Record<string, unknown> | undefined): {
41
+ content: {
42
+ type: string;
43
+ text: string;
44
+ }[];
45
+ };
46
+ interface JsonRpcMessage {
47
+ jsonrpc?: string;
48
+ id?: string | number;
49
+ method?: string;
50
+ params?: any;
51
+ }
52
+ /**
53
+ * Handle one JSON-RPC message. Returns the response object, or null for
54
+ * notifications (which must produce no body). Stateless: no sessions.
55
+ */
56
+ declare function handleRpc(msg: JsonRpcMessage): object | null;
57
+
58
+ export { SERVER_INFO, TOOLS, callTool, handleRpc, listTools };
package/dist/index.js ADDED
@@ -0,0 +1,108 @@
1
+ import {
2
+ SERVER_INFO,
3
+ TOOLS,
4
+ callTool,
5
+ detectBrand,
6
+ formatMoney,
7
+ handleRpc,
8
+ ibanCheckDigits,
9
+ isHoliday,
10
+ isIPv4,
11
+ isIPv6,
12
+ isKnownTld,
13
+ isbn13CheckDigit,
14
+ knownTldCount,
15
+ listTools,
16
+ luhnCheckDigit,
17
+ luhnValid,
18
+ nextHoliday,
19
+ normalizeIban,
20
+ parseAddress,
21
+ parseDate,
22
+ supportedIbanCountries,
23
+ validateAadhaar,
24
+ validateAba,
25
+ validateBtcAddress,
26
+ validateCard,
27
+ validateCnpj,
28
+ validateCpf,
29
+ validateCusip,
30
+ validateDni,
31
+ validateDomain,
32
+ validateEmail,
33
+ validateEthAddress,
34
+ validateIban,
35
+ validateIp,
36
+ validateIsbn10,
37
+ validateIsbn13,
38
+ validateIsin,
39
+ validateIssn,
40
+ validateLei,
41
+ validateOrcid,
42
+ validatePhone,
43
+ validateSaId,
44
+ validateSedol,
45
+ validateTld,
46
+ validateUrl,
47
+ validateUuid,
48
+ validateVat,
49
+ validateVin,
50
+ vatRate,
51
+ verhoeffGenerate,
52
+ verhoeffValid,
53
+ vinCheckDigit
54
+ } from "./chunk-TDQYIG3R.js";
55
+ export {
56
+ SERVER_INFO,
57
+ TOOLS,
58
+ callTool,
59
+ detectBrand,
60
+ formatMoney,
61
+ handleRpc,
62
+ ibanCheckDigits,
63
+ isHoliday,
64
+ isIPv4,
65
+ isIPv6,
66
+ isKnownTld,
67
+ isbn13CheckDigit,
68
+ knownTldCount,
69
+ listTools,
70
+ luhnCheckDigit,
71
+ luhnValid,
72
+ nextHoliday,
73
+ normalizeIban,
74
+ parseAddress,
75
+ parseDate,
76
+ supportedIbanCountries,
77
+ validateAadhaar,
78
+ validateAba,
79
+ validateBtcAddress,
80
+ validateCard,
81
+ validateCnpj,
82
+ validateCpf,
83
+ validateCusip,
84
+ validateDni,
85
+ validateDomain,
86
+ validateEmail,
87
+ validateEthAddress,
88
+ validateIban,
89
+ validateIp,
90
+ validateIsbn10,
91
+ validateIsbn13,
92
+ validateIsin,
93
+ validateIssn,
94
+ validateLei,
95
+ validateOrcid,
96
+ validatePhone,
97
+ validateSaId,
98
+ validateSedol,
99
+ validateTld,
100
+ validateUrl,
101
+ validateUuid,
102
+ validateVat,
103
+ validateVin,
104
+ vatRate,
105
+ verhoeffGenerate,
106
+ verhoeffValid,
107
+ vinCheckDigit
108
+ };
@@ -0,0 +1 @@
1
+ #!/usr/bin/env node
package/dist/server.js ADDED
@@ -0,0 +1,30 @@
1
+ #!/usr/bin/env node
2
+ import {
3
+ SERVER_INFO,
4
+ TOOLS
5
+ } from "./chunk-TDQYIG3R.js";
6
+
7
+ // src/server.ts
8
+ import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
9
+ import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
10
+ import { z } from "zod";
11
+ var server = new McpServer({ name: SERVER_INFO.name, version: SERVER_INFO.version });
12
+ for (const t of TOOLS) {
13
+ const specArgs = t.args ?? [{ name: t.argName, description: t.argDescription, optional: false }];
14
+ const shape = {};
15
+ for (const a of specArgs) {
16
+ const base = z.string().describe(a.description);
17
+ shape[a.name] = a.optional ? base.optional() : base;
18
+ }
19
+ server.tool(t.name, t.description, shape, async (args) => {
20
+ const result = t.args ? t.runArgs(args) : t.run(args[t.argName] ?? "");
21
+ return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] };
22
+ });
23
+ }
24
+ async function main() {
25
+ await server.connect(new StdioServerTransport());
26
+ }
27
+ main().catch((err) => {
28
+ console.error("qiniso MCP server failed to start:", err);
29
+ process.exit(1);
30
+ });
package/package.json ADDED
@@ -0,0 +1,60 @@
1
+ {
2
+ "name": "@qinisolabs/qiniso",
3
+ "version": "0.1.0",
4
+ "mcpName": "io.github.qinisolabs/qiniso",
5
+ "description": "The deterministic fact-verification layer for AI agents — verify identifiers, locale and more against authoritative ground truth.",
6
+ "type": "module",
7
+ "main": "dist/index.js",
8
+ "types": "dist/index.d.ts",
9
+ "exports": {
10
+ ".": {
11
+ "types": "./dist/index.d.ts",
12
+ "import": "./dist/index.js"
13
+ }
14
+ },
15
+ "bin": {
16
+ "qiniso-mcp": "dist/server.js"
17
+ },
18
+ "files": [
19
+ "dist"
20
+ ],
21
+ "engines": {
22
+ "node": ">=18"
23
+ },
24
+ "scripts": {
25
+ "build": "tsup",
26
+ "start": "node dist/server.js",
27
+ "start:http": "node dist/http.js",
28
+ "test": "tsx test/smoke.test.ts"
29
+ },
30
+ "keywords": [
31
+ "mcp",
32
+ "model-context-protocol",
33
+ "agents",
34
+ "verification",
35
+ "validation",
36
+ "deterministic"
37
+ ],
38
+ "license": "Apache-2.0",
39
+ "author": "Qiniso",
40
+ "dependencies": {
41
+ "@modelcontextprotocol/sdk": "^1.10.0",
42
+ "@noble/hashes": "^1.3.3",
43
+ "@scure/base": "^1.1.6",
44
+ "date-holidays": "^3.23.0",
45
+ "jsvat-next": "^2.5.0",
46
+ "libphonenumber-js": "^1.11.0",
47
+ "zod": "^3.23.0"
48
+ },
49
+ "devDependencies": {
50
+ "@qiniso/academic": "*",
51
+ "@qiniso/crypto": "*",
52
+ "@qiniso/finance": "*",
53
+ "@qiniso/identifiers": "*",
54
+ "@qiniso/locale": "*",
55
+ "@qiniso/national-id": "*",
56
+ "@qiniso/network": "*",
57
+ "@qiniso/vat": "*",
58
+ "tsup": "^8.3.0"
59
+ }
60
+ }