Compare commits

...

3 Commits

4 changed files with 410 additions and 196 deletions

View File

@ -1,5 +1,11 @@
{
"diagnostics.disable": [
"missing-fields"
],
"diagnostics.globals": [
"vim",
"make_avante_system_prompt",
"update_avante_system_prompt",
"get_server_list_prompt"
]
}

View File

@ -20,6 +20,22 @@
"type": "github"
}
},
"avante-src": {
"flake": false,
"locked": {
"lastModified": 1746602870,
"narHash": "sha256-REBOplEe2muqfVLwcpTAmXpTrHlzSfhbh8T0litDTDA=",
"owner": "yetone",
"repo": "avante.nvim",
"rev": "113913355a6b9c0fbd62cf52d0cf3e5671d0e34a",
"type": "github"
},
"original": {
"owner": "yetone",
"repo": "avante.nvim",
"type": "github"
}
},
"clio-flake": {
"inputs": {
"flake-compat": "flake-compat",
@ -46,6 +62,7 @@
},
"custom-flakes": {
"inputs": {
"avante-src": "avante-src",
"d2-vim-src": "d2-vim-src",
"flake-utils": "flake-utils_3",
"gomod2nix-src": "gomod2nix-src",
@ -67,11 +84,11 @@
"zig-src": "zig-src"
},
"locked": {
"lastModified": 1746458473,
"narHash": "sha256-3FFhJ18MJFlHHI1YaMKRwXURcQjmLenxIcLFtr+CjGI=",
"lastModified": 1746633381,
"narHash": "sha256-9Vgnz0/Myw+XdZUxNWYhfdfRzz1SSDQIFjrhaXFcJpk=",
"owner": "zaphar",
"repo": "nix-flakes",
"rev": "91588e10769e706024d8d03ebb4958c89e00c264",
"rev": "30a4fb242f5e6542b842be1972d953d20945ed7a",
"type": "github"
},
"original": {
@ -223,6 +240,38 @@
}
},
"flake-compat_4": {
"flake": false,
"locked": {
"lastModified": 1733328505,
"narHash": "sha256-NeCCThCEP3eCl2l/+27kNNK7QrwZB1IJCrXfrbv5oqU=",
"owner": "edolstra",
"repo": "flake-compat",
"rev": "ff81ac966bb2cae68946d5ed5fc4994f96d0ffec",
"type": "github"
},
"original": {
"owner": "edolstra",
"repo": "flake-compat",
"type": "github"
}
},
"flake-compat_5": {
"flake": false,
"locked": {
"lastModified": 1696426674,
"narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=",
"owner": "edolstra",
"repo": "flake-compat",
"rev": "0f9255e01c2351cc7d116c072cb317785dd33b33",
"type": "github"
},
"original": {
"owner": "edolstra",
"repo": "flake-compat",
"type": "github"
}
},
"flake-compat_6": {
"flake": false,
"locked": {
"lastModified": 1648199409,
@ -238,7 +287,7 @@
"type": "github"
}
},
"flake-compat_5": {
"flake-compat_7": {
"flake": false,
"locked": {
"lastModified": 1673956053,
@ -275,6 +324,48 @@
"type": "github"
}
},
"flake-parts_2": {
"inputs": {
"nixpkgs-lib": [
"neovim-nightly-overlay",
"nixpkgs"
]
},
"locked": {
"lastModified": 1743550720,
"narHash": "sha256-hIshGgKZCgWh6AYJpJmRgFdR3WUbkY04o82X05xqQiY=",
"owner": "hercules-ci",
"repo": "flake-parts",
"rev": "c621e8422220273271f52058f618c94e405bb0f5",
"type": "github"
},
"original": {
"owner": "hercules-ci",
"repo": "flake-parts",
"type": "github"
}
},
"flake-parts_3": {
"inputs": {
"nixpkgs-lib": [
"neovim-nightly-overlay",
"hercules-ci-effects",
"nixpkgs"
]
},
"locked": {
"lastModified": 1743550720,
"narHash": "sha256-hIshGgKZCgWh6AYJpJmRgFdR3WUbkY04o82X05xqQiY=",
"owner": "hercules-ci",
"repo": "flake-parts",
"rev": "c621e8422220273271f52058f618c94e405bb0f5",
"type": "github"
},
"original": {
"id": "flake-parts",
"type": "indirect"
}
},
"flake-utils": {
"inputs": {
"systems": "systems"
@ -297,24 +388,6 @@
"inputs": {
"systems": "systems_9"
},
"locked": {
"lastModified": 1710146030,
"narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"flake-utils_11": {
"inputs": {
"systems": "systems_10"
},
"locked": {
"lastModified": 1687709756,
"narHash": "sha256-Y5wKlQSkgEK2weWdOu4J3riRd+kV/VCgHsqLNTTWQ/0=",
@ -329,7 +402,7 @@
"type": "github"
}
},
"flake-utils_12": {
"flake-utils_11": {
"locked": {
"lastModified": 1649676176,
"narHash": "sha256-OWKJratjt2RW151VUlJPRALb7OU2S5s+f0vLj4o1bHM=",
@ -344,9 +417,9 @@
"type": "github"
}
},
"flake-utils_13": {
"flake-utils_12": {
"inputs": {
"systems": "systems_11"
"systems": "systems_10"
},
"locked": {
"lastModified": 1705309234,
@ -362,9 +435,9 @@
"type": "github"
}
},
"flake-utils_14": {
"flake-utils_13": {
"inputs": {
"systems": "systems_12"
"systems": "systems_11"
},
"locked": {
"lastModified": 1726560853,
@ -380,9 +453,9 @@
"type": "github"
}
},
"flake-utils_15": {
"flake-utils_14": {
"inputs": {
"systems": "systems_13"
"systems": "systems_12"
},
"locked": {
"lastModified": 1681202837,
@ -539,7 +612,52 @@
"type": "github"
}
},
"git-hooks": {
"inputs": {
"flake-compat": "flake-compat_5",
"gitignore": "gitignore",
"nixpkgs": [
"neovim-nightly-overlay",
"nixpkgs"
]
},
"locked": {
"lastModified": 1746537231,
"narHash": "sha256-Wb2xeSyOsCoTCTj7LOoD6cdKLEROyFAArnYoS+noCWo=",
"owner": "cachix",
"repo": "git-hooks.nix",
"rev": "fa466640195d38ec97cf0493d6d6882bc4d14969",
"type": "github"
},
"original": {
"owner": "cachix",
"repo": "git-hooks.nix",
"type": "github"
}
},
"gitignore": {
"inputs": {
"nixpkgs": [
"neovim-nightly-overlay",
"git-hooks",
"nixpkgs"
]
},
"locked": {
"lastModified": 1709087332,
"narHash": "sha256-HG2cCnktfHsKV0s4XW83gU3F57gaTljL9KNSuG6bnQs=",
"owner": "hercules-ci",
"repo": "gitignore.nix",
"rev": "637db329424fd7e46cf4185293b9cc8c88c95394",
"type": "github"
},
"original": {
"owner": "hercules-ci",
"repo": "gitignore.nix",
"type": "github"
}
},
"gitignore_2": {
"inputs": {
"nixpkgs": [
"sile-flake",
@ -618,6 +736,28 @@
"type": "github"
}
},
"hercules-ci-effects": {
"inputs": {
"flake-parts": "flake-parts_3",
"nixpkgs": [
"neovim-nightly-overlay",
"nixpkgs"
]
},
"locked": {
"lastModified": 1744693102,
"narHash": "sha256-1Z4WPGVky4w3lrhrgs89OKsLzPdtkbi1bPLNFWsoLfY=",
"owner": "hercules-ci",
"repo": "hercules-ci-effects",
"rev": "5b6cec51c9ec095a0d3fd4c8eeb53eb5c59ae33e",
"type": "github"
},
"original": {
"owner": "hercules-ci",
"repo": "hercules-ci-effects",
"type": "github"
}
},
"home-manager": {
"inputs": {
"nixpkgs": [
@ -867,24 +1007,42 @@
"type": "github"
}
},
"neovim-flake": {
"neovim-nightly-overlay": {
"inputs": {
"flake-utils": "flake-utils_10",
"nixpkgs": "nixpkgs_12"
"flake-compat": "flake-compat_4",
"flake-parts": "flake-parts_2",
"git-hooks": "git-hooks",
"hercules-ci-effects": "hercules-ci-effects",
"neovim-src": "neovim-src",
"nixpkgs": "nixpkgs_12",
"treefmt-nix": "treefmt-nix"
},
"locked": {
"dir": "contrib",
"lastModified": 1715862872,
"narHash": "sha256-FCOipXHkAbkuFw9JjEpOIJ8BkyMkjkI0Dp+SzZ4yZlw=",
"owner": "neovim",
"repo": "neovim",
"rev": "27fb62988e922c2739035f477f93cc052a4fee1e",
"lastModified": 1746693006,
"narHash": "sha256-IztZLDIwNOvJCxqnBmaU7/oEjOBLJZgmLoK0ikQGQkM=",
"owner": "nix-community",
"repo": "neovim-nightly-overlay",
"rev": "b969e3c7bfcb7a438382dd6e379788f762094df5",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "neovim-nightly-overlay",
"type": "github"
}
},
"neovim-src": {
"flake": false,
"locked": {
"lastModified": 1746661883,
"narHash": "sha256-kjIDvE1KGhACcvAJGLgzaQDkenH8dN9Hapfc0/b/3bQ=",
"owner": "neovim",
"repo": "neovim",
"rev": "1b8ae4336db86ff95998223cc6bd8e07229d237d",
"type": "github"
},
"original": {
"dir": "contrib",
"owner": "neovim",
"ref": "stable",
"repo": "neovim",
"type": "github"
}
@ -911,7 +1069,7 @@
},
"nil-flake_2": {
"inputs": {
"flake-utils": "flake-utils_11",
"flake-utils": "flake-utils_10",
"nixpkgs": "nixpkgs_13",
"rust-overlay": "rust-overlay_6"
},
@ -995,16 +1153,16 @@
},
"nixpkgs_12": {
"locked": {
"lastModified": 1715787315,
"narHash": "sha256-cYApT0NXJfqBkKcci7D9Kr4CBYZKOQKDYA23q8XNuWg=",
"owner": "nixos",
"lastModified": 1746576598,
"narHash": "sha256-FshoQvr6Aor5SnORVvh/ZdJ1Sa2U4ZrIMwKBX5k2wu0=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "33d1e753c82ffc557b4a585c77de43d4c922ebb5",
"rev": "b3582c75c7f21ce0b429898980eddbbf05c68e55",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixos-unstable",
"owner": "NixOS",
"ref": "nixpkgs-unstable",
"repo": "nixpkgs",
"type": "github"
}
@ -1282,7 +1440,7 @@
"jujutsu-flake": "jujutsu-flake",
"mcphub-flake": "mcphub-flake",
"neogit-src": "neogit-src_2",
"neovim-flake": "neovim-flake",
"neovim-nightly-overlay": "neovim-nightly-overlay",
"nil-flake": "nil-flake_2",
"nixpkgs": "nixpkgs_14",
"nixpkgs-darwin": "nixpkgs-darwin",
@ -1332,8 +1490,8 @@
},
"runwhen-flake": {
"inputs": {
"flake-compat": "flake-compat_4",
"flake-utils": "flake-utils_12",
"flake-compat": "flake-compat_6",
"flake-utils": "flake-utils_11",
"naersk": "naersk_5"
},
"locked": {
@ -1375,7 +1533,7 @@
},
"rust-overlay-flake": {
"inputs": {
"flake-utils": "flake-utils_13",
"flake-utils": "flake-utils_12",
"nixpkgs": [
"nixpkgs"
]
@ -1530,7 +1688,7 @@
},
"sheetsui-flake": {
"inputs": {
"flake-utils": "flake-utils_14",
"flake-utils": "flake-utils_13",
"naersk": "naersk_6",
"nixpkgs": "nixpkgs_18",
"rust-overlay": "rust-overlay_7"
@ -1551,9 +1709,9 @@
},
"sile-flake": {
"inputs": {
"flake-compat": "flake-compat_5",
"flake-utils": "flake-utils_15",
"gitignore": "gitignore",
"flake-compat": "flake-compat_7",
"flake-utils": "flake-utils_14",
"gitignore": "gitignore_2",
"libtexpdf-src": "libtexpdf-src",
"nixpkgs": "nixpkgs_19"
},
@ -1631,21 +1789,6 @@
"type": "github"
}
},
"systems_13": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
},
"systems_2": {
"locked": {
"lastModified": 1681028828,
@ -1782,6 +1925,27 @@
"type": "github"
}
},
"treefmt-nix": {
"inputs": {
"nixpkgs": [
"neovim-nightly-overlay",
"nixpkgs"
]
},
"locked": {
"lastModified": 1746216483,
"narHash": "sha256-4h3s1L/kKqt3gMDcVfN8/4v2jqHrgLIe4qok4ApH5x4=",
"owner": "numtide",
"repo": "treefmt-nix",
"rev": "29ec5026372e0dec56f890e50dbe4f45930320fd",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "treefmt-nix",
"type": "github"
}
},
"treesitter-context": {
"flake": false,
"locked": {

View File

@ -30,12 +30,7 @@
url = "github:oxalica/rust-overlay";
inputs.nixpkgs.follows = "nixpkgs";
};
neovim-flake = {
url = "github:neovim/neovim/stable?dir=contrib";
# NOTE(jeremy): Currently this needs a newer nixpkgs version
#inputs.nixpkgs.follows = "nixpkgs";
};
neovim-nightly-overlay.url = "github:nix-community/neovim-nightly-overlay";
jujutsu-flake.url = "github:martinvonz/jj";
custom-flakes = {
url = "github:zaphar/nix-flakes";
@ -80,7 +75,7 @@
custom-flakes,
unstable,
heracles-flake,
neovim-flake,
neovim-nightly-overlay,
clio-flake,
sheetsui-flake,
mcphub-flake,
@ -90,6 +85,7 @@
vimModule = system: let
nil-pkg = nil-flake.packages."${system}".default;
mcp-hub-binary = custom-flakes.packages."${system}".mcp-hub;
notion-mcp-server = custom-flakes.packages."${system}".notion-mcp-server;
in
{ config, pkgs, ...}: let
unstablePkgs = import unstable { inherit system; };
@ -110,7 +106,6 @@
nvim-treesitter-context = custom-flakes.packages."${system}".nvim-treesitter-context;
roslyn-nvim = custom-flakes.packages."${system}".roslyn-nvim;
ionide-nvim = custom-flakes.packages."${system}".ionide-nvim;
nvim = neovim-flake.packages."${system}".neovim;
# TODO(zaphar): Until nixpkgs update to a newer version of tree-sitter the queries will be wrong
# for csharp
#tree-sitter-csharp = pkgs.callPackage ./nvim-treesitter-csharp.nix {
@ -124,38 +119,15 @@
# inherit (pkgs) fetchFromGitHub;
#};
mcphub-nvim = mcphub-flake.packages."${system}".default;
in {
imports = [
./program-neovim.nix
];
config = {
environment.variables = {
EDITOR="nvim";
PAGER="less -R";
OMNISHARP_BIN = "${pkgs.omnisharp-roslyn}/bin/OmniSharp";
};
nixpkgs.overlays = [
(final: prev: {
custom-neovim = nvim;
lorri = unstablePkgs.lorri;
avante-nvim = unstablePkgs.vimPlugins.avante-nvim;
copilot-lua = unstablePkgs.vimPlugins.copilot-lua;
})
];
programs = with pkgs; {
neovim.enable = true;
neovim.vimAlias = true;
neovim.viAlias = true;
neovim.package = pkgs.custom-neovim;
neovim.configure = {
my-neovim = pkgs.wrapNeovim unstablePkgs.neovim-unwrapped {
configure = {
customRC = "lua << EOF
${builtins.readFile ./init.lua}
EOF";
packages.myVimPackage = {
packages.myPlugins = {
start = (with pkgs.vimPlugins; [
copilot-lua
avante-nvim
custom-flakes.packages."${system}".avante-nvim
vim-sile
nvim-tree-lua
nvim-lspconfig
@ -235,6 +207,23 @@ EOF";
};
};
};
in {
imports = [
./program-neovim.nix
];
config = {
environment.variables = {
EDITOR="nvim";
PAGER="less -R";
OMNISHARP_BIN = "${pkgs.omnisharp-roslyn}/bin/OmniSharp";
};
nixpkgs.overlays = [
(final: prev: {
lorri = unstablePkgs.lorri;
copilot-lua = unstablePkgs.vimPlugins.copilot-lua;
})
];
environment.systemPackages = (with pkgs; [
terraform-ls
nodePackages.typescript-language-server
@ -251,6 +240,8 @@ EOF";
devenv
unstablePkgs.fq
mcp-hub-binary
notion-mcp-server
my-neovim
]);
};
};

View File

@ -32,12 +32,12 @@ vim.cmd("noswapfile")
vim.cmd("syntax on")
vim.cmd("filetype plugin on")
vim.api.nvim_create_autocmd({"BufEnter", "BufWinEnter"}, {
pattern = {"*.qnt"},
vim.api.nvim_create_autocmd({ "BufEnter", "BufWinEnter" }, {
pattern = { "*.qnt" },
callback = function(args)
vim.lsp.start({
name = 'quint',
cmd = {'quint-language-server', '--stdio'},
cmd = { 'quint-language-server', '--stdio' },
root_dir = vim.fs.dirname(vim.uri_from_bufnr(args.buf))
})
end,
@ -148,7 +148,7 @@ local caps = vim.tbl_deep_extend(
local lspconfig = require("lspconfig")
-- Typst
lspconfig.tinymist.setup{
lspconfig.tinymist.setup {
capabilities = caps,
settings = {
exportPdf = "onSave",
@ -163,11 +163,11 @@ lspconfig.nil_ls.setup {
capabilities = caps,
}
lspconfig.jedi_language_server.setup{}
lspconfig.jedi_language_server.setup {}
require('roslyn').setup({
-- client, bufnr
on_attach = function (_, _)
on_attach = function(_, _)
--vim.notify(vim.inspect(client))
end,
sdk_framework = "net8.0",
@ -234,7 +234,7 @@ vim.api.nvim_create_autocmd('LspAttach', {
vim.keymap.set({ "n", "v" }, "<Leader>a", vim.lsp.buf.code_action, opts)
vim.keymap.set("n", "<Leader>f", vim.lsp.buf.format, opts)
local client = vim.lsp.get_client_by_id(args.data.client_id)
---@diagnostic disable-next-line: undefined-field
---@diagnostic disable-next-line: undefined-field
if client and client.server_capabilities.codelens then
vim.lsp.codelens.refresh()
end
@ -243,9 +243,9 @@ vim.api.nvim_create_autocmd('LspAttach', {
vim.api.nvim_create_autocmd({ 'BufEnter', 'InsertLeave', 'CursorHold' }, {
callback = function(args)
local clients = vim.lsp.get_clients({bufnr=args.buf})
local clients = vim.lsp.get_clients({ bufnr = args.buf })
for cid = 1, #clients do
---@diagnostic disable-next-line: undefined-field
---@diagnostic disable-next-line: undefined-field
if clients[cid].server_capabilities.codelens then
vim.lsp.codelens.refresh()
break
@ -529,7 +529,7 @@ lean.setup {
vim.keymap.set({ "n", "v" }, "<Leader>ti", function() vim.cmd("LeanInfoviewToggle") end, opts)
vim.keymap.set({ "n", "v" }, "<Leader>sg", function() vim.cmd("LeanGoal") end, opts)
vim.keymap.set({ "n", "v" }, "<Leader>stg", function() vim.cmd("LeanTermGoal") end, opts)
vim.api.nvim_set_option_value('omnifunc', 'v:lua.vim.lsp.omnifunc', {scope = "local", buf=bufnr})
vim.api.nvim_set_option_value('omnifunc', 'v:lua.vim.lsp.omnifunc', { scope = "local", buf = bufnr })
end
},
mappings = true,
@ -545,8 +545,10 @@ vim.keymap.set("n", "<Leader>rn", vim.lsp.buf.rename)
vim.keymap.set("n", "<Leader>sl", telescope_builtins.lsp_workspace_symbols)
vim.keymap.set("n", "<Leader>dl", telescope_builtins.diagnostics)
vim.keymap.set("n", "<Leader>rg", telescope_builtins.live_grep)
vim.keymap.set("n", "<Leader>bl", function() telescope_builtins.buffers({
}) end)
vim.keymap.set("n", "<Leader>bl", function()
telescope_builtins.buffers({
})
end)
vim.keymap.set("n", "<leader>lds", telescope_builtins.lsp_document_symbols, { desc = "[D]ocument [S]ymbols" })
vim.keymap.set("n", "<leader>lws", telescope_builtins.lsp_dynamic_workspace_symbols, { desc = "[W]orkspace [S]ymbols" })
@ -572,13 +574,13 @@ require('lualine').setup {
},
sections = {
-- left side
lualine_a = {'mode'},
lualine_b = {'filename'},
lualine_c = {'encoding', 'fileformat', 'filetype'},
lualine_a = { 'mode' },
lualine_b = { 'filename' },
lualine_c = { 'encoding', 'fileformat', 'filetype' },
-- right side
lualine_x = {'diagnostics'},
lualine_y = {'progress', 'lsp_progress'},
lualine_z = {'location'}
lualine_x = { 'diagnostics' },
lualine_y = { 'progress', 'lsp_progress' },
lualine_z = { 'location' }
}
}
@ -678,24 +680,65 @@ local mcphub = require("mcphub")
mcphub.setup({
-- This sets vim.g.mcphub_auto_approve to false by default (can also be toggled from the HUB UI with `ga`)
config = vim.fn.expand("~/.config/mcphub/servers.json"),
auto_approve = false,
auto_approve = true,
auto_toggle_mcp_servers = true, -- Let LLMs start and stop MCP servers automatically
extensions = {
avante = {
make_slash_commands = true, -- make /slash commands from MCP server prompts
}
},
cmd = "mcp-hub";
},
cmd = "mcp-hub",
})
local hub_instance = mcphub.get_hub_instance();
function get_server_list_prompt(hub_instance)
-- returns a list of mcp-servers with a `name` and a list of tools with `name`
local mcp_tool_prompt = "# MCP SERVERS\n\nThe Model Context Protocol (MCP) enables communication between the system and locally running MCP servers that provide additional tools and resources to extend your capabilities.\n\n# Connected MCP Servers\n\nWhen a server is connected, you can use the server's tools via the `use_mcp_tool` tool, and access the server's resources via the `access_mcp_resource` tool.\nNote: Server names are case sensitive and you should always use the exact full name like `Firecrawl MCP` or `src/user/main/time-mcp` etc\n\n"
if not hub_instance then
return ""
end
local servers = hub_instance:get_servers()
if not servers or #servers == 0 then
return ""
end
for _, server in ipairs(servers) do
mcp_tool_prompt = mcp_tool_prompt .. "## server name: `" .. server.name .. "`\n\n"
if server.capabilities.tools and #server.capabilities.tools > 0 then
mcp_tool_prompt = mcp_tool_prompt .. "Available tools:\n\n"
for _, tool in ipairs(server.capabilities.tools) do
mcp_tool_prompt = mcp_tool_prompt .. "- tool name: `" .. tool.name .. "`\n"
if tool.description then
mcp_tool_prompt = mcp_tool_prompt .. " - Description: " .. tool.description .. "\n"
end
end
mcp_tool_prompt = mcp_tool_prompt .. "\n"
end
end
return mcp_tool_prompt
end
function make_avante_system_prompt(hub_instance)
return hub_instance and get_server_list_prompt(hub_instance) or ""
end
function update_avante_system_prompt()
local hub_instance = mcphub.get_hub_instance();
local system_prompt = make_avante_system_prompt(hub_instance)
if system_prompt then
require("avante.config").override({system_prompt = system_prompt})
end
end
require('copilot').setup();
require('avante').setup ({
require('avante').setup({
provider = "claude",
cursor_applying_provider = nil, -- default to whatever provider is configured
mode = "agentic",
cursor_applying_provider = nil, -- default to whatever provide is configured
claude = {
endpoint = "https://api.anthropic.com",
model = "claude-3-7-sonnet-20250219",
@ -703,23 +746,33 @@ require('avante').setup ({
temperature = 0,
max_tokens = 20480,
},
copilot = {
model = "claude-3.7-sonnet",
},
rag_service = {
enabled = false,
host_mount = os.getenv("HOME"), -- Host mount path for the rag service
provider = "ollama", -- The provider to use for RAG service (e.g. openai or ollama)
llm_model = "llama3", -- The LLM model to use for RAG service
embed_model = "", -- The embedding model to use for RAG service
endpoint = "http://localhost:11434", -- The API endpoint for RAG service
},
behavior = {
enable_cursor_planning_mode = true,
},
--system_prompt = hub_instance:get_active_servers_prompt(),
-- Using function prevents requiring mcphub before it's loaded
custom_tools = require("mcphub.extensions.avante").mcp_tool(),
system_prompt = make_avante_system_prompt(mcphub.get_hub_instance()),
custom_tools = { require("mcphub.extensions.avante").mcp_tool() },
-- Disable these because we'll use the mcphub versions instead
disabled_tools = {
"list_files", -- Built-in file operations
"search_files",
"read_file",
"create_file",
"rename_file",
"delete_file",
"create_dir",
"rename_dir",
"delete_dir",
"bash", -- Built-in terminal access
},
--disabled_tools = {
-- "list_files", -- Built-in file operations
-- "search_files",
-- "read_file",
-- "create_file",
-- "rename_file",
-- "delete_file",
-- "create_dir",
-- "rename_dir",
-- "delete_dir",
-- "bash", -- Built-in terminal access
--},
})