11--- @module " codecompanion"
22
3- --- @alias sub_cmd " ls" | " query" | " vectorise" | " files_ls" | " files_rm"
3+ --- @alias VectorCode.CodeCompanion.SubCommand " ls" | " query" | " vectorise" | " files_ls" | " files_rm"
44
55--- @class VectorCode.CodeCompanion.ExtensionOpts
66--- A table where the keys are the subcommand name (`ls`, `query`, `vectorise`, etc.)
77--- and the values are their config options.
8- --- @field tool_opts ? table<sub_cmd | " *" , VectorCode.CodeCompanion.ToolOpts>
8+ --- @field tool_opts ? table<VectorCode.CodeCompanion.SubCommand | " *" , VectorCode.CodeCompanion.ToolOpts>
99--- Options related to the `vectorcode_toolbox` tool group
1010--- @field tool_group ? VectorCode.CodeCompanion.ToolGroupOpts
1111--- Prompt library that automatically creates VectorCode collections on local files
@@ -22,7 +22,7 @@ local utils = require("vectorcode.utils")
2222
2323--- @type VectorCode.CodeCompanion.ExtensionOpts |{}
2424local default_extension_opts = {
25- --- @type table<sub_cmd , VectorCode.CodeCompanion.ToolOpts |{} >
25+ --- @type table<VectorCode.CodeCompanion.SubCommand , VectorCode.CodeCompanion.ToolOpts |{} >
2626 tool_opts = {
2727 -- NOTE: the other default opts are defined in the source code files of the tools.
2828 -- `include_in_toolbox` is here so that the extension setup works as expected.
@@ -40,11 +40,11 @@ local default_extension_opts = {
4040 prompt_library = require (" vectorcode.integrations.codecompanion.prompts.presets" ),
4141}
4242
43- --- @type sub_cmd []
43+ --- @type VectorCode.CodeCompanion.SubCommand []
4444local valid_tools = { " ls" , " query" , " vectorise" , " files_ls" , " files_rm" }
4545
46- --- @param tool_opts table<sub_cmd | " *" , VectorCode.CodeCompanion.ToolOpts>
47- --- @return table<sub_cmd , VectorCode.CodeCompanion.ToolOpts>
46+ --- @param tool_opts table<VectorCode.CodeCompanion.SubCommand | " *" , VectorCode.CodeCompanion.ToolOpts>
47+ --- @return table<VectorCode.CodeCompanion.SubCommand , VectorCode.CodeCompanion.ToolOpts>
4848local function merge_tool_opts (tool_opts )
4949 local wildcard_opts = tool_opts [" *" ]
5050 if wildcard_opts then
@@ -55,7 +55,7 @@ local function merge_tool_opts(tool_opts)
5555 end
5656 tool_opts [" *" ] = nil
5757 end
58- --- @cast tool_opts table<sub_cmd , VectorCode.CodeCompanion.ToolOpts>
58+ --- @cast tool_opts table<VectorCode.CodeCompanion.SubCommand , VectorCode.CodeCompanion.ToolOpts>
5959 return tool_opts
6060end
6161
0 commit comments