fix(build): restore tool policy typing

This commit is contained in:
Peter Steinberger
2026-01-15 04:33:35 +00:00
parent 1baa55c145
commit eb3e865f15
3 changed files with 28 additions and 2 deletions

View File

@@ -146,6 +146,12 @@ export const ToolProfileSchema = z
.union([z.literal("minimal"), z.literal("coding"), z.literal("messaging"), z.literal("full")])
.optional();
const ByProviderPolicySchema = z.object({
profile: ToolProfileSchema,
allow: z.array(z.string()).optional(),
deny: z.array(z.string()).optional(),
});
// Provider docking: allowlists keyed by provider id (no schema updates when adding providers).
export const ElevatedAllowFromSchema = z
.record(z.string(), z.array(z.union([z.string(), z.number()])))
@@ -170,6 +176,7 @@ export const AgentToolsSchema = z
profile: ToolProfileSchema,
allow: z.array(z.string()).optional(),
deny: z.array(z.string()).optional(),
byProvider: z.record(z.string(), ByProviderPolicySchema).optional(),
elevated: z
.object({
enabled: z.boolean().optional(),
@@ -273,6 +280,7 @@ export const ToolsSchema = z
profile: ToolProfileSchema,
allow: z.array(z.string()).optional(),
deny: z.array(z.string()).optional(),
byProvider: z.record(z.string(), ByProviderPolicySchema).optional(),
web: ToolsWebSchema,
audio: z
.object({