@agent-vm/config-contracts 0.0.74 → 0.0.77
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/index.d.ts +36 -46
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +55 -20
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -190,10 +190,24 @@ declare const portalApprovalConfigSchema: z.ZodObject<{
|
|
|
190
190
|
}, z.core.$strict>;
|
|
191
191
|
type PortalApprovalConfig = z.infer<typeof portalApprovalConfigSchema>;
|
|
192
192
|
declare const mcpPortalProfileDefinitionSchema: z.ZodObject<{
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
193
|
+
approval: z.ZodOptional<z.ZodObject<{
|
|
194
|
+
annotationPolicy: z.ZodOptional<z.ZodDefault<z.ZodEnum<{
|
|
195
|
+
"destructive-requires-approval": "destructive-requires-approval";
|
|
196
|
+
"always-require-approval": "always-require-approval";
|
|
197
|
+
}>>>;
|
|
198
|
+
}, z.core.$strict>>;
|
|
199
|
+
namespaces: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
200
|
+
approval: z.ZodDefault<z.ZodObject<{
|
|
201
|
+
allowWithoutApproval: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
202
|
+
alwaysAsk: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
203
|
+
trustedAnnotations: z.ZodDefault<z.ZodBoolean>;
|
|
204
|
+
write: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
205
|
+
}, z.core.$strict>>;
|
|
206
|
+
tools: z.ZodDefault<z.ZodObject<{
|
|
207
|
+
enabled: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
208
|
+
hidden: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
209
|
+
}, z.core.$strict>>;
|
|
210
|
+
}, z.core.$strict>>>;
|
|
197
211
|
logging: z.ZodOptional<z.ZodObject<{
|
|
198
212
|
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
199
213
|
}, z.core.$strict>>;
|
|
@@ -204,25 +218,6 @@ declare const mcpPortalProfileDefinitionSchema: z.ZodObject<{
|
|
|
204
218
|
cache: z.ZodOptional<z.ZodObject<{
|
|
205
219
|
catalogTtlMs: z.ZodDefault<z.ZodNumber>;
|
|
206
220
|
}, z.core.$strict>>;
|
|
207
|
-
approval: z.ZodOptional<z.ZodObject<{
|
|
208
|
-
allowWithoutApprovalTools: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
209
|
-
namespace: z.ZodString;
|
|
210
|
-
toolName: z.ZodString;
|
|
211
|
-
}, z.core.$strict>>>;
|
|
212
|
-
alwaysAskTools: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
213
|
-
namespace: z.ZodString;
|
|
214
|
-
toolName: z.ZodString;
|
|
215
|
-
}, z.core.$strict>>>;
|
|
216
|
-
annotationPolicy: z.ZodDefault<z.ZodEnum<{
|
|
217
|
-
"destructive-requires-approval": "destructive-requires-approval";
|
|
218
|
-
"always-require-approval": "always-require-approval";
|
|
219
|
-
}>>;
|
|
220
|
-
trustedAnnotationNamespaces: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
221
|
-
writeTools: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
222
|
-
namespace: z.ZodString;
|
|
223
|
-
toolName: z.ZodString;
|
|
224
|
-
}, z.core.$strict>>>;
|
|
225
|
-
}, z.core.$strict>>;
|
|
226
221
|
}, z.core.$strict>;
|
|
227
222
|
type McpPortalProfileDefinition = z.infer<typeof mcpPortalProfileDefinitionSchema>;
|
|
228
223
|
declare const resolvedMcpPortalProfileSchema: z.ZodObject<{
|
|
@@ -325,10 +320,24 @@ declare const mcpPortalConfigSchema: z.ZodObject<{
|
|
|
325
320
|
}, z.core.$strict>], "source">>;
|
|
326
321
|
}, z.core.$strict>>>;
|
|
327
322
|
profiles: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
323
|
+
approval: z.ZodOptional<z.ZodObject<{
|
|
324
|
+
annotationPolicy: z.ZodOptional<z.ZodDefault<z.ZodEnum<{
|
|
325
|
+
"destructive-requires-approval": "destructive-requires-approval";
|
|
326
|
+
"always-require-approval": "always-require-approval";
|
|
327
|
+
}>>>;
|
|
328
|
+
}, z.core.$strict>>;
|
|
329
|
+
namespaces: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
330
|
+
approval: z.ZodDefault<z.ZodObject<{
|
|
331
|
+
allowWithoutApproval: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
332
|
+
alwaysAsk: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
333
|
+
trustedAnnotations: z.ZodDefault<z.ZodBoolean>;
|
|
334
|
+
write: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
335
|
+
}, z.core.$strict>>;
|
|
336
|
+
tools: z.ZodDefault<z.ZodObject<{
|
|
337
|
+
enabled: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
338
|
+
hidden: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
339
|
+
}, z.core.$strict>>;
|
|
340
|
+
}, z.core.$strict>>>;
|
|
332
341
|
logging: z.ZodOptional<z.ZodObject<{
|
|
333
342
|
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
334
343
|
}, z.core.$strict>>;
|
|
@@ -339,25 +348,6 @@ declare const mcpPortalConfigSchema: z.ZodObject<{
|
|
|
339
348
|
cache: z.ZodOptional<z.ZodObject<{
|
|
340
349
|
catalogTtlMs: z.ZodDefault<z.ZodNumber>;
|
|
341
350
|
}, z.core.$strict>>;
|
|
342
|
-
approval: z.ZodOptional<z.ZodObject<{
|
|
343
|
-
allowWithoutApprovalTools: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
344
|
-
namespace: z.ZodString;
|
|
345
|
-
toolName: z.ZodString;
|
|
346
|
-
}, z.core.$strict>>>;
|
|
347
|
-
alwaysAskTools: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
348
|
-
namespace: z.ZodString;
|
|
349
|
-
toolName: z.ZodString;
|
|
350
|
-
}, z.core.$strict>>>;
|
|
351
|
-
annotationPolicy: z.ZodDefault<z.ZodEnum<{
|
|
352
|
-
"destructive-requires-approval": "destructive-requires-approval";
|
|
353
|
-
"always-require-approval": "always-require-approval";
|
|
354
|
-
}>>;
|
|
355
|
-
trustedAnnotationNamespaces: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
356
|
-
writeTools: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
357
|
-
namespace: z.ZodString;
|
|
358
|
-
toolName: z.ZodString;
|
|
359
|
-
}, z.core.$strict>>>;
|
|
360
|
-
}, z.core.$strict>>;
|
|
361
351
|
}, z.core.$strict>>;
|
|
362
352
|
}, z.core.$strict>;
|
|
363
353
|
type ParsedMcpPortalConfig = z.infer<typeof mcpPortalConfigSchema>;
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","names":[],"sources":["../src/json-config-file.ts","../src/json-value.ts","../src/secret-value.ts","../src/mcp-config.ts","../src/mcp-portal-config.ts","../src/mcp-portal-approval-policy.ts","../src/schema-artifacts.ts"],"mappings":";;;iBAsBsB,kBAAA,CAAmB,QAAA,WAAmB,OAAA;;;KCpBhD,aAAA;AAAA,KACA,SAAA,GAAY,SAAA;AAAA,KACZ,UAAA;EAAA,CAAgB,GAAA,WAAc,SAAA;AAAA;AAAA,KAC9B,SAAA,GAAY,SAAA,GAAY,UAAA,GAAa,aAAA;AAAA,cAEpC,eAAA,EAAiB,CAAA,CAAE,OAAA,CAAQ,SAAA;AAAA,cAW3B,gBAAA,EAAkB,CAAA,CAAE,OAAA,CAAQ,UAAA;AAAA,iBAEzB,YAAA,CAAa,KAAA,YAAiB,KAAA,IAAS,UAAA;AAAA,iBAIvC,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A;EAAA,SACzB,MAAA,EAAQ,QAAA,CAAS,MAAA,SAAe,oBAAA;AAAA;AAAA,cAG7B,mCAAA,EAAmC,CAAA,CAAA,SAAA;;;;KAOpC,6BAAA,GAAgC,CAAA,CAAE,KAAA,QAAa,mCAAA;AAAA,iBAcrC,mBAAA,CAAoB,UAAA,WAAqB,OAAA,CAAQ,eAAA;AAAA,iBAoEvD,uBAAA,CACf,MAAA,EAAQ,eAAA,EACR,WAAA,WACE,wBAAA;AAAA,iBAQa,iCAAA,CAAkC,MAAA,EAAQ,WAAA;;;UChSzC,gCAAA;EAAA,SACP,eAAA;EAAA,SACA,YAAA;AAAA;AAAA,UAGO,yBAAA;EAAA,SACP,WAAA,GAAc,gCAAA;EAAA,SACd,SAAA;EAAA,SACA,QAAA;AAAA;AAAA,iBAyBM,6BAAA,CACf,OAAA,EAAS,wBAAA,EACT,IAAA,EAAM,yBAAA;;;cChCM,6BAAA;EAAA,SAGH,GAAA;EAAA,SAAA,SAAA;AAAA;AAAA,cAEG,wBAAA;EAAA,SAGH,GAAA;EAAA,SAAA,SAAA;AAAA;AAAA,cAEG,0BAAA;EAAA,SAGH,oBAAA;EAAA,SAAA,0BAAA;AAAA;AAAA,UAEO,6BAAA;EAAA,SACP,GAAA,EAAK,MAAA;EAAA,SACL,SAAA,EAAW,MAAA;AAAA;AAAA,iBAUL,mCAAA,CAAA,GAAuC,6BAAA"}
|
package/dist/index.js
CHANGED
|
@@ -162,18 +162,35 @@ const portalApprovalConfigSchema = z.object({
|
|
|
162
162
|
trustedAnnotationNamespaces: z.array(z.string().min(1)).default([]),
|
|
163
163
|
writeTools: z.array(namespaceToolRefSchema).default([])
|
|
164
164
|
}).strict();
|
|
165
|
+
const portalNamespaceToolsSchema = z.object({
|
|
166
|
+
enabled: z.array(z.string().min(1)).optional(),
|
|
167
|
+
hidden: z.array(z.string().min(1)).default([])
|
|
168
|
+
}).strict();
|
|
169
|
+
const defaultPortalNamespaceTools = { hidden: [] };
|
|
170
|
+
const portalNamespaceApprovalSchema = z.object({
|
|
171
|
+
allowWithoutApproval: z.array(z.string().min(1)).default([]),
|
|
172
|
+
alwaysAsk: z.array(z.string().min(1)).default([]),
|
|
173
|
+
trustedAnnotations: z.boolean().default(false),
|
|
174
|
+
write: z.array(z.string().min(1)).default([])
|
|
175
|
+
}).strict();
|
|
176
|
+
const portalNamespacePolicySchema = z.object({
|
|
177
|
+
approval: portalNamespaceApprovalSchema.default({
|
|
178
|
+
allowWithoutApproval: [],
|
|
179
|
+
alwaysAsk: [],
|
|
180
|
+
trustedAnnotations: false,
|
|
181
|
+
write: []
|
|
182
|
+
}),
|
|
183
|
+
tools: portalNamespaceToolsSchema.default(defaultPortalNamespaceTools)
|
|
184
|
+
}).strict();
|
|
165
185
|
const mcpPortalProfileDefinitionSchema = z.object({
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
enabledToolsByNamespace: z.record(z.string().min(1), z.array(z.string().min(1))).optional(),
|
|
169
|
-
hiddenToolsByNamespace: z.record(z.string().min(1), z.array(z.string().min(1))).optional(),
|
|
186
|
+
approval: z.object({ annotationPolicy: portalApprovalConfigSchema.shape.annotationPolicy.optional() }).strict().optional(),
|
|
187
|
+
namespaces: z.record(z.string().min(1), portalNamespacePolicySchema).default({}),
|
|
170
188
|
logging: z.object({ enabled: z.boolean().default(false) }).strict().optional(),
|
|
171
189
|
promptContext: z.object({
|
|
172
190
|
enabled: z.boolean().default(true),
|
|
173
191
|
maxNamespaces: z.number().int().positive().default(12)
|
|
174
192
|
}).strict().optional(),
|
|
175
|
-
cache: z.object({ catalogTtlMs: z.number().int().positive().default(6e4) }).strict().optional()
|
|
176
|
-
approval: portalApprovalConfigSchema.optional()
|
|
193
|
+
cache: z.object({ catalogTtlMs: z.number().int().positive().default(6e4) }).strict().optional()
|
|
177
194
|
}).strict();
|
|
178
195
|
const resolvedMcpPortalProfileSchema = z.object({
|
|
179
196
|
enabledNamespaces: z.array(z.string().min(1)),
|
|
@@ -240,25 +257,43 @@ const defaultProfile = {
|
|
|
240
257
|
async function loadMcpPortalConfig(configPath) {
|
|
241
258
|
return mcpPortalConfigSchema.parse(await loadJsonConfigFile(configPath));
|
|
242
259
|
}
|
|
243
|
-
function
|
|
260
|
+
function namespaceToolRefs(namespaces, selector) {
|
|
261
|
+
return Object.entries(namespaces).flatMap(([namespace, policy]) => selector(policy).map((toolName) => ({
|
|
262
|
+
namespace,
|
|
263
|
+
toolName
|
|
264
|
+
})));
|
|
265
|
+
}
|
|
266
|
+
function compileNamespaceApproval(namespaces, annotationPolicy) {
|
|
267
|
+
return portalApprovalConfigSchema.parse({
|
|
268
|
+
allowWithoutApprovalTools: namespaceToolRefs(namespaces, (policy) => policy.approval?.allowWithoutApproval ?? []),
|
|
269
|
+
annotationPolicy,
|
|
270
|
+
alwaysAskTools: namespaceToolRefs(namespaces, (policy) => policy.approval?.alwaysAsk ?? []),
|
|
271
|
+
trustedAnnotationNamespaces: Object.entries(namespaces).filter(([, policy]) => policy.approval?.trustedAnnotations).map(([namespace]) => namespace),
|
|
272
|
+
writeTools: namespaceToolRefs(namespaces, (policy) => policy.approval?.write ?? [])
|
|
273
|
+
});
|
|
274
|
+
}
|
|
275
|
+
function compileEnabledToolsByNamespace(namespaces) {
|
|
276
|
+
return Object.fromEntries(Object.entries(namespaces).filter(([, policy]) => policy.tools?.enabled !== void 0).map(([namespace, policy]) => [namespace, policy.tools?.enabled ?? []]));
|
|
277
|
+
}
|
|
278
|
+
function compileHiddenToolsByNamespace(namespaces) {
|
|
279
|
+
return Object.fromEntries(Object.entries(namespaces).filter(([, policy]) => (policy.tools?.hidden ?? []).length > 0).map(([namespace, policy]) => [namespace, policy.tools?.hidden ?? []]));
|
|
280
|
+
}
|
|
281
|
+
function compileProfileFromNamespaces(namespaces, profile) {
|
|
282
|
+
const annotationPolicy = profile.approval?.annotationPolicy ?? defaultProfile.approval.annotationPolicy;
|
|
244
283
|
return resolvedMcpPortalProfileSchema.parse({
|
|
245
|
-
approval:
|
|
246
|
-
cache:
|
|
247
|
-
enabledNamespaces:
|
|
248
|
-
enabledToolsByNamespace:
|
|
249
|
-
hiddenToolsByNamespace:
|
|
250
|
-
logging:
|
|
251
|
-
promptContext:
|
|
284
|
+
approval: compileNamespaceApproval(namespaces, annotationPolicy),
|
|
285
|
+
cache: profile.cache ?? defaultProfile.cache,
|
|
286
|
+
enabledNamespaces: Object.keys(namespaces),
|
|
287
|
+
enabledToolsByNamespace: compileEnabledToolsByNamespace(namespaces),
|
|
288
|
+
hiddenToolsByNamespace: compileHiddenToolsByNamespace(namespaces),
|
|
289
|
+
logging: profile.logging ?? defaultProfile.logging,
|
|
290
|
+
promptContext: profile.promptContext ?? defaultProfile.promptContext
|
|
252
291
|
});
|
|
253
292
|
}
|
|
254
|
-
function
|
|
293
|
+
function resolveMcpPortalProfile(config, profileName) {
|
|
255
294
|
const profile = config.profiles[profileName];
|
|
256
295
|
if (profile === void 0) throw new Error(`unknown MCP profile '${profileName}'`);
|
|
257
|
-
|
|
258
|
-
return mergeProfile(profile.extends === void 0 ? defaultProfile : resolveMcpPortalProfileWithState(config, profile.extends, { stack: [...state.stack, profileName] }), profile);
|
|
259
|
-
}
|
|
260
|
-
function resolveMcpPortalProfile(config, profileName) {
|
|
261
|
-
return resolveMcpPortalProfileWithState(config, profileName, { stack: [] });
|
|
296
|
+
return compileProfileFromNamespaces(profile.namespaces, profile);
|
|
262
297
|
}
|
|
263
298
|
function secretValueToEnvironmentReference(secret) {
|
|
264
299
|
if (secret.source === "environment") return `\${${secret.name}}`;
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../src/json-config-file.ts","../src/json-value.ts","../src/secret-value.ts","../src/mcp-config.ts","../src/mcp-portal-approval-policy.ts","../src/mcp-portal-config.ts","../src/schema-artifacts.ts"],"sourcesContent":["import { readFile } from 'node:fs/promises';\n\nimport { parse, type ParseError, type ParseOptions, printParseErrorCode } from 'jsonc-parser';\n\nconst parseJsoncToUnknown: (text: string, errors: ParseError[], options: ParseOptions) => unknown =\n\tparse;\n\nfunction formatLineColumn(text: string, offset: number): string {\n\tconst prefix = text.slice(0, offset);\n\tconst line = prefix.split('\\n').length;\n\tconst lastLineBreakIndex = prefix.lastIndexOf('\\n');\n\tconst column = offset - lastLineBreakIndex;\n\treturn `line ${line}, column ${column}`;\n}\n\nfunction formatParseError(filePath: string, text: string, error: ParseError): string {\n\treturn [\n\t\t`Invalid JSONC in ${filePath}: ${formatLineColumn(text, error.offset)}:`,\n\t\tprintParseErrorCode(error.error),\n\t].join(' ');\n}\n\nexport async function loadJsonConfigFile(filePath: string): Promise<unknown> {\n\tconst rawConfig = await readFile(filePath, 'utf8');\n\tconst parseErrors: ParseError[] = [];\n\tconst parsedConfig = parseJsoncToUnknown(rawConfig, parseErrors, {\n\t\tallowTrailingComma: true,\n\t\tdisallowComments: false,\n\t});\n\n\tif (parseErrors.length > 0) {\n\t\tconst firstParseError = parseErrors[0];\n\t\tif (firstParseError !== undefined) {\n\t\t\tthrow new Error(formatParseError(filePath, rawConfig, firstParseError));\n\t\t}\n\t}\n\n\treturn parsedConfig;\n}\n","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\nexport const secretValueSchema = z.discriminatedUnion('source', [\n\tz\n\t\t.object({\n\t\t\tsource: z.literal('environment'),\n\t\t\tname: z.string().min(1),\n\t\t})\n\t\t.strict(),\n\tz\n\t\t.object({\n\t\t\tsource: z.literal('1password'),\n\t\t\tref: z.string().regex(/^op:\\/\\//u, '1Password refs must start with op://'),\n\t\t})\n\t\t.strict(),\n]);\n\nexport type SecretValue = z.infer<typeof secretValueSchema>;\n","import { z } from 'zod';\n\nimport { loadJsonConfigFile } from './json-config-file.js';\nimport { secretValueSchema, type SecretValue } from './secret-value.js';\n\nconst mcpProviderDiscoverySchema = z\n\t.object({\n\t\tsummary: z.string().min(1).optional(),\n\t})\n\t.strict();\n\nconst remoteTransportUrlSchema = z.url().refine(\n\t(value) => {\n\t\tconst protocol = new URL(value).protocol;\n\t\treturn protocol === 'http:' || protocol === 'https:';\n\t},\n\t{ message: 'Remote MCP transport URLs must use http or https.' },\n);\n\nconst streamableHttpTransportSchema = z\n\t.object({\n\t\tkind: z.literal('streamable-http'),\n\t\turl: remoteTransportUrlSchema,\n\t\theaders: z.record(z.string(), secretValueSchema).default({}),\n\t\trequiredEgressHosts: z.array(z.string().min(1)).default([]),\n\t})\n\t.strict();\n\nconst sseTransportSchema = z\n\t.object({\n\t\tkind: z.literal('sse'),\n\t\turl: remoteTransportUrlSchema,\n\t\theaders: z.record(z.string(), secretValueSchema).default({}),\n\t\trequiredEgressHosts: z.array(z.string().min(1)).default([]),\n\t})\n\t.strict();\n\nconst stdioTransportSchema = z\n\t.object({\n\t\tkind: z.literal('stdio'),\n\t\tcommand: z.string().min(1),\n\t\targs: z.array(z.string()).default([]),\n\t\tcwd: z.string().min(1).optional(),\n\t\tenv: z.record(z.string(), secretValueSchema).default({}),\n\t\tnetworkAccess: z.enum(['declared', 'none']).optional(),\n\t\trequiredEgressHosts: z.array(z.string().min(1)).default([]),\n\t})\n\t.strict();\n\nexport const mcpSecretPolicySchema = z\n\t.object({\n\t\thosts: z.array(z.string()).default([]),\n\t\tinjection: z.enum(['env', 'http-mediation']),\n\t})\n\t.strict()\n\t.superRefine((policy, context) => {\n\t\tif (policy.injection === 'http-mediation' && policy.hosts.length === 0) {\n\t\t\tcontext.addIssue({\n\t\t\t\tcode: z.ZodIssueCode.custom,\n\t\t\t\tmessage: 'http-mediation secret policies must declare at least one host.',\n\t\t\t\tpath: ['hosts'],\n\t\t\t});\n\t\t}\n\t\tif (policy.injection === 'env' && policy.hosts.length > 0) {\n\t\t\tcontext.addIssue({\n\t\t\t\tcode: z.ZodIssueCode.custom,\n\t\t\t\tmessage: 'env secret policies must not declare hosts.',\n\t\t\t\tpath: ['hosts'],\n\t\t\t});\n\t\t}\n\t});\n\nexport const mcpProviderSchema = z\n\t.object({\n\t\tkind: z.literal('mcp'),\n\t\tnamespace: z.string().min(1),\n\t\tdiscovery: mcpProviderDiscoverySchema.default({}),\n\t\tsecretPolicies: z.record(z.string().min(1), mcpSecretPolicySchema).default({}),\n\t\ttransport: z.discriminatedUnion('kind', [\n\t\t\tstreamableHttpTransportSchema,\n\t\t\tsseTransportSchema,\n\t\t\tstdioTransportSchema,\n\t\t]),\n\t})\n\t.strict();\n\nexport const mcpConfigSchema = z\n\t.object({\n\t\t$schema: z.string().min(1).optional(),\n\t\tschemaVersion: z.literal(1),\n\t\tproviders: z.record(z.string().min(1), mcpProviderSchema).default({}),\n\t})\n\t.strict();\n\nexport type McpConfig = z.infer<typeof mcpConfigSchema>;\nexport type McpProvider = z.infer<typeof mcpProviderSchema>;\n\nexport type ResolvedMcpProvider =\n\t| {\n\t\t\treadonly headers: Readonly<Record<string, SecretValue>>;\n\t\t\treadonly namespace: string;\n\t\t\treadonly transport: 'streamable-http' | 'sse';\n\t\t\treadonly url: string;\n\t }\n\t| {\n\t\t\treadonly args: readonly string[];\n\t\t\treadonly command: string;\n\t\t\treadonly cwd?: string;\n\t\t\treadonly env: Readonly<Record<string, SecretValue>>;\n\t\t\treadonly namespace: string;\n\t\t\treadonly transport: 'stdio';\n\t };\n\nexport async function loadMcpConfig(configPath: string): Promise<McpConfig> {\n\treturn mcpConfigSchema.parse(await loadJsonConfigFile(configPath));\n}\n\nexport function mcpConfigToResolvedProviders(config: McpConfig): readonly ResolvedMcpProvider[] {\n\treturn Object.values(config.providers).map((provider) => {\n\t\tconst transport = provider.transport;\n\t\tif (transport.kind === 'stdio') {\n\t\t\tconst resolvedProvider: {\n\t\t\t\targs: readonly string[];\n\t\t\t\tcommand: string;\n\t\t\t\tcwd?: string;\n\t\t\t\tenv: Readonly<Record<string, SecretValue>>;\n\t\t\t\tnamespace: string;\n\t\t\t\ttransport: 'stdio';\n\t\t\t} = {\n\t\t\t\targs: transport.args,\n\t\t\t\tcommand: transport.command,\n\t\t\t\tenv: transport.env,\n\t\t\t\tnamespace: provider.namespace,\n\t\t\t\ttransport: transport.kind,\n\t\t\t};\n\t\t\tif (transport.cwd !== undefined) {\n\t\t\t\tresolvedProvider.cwd = transport.cwd;\n\t\t\t}\n\t\t\treturn resolvedProvider;\n\t\t}\n\n\t\treturn {\n\t\t\theaders: transport.headers,\n\t\t\tnamespace: provider.namespace,\n\t\t\ttransport: transport.kind,\n\t\t\turl: transport.url,\n\t\t};\n\t});\n}\n","import type { NamespaceToolRef, ResolvedMcpPortalProfile } from './mcp-portal-config.js';\n\nexport interface McpPortalApprovalToolAnnotations {\n\treadonly destructiveHint?: boolean | undefined;\n\treadonly readOnlyHint?: boolean | undefined;\n}\n\nexport interface McpPortalApprovalToolCall {\n\treadonly annotations?: McpPortalApprovalToolAnnotations;\n\treadonly namespace: string;\n\treadonly toolName: string;\n}\n\nfunction selectorMatches(\n\tselectors: readonly NamespaceToolRef[],\n\tnamespace: string,\n\ttoolName: string,\n): boolean {\n\treturn selectors.some(\n\t\t(selector) => selector.namespace === namespace && selector.toolName === toolName,\n\t);\n}\n\nfunction hasTrustedReadOnlyAnnotation(\n\tprofile: ResolvedMcpPortalProfile,\n\tcall: McpPortalApprovalToolCall,\n): boolean {\n\treturn (\n\t\tprofile.approval.annotationPolicy === 'destructive-requires-approval' &&\n\t\tprofile.approval.trustedAnnotationNamespaces.includes(call.namespace) &&\n\t\tcall.annotations?.readOnlyHint === true &&\n\t\tcall.annotations.destructiveHint !== true\n\t);\n}\n\nexport function mcpPortalCallRequiresApproval(\n\tprofile: ResolvedMcpPortalProfile,\n\tcall: McpPortalApprovalToolCall,\n): boolean {\n\tif (selectorMatches(profile.approval.allowWithoutApprovalTools, call.namespace, call.toolName)) {\n\t\treturn false;\n\t}\n\tif (profile.approval.annotationPolicy === 'always-require-approval') {\n\t\treturn true;\n\t}\n\tif (\n\t\tselectorMatches(profile.approval.alwaysAskTools, call.namespace, call.toolName) ||\n\t\tselectorMatches(profile.approval.writeTools, call.namespace, call.toolName)\n\t) {\n\t\treturn true;\n\t}\n\treturn !hasTrustedReadOnlyAnnotation(profile, call);\n}\n","import { z } from 'zod';\n\nimport { loadJsonConfigFile } from './json-config-file.js';\nimport { secretValueSchema, type SecretValue } from './secret-value.js';\n\nexport const namespaceToolRefSchema = z\n\t.object({\n\t\tnamespace: z.string().min(1),\n\t\ttoolName: z.string().min(1),\n\t})\n\t.strict();\n\nexport type NamespaceToolRef = z.infer<typeof namespaceToolRefSchema>;\n\nexport const portalApprovalConfigSchema = z\n\t.object({\n\t\tallowWithoutApprovalTools: z.array(namespaceToolRefSchema).default([]),\n\t\talwaysAskTools: z.array(namespaceToolRefSchema).default([]),\n\t\tannotationPolicy: z\n\t\t\t.enum(['destructive-requires-approval', 'always-require-approval'])\n\t\t\t.default('destructive-requires-approval'),\n\t\ttrustedAnnotationNamespaces: z.array(z.string().min(1)).default([]),\n\t\twriteTools: z.array(namespaceToolRefSchema).default([]),\n\t})\n\t.strict();\n\nexport type PortalApprovalConfig = z.infer<typeof portalApprovalConfigSchema>;\n\nexport const mcpPortalProfileDefinitionSchema = z\n\t.object({\n\t\textends: z.string().min(1).optional(),\n\t\tenabledNamespaces: z.array(z.string().min(1)).optional(),\n\t\tenabledToolsByNamespace: z.record(z.string().min(1), z.array(z.string().min(1))).optional(),\n\t\thiddenToolsByNamespace: z.record(z.string().min(1), z.array(z.string().min(1))).optional(),\n\t\tlogging: z\n\t\t\t.object({ enabled: z.boolean().default(false) })\n\t\t\t.strict()\n\t\t\t.optional(),\n\t\tpromptContext: z\n\t\t\t.object({\n\t\t\t\tenabled: z.boolean().default(true),\n\t\t\t\tmaxNamespaces: z.number().int().positive().default(12),\n\t\t\t})\n\t\t\t.strict()\n\t\t\t.optional(),\n\t\tcache: z\n\t\t\t.object({\n\t\t\t\tcatalogTtlMs: z.number().int().positive().default(60_000),\n\t\t\t})\n\t\t\t.strict()\n\t\t\t.optional(),\n\t\tapproval: portalApprovalConfigSchema.optional(),\n\t})\n\t.strict();\n\nexport type McpPortalProfileDefinition = z.infer<typeof mcpPortalProfileDefinitionSchema>;\n\nexport const resolvedMcpPortalProfileSchema = z\n\t.object({\n\t\tenabledNamespaces: z.array(z.string().min(1)),\n\t\tenabledToolsByNamespace: z.record(z.string().min(1), z.array(z.string().min(1))),\n\t\thiddenToolsByNamespace: z.record(z.string().min(1), z.array(z.string().min(1))),\n\t\tlogging: z.object({ enabled: z.boolean() }).strict(),\n\t\tpromptContext: z\n\t\t\t.object({\n\t\t\t\tenabled: z.boolean(),\n\t\t\t\tmaxNamespaces: z.number().int().positive(),\n\t\t\t})\n\t\t\t.strict(),\n\t\tcache: z.object({ catalogTtlMs: z.number().int().positive() }).strict(),\n\t\tapproval: portalApprovalConfigSchema,\n\t})\n\t.strict();\n\nexport type ResolvedMcpPortalProfile = z.infer<typeof resolvedMcpPortalProfileSchema>;\n\nexport const mcpPortalExternalAuthSchema = z\n\t.object({\n\t\tmasterKey: secretValueSchema,\n\t})\n\t.strict();\n\nexport type McpPortalExternalAuthConfig = z.infer<typeof mcpPortalExternalAuthSchema>;\n\nfunction isLoopbackProxyHost(host: string): boolean {\n\tconst normalizedHost = host.toLowerCase();\n\treturn (\n\t\tnormalizedHost === 'localhost' || normalizedHost === '127.0.0.1' || normalizedHost === '::1'\n\t);\n}\n\nexport const mcpPortalProxySchema = z\n\t.object({\n\t\tserver: z\n\t\t\t.object({\n\t\t\t\thost: z\n\t\t\t\t\t.string()\n\t\t\t\t\t.min(1)\n\t\t\t\t\t.refine(isLoopbackProxyHost, {\n\t\t\t\t\t\tmessage: 'mcpProxy.server.host must be loopback-only for HTTP bearer auth.',\n\t\t\t\t\t})\n\t\t\t\t\t.default('127.0.0.1'),\n\t\t\t\tport: z.number().int().min(1).max(65_535).default(18_791),\n\t\t\t})\n\t\t\t.strict()\n\t\t\t.default({ host: '127.0.0.1', port: 18_791 }),\n\t\tauth: z\n\t\t\t.object({\n\t\t\t\theaderName: z.string().min(1).default('authorization'),\n\t\t\t})\n\t\t\t.strict()\n\t\t\t.default({ headerName: 'authorization' }),\n\t})\n\t.strict();\n\nexport type McpPortalProxyConfig = z.infer<typeof mcpPortalProxySchema>;\n\nexport const mcpPortalAgentConfigSchema = z\n\t.object({\n\t\tcredentialVersion: z.number().int().positive().default(1),\n\t\tprofile: z.string().min(1),\n\t\thmacKey: secretValueSchema.optional(),\n\t})\n\t.strict();\n\nexport type McpPortalAgentConfig = z.infer<typeof mcpPortalAgentConfigSchema>;\n\nexport const mcpPortalConfigSchema = z\n\t.object({\n\t\t$schema: z.string().min(1).optional(),\n\t\tschemaVersion: z.literal(1),\n\t\texternalAuth: mcpPortalExternalAuthSchema.optional(),\n\t\tmcpProxy: mcpPortalProxySchema.optional(),\n\t\tagents: z.record(z.string().min(1), mcpPortalAgentConfigSchema).default({}),\n\t\tprofiles: z.record(z.string().min(1), mcpPortalProfileDefinitionSchema),\n\t})\n\t.strict()\n\t.superRefine((config, context) => {\n\t\tif (Object.keys(config.profiles).length === 0) {\n\t\t\tcontext.addIssue({\n\t\t\t\tcode: z.ZodIssueCode.custom,\n\t\t\t\tmessage: 'mcp-portal.config.jsonc must define at least one profile.',\n\t\t\t\tpath: ['profiles'],\n\t\t\t});\n\t\t}\n\t});\n\ntype ParsedMcpPortalConfig = z.infer<typeof mcpPortalConfigSchema>;\nexport type McpPortalConfig = Omit<ParsedMcpPortalConfig, 'agents'> & {\n\treadonly agents: Readonly<Record<string, McpPortalAgentConfig>>;\n};\n\nexport const openClawMcpPortalPluginConfigSchema = z\n\t.object({\n\t\tconfigDir: z.string().min(1),\n\t\tbinPath: z.string().min(1).optional(),\n\t})\n\t.strict();\n\nexport type OpenClawMcpPortalPluginConfig = z.infer<typeof openClawMcpPortalPluginConfigSchema>;\n\nconst defaultProfile: ResolvedMcpPortalProfile = {\n\tapproval: portalApprovalConfigSchema.parse({}),\n\tcache: { catalogTtlMs: 60_000 },\n\tenabledNamespaces: [],\n\tenabledToolsByNamespace: {},\n\thiddenToolsByNamespace: {},\n\tlogging: { enabled: false },\n\tpromptContext: { enabled: true, maxNamespaces: 12 },\n};\n\ninterface ResolveProfileState {\n\treadonly stack: readonly string[];\n}\n\nexport async function loadMcpPortalConfig(configPath: string): Promise<McpPortalConfig> {\n\treturn mcpPortalConfigSchema.parse(await loadJsonConfigFile(configPath));\n}\n\nfunction mergeProfile(\n\tbase: ResolvedMcpPortalProfile,\n\toverride: McpPortalProfileDefinition,\n): ResolvedMcpPortalProfile {\n\treturn resolvedMcpPortalProfileSchema.parse({\n\t\tapproval: override.approval ?? base.approval,\n\t\tcache: override.cache ?? base.cache,\n\t\tenabledNamespaces: override.enabledNamespaces ?? base.enabledNamespaces,\n\t\tenabledToolsByNamespace: override.enabledToolsByNamespace ?? base.enabledToolsByNamespace,\n\t\thiddenToolsByNamespace: override.hiddenToolsByNamespace ?? base.hiddenToolsByNamespace,\n\t\tlogging: override.logging ?? base.logging,\n\t\tpromptContext: override.promptContext ?? base.promptContext,\n\t});\n}\n\nfunction resolveMcpPortalProfileWithState(\n\tconfig: McpPortalConfig,\n\tprofileName: string,\n\tstate: ResolveProfileState,\n): ResolvedMcpPortalProfile {\n\tconst profile = config.profiles[profileName];\n\tif (profile === undefined) {\n\t\tthrow new Error(`unknown MCP profile '${profileName}'`);\n\t}\n\tif (state.stack.includes(profileName)) {\n\t\tthrow new Error(`MCP profile inheritance cycle: ${[...state.stack, profileName].join(' -> ')}`);\n\t}\n\n\tconst parentProfile =\n\t\tprofile.extends === undefined\n\t\t\t? defaultProfile\n\t\t\t: resolveMcpPortalProfileWithState(config, profile.extends, {\n\t\t\t\t\tstack: [...state.stack, profileName],\n\t\t\t\t});\n\treturn mergeProfile(parentProfile, profile);\n}\n\nexport function resolveMcpPortalProfile(\n\tconfig: McpPortalConfig,\n\tprofileName: string,\n): ResolvedMcpPortalProfile {\n\treturn resolveMcpPortalProfileWithState(config, profileName, { stack: [] });\n}\n\nexport function secretValueToEnvironmentReference(secret: SecretValue): string {\n\tif (secret.source === 'environment') {\n\t\treturn `\\${${secret.name}}`;\n\t}\n\treturn secret.ref;\n}\n","import * as zod from 'zod';\n\nimport { mcpConfigSchema } from './mcp-config.js';\nimport { mcpPortalConfigSchema } from './mcp-portal-config.js';\n\nexport const mcpPortalConfigSchemaVersions = {\n\tmcp: 1,\n\tmcpPortal: 1,\n} as const;\n\nexport const mcpPortalConfigSchemaIds = {\n\tmcp: 'agent-vm:mcp:1',\n\tmcpPortal: 'agent-vm:mcp-portal:1',\n} as const;\n\nexport const mcpPortalConfigSchemaPaths = {\n\tmcpFromGatewayConfig: '../../schemas/mcp.schema.json',\n\tmcpPortalFromGatewayConfig: '../../schemas/mcp-portal.schema.json',\n} as const;\n\nexport interface ConfigContractSchemaArtifacts {\n\treadonly mcp: Record<string, unknown>;\n\treadonly mcpPortal: Record<string, unknown>;\n}\n\nfunction withSchemaId(schema: Record<string, unknown>, schemaId: string): Record<string, unknown> {\n\treturn {\n\t\t$id: schemaId,\n\t\t...schema,\n\t};\n}\n\nexport function createConfigContractSchemaArtifacts(): ConfigContractSchemaArtifacts {\n\treturn {\n\t\tmcp: withSchemaId(\n\t\t\tzod.toJSONSchema(mcpConfigSchema, { target: 'draft-07' }),\n\t\t\tmcpPortalConfigSchemaIds.mcp,\n\t\t),\n\t\tmcpPortal: withSchemaId(\n\t\t\tzod.toJSONSchema(mcpPortalConfigSchema, { target: 'draft-07' }),\n\t\t\tmcpPortalConfigSchemaIds.mcpPortal,\n\t\t),\n\t};\n}\n"],"mappings":";;;;;AAIA,MAAM,sBACL;AAED,SAAS,iBAAiB,MAAc,QAAwB;CAC/D,MAAM,SAAS,KAAK,MAAM,GAAG,OAAO;CAIpC,OAAO,QAHM,OAAO,MAAM,KAAK,CAAC,OAGZ,WADL,SADY,OAAO,YAAY,KACJ;;AAI3C,SAAS,iBAAiB,UAAkB,MAAc,OAA2B;CACpF,OAAO,CACN,oBAAoB,SAAS,IAAI,iBAAiB,MAAM,MAAM,OAAO,CAAC,IACtE,oBAAoB,MAAM,MAAM,CAChC,CAAC,KAAK,IAAI;;AAGZ,eAAsB,mBAAmB,UAAoC;CAC5E,MAAM,YAAY,MAAM,SAAS,UAAU,OAAO;CAClD,MAAM,cAA4B,EAAE;CACpC,MAAM,eAAe,oBAAoB,WAAW,aAAa;EAChE,oBAAoB;EACpB,kBAAkB;EAClB,CAAC;CAEF,IAAI,YAAY,SAAS,GAAG;EAC3B,MAAM,kBAAkB,YAAY;EACpC,IAAI,oBAAoB,KAAA,GACvB,MAAM,IAAI,MAAM,iBAAiB,UAAU,WAAW,gBAAgB,CAAC;;CAIzE,OAAO;;;;AC9BR,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;;AA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EAAE,OAAO,EAAE,EAAE,CAAC;;AAG5E,SAAgB,kCAAkC,QAA6B;CAC9E,IAAI,OAAO,WAAW,eACrB,OAAO,MAAM,OAAO,KAAK;CAE1B,OAAO,OAAO;;;;AC9Nf,MAAa,gCAAgC;CAC5C,KAAK;CACL,WAAW;CACX;AAED,MAAa,2BAA2B;CACvC,KAAK;CACL,WAAW;CACX;AAED,MAAa,6BAA6B;CACzC,sBAAsB;CACtB,4BAA4B;CAC5B;AAOD,SAAS,aAAa,QAAiC,UAA2C;CACjG,OAAO;EACN,KAAK;EACL,GAAG;EACH;;AAGF,SAAgB,sCAAqE;CACpF,OAAO;EACN,KAAK,aACJ,IAAI,aAAa,iBAAiB,EAAE,QAAQ,YAAY,CAAC,EACzD,yBAAyB,IACzB;EACD,WAAW,aACV,IAAI,aAAa,uBAAuB,EAAE,QAAQ,YAAY,CAAC,EAC/D,yBAAyB,UACzB;EACD"}
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../src/json-config-file.ts","../src/json-value.ts","../src/secret-value.ts","../src/mcp-config.ts","../src/mcp-portal-approval-policy.ts","../src/mcp-portal-config.ts","../src/schema-artifacts.ts"],"sourcesContent":["import { readFile } from 'node:fs/promises';\n\nimport { parse, type ParseError, type ParseOptions, printParseErrorCode } from 'jsonc-parser';\n\nconst parseJsoncToUnknown: (text: string, errors: ParseError[], options: ParseOptions) => unknown =\n\tparse;\n\nfunction formatLineColumn(text: string, offset: number): string {\n\tconst prefix = text.slice(0, offset);\n\tconst line = prefix.split('\\n').length;\n\tconst lastLineBreakIndex = prefix.lastIndexOf('\\n');\n\tconst column = offset - lastLineBreakIndex;\n\treturn `line ${line}, column ${column}`;\n}\n\nfunction formatParseError(filePath: string, text: string, error: ParseError): string {\n\treturn [\n\t\t`Invalid JSONC in ${filePath}: ${formatLineColumn(text, error.offset)}:`,\n\t\tprintParseErrorCode(error.error),\n\t].join(' ');\n}\n\nexport async function loadJsonConfigFile(filePath: string): Promise<unknown> {\n\tconst rawConfig = await readFile(filePath, 'utf8');\n\tconst parseErrors: ParseError[] = [];\n\tconst parsedConfig = parseJsoncToUnknown(rawConfig, parseErrors, {\n\t\tallowTrailingComma: true,\n\t\tdisallowComments: false,\n\t});\n\n\tif (parseErrors.length > 0) {\n\t\tconst firstParseError = parseErrors[0];\n\t\tif (firstParseError !== undefined) {\n\t\t\tthrow new Error(formatParseError(filePath, rawConfig, firstParseError));\n\t\t}\n\t}\n\n\treturn parsedConfig;\n}\n","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\nexport const secretValueSchema = z.discriminatedUnion('source', [\n\tz\n\t\t.object({\n\t\t\tsource: z.literal('environment'),\n\t\t\tname: z.string().min(1),\n\t\t})\n\t\t.strict(),\n\tz\n\t\t.object({\n\t\t\tsource: z.literal('1password'),\n\t\t\tref: z.string().regex(/^op:\\/\\//u, '1Password refs must start with op://'),\n\t\t})\n\t\t.strict(),\n]);\n\nexport type SecretValue = z.infer<typeof secretValueSchema>;\n","import { z } from 'zod';\n\nimport { loadJsonConfigFile } from './json-config-file.js';\nimport { secretValueSchema, type SecretValue } from './secret-value.js';\n\nconst mcpProviderDiscoverySchema = z\n\t.object({\n\t\tsummary: z.string().min(1).optional(),\n\t})\n\t.strict();\n\nconst remoteTransportUrlSchema = z.url().refine(\n\t(value) => {\n\t\tconst protocol = new URL(value).protocol;\n\t\treturn protocol === 'http:' || protocol === 'https:';\n\t},\n\t{ message: 'Remote MCP transport URLs must use http or https.' },\n);\n\nconst streamableHttpTransportSchema = z\n\t.object({\n\t\tkind: z.literal('streamable-http'),\n\t\turl: remoteTransportUrlSchema,\n\t\theaders: z.record(z.string(), secretValueSchema).default({}),\n\t\trequiredEgressHosts: z.array(z.string().min(1)).default([]),\n\t})\n\t.strict();\n\nconst sseTransportSchema = z\n\t.object({\n\t\tkind: z.literal('sse'),\n\t\turl: remoteTransportUrlSchema,\n\t\theaders: z.record(z.string(), secretValueSchema).default({}),\n\t\trequiredEgressHosts: z.array(z.string().min(1)).default([]),\n\t})\n\t.strict();\n\nconst stdioTransportSchema = z\n\t.object({\n\t\tkind: z.literal('stdio'),\n\t\tcommand: z.string().min(1),\n\t\targs: z.array(z.string()).default([]),\n\t\tcwd: z.string().min(1).optional(),\n\t\tenv: z.record(z.string(), secretValueSchema).default({}),\n\t\tnetworkAccess: z.enum(['declared', 'none']).optional(),\n\t\trequiredEgressHosts: z.array(z.string().min(1)).default([]),\n\t})\n\t.strict();\n\nexport const mcpSecretPolicySchema = z\n\t.object({\n\t\thosts: z.array(z.string()).default([]),\n\t\tinjection: z.enum(['env', 'http-mediation']),\n\t})\n\t.strict()\n\t.superRefine((policy, context) => {\n\t\tif (policy.injection === 'http-mediation' && policy.hosts.length === 0) {\n\t\t\tcontext.addIssue({\n\t\t\t\tcode: z.ZodIssueCode.custom,\n\t\t\t\tmessage: 'http-mediation secret policies must declare at least one host.',\n\t\t\t\tpath: ['hosts'],\n\t\t\t});\n\t\t}\n\t\tif (policy.injection === 'env' && policy.hosts.length > 0) {\n\t\t\tcontext.addIssue({\n\t\t\t\tcode: z.ZodIssueCode.custom,\n\t\t\t\tmessage: 'env secret policies must not declare hosts.',\n\t\t\t\tpath: ['hosts'],\n\t\t\t});\n\t\t}\n\t});\n\nexport const mcpProviderSchema = z\n\t.object({\n\t\tkind: z.literal('mcp'),\n\t\tnamespace: z.string().min(1),\n\t\tdiscovery: mcpProviderDiscoverySchema.default({}),\n\t\tsecretPolicies: z.record(z.string().min(1), mcpSecretPolicySchema).default({}),\n\t\ttransport: z.discriminatedUnion('kind', [\n\t\t\tstreamableHttpTransportSchema,\n\t\t\tsseTransportSchema,\n\t\t\tstdioTransportSchema,\n\t\t]),\n\t})\n\t.strict();\n\nexport const mcpConfigSchema = z\n\t.object({\n\t\t$schema: z.string().min(1).optional(),\n\t\tschemaVersion: z.literal(1),\n\t\tproviders: z.record(z.string().min(1), mcpProviderSchema).default({}),\n\t})\n\t.strict();\n\nexport type McpConfig = z.infer<typeof mcpConfigSchema>;\nexport type McpProvider = z.infer<typeof mcpProviderSchema>;\n\nexport type ResolvedMcpProvider =\n\t| {\n\t\t\treadonly headers: Readonly<Record<string, SecretValue>>;\n\t\t\treadonly namespace: string;\n\t\t\treadonly transport: 'streamable-http' | 'sse';\n\t\t\treadonly url: string;\n\t }\n\t| {\n\t\t\treadonly args: readonly string[];\n\t\t\treadonly command: string;\n\t\t\treadonly cwd?: string;\n\t\t\treadonly env: Readonly<Record<string, SecretValue>>;\n\t\t\treadonly namespace: string;\n\t\t\treadonly transport: 'stdio';\n\t };\n\nexport async function loadMcpConfig(configPath: string): Promise<McpConfig> {\n\treturn mcpConfigSchema.parse(await loadJsonConfigFile(configPath));\n}\n\nexport function mcpConfigToResolvedProviders(config: McpConfig): readonly ResolvedMcpProvider[] {\n\treturn Object.values(config.providers).map((provider) => {\n\t\tconst transport = provider.transport;\n\t\tif (transport.kind === 'stdio') {\n\t\t\tconst resolvedProvider: {\n\t\t\t\targs: readonly string[];\n\t\t\t\tcommand: string;\n\t\t\t\tcwd?: string;\n\t\t\t\tenv: Readonly<Record<string, SecretValue>>;\n\t\t\t\tnamespace: string;\n\t\t\t\ttransport: 'stdio';\n\t\t\t} = {\n\t\t\t\targs: transport.args,\n\t\t\t\tcommand: transport.command,\n\t\t\t\tenv: transport.env,\n\t\t\t\tnamespace: provider.namespace,\n\t\t\t\ttransport: transport.kind,\n\t\t\t};\n\t\t\tif (transport.cwd !== undefined) {\n\t\t\t\tresolvedProvider.cwd = transport.cwd;\n\t\t\t}\n\t\t\treturn resolvedProvider;\n\t\t}\n\n\t\treturn {\n\t\t\theaders: transport.headers,\n\t\t\tnamespace: provider.namespace,\n\t\t\ttransport: transport.kind,\n\t\t\turl: transport.url,\n\t\t};\n\t});\n}\n","import type { NamespaceToolRef, ResolvedMcpPortalProfile } from './mcp-portal-config.js';\n\nexport interface McpPortalApprovalToolAnnotations {\n\treadonly destructiveHint?: boolean | undefined;\n\treadonly readOnlyHint?: boolean | undefined;\n}\n\nexport interface McpPortalApprovalToolCall {\n\treadonly annotations?: McpPortalApprovalToolAnnotations;\n\treadonly namespace: string;\n\treadonly toolName: string;\n}\n\nfunction selectorMatches(\n\tselectors: readonly NamespaceToolRef[],\n\tnamespace: string,\n\ttoolName: string,\n): boolean {\n\treturn selectors.some(\n\t\t(selector) => selector.namespace === namespace && selector.toolName === toolName,\n\t);\n}\n\nfunction hasTrustedReadOnlyAnnotation(\n\tprofile: ResolvedMcpPortalProfile,\n\tcall: McpPortalApprovalToolCall,\n): boolean {\n\treturn (\n\t\tprofile.approval.annotationPolicy === 'destructive-requires-approval' &&\n\t\tprofile.approval.trustedAnnotationNamespaces.includes(call.namespace) &&\n\t\tcall.annotations?.readOnlyHint === true &&\n\t\tcall.annotations.destructiveHint !== true\n\t);\n}\n\nexport function mcpPortalCallRequiresApproval(\n\tprofile: ResolvedMcpPortalProfile,\n\tcall: McpPortalApprovalToolCall,\n): boolean {\n\tif (selectorMatches(profile.approval.allowWithoutApprovalTools, call.namespace, call.toolName)) {\n\t\treturn false;\n\t}\n\tif (profile.approval.annotationPolicy === 'always-require-approval') {\n\t\treturn true;\n\t}\n\tif (\n\t\tselectorMatches(profile.approval.alwaysAskTools, call.namespace, call.toolName) ||\n\t\tselectorMatches(profile.approval.writeTools, call.namespace, call.toolName)\n\t) {\n\t\treturn true;\n\t}\n\treturn !hasTrustedReadOnlyAnnotation(profile, call);\n}\n","import { z } from 'zod';\n\nimport { loadJsonConfigFile } from './json-config-file.js';\nimport { secretValueSchema, type SecretValue } from './secret-value.js';\n\nexport const namespaceToolRefSchema = z\n\t.object({\n\t\tnamespace: z.string().min(1),\n\t\ttoolName: z.string().min(1),\n\t})\n\t.strict();\n\nexport type NamespaceToolRef = z.infer<typeof namespaceToolRefSchema>;\n\nexport const portalApprovalConfigSchema = z\n\t.object({\n\t\tallowWithoutApprovalTools: z.array(namespaceToolRefSchema).default([]),\n\t\talwaysAskTools: z.array(namespaceToolRefSchema).default([]),\n\t\tannotationPolicy: z\n\t\t\t.enum(['destructive-requires-approval', 'always-require-approval'])\n\t\t\t.default('destructive-requires-approval'),\n\t\ttrustedAnnotationNamespaces: z.array(z.string().min(1)).default([]),\n\t\twriteTools: z.array(namespaceToolRefSchema).default([]),\n\t})\n\t.strict();\n\nexport type PortalApprovalConfig = z.infer<typeof portalApprovalConfigSchema>;\n\nconst portalNamespaceToolsSchema = z\n\t.object({\n\t\tenabled: z.array(z.string().min(1)).optional(),\n\t\thidden: z.array(z.string().min(1)).default([]),\n\t})\n\t.strict();\n\nconst defaultPortalNamespaceTools = {\n\thidden: [],\n} satisfies z.infer<typeof portalNamespaceToolsSchema>;\n\nconst portalNamespaceApprovalSchema = z\n\t.object({\n\t\tallowWithoutApproval: z.array(z.string().min(1)).default([]),\n\t\talwaysAsk: z.array(z.string().min(1)).default([]),\n\t\ttrustedAnnotations: z.boolean().default(false),\n\t\twrite: z.array(z.string().min(1)).default([]),\n\t})\n\t.strict();\n\nconst defaultPortalNamespaceApproval = {\n\tallowWithoutApproval: [],\n\talwaysAsk: [],\n\ttrustedAnnotations: false,\n\twrite: [],\n} satisfies z.infer<typeof portalNamespaceApprovalSchema>;\n\nconst portalNamespacePolicySchema = z\n\t.object({\n\t\tapproval: portalNamespaceApprovalSchema.default(defaultPortalNamespaceApproval),\n\t\ttools: portalNamespaceToolsSchema.default(defaultPortalNamespaceTools),\n\t})\n\t.strict();\n\ntype PortalNamespacePolicy = z.infer<typeof portalNamespacePolicySchema>;\n\nexport const mcpPortalProfileDefinitionSchema = z\n\t.object({\n\t\tapproval: z\n\t\t\t.object({\n\t\t\t\tannotationPolicy: portalApprovalConfigSchema.shape.annotationPolicy.optional(),\n\t\t\t})\n\t\t\t.strict()\n\t\t\t.optional(),\n\t\tnamespaces: z.record(z.string().min(1), portalNamespacePolicySchema).default({}),\n\t\tlogging: z\n\t\t\t.object({ enabled: z.boolean().default(false) })\n\t\t\t.strict()\n\t\t\t.optional(),\n\t\tpromptContext: z\n\t\t\t.object({\n\t\t\t\tenabled: z.boolean().default(true),\n\t\t\t\tmaxNamespaces: z.number().int().positive().default(12),\n\t\t\t})\n\t\t\t.strict()\n\t\t\t.optional(),\n\t\tcache: z\n\t\t\t.object({\n\t\t\t\tcatalogTtlMs: z.number().int().positive().default(60_000),\n\t\t\t})\n\t\t\t.strict()\n\t\t\t.optional(),\n\t})\n\t.strict();\n\nexport type McpPortalProfileDefinition = z.infer<typeof mcpPortalProfileDefinitionSchema>;\n\nexport const resolvedMcpPortalProfileSchema = z\n\t.object({\n\t\tenabledNamespaces: z.array(z.string().min(1)),\n\t\tenabledToolsByNamespace: z.record(z.string().min(1), z.array(z.string().min(1))),\n\t\thiddenToolsByNamespace: z.record(z.string().min(1), z.array(z.string().min(1))),\n\t\tlogging: z.object({ enabled: z.boolean() }).strict(),\n\t\tpromptContext: z\n\t\t\t.object({\n\t\t\t\tenabled: z.boolean(),\n\t\t\t\tmaxNamespaces: z.number().int().positive(),\n\t\t\t})\n\t\t\t.strict(),\n\t\tcache: z.object({ catalogTtlMs: z.number().int().positive() }).strict(),\n\t\tapproval: portalApprovalConfigSchema,\n\t})\n\t.strict();\n\nexport type ResolvedMcpPortalProfile = z.infer<typeof resolvedMcpPortalProfileSchema>;\n\nexport const mcpPortalExternalAuthSchema = z\n\t.object({\n\t\tmasterKey: secretValueSchema,\n\t})\n\t.strict();\n\nexport type McpPortalExternalAuthConfig = z.infer<typeof mcpPortalExternalAuthSchema>;\n\nfunction isLoopbackProxyHost(host: string): boolean {\n\tconst normalizedHost = host.toLowerCase();\n\treturn (\n\t\tnormalizedHost === 'localhost' || normalizedHost === '127.0.0.1' || normalizedHost === '::1'\n\t);\n}\n\nexport const mcpPortalProxySchema = z\n\t.object({\n\t\tserver: z\n\t\t\t.object({\n\t\t\t\thost: z\n\t\t\t\t\t.string()\n\t\t\t\t\t.min(1)\n\t\t\t\t\t.refine(isLoopbackProxyHost, {\n\t\t\t\t\t\tmessage: 'mcpProxy.server.host must be loopback-only for HTTP bearer auth.',\n\t\t\t\t\t})\n\t\t\t\t\t.default('127.0.0.1'),\n\t\t\t\tport: z.number().int().min(1).max(65_535).default(18_791),\n\t\t\t})\n\t\t\t.strict()\n\t\t\t.default({ host: '127.0.0.1', port: 18_791 }),\n\t\tauth: z\n\t\t\t.object({\n\t\t\t\theaderName: z.string().min(1).default('authorization'),\n\t\t\t})\n\t\t\t.strict()\n\t\t\t.default({ headerName: 'authorization' }),\n\t})\n\t.strict();\n\nexport type McpPortalProxyConfig = z.infer<typeof mcpPortalProxySchema>;\n\nexport const mcpPortalAgentConfigSchema = z\n\t.object({\n\t\tcredentialVersion: z.number().int().positive().default(1),\n\t\tprofile: z.string().min(1),\n\t\thmacKey: secretValueSchema.optional(),\n\t})\n\t.strict();\n\nexport type McpPortalAgentConfig = z.infer<typeof mcpPortalAgentConfigSchema>;\n\nexport const mcpPortalConfigSchema = z\n\t.object({\n\t\t$schema: z.string().min(1).optional(),\n\t\tschemaVersion: z.literal(1),\n\t\texternalAuth: mcpPortalExternalAuthSchema.optional(),\n\t\tmcpProxy: mcpPortalProxySchema.optional(),\n\t\tagents: z.record(z.string().min(1), mcpPortalAgentConfigSchema).default({}),\n\t\tprofiles: z.record(z.string().min(1), mcpPortalProfileDefinitionSchema),\n\t})\n\t.strict()\n\t.superRefine((config, context) => {\n\t\tif (Object.keys(config.profiles).length === 0) {\n\t\t\tcontext.addIssue({\n\t\t\t\tcode: z.ZodIssueCode.custom,\n\t\t\t\tmessage: 'mcp-portal.config.jsonc must define at least one profile.',\n\t\t\t\tpath: ['profiles'],\n\t\t\t});\n\t\t}\n\t});\n\ntype ParsedMcpPortalConfig = z.infer<typeof mcpPortalConfigSchema>;\nexport type McpPortalConfig = Omit<ParsedMcpPortalConfig, 'agents'> & {\n\treadonly agents: Readonly<Record<string, McpPortalAgentConfig>>;\n};\n\nexport const openClawMcpPortalPluginConfigSchema = z\n\t.object({\n\t\tconfigDir: z.string().min(1),\n\t\tbinPath: z.string().min(1).optional(),\n\t})\n\t.strict();\n\nexport type OpenClawMcpPortalPluginConfig = z.infer<typeof openClawMcpPortalPluginConfigSchema>;\n\nconst defaultProfile: ResolvedMcpPortalProfile = {\n\tapproval: portalApprovalConfigSchema.parse({}),\n\tcache: { catalogTtlMs: 60_000 },\n\tenabledNamespaces: [],\n\tenabledToolsByNamespace: {},\n\thiddenToolsByNamespace: {},\n\tlogging: { enabled: false },\n\tpromptContext: { enabled: true, maxNamespaces: 12 },\n};\n\ntype AuthoredPortalNamespaces = McpPortalProfileDefinition['namespaces'];\n\nexport async function loadMcpPortalConfig(configPath: string): Promise<McpPortalConfig> {\n\treturn mcpPortalConfigSchema.parse(await loadJsonConfigFile(configPath));\n}\n\nfunction namespaceToolRefs(\n\tnamespaces: Readonly<Record<string, PortalNamespacePolicy>>,\n\tselector: (policy: PortalNamespacePolicy) => readonly string[],\n): readonly NamespaceToolRef[] {\n\treturn Object.entries(namespaces).flatMap(([namespace, policy]) =>\n\t\tselector(policy).map((toolName) => ({ namespace, toolName })),\n\t);\n}\n\nfunction compileNamespaceApproval(\n\tnamespaces: Readonly<Record<string, PortalNamespacePolicy>>,\n\tannotationPolicy: PortalApprovalConfig['annotationPolicy'],\n): PortalApprovalConfig {\n\treturn portalApprovalConfigSchema.parse({\n\t\tallowWithoutApprovalTools: namespaceToolRefs(\n\t\t\tnamespaces,\n\t\t\t(policy) => policy.approval?.allowWithoutApproval ?? [],\n\t\t),\n\t\tannotationPolicy,\n\t\talwaysAskTools: namespaceToolRefs(namespaces, (policy) => policy.approval?.alwaysAsk ?? []),\n\t\ttrustedAnnotationNamespaces: Object.entries(namespaces)\n\t\t\t.filter(([, policy]) => policy.approval?.trustedAnnotations)\n\t\t\t.map(([namespace]) => namespace),\n\t\twriteTools: namespaceToolRefs(namespaces, (policy) => policy.approval?.write ?? []),\n\t});\n}\n\nfunction compileEnabledToolsByNamespace(\n\tnamespaces: Readonly<Record<string, PortalNamespacePolicy>>,\n): Record<string, readonly string[]> {\n\treturn Object.fromEntries(\n\t\tObject.entries(namespaces)\n\t\t\t.filter(([, policy]) => policy.tools?.enabled !== undefined)\n\t\t\t.map(([namespace, policy]) => [namespace, policy.tools?.enabled ?? []]),\n\t);\n}\n\nfunction compileHiddenToolsByNamespace(\n\tnamespaces: Readonly<Record<string, PortalNamespacePolicy>>,\n): Record<string, readonly string[]> {\n\treturn Object.fromEntries(\n\t\tObject.entries(namespaces)\n\t\t\t.filter(([, policy]) => (policy.tools?.hidden ?? []).length > 0)\n\t\t\t.map(([namespace, policy]) => [namespace, policy.tools?.hidden ?? []]),\n\t);\n}\n\nfunction compileProfileFromNamespaces(\n\tnamespaces: AuthoredPortalNamespaces,\n\tprofile: McpPortalProfileDefinition,\n): ResolvedMcpPortalProfile {\n\tconst annotationPolicy =\n\t\tprofile.approval?.annotationPolicy ?? defaultProfile.approval.annotationPolicy;\n\treturn resolvedMcpPortalProfileSchema.parse({\n\t\tapproval: compileNamespaceApproval(namespaces, annotationPolicy),\n\t\tcache: profile.cache ?? defaultProfile.cache,\n\t\tenabledNamespaces: Object.keys(namespaces),\n\t\tenabledToolsByNamespace: compileEnabledToolsByNamespace(namespaces),\n\t\thiddenToolsByNamespace: compileHiddenToolsByNamespace(namespaces),\n\t\tlogging: profile.logging ?? defaultProfile.logging,\n\t\tpromptContext: profile.promptContext ?? defaultProfile.promptContext,\n\t});\n}\n\nexport function resolveMcpPortalProfile(\n\tconfig: McpPortalConfig,\n\tprofileName: string,\n): ResolvedMcpPortalProfile {\n\tconst profile = config.profiles[profileName];\n\tif (profile === undefined) {\n\t\tthrow new Error(`unknown MCP profile '${profileName}'`);\n\t}\n\treturn compileProfileFromNamespaces(profile.namespaces, profile);\n}\n\nexport function secretValueToEnvironmentReference(secret: SecretValue): string {\n\tif (secret.source === 'environment') {\n\t\treturn `\\${${secret.name}}`;\n\t}\n\treturn secret.ref;\n}\n","import * as zod from 'zod';\n\nimport { mcpConfigSchema } from './mcp-config.js';\nimport { mcpPortalConfigSchema } from './mcp-portal-config.js';\n\nexport const mcpPortalConfigSchemaVersions = {\n\tmcp: 1,\n\tmcpPortal: 1,\n} as const;\n\nexport const mcpPortalConfigSchemaIds = {\n\tmcp: 'agent-vm:mcp:1',\n\tmcpPortal: 'agent-vm:mcp-portal:1',\n} as const;\n\nexport const mcpPortalConfigSchemaPaths = {\n\tmcpFromGatewayConfig: '../../schemas/mcp.schema.json',\n\tmcpPortalFromGatewayConfig: '../../schemas/mcp-portal.schema.json',\n} as const;\n\nexport interface ConfigContractSchemaArtifacts {\n\treadonly mcp: Record<string, unknown>;\n\treadonly mcpPortal: Record<string, unknown>;\n}\n\nfunction withSchemaId(schema: Record<string, unknown>, schemaId: string): Record<string, unknown> {\n\treturn {\n\t\t$id: schemaId,\n\t\t...schema,\n\t};\n}\n\nexport function createConfigContractSchemaArtifacts(): ConfigContractSchemaArtifacts {\n\treturn {\n\t\tmcp: withSchemaId(\n\t\t\tzod.toJSONSchema(mcpConfigSchema, { target: 'draft-07' }),\n\t\t\tmcpPortalConfigSchemaIds.mcp,\n\t\t),\n\t\tmcpPortal: withSchemaId(\n\t\t\tzod.toJSONSchema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