From 718bfb0777018927e9cbc3f4b8cdae6d27a4849b Mon Sep 17 00:00:00 2001 From: Xuan Son Nguyen Date: Thu, 19 Mar 2026 23:08:34 +0100 Subject: [PATCH] displayName -> display_name --- tools/server/README-dev.md | 2 +- tools/server/server-tools.cpp | 18 +++++++++--------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/tools/server/README-dev.md b/tools/server/README-dev.md index 326cb357b4..f9fae5a6cc 100644 --- a/tools/server/README-dev.md +++ b/tools/server/README-dev.md @@ -103,7 +103,7 @@ This endpoint is intended to be used internally by the Web UI and subject to cha Get a list of tools, each tool has these fields: - `tool` (string): the ID name of the tool, to be used in POST call. Example: `read_file` -- `displayName` (string): the name to be displayed on UI. Example: `Read file` +- `display_name` (string): the name to be displayed on UI. Example: `Read file` - `type` (string): always be `"builtin"` for now - `permissions` (object): a mapping string --> boolean that indicates the permission required by this tool. This is useful for the UI to ask the user before calling the tool. For now, the only permission supported is `"write"` - `definition` (object): the OAI-compat definition of this tool diff --git a/tools/server/server-tools.cpp b/tools/server/server-tools.cpp index d5c7921efd..7e371bfb81 100644 --- a/tools/server/server-tools.cpp +++ b/tools/server/server-tools.cpp @@ -139,7 +139,7 @@ static bool glob_match(const std::string & pattern, const std::string & str) { struct server_tool { std::string name; - std::string displayName; + std::string display_name; json definition; bool permission_write = false; @@ -149,7 +149,7 @@ struct server_tool { json to_json() { return { - {"displayName", displayName}, + {"display_name", display_name}, {"tool", name}, {"type", "builtin"}, {"permissions", json{ @@ -169,7 +169,7 @@ static constexpr size_t SERVER_TOOL_READ_FILE_MAX_SIZE = 16 * 1024; // 16 KB struct server_tool_read_file : server_tool { server_tool_read_file() { name = "read_file"; - displayName = "Read file"; + display_name = "Read file"; permission_write = false; } @@ -252,7 +252,7 @@ static constexpr size_t SERVER_TOOL_FILE_SEARCH_MAX_RESULTS = 100; struct server_tool_file_glob_search : server_tool { server_tool_file_glob_search() { name = "file_glob_search"; - displayName = "File search"; + display_name = "File search"; permission_write = false; } @@ -316,7 +316,7 @@ static constexpr size_t SERVER_TOOL_GREP_SEARCH_MAX_RESULTS = 100; struct server_tool_grep_search : server_tool { server_tool_grep_search() { name = "grep_search"; - displayName = "Grep search"; + display_name = "Grep search"; permission_write = false; } @@ -414,7 +414,7 @@ static constexpr int SERVER_TOOL_EXEC_SHELL_COMMAND_MAX_TIMEOUT = 60; struct server_tool_exec_shell_command : server_tool { server_tool_exec_shell_command() { name = "exec_shell_command"; - displayName = "Execute shell command"; + display_name = "Execute shell command"; permission_write = true; } @@ -470,7 +470,7 @@ struct server_tool_exec_shell_command : server_tool { struct server_tool_write_file : server_tool { server_tool_write_file() { name = "write_file"; - displayName = "Write file"; + display_name = "Write file"; permission_write = true; } @@ -525,7 +525,7 @@ struct server_tool_write_file : server_tool { struct server_tool_edit_file : server_tool { server_tool_edit_file() { name = "edit_file"; - displayName = "Edit file"; + display_name = "Edit file"; permission_write = true; } @@ -691,7 +691,7 @@ struct server_tool_edit_file : server_tool { struct server_tool_apply_diff : server_tool { server_tool_apply_diff() { name = "apply_diff"; - displayName = "Apply diff"; + display_name = "Apply diff"; permission_write = true; }