void icon indicating copy to clipboard operation
void copied to clipboard

functions of the copilot agent

Open msmirnyagin opened this issue 6 months ago • 0 comments

Hi, I like the void project, but it's still very raw. you may find it useful - here are the functions of the copilot agent:

{ role: "user", content: "\nThe current date is 7 июня 2025 г..\n\n<editorContext>\nThe user's current file is /Users/msmirnyagin/dev/home-router-llm/src/index.ts. \n</editorContext>\n\nWhen using the insert_edit_into_file tool, avoid repeating existing code, instead use a line comment with \...existing code...\\ to represent regions of unchanged code.\n\n<userRequest>\nhi\n</userRequest>", } ], model: "qwen2.5-coder", temperature: 0.1, top_p: 1, tools: [ { type: "function", function: { name: "create_and_run_task", description: "For a workspace, this tool will create a task based on the package.json, README.md, and project structure so that the project can be built and run.", parameters: { type: "object", properties: { workspaceFolder: { type: "string", description: "The absolute path of the workspace folder where the tasks.json file will be created.", }, task: { type: "object", description: "The task to add to the new tasks.json file.", properties: { label: { type: "string", description: "The label of the task.", }, type: { type: "string", description: "The type of the task. The only supported value is 'shell'.", enum: [ "shell" ], }, command: { type: "string", description: "The shell command to run for the task. Use this to specify commands for building or running the application.", }, args: { type: "array", description: "The arguments to pass to the command.", items: [Object ...], }, isBackground: { type: "boolean", description: "Whether the task runs in the background without blocking the UI or other tasks. Set to true for long-running processes like watch tasks or servers that should continue executing without requiring user attention. When false, the task will block the terminal until completion.", }, problemMatcher: { type: "array", description: "The problem matcher to use to parse task output for errors and warnings. Can be a predefined matcher like '$tsc' (TypeScript), '$eslint-stylish', '$gcc', etc., or a custom pattern defined in tasks.json. This helps VS Code display errors in the Problems panel and enables quick navigation to error locations.", items: [Object ...], }, group: { type: "string", description: "The group to which the task belongs.", }, }, required: [ "label", "type", "command" ], }, }, required: [ "task", "workspaceFolder" ], }, }, }, { type: "function", function: { name: "create_directory", description: "Create a new directory structure in the workspace. Will recursively create all directories in the path, like mkdir -p. You do not need to use this tool before using create_file, that tool will automatically create the needed directories.", parameters: { type: "object", properties: { dirPath: { type: "string", description: "The absolute path to the directory to create.", }, }, required: [ "dirPath" ], }, }, }, { type: "function", function: { name: "create_file", description: "This is a tool for creating a new file in the workspace. The file will be created with the specified content. The directory will be created if it does not already exist. Never use this tool to edit a file that already exists.", parameters: { type: "object", properties: { filePath: { type: "string", description: "The absolute path to the file to create.", }, content: { type: "string", description: "The content to write to the file.", }, }, required: [ "filePath", "content" ], }, }, }, { type: "function", function: { name: "create_new_jupyter_notebook", description: "Generates a new Jupyter Notebook (.ipynb) in VS Code. Jupyter Notebooks are interactive documents commonly used for data exploration, analysis, visualization, and combining code with narrative text. This tool should only be called when the user explicitly requests to create a new Jupyter Notebook.", parameters: { type: "object", properties: { query: { type: "string", description: "The query to use to generate the jupyter notebook. This should be a clear and concise description of the notebook the user wants to create.", }, }, required: [ "query" ], }, }, }, { type: "function", function: { name: "create_new_workspace", description: "Get steps to help the user create any project in a VS Code workspace. Use this tool to help users set up new projects, including TypeScript-based projects, Model Context Protocol (MCP) servers, VS Code extensions, Next.js projects, Vite projects, or any other project.", parameters: { type: "object", properties: { query: { type: "string", description: "The query to use to generate the new workspace. This should be a clear and concise description of the workspace the user wants to create.", }, }, required: [ "query" ], }, }, }, { type: "function", function: { name: "edit_notebook_file", description: "This is a tool for editing an existing Notebook file in the workspace. Generate the "explanation" property first.\nThe system is very smart and can understand how to apply your edits to the notebooks.\nWhen updating the content of an existing cell, ensure newCode includes at least 3-5 lines of context both before and after the new changes, preserving whitespace and indentation exactly.", parameters: { type: "object", properties: { filePath: { type: "string", description: "An absolute path to the notebook file to edit, or the URI of a untitled, not yet named, file, such as untitled:Untitled-1.", }, explanation: { type: "string", description: "A one-sentence description of edit operation. This will be shown to the user before the tool is run.", }, cellId: { type: "string", description: "Id of the cell that needs to be deleted or edited. Use the value TOP, BOTTOMwhen inserting a cell at the top or bottom of the notebook, else provide the id of the cell after which a new cell is to be inserted. Remember, if a cellId is provided and editType=insert, then a cell will be inserted after the cell with the provided cellId.", }, newCode: { anyOf: [ { type: "string", description: "The code for the new or existing cell to be edited. Code should not be wrapped within <VSCode.Cell> tags", }, { type: "array", items: [Object ...], } ], }, language: { type: "string", description: "The language of the cell.markdown, python, javascript, julia, etc.", }, editType: { type: "string", enum: [ "insert", "delete", "edit" ], description: "The operation peformed on the cell, whether insert, deleteoredit.\nUse the editTypefield to specify the operation:insertto add a new cell,editto modify an existing cell's content, anddeleteto remove a cell.", }, }, required: [ "filePath", "explanation", "editType" ], }, }, }, { type: "function", function: { name: "fetch_webpage", description: "Fetches the main content from a web page. This tool is useful for summarizing or analyzing the content of a webpage. You should use this tool when you think the user is looking for information from a specific webpage.", parameters: { type: "object", properties: { urls: { type: "array", items: { type: "string", }, description: "An array of URLs to fetch content from.", }, query: { type: "string", description: "The query to search for in the web page's content. This should be a clear and concise description of the content you want to find.", }, }, required: [ "urls", "query" ], }, }, }, { type: "function", function: { name: "file_search", description: "Search for files in the workspace by glob pattern. This only returns the paths of matching files. Use this tool when you know the exact filename pattern of the files you're searching for. Glob patterns match from the root of the workspace folder. Examples:\n- **/*.{js,ts} to match all js/ts files in the workspace.\n- src/** to match all files under the top-level src folder.\n- **/foo/**/*.js to match all js files under any foo folder in the workspace.", parameters: { type: "object", properties: { query: { type: "string", description: "Search for files with names or paths matching this glob pattern.", }, maxResults: { type: "number", description: "The maximum number of results to return. Do not use this unless necessary, it can slow things down. By default, only some matches are returned. If you use this and don't see what you're looking for, you can try again with a more specific query or a larger maxResults.", }, }, required: [ "query" ], }, }, }, { type: "function", function: { name: "test_search", description: "For a source code file, find the file that contains the tests. For a test file find the file that contains the code under test.", parameters: { type: "object", properties: { filePaths: { type: "array", items: { type: "string", }, }, }, required: [ "filePaths" ], }, }, }, { type: "function", function: { name: "grep_search", description: "Do a fast text search in the workspace. Use this tool when you want to search with an exact string or regex. Use includePattern to search within files matching a specific pattern, or in a specific file, using a relative path. Use this tool when you want to see an overview of a particular file, instead of using read_file many times to look for code within a file.", parameters: { type: "object", properties: { query: { type: "string", description: "The pattern to search for in files in the workspace. The isRegexp property declares whether it's a regex or plain text pattern. Is case-insensitive.", }, isRegexp: { type: "boolean", description: "Whether the pattern is a regex. False by default.", }, includePattern: { type: "string", description: "Search files matching this glob pattern. Will be applied to the relative path of files within the workspace.", }, maxResults: { type: "number", description: "The maximum number of results to return. Do not use this unless necessary, it can slow things down. By default, only some matches are returned. If you use this and don't see what you're looking for, you can try again with a more specific query or a larger maxResults.", }, }, required: [ "query", "isRegexp" ], }, }, }, { type: "function", function: { name: "get_changed_files", description: "Get git diffs of current file changes in a git repository. Don't forget that you can use run_in_terminal to run git commands in a terminal as well.", parameters: { type: "object", properties: { repositoryPath: { type: "string", description: "The absolute path to the git repository to look for changes in. If not provided, the active git repository will be used.", }, sourceControlState: { type: "array", items: { type: "string", enum: [ "staged", "unstaged", "merge-conflicts" ], }, description: "The kinds of git state to filter by. Allowed values are: 'staged', 'unstaged', and 'merge-conflicts'. If not provided, all states will be included.", }, }, }, }, }, { type: "function", function: { name: "get_errors", description: "Get any compile or lint errors in a code file. If the user mentions errors or problems in a file, they may be referring to these. Use the tool to see the same errors that the user is seeing. Also use this tool after editing a file to validate the change.", parameters: { type: "object", properties: { filePaths: { description: "The absolute paths to the files to check for errors.", type: "array", items: { type: "string", }, }, }, required: [ "filePaths" ], }, }, }, { type: "function", function: { name: "copilot_getNotebookSummary", description: "This is a tool returns the list of the Notebook cells along with the id, cell types, language, execution information and output mime types for each cell. This is useful to get Cell Ids when executing a notebook or determine what cells have been executed and what order, or what cells have outputs. Requery this tool if the contents of the notebook change.", parameters: { type: "object", properties: { filePath: { type: "string", description: "An absolute path to the notebook file with the cell to run, or the URI of a untitled, not yet named, file, such asuntitled:Untitled-1.ipynb", }, }, required: [ "filePath" ], }, }, }, { type: "function", function: { name: "get_project_setup_info", description: "Do not call this tool without first calling the tool to create a workspace. This tool provides a project setup information for a Visual Studio Code workspace based on a project type and programming language.", parameters: { type: "object", properties: { projectType: { type: "string", description: "The type of project to create. Supported values are: 'python-script', 'python-project', 'mcp-server', 'model-context-protocol-server', 'vscode-extension', 'next-js', 'vite' and 'other'", }, language: { type: "string", description: "The programming language for the project. Supported: 'javascript', 'typescript', 'python' and 'other'.", }, }, required: [ "projectType" ], }, }, }, { type: "function", function: { name: "get_search_view_results", description: "The results from the search view", }, }, { type: "function", function: { name: "get_terminal_last_command", description: "Get the user's current selection in the active terminal.", }, }, { type: "function", function: { name: "get_terminal_output", description: "Get the output of a terminal command previous started with run_in_terminal", parameters: { type: "object", properties: { id: { type: "string", description: "The ID of the terminal command output to check.", }, }, required: [ "id" ], }, }, }, { type: "function", function: { name: "get_terminal_selection", description: "Get the user's current selection in the active terminal.", }, }, { type: "function", function: { name: "get_vscode_api", description: "Get relevant VS Code API references to answer questions about VS Code extension development. Use this tool when the user asks about VS Code APIs, capabilities, or best practices related to developing VS Code extensions. Use it in all VS Code extension development workspaces.", parameters: { type: "object", properties: { query: { type: "string", description: "The query to search vscode documentation for. Should contain all relevant context.", }, }, required: [ "query" ], }, }, }, { type: "function", function: { name: "github_repo", description: "Searches a GitHub repository for relevant source code snippets. Only use this tool if the user is very clearly asking for code snippets from a specific GitHub repository. Do not use this tool for Github repos that the user has open in their workspace.", parameters: { type: "object", properties: { repo: { type: "string", description: "The name of the Github repository to search for code in. Should must be formatted as '/'.", }, query: { type: "string", description: "The query to search for repo. Should contain all relevant context.", }, }, required: [ "repo", "query" ], }, }, }, { type: "function", function: { name: "insert_edit_into_file", description: "Insert new code into an existing file in the workspace. Use this tool once per file that needs to be modified, even if there are multiple changes for a file. Generate the "explanation" property first.\nThe system is very smart and can understand how to apply your edits to the files, you just need to provide minimal hints.\nAvoid repeating existing code, instead use comments to represent regions of unchanged code. Be as concise as possible. For example:\n// ...existing code...\n{ changed code }\n// ...existing code...\n{ changed code }\n// ...existing code...\n\nHere is an example of how you should use format an edit to an existing Person class:\nclass Person {\n\t// ...existing code...\n\tage: number;\n\t// ...existing code...\n\tgetAge() {\n\treturn this.age;\n\t}\n}", parameters: { type: "object", properties: { explanation: { type: "string", description: "A short explanation of the edit being made.", }, filePath: { type: "string", description: "An absolute path to the file to edit.", }, code: { type: "string", description: "The code change to apply to the file.\nThe system is very smart and can understand how to apply your edits to the files, you just need to provide minimal hints.\nAvoid repeating existing code, instead use comments to represent regions of unchanged code. Be as concise as possible. For example:\n// ...existing code...\n{ changed code }\n// ...existing code...\n{ changed code }\n// ...existing code...\n\nHere is an example of how you should use format an edit to an existing Person class:\nclass Person {\n\t// ...existing code...\n\tage: number;\n\t// ...existing code...\n\tgetAge() {\n\t\treturn this.age;\n\t}\n}", }, }, required: [ "explanation", "filePath", "code" ], }, }, }, { type: "function", function: { name: "install_extension", description: "Install an extension in VS Code. Use this tool to install an extension in Visual Studio Code as part of a new workspace creation process only.", parameters: { type: "object", properties: { id: { type: "string", description: "The ID of the extension to install. This should be in the format ..", }, name: { type: "string", description: "The name of the extension to install. This should be a clear and concise description of the extension.", }, }, required: [ "id", "name" ], }, }, }, { type: "function", function: { name: "list_code_usages", description: "Request to list all usages (references, definitions, implementations etc) of a function, class, method, variable etc. Use this tool when \n1. Looking for a sample implementation of an interface or class\n2. Checking how a function is used throughout the codebase.\n3. Including and updating all usages when changing a function, method, or constructor", parameters: { type: "object", properties: { symbolName: { type: "string", description: "The name of the symbol, such as a function name, class name, method name, variable name, etc.", }, filePaths: { type: "array", description: "One or more file paths which likely contain the definition of the symbol. For instance the file which declares a class or function. This is optional but will speed up the invocation of this tool and improve the quality of its output.", items: { type: "string", }, }, }, required: [ "symbolName" ], }, }, }, { type: "function", function: { name: "list_dir", description: "List the contents of a directory. Result will have the name of the child. If the name ends in /, it's a folder, otherwise a file", parameters: { type: "object", properties: { path: { type: "string", description: "The absolute path to the directory to list.", }, }, required: [ "path" ], }, }, }, { type: "function", function: { name: "open_simple_browser", description: "Preview a website or open a URL in the editor's Simple Browser. Useful for quickly viewing locally hosted websites, demos, or resources without leaving the coding environment.", parameters: { type: "object", properties: { url: { type: "string", description: "The website URL to preview or open in the Simple Browser inside the editor.", }, }, required: [ "url" ], }, }, }, { type: "function", function: { name: "read_file", description: "Read the contents of a file.\n\nYou must specify the line range you're interested in. Line numbers are 1-indexed. If the file contents returned are insufficient for your task, you may call this tool again to retrieve more content. Prefer reading larger ranges over doing many small reads.", parameters: { type: "object", properties: { filePath: { description: "The absolute path of the file to read.", type: "string", }, startLineNumber: { type: "number", description: "The line number to start reading from, 1-based.", }, endLineNumber: { type: "number", description: "The inclusive line number to end reading at, 1-based.", }, }, required: [ "filePath", "startLineNumber", "endLineNumber" ], }, }, }, { type: "function", function: { name: "run_in_terminal", description: "This tool allows you to execute shell commands in a persistent terminal session, preserving environment variables, working directory, and other context across multiple commands.\n\nCommand Execution:\n- Supports chaining with && or ; (e.g., npm install && npm start).\n- Supports multi-line commands \n\nDirectory Management:\n- Use absolute paths to avoid navigation issues.\n\nProgram Execution:\n- Supports Python, Node.js, and other executables.\n- Install dependencies via pip, npm, etc.\n\nBackground Processes:\n- For long-running tasks (e.g., servers), set isBackground=true.\n- Returns a terminal ID for checking status and runtime later.\n\nImportant Notes:\n- If the command may produce excessively large output, use head or tail to reduce the output.\n- If a command may use a pager, you must something to disable it. For example, you can use git --no-pager. Otherwise you should add something like | cat. Examples: git, less, man, etc.", parameters: { type: "object", properties: { command: { type: "string", description: "The command to run in the terminal.", }, explanation: { type: "string", description: "A one-sentence description of what the command does. This will be shown to the user before the command is run.", }, isBackground: { type: "boolean", description: "Whether the command starts a background process. If true, the command will run in the background and you will not see the output. If false, the tool call will block on the command finishing, and then you will get the output. Examples of backgrond processes: building in watch mode, starting a server. You can check the output of a backgrond process later on by using get_terminal_output.", }, }, required: [ "command", "explanation", "isBackground" ], }, }, }, { type: "function", function: { name: "run_notebook_cell", description: "This is a tool for running a code cell in a notebook file directly in the notebook editor. The output from the execution will be returned. Code cells should be run as they are added or edited when working through a problem to bring the kernel state up to date and ensure the code executes successfully. Code cells are ready to run and don't require any pre-processing. If asked to run the first cell in a notebook, you should run the first code cell since markdown cells cannot be executed.", parameters: { type: "object", properties: { filePath: { type: "string", description: "An absolute path to the notebook file with the cell to run, or the URI of a untitled, not yet named, file, such as `untitled:Untitled-1.ipynb", }, reason: { type: "string", description: "An optional explanation of why the cell is being run. This will be shown to the user before the tool is run and is not necessary if it's self-explanatory.", }, cellId: { type: "string", description: "The ID for the code cell to execute. Avoid providing markdown cell IDs as nothing will be executed.", }, continueOnError: { type: "boolean", description: "Whether or not execution should continue for remaining cells if an error is encountered. Default to false unless instructed otherwise.", }, }, required: [ "filePath", "cellId" ], }, }, }, { type: "function", function: { name: "run_vscode_command", description: "Run a command in VS Code. Use this tool to run a command in Visual Studio Code as part of a new workspace creation process only.", parameters: { type: "object", properties: { commandId: { type: "string", description: "The ID of the command to execute. This should be in the format .", }, name: { type: "string", description: "The name of the command to execute. This should be a clear and concise description of the command.", }, args: { type: "array", description: "The arguments to pass to the command. This should be an array of strings.", items: { type: "string", }, }, }, required: [ "commandId", "name" ], }, }, }, { type: "function", function: { name: "run_vs_code_task", description: "Runs a VS Code task.\n\n- If you see that an appropriate task exists for building or running code, prefer to use this tool to run the task instead of using the run_in_terminal tool.\n- Make sure that any appropriate build or watch task is running before trying to run tests or execute code.\n- If the user asks to run a task, use this tool to do so.", parameters: { type: "object", properties: { workspaceFolder: { type: "string", description: "The workspace folder path containing the task", }, id: { type: "string", description: "The task ID to run.", }, }, required: [ "workspaceFolder", "id" ], }, }, }, { type: "function", function: { name: "semantic_search", description: "Run a natural language search for relevant code or documentation comments from the user's current workspace. Returns relevant code snippets from the user's current workspace if it is large, or the full contents of the workspace if it is small.", parameters: { type: "object", properties: { query: { type: "string", description: "The query to search the codebase for. Should contain all relevant context. Should ideally be text that might appear in the codebase, such as function names, variable names, or comments.", }, }, required: [ "query" ], }, }, }, { type: "function", function: { name: "test_failure", description: "Includes test failure information in the prompt.", }, }, { type: "function", function: { name: "vscode_searchExtensions_internal", description: "Это инструмент для просмотра магазина расширений Visual Studio Code. Он позволяет модели искать расширения и получать подробную информацию о них. Модель должна использовать этот инструмент каждый раз, когда необходимо обнаружить расширения или разрешить информацию об известных расширениях. Чтобы использовать инструмент, модель должна указать категорию расширений, соответствующие ключевые слова поиска или идентификаторы известных расширений. Обратите внимание, что результаты поиска могут содержать ложные срабатывания, поэтому рекомендуется их проверять и фильтровать.", parameters: { type: "object", properties: { category: { type: "string", description: "The category of extensions to search for", enum: [ "AI", "Azure", "Chat", "Data Science", "Debuggers", "Extension Packs", "Education", "Formatters", "Keymaps", "Language Packs", "Linters", "Machine Learning", "Notebooks", "Programming Languages", "SCM Providers", "Snippets", "Testing", "Themes", "Visualization", "Other" ], }, keywords: { type: "array", items: { type: "string", }, description: "The keywords to search for", }, ids: { type: "array", items: { type: "string", }, description: "The ids of the extensions to search for", }, }, }, }, }, { type: "function", function: { name: "vscode-websearchforcopilot_webSearch", description: "Поиск актуальных и релевантных сведений в Интернете", parameters: { type: "object", properties: { query: { type: "string", description: "Запрос для поиска в Интернете", }, }, required: [ "query" ], }, }, } ], n: 1, stream: true, stream_options: { include_usage: true, }, }

msmirnyagin avatar Jun 07 '25 06:06 msmirnyagin