This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- example_config.lua | |
require('codecompanion').setup { | |
extensions = { | |
analytics = { | |
opts = { | |
keymap = "<leader>aa", | |
retention_days = 365, | |
title_formatter = function(name) | |
return "### " .. name | |
end, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- checklist_tools.lua | |
local data_path = vim.fn.stdpath('data') .. '/codecompanion' | |
local workspace_root = vim.fn.getcwd() | |
local workspace_id = vim.fn.substitute(workspace_root, '[/\\:*?"<>|]', '_', 'g') | |
local checklist_file = data_path .. '/checklists_v3_' .. workspace_id .. '.json' | |
vim.fn.mkdir(data_path, 'p') | |
---@class ChecklistTask |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Directory Structure: | |
βββ ./ | |
βββ src | |
β βββ Accounts | |
β β βββ AccountsRepo.ts | |
β β βββ Api.ts | |
β β βββ Http.ts | |
β β βββ Policy.ts | |
β β βββ UsersRepo.ts |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Directory Structure: | |
βββ ./ | |
βββ lua | |
βββ codecompanion | |
βββ strategies | |
βββ chat | |
βββ agents | |
β βββ tools | |
β β βββ helpers |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- CodeCompanion Model Toggle Extension | |
--- Provides quick model switching for chat buffers. | |
---@alias ModelName string | |
---@class ModelToggleOpts | |
---@field keymap string? Keymap to toggle models (default: "gM") | |
---@class ModelToggleConfig | |
---@field [adapter_name: string] ModelName Alternate model per adapter |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local Snacks = require("snacks") | |
-- input: | |
-- DESIRED BEHAVIOR ------------------------------------------------------------- | |
-- user: hello 1 | |
-- llm: hello | |
-- user: hello 2 | |
-- llm: hello again | |
-- user: hello 3 <- last user message | |
-- llm: hello again |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--============================================================================= | |
-- CodeCompanion-Rules β manage rule files via chat.refs only | |
--============================================================================= | |
---@class CodeCompanionChatMessage | |
---@field content? string | |
---@field opts? table | |
---@field opts.reference? string | |
---@field role? string | |
---@field id? any |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
---@diagnostic disable: undefined-field | |
-- write_file.lua -------------------------------------------------------------- | |
---@class WriteFileToolArgs | |
---@field file_path string Absolute path of the file to write | |
---@field content string Content to write to the file | |
---@class EditFileToolArgs | |
---@field file_path string Absolute path of the file to edit | |
---@field old_string string The text to replace |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- checklist_dag.lua | |
-- DAG checklist tools with proper type annotations and standardized returns | |
local dag_manager_module = require('codecompanion.strategies.chat.agents.tools.checklist_lib.dag_manager') | |
local dag_formatter_module = require('codecompanion.strategies.chat.agents.tools.checklist_lib.dag_formatter') | |
local dag_executor = require('codecompanion.strategies.chat.agents.tools.checklist_lib.dag_executor') | |
local storage_module = require('codecompanion.strategies.chat.agents.tools.checklist_lib.storage') | |
-- Create DAG system instance | |
---@return table |