This change adds a new API endpoint customCommands/list that allows clients to retrieve a list of available custom commands stored in the local .cody/commands.json file. This is used to populate the list of custom commands in the Cody UI acrooss IDEs.
The changes include:
Adding a new customCommands/list request handler in the Agent class that calls the cody.commands.get-custom-commands command to retrieve the list of custom commands.
Updating the agent-protocol.ts file to define the new customCommands/list request type.
Adding a test in custom-commands.test.ts to verify that the customCommands/list API returns the expected number of custom commands.
Implementing the cody.commands.get-custom-commands command in the CustomCommandsManager class to return the list of custom commands.
Test plan
Verified the new API works by porting it to the cli tool (for testing only, the code has been removed):
This is just to add the missing piece to the Agent API. Custom Commands is currently not integrated into other clients atm.
This change adds a new API endpoint
customCommands/list
that allows clients to retrieve a list of available custom commands stored in the local.cody/commands.json
file. This is used to populate the list of custom commands in the Cody UI acrooss IDEs.The changes include:
customCommands/list
request handler in theAgent
class that calls thecody.commands.get-custom-commands
command to retrieve the list of custom commands.agent-protocol.ts
file to define the newcustomCommands/list
request type.custom-commands.test.ts
to verify that thecustomCommands/list
API returns the expected number of custom commands.cody.commands.get-custom-commands
command in theCustomCommandsManager
class to return the list of custom commands.Test plan
Verified the new API works by porting it to the cli tool (for testing only, the code has been removed):
This is just to add the missing piece to the Agent API. Custom Commands is currently not integrated into other clients atm.