feat(tools): add tool profiles and group shorthands
This commit is contained in:
@@ -107,6 +107,8 @@ const FIELD_LABELS: Record<string, string> = {
|
||||
"tools.audio.transcription.args": "Audio Transcription Args",
|
||||
"tools.audio.transcription.timeoutSeconds":
|
||||
"Audio Transcription Timeout (sec)",
|
||||
"tools.profile": "Tool Profile",
|
||||
"agents.list[].tools.profile": "Agent Tool Profile",
|
||||
"tools.exec.applyPatch.enabled": "Enable apply_patch",
|
||||
"tools.exec.applyPatch.allowModels": "apply_patch Model Allowlist",
|
||||
"gateway.controlUi.basePath": "Control UI Base Path",
|
||||
|
||||
@@ -988,7 +988,11 @@ export type QueueConfig = {
|
||||
drop?: QueueDropPolicy;
|
||||
};
|
||||
|
||||
export type ToolProfileId = "minimal" | "coding" | "messaging" | "full";
|
||||
|
||||
export type AgentToolsConfig = {
|
||||
/** Base tool profile applied before allow/deny lists. */
|
||||
profile?: ToolProfileId;
|
||||
allow?: string[];
|
||||
deny?: string[];
|
||||
/** Per-agent elevated exec gate (can only further restrict global tools.elevated). */
|
||||
@@ -1053,6 +1057,8 @@ export type MemorySearchConfig = {
|
||||
};
|
||||
|
||||
export type ToolsConfig = {
|
||||
/** Base tool profile applied before allow/deny lists. */
|
||||
profile?: ToolProfileId;
|
||||
allow?: string[];
|
||||
deny?: string[];
|
||||
audio?: {
|
||||
|
||||
@@ -837,6 +837,15 @@ const ToolPolicySchema = z
|
||||
})
|
||||
.optional();
|
||||
|
||||
const ToolProfileSchema = z
|
||||
.union([
|
||||
z.literal("minimal"),
|
||||
z.literal("coding"),
|
||||
z.literal("messaging"),
|
||||
z.literal("full"),
|
||||
])
|
||||
.optional();
|
||||
|
||||
// Provider docking: allowlists keyed by provider id (no schema updates when adding providers).
|
||||
const ElevatedAllowFromSchema = z
|
||||
.record(z.string(), z.array(z.union([z.string(), z.number()])))
|
||||
@@ -866,6 +875,7 @@ const AgentSandboxSchema = z
|
||||
|
||||
const AgentToolsSchema = z
|
||||
.object({
|
||||
profile: ToolProfileSchema,
|
||||
allow: z.array(z.string()).optional(),
|
||||
deny: z.array(z.string()).optional(),
|
||||
elevated: z
|
||||
@@ -962,6 +972,7 @@ const AgentEntrySchema = z.object({
|
||||
|
||||
const ToolsSchema = z
|
||||
.object({
|
||||
profile: ToolProfileSchema,
|
||||
allow: z.array(z.string()).optional(),
|
||||
deny: z.array(z.string()).optional(),
|
||||
audio: z
|
||||
|
||||
Reference in New Issue
Block a user