@agent-vm/mcp-portal 0.0.59

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.
@@ -0,0 +1,160 @@
1
+ import { z } from "zod";
2
+ import { createHash } from "node:crypto";
3
+ //#region src/json-schema.ts
4
+ const jsonValueSchema = z.lazy(() => z.union([
5
+ z.string(),
6
+ z.number().finite(),
7
+ z.boolean(),
8
+ z.null(),
9
+ z.array(jsonValueSchema),
10
+ jsonObjectSchema
11
+ ]));
12
+ const jsonObjectSchema = z.record(z.string(), jsonValueSchema);
13
+ function isJsonObject(value) {
14
+ return typeof value === "object" && value !== null && !Array.isArray(value);
15
+ }
16
+ function assertJsonObject(value, label) {
17
+ if (!isJsonObject(value)) throw new Error(`${label} must be a JSON object.`);
18
+ return jsonObjectSchema.parse(value);
19
+ }
20
+ //#endregion
21
+ //#region src/catalog-types.ts
22
+ const forbiddenMetadataKeys = new Set([
23
+ "agentid",
24
+ "authprofile",
25
+ "bindingid",
26
+ "runid",
27
+ "sessionid"
28
+ ]);
29
+ function findForbiddenMetadataKey(value) {
30
+ const stack = [value];
31
+ while (stack.length > 0) {
32
+ const current = stack.pop();
33
+ if (!current) continue;
34
+ if (Array.isArray(current)) {
35
+ stack.push(...current);
36
+ continue;
37
+ }
38
+ if (typeof current !== "object" || current === null) continue;
39
+ for (const [key, childValue] of Object.entries(current)) {
40
+ if (forbiddenMetadataKeys.has(key.toLowerCase())) return key;
41
+ if (typeof childValue === "object" && childValue !== null) stack.push(childValue);
42
+ }
43
+ }
44
+ return null;
45
+ }
46
+ const portalToolAnnotationsSchema = z.object({
47
+ destructiveHint: z.boolean().optional(),
48
+ idempotentHint: z.boolean().optional(),
49
+ openWorldHint: z.boolean().optional(),
50
+ readOnlyHint: z.boolean().optional(),
51
+ title: z.string().optional()
52
+ }).catchall(jsonObjectSchema.or(z.string()).or(z.number()).or(z.boolean()).or(z.null())).optional();
53
+ const safeToolMetadataSchema = jsonObjectSchema.optional().superRefine((metadata, context) => {
54
+ if (!metadata) return;
55
+ const forbiddenKey = findForbiddenMetadataKey(metadata);
56
+ if (forbiddenKey) context.addIssue({
57
+ code: "custom",
58
+ message: `metadata contains forbidden key "${forbiddenKey}"`
59
+ });
60
+ });
61
+ const portalToolRecordSchema = z.object({
62
+ annotations: portalToolAnnotationsSchema,
63
+ description: z.string().optional(),
64
+ inputSchema: jsonObjectSchema,
65
+ metadata: safeToolMetadataSchema,
66
+ namespace: z.string().min(1),
67
+ outputSchema: jsonObjectSchema.optional(),
68
+ title: z.string().optional(),
69
+ toolName: z.string().min(1)
70
+ }).strict();
71
+ //#endregion
72
+ //#region src/tool-ref.ts
73
+ const toolIdentitySchema = z.object({
74
+ namespace: z.string().min(1),
75
+ toolName: z.string().min(1)
76
+ }).strict();
77
+ const toolRefSchema = z.string().startsWith("mcp:").brand();
78
+ function decodeToolRefSegment(segment) {
79
+ if (!/^[A-Za-z0-9_-]+$/.test(segment)) throw new Error("Invalid MCP toolRef.");
80
+ const decoded = Buffer.from(segment, "base64url").toString("utf-8");
81
+ if (Buffer.from(decoded, "utf-8").toString("base64url") !== segment) throw new Error("Invalid MCP toolRef.");
82
+ return decoded;
83
+ }
84
+ function encodeToolRef(identity) {
85
+ const parsed = toolIdentitySchema.parse(identity);
86
+ const encodedNamespace = Buffer.from(parsed.namespace, "utf-8").toString("base64url");
87
+ const encodedToolName = Buffer.from(parsed.toolName, "utf-8").toString("base64url");
88
+ return toolRefSchema.parse(`mcp:${encodedNamespace}:${encodedToolName}`);
89
+ }
90
+ function decodeToolRef(toolRef) {
91
+ const [scheme, encodedNamespace, encodedToolName, ...extraParts] = toolRef.split(":");
92
+ if (scheme !== "mcp" || !encodedNamespace || !encodedToolName || extraParts.length > 0) throw new Error("Invalid MCP toolRef.");
93
+ try {
94
+ return toolIdentitySchema.parse({
95
+ namespace: decodeToolRefSegment(encodedNamespace),
96
+ toolName: decodeToolRefSegment(encodedToolName)
97
+ });
98
+ } catch {
99
+ throw new Error("Invalid MCP toolRef.");
100
+ }
101
+ }
102
+ //#endregion
103
+ //#region src/tool-vm/typescript-artifact.ts
104
+ function toIdentifierPart(value) {
105
+ const words = value.split(/[^A-Za-z0-9]+/).filter(Boolean);
106
+ if (words.length === 0) return "tool";
107
+ return words.map((word) => word.slice(0, 1).toUpperCase() + word.slice(1)).join("");
108
+ }
109
+ function shortToolRefHash(toolRef) {
110
+ return createHash("sha256").update(toolRef).digest("hex").slice(0, 8);
111
+ }
112
+ function toToolConstantName(tool) {
113
+ const identifier = `${toIdentifierPart(tool.namespace)}${toIdentifierPart(tool.toolName)}${shortToolRefHash(tool.toolRef)}Tool`;
114
+ return identifier.slice(0, 1).toLowerCase() + identifier.slice(1);
115
+ }
116
+ function generateTypescriptCatalogArtifact(input) {
117
+ const catalogEntries = input.tools.map((tool) => portalToolRecordSchema.parse(tool)).toSorted((left, right) => {
118
+ const leftRef = encodeToolRef({
119
+ namespace: left.namespace,
120
+ toolName: left.toolName
121
+ });
122
+ const rightRef = encodeToolRef({
123
+ namespace: right.namespace,
124
+ toolName: right.toolName
125
+ });
126
+ return leftRef.localeCompare(rightRef);
127
+ }).map((tool) => Object.assign({}, tool, { toolRef: encodeToolRef({
128
+ namespace: tool.namespace,
129
+ toolName: tool.toolName
130
+ }) }));
131
+ const constants = catalogEntries.map((tool) => {
132
+ return `export const ${toToolConstantName(tool)} = requireCatalogTool(${JSON.stringify(tool.toolRef)});`;
133
+ }).join("\n");
134
+ return [
135
+ "// Generated by agent-vm-mcp-portal. JSON Schema is canonical; Zod is derived for runtime validation.",
136
+ "import * as z from 'zod';",
137
+ "",
138
+ `export const portalCatalog = ${JSON.stringify({ tools: catalogEntries }, null, " ")} as const;`,
139
+ "",
140
+ constants,
141
+ "",
142
+ "function requireCatalogTool(toolRef: string): (typeof portalCatalog.tools)[number] {",
143
+ " const tool = portalCatalog.tools.find((catalogTool) => catalogTool.toolRef === toolRef);",
144
+ " if (!tool) {",
145
+ " throw new Error(`Unknown MCP portal toolRef: ${toolRef}`);",
146
+ " }",
147
+ " return tool;",
148
+ "}",
149
+ "",
150
+ "export function createInputValidator(toolRef: string): z.ZodType {",
151
+ " const tool = requireCatalogTool(toolRef);",
152
+ " return z.fromJSONSchema(tool.inputSchema);",
153
+ "}",
154
+ ""
155
+ ].join("\n");
156
+ }
157
+ //#endregion
158
+ export { portalToolRecordSchema as a, isJsonObject as c, portalToolAnnotationsSchema as i, jsonObjectSchema as l, decodeToolRef as n, safeToolMetadataSchema as o, encodeToolRef as r, assertJsonObject as s, generateTypescriptCatalogArtifact as t, jsonValueSchema as u };
159
+
160
+ //# sourceMappingURL=typescript-artifact-BqU8okQy.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"typescript-artifact-BqU8okQy.js","names":[],"sources":["../src/json-schema.ts","../src/catalog-types.ts","../src/tool-ref.ts","../src/tool-vm/typescript-artifact.ts"],"sourcesContent":["import { z } from 'zod';\n\nexport type JsonPrimitive = boolean | null | number | string;\nexport type JsonArray = JsonValue[];\nexport type JsonObject = { [key: string]: JsonValue };\nexport type JsonValue = JsonArray | JsonObject | JsonPrimitive;\n\nexport const jsonValueSchema: z.ZodType<JsonValue> = z.lazy(() =>\n\tz.union([\n\t\tz.string(),\n\t\tz.number().finite(),\n\t\tz.boolean(),\n\t\tz.null(),\n\t\tz.array(jsonValueSchema),\n\t\tjsonObjectSchema,\n\t]),\n);\n\nexport const jsonObjectSchema: z.ZodType<JsonObject> = z.record(z.string(), jsonValueSchema);\n\nexport function isJsonObject(value: unknown): value is JsonObject {\n\treturn typeof value === 'object' && value !== null && !Array.isArray(value);\n}\n\nexport function assertJsonObject(value: unknown, label: string): JsonObject {\n\tif (!isJsonObject(value)) {\n\t\tthrow new Error(`${label} must be a JSON object.`);\n\t}\n\n\treturn jsonObjectSchema.parse(value);\n}\n","import { z } from 'zod';\n\nimport { jsonObjectSchema, type JsonObject, type JsonValue } from './json-schema.js';\n\nconst forbiddenMetadataKeys = new Set([\n\t'agentid',\n\t'authprofile',\n\t'bindingid',\n\t'runid',\n\t'sessionid',\n]);\n\nfunction findForbiddenMetadataKey(value: JsonObject): string | null {\n\tconst stack: JsonValue[] = [value];\n\n\twhile (stack.length > 0) {\n\t\tconst current = stack.pop();\n\t\tif (!current) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (Array.isArray(current)) {\n\t\t\tstack.push(...current);\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (typeof current !== 'object' || current === null) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tfor (const [key, childValue] of Object.entries(current)) {\n\t\t\tif (forbiddenMetadataKeys.has(key.toLowerCase())) {\n\t\t\t\treturn key;\n\t\t\t}\n\t\t\tif (typeof childValue === 'object' && childValue !== null) {\n\t\t\t\tstack.push(childValue);\n\t\t\t}\n\t\t}\n\t}\n\n\treturn null;\n}\n\nexport const portalToolAnnotationsSchema = z\n\t.object({\n\t\tdestructiveHint: z.boolean().optional(),\n\t\tidempotentHint: z.boolean().optional(),\n\t\topenWorldHint: z.boolean().optional(),\n\t\treadOnlyHint: z.boolean().optional(),\n\t\ttitle: z.string().optional(),\n\t})\n\t.catchall(jsonObjectSchema.or(z.string()).or(z.number()).or(z.boolean()).or(z.null()))\n\t.optional();\n\nexport const safeToolMetadataSchema = jsonObjectSchema\n\t.optional()\n\t.superRefine((metadata, context) => {\n\t\tif (!metadata) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst forbiddenKey = findForbiddenMetadataKey(metadata);\n\t\tif (forbiddenKey) {\n\t\t\tcontext.addIssue({\n\t\t\t\tcode: 'custom',\n\t\t\t\tmessage: `metadata contains forbidden key \"${forbiddenKey}\"`,\n\t\t\t});\n\t\t}\n\t});\n\nexport const portalToolRecordSchema = z\n\t.object({\n\t\tannotations: portalToolAnnotationsSchema,\n\t\tdescription: z.string().optional(),\n\t\tinputSchema: jsonObjectSchema,\n\t\tmetadata: safeToolMetadataSchema,\n\t\tnamespace: z.string().min(1),\n\t\toutputSchema: jsonObjectSchema.optional(),\n\t\ttitle: z.string().optional(),\n\t\ttoolName: z.string().min(1),\n\t})\n\t.strict();\n\nexport type PortalToolRecord = z.infer<typeof portalToolRecordSchema>;\nexport type PortalToolAnnotations = z.infer<typeof portalToolAnnotationsSchema>;\n","import { z } from 'zod';\n\nexport interface ToolIdentity {\n\treadonly namespace: string;\n\treadonly toolName: string;\n}\n\nconst toolIdentitySchema = z\n\t.object({\n\t\tnamespace: z.string().min(1),\n\t\ttoolName: z.string().min(1),\n\t})\n\t.strict();\nconst toolRefSchema = z.string().startsWith('mcp:').brand<'ToolRef'>();\n\nexport type ToolRef = z.infer<typeof toolRefSchema>;\n\nfunction decodeToolRefSegment(segment: string): string {\n\tif (!/^[A-Za-z0-9_-]+$/.test(segment)) {\n\t\tthrow new Error('Invalid MCP toolRef.');\n\t}\n\n\tconst decoded = Buffer.from(segment, 'base64url').toString('utf-8');\n\tconst canonicalSegment = Buffer.from(decoded, 'utf-8').toString('base64url');\n\tif (canonicalSegment !== segment) {\n\t\tthrow new Error('Invalid MCP toolRef.');\n\t}\n\n\treturn decoded;\n}\n\nexport function encodeToolRef(identity: ToolIdentity): ToolRef {\n\tconst parsed = toolIdentitySchema.parse(identity);\n\tconst encodedNamespace = Buffer.from(parsed.namespace, 'utf-8').toString('base64url');\n\tconst encodedToolName = Buffer.from(parsed.toolName, 'utf-8').toString('base64url');\n\n\treturn toolRefSchema.parse(`mcp:${encodedNamespace}:${encodedToolName}`);\n}\n\nexport function decodeToolRef(toolRef: string | ToolRef): ToolIdentity {\n\tconst [scheme, encodedNamespace, encodedToolName, ...extraParts] = toolRef.split(':');\n\tif (scheme !== 'mcp' || !encodedNamespace || !encodedToolName || extraParts.length > 0) {\n\t\tthrow new Error('Invalid MCP toolRef.');\n\t}\n\n\ttry {\n\t\treturn toolIdentitySchema.parse({\n\t\t\tnamespace: decodeToolRefSegment(encodedNamespace),\n\t\t\ttoolName: decodeToolRefSegment(encodedToolName),\n\t\t});\n\t} catch {\n\t\tthrow new Error('Invalid MCP toolRef.');\n\t}\n}\n","import { createHash } from 'node:crypto';\n\nimport { portalToolRecordSchema, type PortalToolRecord } from '../catalog-types.js';\nimport { encodeToolRef } from '../tool-ref.js';\n\nexport interface CatalogArtifactInput {\n\treadonly tools: readonly PortalToolRecord[];\n}\n\nfunction toIdentifierPart(value: string): string {\n\tconst words = value.split(/[^A-Za-z0-9]+/).filter(Boolean);\n\tif (words.length === 0) {\n\t\treturn 'tool';\n\t}\n\n\treturn words.map((word) => word.slice(0, 1).toUpperCase() + word.slice(1)).join('');\n}\n\nfunction shortToolRefHash(toolRef: string): string {\n\treturn createHash('sha256').update(toolRef).digest('hex').slice(0, 8);\n}\n\nfunction toToolConstantName(tool: PortalToolRecord & { readonly toolRef: string }): string {\n\tconst namespacePart = toIdentifierPart(tool.namespace);\n\tconst toolNamePart = toIdentifierPart(tool.toolName);\n\tconst identifier = `${namespacePart}${toolNamePart}${shortToolRefHash(tool.toolRef)}Tool`;\n\n\treturn identifier.slice(0, 1).toLowerCase() + identifier.slice(1);\n}\n\nexport function generateTypescriptCatalogArtifact(input: CatalogArtifactInput): string {\n\tconst tools = input.tools\n\t\t.map((tool) => portalToolRecordSchema.parse(tool))\n\t\t.toSorted((left, right) => {\n\t\t\tconst leftRef = encodeToolRef({ namespace: left.namespace, toolName: left.toolName });\n\t\t\tconst rightRef = encodeToolRef({ namespace: right.namespace, toolName: right.toolName });\n\t\t\treturn leftRef.localeCompare(rightRef);\n\t\t});\n\n\tconst catalogEntries = tools.map((tool) =>\n\t\tObject.assign({}, tool, {\n\t\t\ttoolRef: encodeToolRef({ namespace: tool.namespace, toolName: tool.toolName }),\n\t\t}),\n\t);\n\tconst constants = catalogEntries\n\t\t.map((tool) => {\n\t\t\tconst constantName = toToolConstantName(tool);\n\t\t\treturn `export const ${constantName} = requireCatalogTool(${JSON.stringify(tool.toolRef)});`;\n\t\t})\n\t\t.join('\\n');\n\n\treturn [\n\t\t'// Generated by agent-vm-mcp-portal. JSON Schema is canonical; Zod is derived for runtime validation.',\n\t\t\"import * as z from 'zod';\",\n\t\t'',\n\t\t`export const portalCatalog = ${JSON.stringify({ tools: catalogEntries }, null, '\\t')} as const;`,\n\t\t'',\n\t\tconstants,\n\t\t'',\n\t\t'function requireCatalogTool(toolRef: string): (typeof portalCatalog.tools)[number] {',\n\t\t'\\tconst tool = portalCatalog.tools.find((catalogTool) => catalogTool.toolRef === toolRef);',\n\t\t'\\tif (!tool) {',\n\t\t'\\t\\tthrow new Error(`Unknown MCP portal toolRef: ${toolRef}`);',\n\t\t'\\t}',\n\t\t'\\treturn tool;',\n\t\t'}',\n\t\t'',\n\t\t'export function createInputValidator(toolRef: string): z.ZodType {',\n\t\t'\\tconst tool = requireCatalogTool(toolRef);',\n\t\t'\\treturn z.fromJSONSchema(tool.inputSchema);',\n\t\t'}',\n\t\t'',\n\t].join('\\n');\n}\n"],"mappings":";;;AAOA,MAAa,kBAAwC,EAAE,WACtD,EAAE,MAAM;CACP,EAAE,QAAQ;CACV,EAAE,QAAQ,CAAC,QAAQ;CACnB,EAAE,SAAS;CACX,EAAE,MAAM;CACR,EAAE,MAAM,gBAAgB;CACxB;CACA,CAAC,CACF;AAED,MAAa,mBAA0C,EAAE,OAAO,EAAE,QAAQ,EAAE,gBAAgB;AAE5F,SAAgB,aAAa,OAAqC;CACjE,OAAO,OAAO,UAAU,YAAY,UAAU,QAAQ,CAAC,MAAM,QAAQ,MAAM;;AAG5E,SAAgB,iBAAiB,OAAgB,OAA2B;CAC3E,IAAI,CAAC,aAAa,MAAM,EACvB,MAAM,IAAI,MAAM,GAAG,MAAM,yBAAyB;CAGnD,OAAO,iBAAiB,MAAM,MAAM;;;;ACzBrC,MAAM,wBAAwB,IAAI,IAAI;CACrC;CACA;CACA;CACA;CACA;CACA,CAAC;AAEF,SAAS,yBAAyB,OAAkC;CACnE,MAAM,QAAqB,CAAC,MAAM;CAElC,OAAO,MAAM,SAAS,GAAG;EACxB,MAAM,UAAU,MAAM,KAAK;EAC3B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