feat: add permission field to the list tools response (#2080)
This commit is contained in:
@@ -19,6 +19,18 @@
|
||||
"super::routes::agent"
|
||||
],
|
||||
"operationId": "get_tools",
|
||||
"parameters": [
|
||||
{
|
||||
"name": "extension_name",
|
||||
"in": "query",
|
||||
"description": "Optional extension name to filter tools",
|
||||
"required": false,
|
||||
"schema": {
|
||||
"type": "string",
|
||||
"nullable": true
|
||||
}
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "Tools retrieved successfully",
|
||||
@@ -547,6 +559,15 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"PermissionLevel": {
|
||||
"type": "string",
|
||||
"description": "Enum representing the possible permission levels for a tool.",
|
||||
"enum": [
|
||||
"always_allow",
|
||||
"ask_before",
|
||||
"never_allow"
|
||||
]
|
||||
},
|
||||
"ProviderDetails": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
@@ -688,6 +709,37 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"ToolInfo": {
|
||||
"type": "object",
|
||||
"description": "Information about the tool used for building prompts",
|
||||
"required": [
|
||||
"name",
|
||||
"description",
|
||||
"parameters"
|
||||
],
|
||||
"properties": {
|
||||
"description": {
|
||||
"type": "string"
|
||||
},
|
||||
"name": {
|
||||
"type": "string"
|
||||
},
|
||||
"parameters": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"permission": {
|
||||
"allOf": [
|
||||
{
|
||||
"$ref": "#/components/schemas/PermissionLevel"
|
||||
}
|
||||
],
|
||||
"nullable": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"UpsertConfigQuery": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
|
||||
@@ -84,6 +84,11 @@ export type ExtensionResponse = {
|
||||
extensions: Array<ExtensionEntry>;
|
||||
};
|
||||
|
||||
/**
|
||||
* Enum representing the possible permission levels for a tool.
|
||||
*/
|
||||
export type PermissionLevel = 'always_allow' | 'ask_before' | 'never_allow';
|
||||
|
||||
export type ProviderDetails = {
|
||||
/**
|
||||
* Indicates whether the provider is fully configured
|
||||
@@ -204,6 +209,16 @@ export type ToolAnnotations = {
|
||||
title?: string | null;
|
||||
};
|
||||
|
||||
/**
|
||||
* Information about the tool used for building prompts
|
||||
*/
|
||||
export type ToolInfo = {
|
||||
description: string;
|
||||
name: string;
|
||||
parameters: Array<string>;
|
||||
permission?: PermissionLevel | null;
|
||||
};
|
||||
|
||||
export type UpsertConfigQuery = {
|
||||
is_secret: boolean;
|
||||
key: string;
|
||||
@@ -213,7 +228,12 @@ export type UpsertConfigQuery = {
|
||||
export type GetToolsData = {
|
||||
body?: never;
|
||||
path?: never;
|
||||
query?: never;
|
||||
query?: {
|
||||
/**
|
||||
* Optional extension name to filter tools
|
||||
*/
|
||||
extension_name?: string | null;
|
||||
};
|
||||
url: '/agent/tools';
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user