up
This commit is contained in:
parent
92b0cd0fac
commit
ebb0cc7177
13 changed files with 385 additions and 85 deletions
251
flake.lock
251
flake.lock
|
|
@ -19,12 +19,8 @@
|
|||
"blink-pairs": {
|
||||
"inputs": {
|
||||
"fenix": "fenix",
|
||||
"flake-parts": [
|
||||
"flake-parts"
|
||||
],
|
||||
"nixpkgs": [
|
||||
"nixpkgs"
|
||||
]
|
||||
"flake-parts": "flake-parts",
|
||||
"nixpkgs": "nixpkgs"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1757108414,
|
||||
|
|
@ -110,10 +106,60 @@
|
|||
"type": "github"
|
||||
}
|
||||
},
|
||||
"flake-compat_2": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1747046372,
|
||||
"narHash": "sha256-CIVLLkVgvHYbgI2UpXvIIBJ12HWgX+fjA8Xf8PUmqCY=",
|
||||
"owner": "edolstra",
|
||||
"repo": "flake-compat",
|
||||
"rev": "9100a0f413b0c601e0533d1d94ffd501ce2e7885",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "edolstra",
|
||||
"repo": "flake-compat",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"flake-compat_3": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1747046372,
|
||||
"narHash": "sha256-CIVLLkVgvHYbgI2UpXvIIBJ12HWgX+fjA8Xf8PUmqCY=",
|
||||
"owner": "edolstra",
|
||||
"repo": "flake-compat",
|
||||
"rev": "9100a0f413b0c601e0533d1d94ffd501ce2e7885",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "edolstra",
|
||||
"repo": "flake-compat",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"flake-parts": {
|
||||
"inputs": {
|
||||
"nixpkgs-lib": "nixpkgs-lib"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1741352980,
|
||||
"narHash": "sha256-+u2UunDA4Cl5Fci3m7S643HzKmIDAe+fiXrLqYsR2fs=",
|
||||
"owner": "hercules-ci",
|
||||
"repo": "flake-parts",
|
||||
"rev": "f4330d22f1c5d2ba72d3d22df5597d123fdb60a9",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "hercules-ci",
|
||||
"repo": "flake-parts",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"flake-parts_2": {
|
||||
"inputs": {
|
||||
"nixpkgs-lib": "nixpkgs-lib_2"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1759362264,
|
||||
"narHash": "sha256-wfG0S7pltlYyZTM+qqlhJ7GMw2fTF4mLKCIVhLii/4M=",
|
||||
|
|
@ -194,6 +240,29 @@
|
|||
"type": "github"
|
||||
}
|
||||
},
|
||||
"git-hooks_2": {
|
||||
"inputs": {
|
||||
"flake-compat": "flake-compat_3",
|
||||
"gitignore": "gitignore_2",
|
||||
"nixpkgs": [
|
||||
"neovim-nightly-overlay",
|
||||
"nixpkgs"
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1759523803,
|
||||
"narHash": "sha256-PTod9NG+i3XbbnBKMl/e5uHDBYpwIWivQ3gOWSEuIEM=",
|
||||
"owner": "cachix",
|
||||
"repo": "git-hooks.nix",
|
||||
"rev": "cfc9f7bb163ad8542029d303e599c0f7eee09835",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "cachix",
|
||||
"repo": "git-hooks.nix",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"gitignore": {
|
||||
"inputs": {
|
||||
"nixpkgs": [
|
||||
|
|
@ -216,6 +285,53 @@
|
|||
"type": "github"
|
||||
}
|
||||
},
|
||||
"gitignore_2": {
|
||||
"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"
|
||||
}
|
||||
},
|
||||
"hercules-ci-effects": {
|
||||
"inputs": {
|
||||
"flake-parts": [
|
||||
"neovim-nightly-overlay",
|
||||
"flake-parts"
|
||||
],
|
||||
"nixpkgs": [
|
||||
"neovim-nightly-overlay",
|
||||
"nixpkgs"
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1758022363,
|
||||
"narHash": "sha256-ENUhCRWgSX4ni751HieNuQoq06dJvApV/Nm89kh+/A0=",
|
||||
"owner": "hercules-ci",
|
||||
"repo": "hercules-ci-effects",
|
||||
"rev": "1a3667d33e247ad35ca250698d63f49a5453d824",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "hercules-ci",
|
||||
"repo": "hercules-ci-effects",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"hlargs-nvim": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
|
|
@ -280,23 +396,82 @@
|
|||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixpkgs": {
|
||||
"neovim-nightly-overlay": {
|
||||
"inputs": {
|
||||
"flake-compat": "flake-compat_2",
|
||||
"flake-parts": [
|
||||
"flake-parts"
|
||||
],
|
||||
"git-hooks": "git-hooks_2",
|
||||
"hercules-ci-effects": "hercules-ci-effects",
|
||||
"neovim-src": "neovim-src",
|
||||
"nixpkgs": [
|
||||
"nixpkgs"
|
||||
],
|
||||
"treefmt-nix": "treefmt-nix"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1759831965,
|
||||
"narHash": "sha256-vgPm2xjOmKdZ0xKA6yLXPJpjOtQPHfaZDRtH+47XEBo=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "c9b6fb798541223bbb396d287d16f43520250518",
|
||||
"lastModified": 1760168241,
|
||||
"narHash": "sha256-87aML9i/zVm5WSCEx59PUpCrpkLbXEqcLEFPNn5+2iE=",
|
||||
"owner": "nix-community",
|
||||
"repo": "neovim-nightly-overlay",
|
||||
"rev": "d5ef90cf4577df3e3daef7e070d200cca64c889f",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "NixOS",
|
||||
"ref": "nixos-unstable",
|
||||
"owner": "nix-community",
|
||||
"repo": "neovim-nightly-overlay",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"neovim-src": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1760105690,
|
||||
"narHash": "sha256-ZII7EvSnJueiV/a595uOsIdbWcXVWhO5pCvvJp2/mco=",
|
||||
"owner": "neovim",
|
||||
"repo": "neovim",
|
||||
"rev": "fafc329bbd1e15f9ab595568e8cd8b10295113dd",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "neovim",
|
||||
"repo": "neovim",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1741865919,
|
||||
"narHash": "sha256-4thdbnP6dlbdq+qZWTsm4ffAwoS8Tiq1YResB+RP6WE=",
|
||||
"owner": "nixos",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "573c650e8a14b2faa0041645ab18aed7e60f0c9a",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nixos",
|
||||
"ref": "nixpkgs-unstable",
|
||||
"repo": "nixpkgs",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixpkgs-lib": {
|
||||
"locked": {
|
||||
"lastModified": 1740877520,
|
||||
"narHash": "sha256-oiwv/ZK/2FhGxrCkQkB83i7GnWXPPLzoqFHpDD3uYpk=",
|
||||
"owner": "nix-community",
|
||||
"repo": "nixpkgs.lib",
|
||||
"rev": "147dee35aab2193b174e4c0868bd80ead5ce755c",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nix-community",
|
||||
"repo": "nixpkgs.lib",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixpkgs-lib_2": {
|
||||
"locked": {
|
||||
"lastModified": 1754788789,
|
||||
"narHash": "sha256-x2rJ+Ovzq0sCMpgfgGaaqgBSwY+LST+WbZ6TytnT9Rk=",
|
||||
|
|
@ -327,6 +502,22 @@
|
|||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixpkgs_2": {
|
||||
"locked": {
|
||||
"lastModified": 1760038930,
|
||||
"narHash": "sha256-Oncbh0UmHjSlxO7ErQDM3KM0A5/Znfofj2BSzlHLeVw=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "0b4defa2584313f3b781240b29d61f6f9f7e0df3",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "NixOS",
|
||||
"ref": "nixos-unstable",
|
||||
"repo": "nixpkgs",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nvim-yati": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
|
|
@ -349,13 +540,14 @@
|
|||
"blink-pairs": "blink-pairs",
|
||||
"cmp-diag-codes": "cmp-diag-codes",
|
||||
"diaglist-nvim": "diaglist-nvim",
|
||||
"flake-parts": "flake-parts",
|
||||
"flake-parts": "flake-parts_2",
|
||||
"gen-luarc": "gen-luarc",
|
||||
"gentags-lua": "gentags-lua",
|
||||
"hlargs-nvim": "hlargs-nvim",
|
||||
"local-highlight-nvim": "local-highlight-nvim",
|
||||
"namu-nvim": "namu-nvim",
|
||||
"nixpkgs": "nixpkgs",
|
||||
"neovim-nightly-overlay": "neovim-nightly-overlay",
|
||||
"nixpkgs": "nixpkgs_2",
|
||||
"nvim-yati": "nvim-yati",
|
||||
"stay-in-place-nvim": "stay-in-place-nvim",
|
||||
"whatthejump-nvim": "whatthejump-nvim",
|
||||
|
|
@ -395,6 +587,27 @@
|
|||
"type": "github"
|
||||
}
|
||||
},
|
||||
"treefmt-nix": {
|
||||
"inputs": {
|
||||
"nixpkgs": [
|
||||
"neovim-nightly-overlay",
|
||||
"nixpkgs"
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1760120816,
|
||||
"narHash": "sha256-gq9rdocpmRZCwLS5vsHozwB6b5nrOBDNc2kkEaTXHfg=",
|
||||
"owner": "numtide",
|
||||
"repo": "treefmt-nix",
|
||||
"rev": "761ae7aff00907b607125b2f57338b74177697ed",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "numtide",
|
||||
"repo": "treefmt-nix",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"whatthejump-nvim": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
|
|
@ -414,11 +627,11 @@
|
|||
"yaml-nvim": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1757087818,
|
||||
"narHash": "sha256-UaJmX1gZ7ull6uu6OGJfiCFI5BV37FvoXPrSkxqSJ04=",
|
||||
"lastModified": 1760098317,
|
||||
"narHash": "sha256-NNc5Zb4EYi6L+gd76I/NxIIYgxTvHplEhy03Q9GUAuc=",
|
||||
"owner": "cuducos",
|
||||
"repo": "yaml.nvim",
|
||||
"rev": "c6c7bac834c3f48e1afdb78a7a1d23996a2f89d9",
|
||||
"rev": "e70ee49f7aefc79dce020d3ffc3c9447b0c52236",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
|
|
|||
|
|
@ -3,6 +3,10 @@
|
|||
|
||||
inputs = {
|
||||
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
||||
neovim-nightly-overlay.url = "github:nix-community/neovim-nightly-overlay";
|
||||
neovim-nightly-overlay.inputs.nixpkgs.follows = "nixpkgs";
|
||||
neovim-nightly-overlay.inputs.flake-parts.follows = "flake-parts";
|
||||
|
||||
flake-parts.url = "github:hercules-ci/flake-parts";
|
||||
gen-luarc.url = "github:mrcjkb/nix-gen-luarc-json";
|
||||
gen-luarc.inputs.nixpkgs.follows = "nixpkgs";
|
||||
|
|
@ -10,8 +14,6 @@
|
|||
|
||||
|
||||
blink-pairs.url = "github:Saghen/blink.pairs";
|
||||
blink-pairs.inputs.nixpkgs.follows = "nixpkgs";
|
||||
blink-pairs.inputs.flake-parts.follows = "flake-parts";
|
||||
|
||||
# Add bleeding-edge plugins here.
|
||||
# They can be updated with `nix flake update` (make sure to commit the generated flake.lock)
|
||||
|
|
|
|||
53
nix/ai.nix
53
nix/ai.nix
|
|
@ -1,35 +1,36 @@
|
|||
{ inputs, pkgs, ... }:
|
||||
with pkgs.vimPlugins; [
|
||||
{
|
||||
plugin = codecompanion-nvim.overrideAttrs (oa: {
|
||||
dependencies = with pkgs.vimPlugins; [
|
||||
codecompanion-spinner-nvim
|
||||
codecompanion-history-nvim
|
||||
];
|
||||
});
|
||||
type = "lua";
|
||||
optional = false;
|
||||
}
|
||||
# {
|
||||
# plugin = avante-nvim.overrideAttrs (oa: {
|
||||
# plugin = codecompanion-nvim.overrideAttrs (oa: {
|
||||
# dependencies = with pkgs.vimPlugins; [
|
||||
# nui-nvim
|
||||
# nvim-treesitter
|
||||
# plenary-nvim
|
||||
# {
|
||||
# plugin = blink-cmp-avante;
|
||||
# type = "lua";
|
||||
# optional = true;
|
||||
# config = /*lua*/''
|
||||
# lze.load {
|
||||
# "${blink-cmp-avante.pname}",
|
||||
# on_plugin = "blink.cmp",
|
||||
# }
|
||||
# '';
|
||||
# }
|
||||
# codecompanion-spinner-nvim
|
||||
# codecompanion-history-nvim
|
||||
# ];
|
||||
# });
|
||||
# type = "lua";
|
||||
# optional = true;
|
||||
# optional = false;
|
||||
# }
|
||||
{
|
||||
plugin = avante-nvim.overrideAttrs (oa: {
|
||||
dependencies = with pkgs.vimPlugins; [
|
||||
nui-nvim
|
||||
nvim-treesitter
|
||||
plenary-nvim
|
||||
];
|
||||
});
|
||||
type = "lua";
|
||||
optional = true;
|
||||
}
|
||||
{
|
||||
plugin = blink-cmp-avante;
|
||||
type = "lua";
|
||||
optional = true;
|
||||
config = /*lua*/''
|
||||
lze.load {
|
||||
"${blink-cmp-avante.pname}",
|
||||
on_plugin = "blink.cmp",
|
||||
}
|
||||
'';
|
||||
}
|
||||
|
||||
]
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@
|
|||
, # Set by the overlay to ensure we use a compatible version of `wrapNeovimUnstable`
|
||||
wrapNeovimUnstable
|
||||
, neovimUtils
|
||||
, neovim-nightly
|
||||
,
|
||||
}:
|
||||
with lib;
|
||||
|
|
@ -214,7 +215,7 @@ let
|
|||
''--suffix LUA_PATH ";" "${concatMapStringsSep ";" luaPackages.getLuaPath resolvedExtraLuaPackages}"'';
|
||||
|
||||
# wrapNeovimUnstable is the nixpkgs utility function for building a Neovim derivation.
|
||||
neovim-wrapped = wrapNeovimUnstable neovim-unwrapped (neovimConfig
|
||||
neovim-wrapped = wrapNeovimUnstable neovim-nightly (neovimConfig
|
||||
// {
|
||||
luaRcContent = initLua;
|
||||
wrapperArgs =
|
||||
|
|
|
|||
|
|
@ -4,8 +4,6 @@ with final.pkgs.lib; let
|
|||
pkgs = final;
|
||||
lib = final.pkgs.lib;
|
||||
|
||||
rust-bin = inputs.rust-overlay.rust-bin;
|
||||
|
||||
# Use this to create a plugin from a flake input
|
||||
mkNvimPlugin = src: pname:
|
||||
pkgs.vimUtils.buildVimPlugin {
|
||||
|
|
@ -16,10 +14,12 @@ with final.pkgs.lib; let
|
|||
# Make sure we use the pinned nixpkgs instance for wrapNeovimUnstable,
|
||||
# otherwise it could have an incompatible signature when applying this overlay.
|
||||
pkgs-locked = inputs.nixpkgs.legacyPackages.${pkgs.system};
|
||||
neovim-nightly = inputs.neovim-nightly-overlay.packages.${pkgs.system}.default;
|
||||
|
||||
# This is the helper function that builds the Neovim derivation.
|
||||
mkNeovim = pkgs.callPackage ./mkNeovim.nix {
|
||||
inherit (pkgs-locked) wrapNeovimUnstable neovimUtils;
|
||||
neovim-nightly = neovim-nightly;
|
||||
};
|
||||
|
||||
callPackage = (file: pkgs.callPackage file {
|
||||
|
|
|
|||
|
|
@ -18,7 +18,12 @@ M.airun = function()
|
|||
url = vim.env.AI_RUN_URL,
|
||||
api_key = "AI_RUN_TOKEN", -- optional: if your endpoint is authenticated
|
||||
chat_url = "/v1/chat/completions", -- optional: default value, override if different
|
||||
-- models_endpoint = "/v1/models", -- optional: attaches to the end of the URL to form the endpoint to retrieve models
|
||||
models_endpoint = "/v1/models", -- optional: attaches to the end of the URL to form the endpoint to retrieve models
|
||||
},
|
||||
opts = {
|
||||
vision = false,
|
||||
tools = true,
|
||||
stream = true,
|
||||
},
|
||||
schema = {
|
||||
model = {
|
||||
|
|
@ -27,13 +32,9 @@ M.airun = function()
|
|||
return {}
|
||||
end,
|
||||
},
|
||||
opts = {
|
||||
vision = false,
|
||||
tools = true,
|
||||
num_ctx = {
|
||||
default = 131072,
|
||||
},
|
||||
-- num_ctx = {
|
||||
-- default = 131072,
|
||||
-- },
|
||||
},
|
||||
})
|
||||
end
|
||||
|
|
|
|||
|
|
@ -1,6 +1,9 @@
|
|||
return {
|
||||
calculator = {
|
||||
description = "Perform calculations",
|
||||
opts = {
|
||||
requires_approval = true,
|
||||
},
|
||||
callback = {
|
||||
name = "calculator",
|
||||
cmds = {
|
||||
|
|
|
|||
|
|
@ -1,6 +1,4 @@
|
|||
vim.g.did_load_avante_plugin = true
|
||||
|
||||
if vim.g.did_load_avante_plugin then
|
||||
if vim.g.did_load_avante_plugin or vim.g.did_load_ai_plugin then
|
||||
return
|
||||
end
|
||||
vim.g.did_load_avante_plugin = true
|
||||
|
|
@ -31,6 +29,7 @@ local opts = {
|
|||
enable_token_counting = true,
|
||||
use_cwd_as_project_root = true,
|
||||
auto_focus_on_diff_view = true,
|
||||
auto_approve_tool_permissions = false,
|
||||
},
|
||||
|
||||
selection = {
|
||||
|
|
|
|||
|
|
@ -1,4 +1,6 @@
|
|||
if vim.g.did_load_cai_plugin then
|
||||
vim.g.did_load_cai_plugin = true
|
||||
|
||||
if vim.g.did_load_cai_plugin or vim.g.did_load_ai_plugin then
|
||||
return
|
||||
end
|
||||
vim.g.did_load_cai_plugin = true
|
||||
|
|
@ -91,7 +93,7 @@ lze.load({
|
|||
after = function()
|
||||
local opts = {
|
||||
opts = {
|
||||
log_level = "DEBUG", -- TRACE|DEBUG|ERROR|INFO
|
||||
log_level = "TRACE", -- TRACE|DEBUG|ERROR|INFO
|
||||
},
|
||||
adapters = {
|
||||
http = adapters,
|
||||
|
|
@ -120,6 +122,9 @@ lze.load({
|
|||
},
|
||||
agent = { adapter = "default_adapter" },
|
||||
},
|
||||
diff = {
|
||||
enabled = true,
|
||||
},
|
||||
display = {
|
||||
chat = {
|
||||
-- window = {
|
||||
|
|
@ -131,30 +136,31 @@ lze.load({
|
|||
},
|
||||
show_header_separator = true,
|
||||
show_settings = true,
|
||||
show_tools_processing = true,
|
||||
},
|
||||
},
|
||||
extensions = {
|
||||
spinner = {},
|
||||
history = {
|
||||
enabled = true,
|
||||
opts = {
|
||||
keymap = "<leader>sh",
|
||||
save_chat_keymap = "sc",
|
||||
auto_save = true,
|
||||
expiration_days = 0,
|
||||
picker = "fzf-lua",
|
||||
auto_generate_title = false,
|
||||
---On exiting and entering neovim, loads the last chat on opening chat
|
||||
continue_last_chat = false,
|
||||
---When chat is cleared with `gx` delete the chat from history
|
||||
delete_on_clearing_chat = true,
|
||||
---Directory path to save the chats
|
||||
dir_to_save = vim.fn.stdpath("data") .. "/codecompanion-history",
|
||||
---Enable detailed logging for history extension
|
||||
enable_logging = false,
|
||||
},
|
||||
},
|
||||
},
|
||||
-- extensions = {
|
||||
-- spinner = {},
|
||||
-- history = {
|
||||
-- enabled = true,
|
||||
-- opts = {
|
||||
-- keymap = "<leader>sh",
|
||||
-- save_chat_keymap = "sc",
|
||||
-- auto_save = true,
|
||||
-- expiration_days = 0,
|
||||
-- picker = "fzf-lua",
|
||||
-- auto_generate_title = false,
|
||||
-- ---On exiting and entering neovim, loads the last chat on opening chat
|
||||
-- continue_last_chat = false,
|
||||
-- ---When chat is cleared with `gx` delete the chat from history
|
||||
-- delete_on_clearing_chat = true,
|
||||
-- ---Directory path to save the chats
|
||||
-- dir_to_save = vim.fn.stdpath("data") .. "/codecompanion-history",
|
||||
-- ---Enable detailed logging for history extension
|
||||
-- enable_logging = false,
|
||||
-- },
|
||||
-- },
|
||||
-- },
|
||||
}
|
||||
|
||||
local ok, _ = pcall(require, "mchup")
|
||||
|
|
|
|||
|
|
@ -77,9 +77,11 @@ lze.load({
|
|||
mappings = {
|
||||
i = {
|
||||
j = {
|
||||
k = "<Esc>",
|
||||
j = "<Esc>",
|
||||
},
|
||||
k = {
|
||||
k = "<Esc>",
|
||||
},
|
||||
},
|
||||
c = {},
|
||||
t = {
|
||||
|
|
|
|||
62
tests/airun.http
Normal file
62
tests/airun.http
Normal file
|
|
@ -0,0 +1,62 @@
|
|||
### openai completion gemma
|
||||
POST {{ollama}}/v1/chat/completions
|
||||
Content-Type: application/json
|
||||
{
|
||||
"stream_options": {
|
||||
"include_usage": true
|
||||
},
|
||||
"model": "x5-airun-small-coder-prod",
|
||||
"tools": [
|
||||
{
|
||||
"function": {
|
||||
"description": "Run shell commands on the user's system, sharing the output with the user before then sharing with you.",
|
||||
"name": "cmd_runner",
|
||||
"parameters": {
|
||||
"properties": {
|
||||
"cmd": {
|
||||
"description": "The command to run, e.g. `pytest` or `make test`",
|
||||
"type": "string"
|
||||
},
|
||||
"flag": {
|
||||
"anyOf": [
|
||||
{
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"type": "null"
|
||||
}
|
||||
],
|
||||
"description": "If running tests, set to `\"testing\"`; null otherwise"
|
||||
}
|
||||
},
|
||||
"type": "object",
|
||||
"required": [
|
||||
"cmd",
|
||||
"flag"
|
||||
],
|
||||
"additionalProperties": false
|
||||
}
|
||||
},
|
||||
"type": "function"
|
||||
}
|
||||
],
|
||||
"stream": true,
|
||||
"messages": [
|
||||
{
|
||||
"content": "You are an AI programming assistant named \"CodeCompanion\", working within the Neovim text editor.\n\nYou can answer general programming questions and perform the following tasks:\n* Answer general programming questions.\n* Explain how the code in a Neovim buffer works.\n* Review the selected code from a Neovim buffer.\n* Generate unit tests for the selected code.\n* Propose fixes for problems in the selected code.\n* Scaffold code for a new workspace.\n* Find relevant code to the user's query.\n* Propose fixes for test failures.\n* Answer questions about Neovim.\n\nFollow the user's requirements carefully and to the letter.\nUse the context and attachments the user provides.\nKeep your answers short and impersonal, especially if the user's context is outside your core tasks.\nAll non-code text responses must be written in the English language.\nUse Markdown formatting in your answers.\nDo not use H1 or H2 markdown headers.\nWhen suggesting code changes or new content, use Markdown code blocks.\nTo start a code block, use 4 backticks.\nAfter the backticks, add the programming language name as the language ID.\nTo close a code block, use 4 backticks on a new line.\nIf the code modifies an existing file or should be placed at a specific location, add a line comment with 'filepath:' and the file path.\nIf you want the user to decide where to place the code, do not add the file path comment.\nIn the code block, use a line comment with '...existing code...' to indicate code that is already present in the file.\nCode block example:\n````languageId\n// filepath: /path/to/file\n// ...existing code...\n{ changed code }\n// ...existing code...\n{ changed code }\n// ...existing code...\n````\nEnsure line comments use the correct syntax for the programming language (e.g. \"#\" for Python, \"--\" for Lua).\nFor code blocks use four backticks to start and end.\nAvoid wrapping the whole response in triple backticks.\nDo not include diff formatting unless explicitly asked.\nDo not include line numbers in code blocks.\n\nWhen given a task:\n1. Think step-by-step and, unless the user requests otherwise or the task is very simple, describe your plan in pseudocode.\n2. When outputting code blocks, ensure only relevant code is included, avoiding any repeating or unrelated code.\n3. End your response with a short suggestion for the next user turn that directly supports continuing the conversation.\n\nAdditional context:\nThe current date is 2025-10-11.\nThe user's Neovim version is 0.12.0.\nThe user is working on a Linux machine. Please respond with system specific commands if applicable.",
|
||||
"role": "system"
|
||||
},
|
||||
{
|
||||
"content": "<instructions>\nYou are a highly sophisticated automated coding agent with expert-level knowledge across many different programming languages and frameworks.\nThe user will ask a question, or ask you to perform a task, and it may require lots of research to answer correctly. There is a selection of tools that let you perform actions or retrieve helpful context to answer the user's question.\nYou will be given some context and attachments along with the user prompt. You can use them if they are relevant to the task, and ignore them if not.\nIf you can infer the project type (languages, frameworks, and libraries) from the user's query or the context that you have, make sure to keep them in mind when making changes.\nIf the user wants you to implement a feature and they have not specified the files to edit, first break down the user's request into smaller concepts and think about the kinds of files you need to grasp each concept.\nIf you aren't sure which tool is relevant, you can call multiple tools. You can call tools repeatedly to take actions or gather as much context as needed until you have completed the task fully. Don't give up unless you are sure the request cannot be fulfilled with the tools you have. It's YOUR RESPONSIBILITY to make sure that you have done all you can to collect necessary context.\nDon't make assumptions about the situation - gather context first, then perform the task or answer the question.\nThink creatively and explore the workspace in order to make a complete fix.\nDon't repeat yourself after a tool call, pick up where you left off.\nNEVER print out a codeblock with a terminal command to run unless the user asked for it.\nYou don't need to read a file if it's already provided in context.\n</instructions>\n<toolUseInstructions>\nWhen using a tool, follow the json schema very carefully and make sure to include ALL required properties.\nAlways output valid JSON when using a tool.\nIf a tool exists to do a task, use the tool instead of asking the user to manually take an action.\nIf you say that you will take an action, then go ahead and use the tool to do it. No need to ask permission.\nNever use a tool that does not exist. Use tools using the proper procedure, DO NOT write out a json codeblock with the tool inputs.\nNever say the name of a tool to a user. For example, instead of saying that you'll use the insert_edit_into_file tool, say \"I'll edit the file\".\nIf you think running multiple tools can answer the user's question, prefer calling them in parallel whenever possible.\nWhen invoking a tool that takes a file path, always use the file path you have been given by the user or by the output of a tool.\n</toolUseInstructions>\n<outputFormatting>\nUse proper Markdown formatting in your answers. When referring to a filename or symbol in the user's workspace, wrap it in backticks.\nAny code block examples must be wrapped in four backticks with the programming language.\n<example>\n````languageId\n// Your code here\n````\n</example>\nThe languageId must be the correct identifier for the programming language, e.g. python, javascript, lua, etc.\nIf you are providing code changes, use the insert_edit_into_file tool (if available to you) to make the changes directly instead of printing out a code block with the changes.\n</outputFormatting>",
|
||||
"role": "system"
|
||||
},
|
||||
{
|
||||
"content": "using tool the cmd_runner tool get permissions of files",
|
||||
"role": "user"
|
||||
},
|
||||
{
|
||||
"content": "# Command Runner Tool (`cmd_runner`)\n\n## CONTEXT\n- You have access to a command runner tool running within CodeCompanion, in Neovim.\n- You can use it to run shell commands on the user's system.\n- You may be asked to run a specific command or to determine the appropriate command to fulfil the user's request.\n- All tool executions take place in the current working directory /projects/jmarkin/nvim-nix.\n\n## OBJECTIVE\n- Follow the tool's schema.\n- Respond with a single command, per tool execution.\n\n## RESPONSE\n- Only invoke this tool when the user specifically asks.\n- If the user asks you to run a specific command, do so to the letter, paying great attention.\n- Use this tool strictly for command execution; but file operations must NOT be executed in this tool unless the user explicitly approves.\n- To run multiple commands, you will need to call this tool multiple times.\n\n## SAFETY RESTRICTIONS\n- Never execute the following dangerous commands under any circumstances:\n - `rm -rf /` or any variant targeting root directories\n - `rm -rf ~` or any command that could wipe out home directories\n - `rm -rf .` without specific context and explicit user confirmation\n - Any command with `:(){:|:&};:` or similar fork bombs\n - Any command that would expose sensitive information (keys, tokens, passwords)\n - Commands that intentionally create infinite loops\n- For any destructive operation (delete, overwrite, etc.), always:\n 1. Warn the user about potential consequences\n 2. Request explicit confirmation before execution\n 3. Suggest safer alternatives when available\n- If unsure about a command's safety, decline to run it and explain your concerns\n\n## POINTS TO NOTE\n- This tool can be used alongside other tools within CodeCompanion\n\n## USER ENVIRONMENT\n- Shell: /nix/store/ddx7976jyll30xjbasghv9jailswprcp-bash-interactive-5.3p3/bin/bash\n- Operating System: Unix\n- Neovim Version: 0.12.0",
|
||||
"role": "system"
|
||||
}
|
||||
]
|
||||
}
|
||||
10
tests/fib.py
10
tests/fib.py
|
|
@ -9,6 +9,16 @@ def fib():
|
|||
a, b = b, a + b # a will now be 1, and b will also be 1, (0 + 1)
|
||||
|
||||
|
||||
def print_n_fibonacchi_numbers(n, message_on_complete: str):
|
||||
"""Generate and print first N Fibonacci numbers."""
|
||||
t = time()
|
||||
for index, fibonacci_number in zip(range(n), fib()):
|
||||
ti = time()
|
||||
print("{i:3}: {f: >21} {t:.3e}".format(i=index, f=fibonacci_number, t=ti - t))
|
||||
t = ti
|
||||
print(message_on_complete)
|
||||
|
||||
|
||||
t = time()
|
||||
for index, fibonacci_number in zip(range(100), fib()):
|
||||
ti = time()
|
||||
|
|
|
|||
Loading…
Reference in a new issue