Skip to content

Instantly share code, notes, and snippets.

@olafurpg
Created June 27, 2024 23:43
Show Gist options
  • Save olafurpg/708bfaed4edd12d1c91d2fbc94ac63e9 to your computer and use it in GitHub Desktop.
Save olafurpg/708bfaed4edd12d1c91d2fbc94ac63e9 to your computer and use it in GitHub Desktop.
diff --git a/agent/bindings/kotlin/lib/src/main/kotlin/com/sourcegraph/cody/protocol_generated/CodyAgentServer.kt b/agent/bindings/kotlin/lib/src/main/kotlin/com/sourcegraph/cody/protocol_generated/CodyAgentServer.kt
index 6a2d5123c..1cd74a15e 100644
--- a/agent/bindings/kotlin/lib/src/main/kotlin/com/sourcegraph/cody/protocol_generated/CodyAgentServer.kt
+++ b/agent/bindings/kotlin/lib/src/main/kotlin/com/sourcegraph/cody/protocol_generated/CodyAgentServer.kt
@@ -36,6 +36,8 @@ interface CodyAgentServer {
fun commands_smell(params: Null?): CompletableFuture<String>
@JsonRequest("commands/custom")
fun commands_custom(params: Commands_CustomParams): CompletableFuture<CustomCommandResult>
+ @JsonRequest("customCommands/list")
+ fun customCommands_list(params: Null?): CompletableFuture<List<CodyCommand>>
@JsonRequest("editCommands/code")
fun editCommands_code(params: EditCommands_CodeParams): CompletableFuture<EditTask>
@JsonRequest("editCommands/test")
diff --git a/agent/bindings/kotlin/lib/src/main/kotlin/com/sourcegraph/cody/protocol_generated/CodyCommand.kt b/agent/bindings/kotlin/lib/src/main/kotlin/com/sourcegraph/cody/protocol_generated/CodyCommand.kt
new file mode 100644
index 000000000..8eefde2c3
--- /dev/null
+++ b/agent/bindings/kotlin/lib/src/main/kotlin/com/sourcegraph/cody/protocol_generated/CodyCommand.kt
@@ -0,0 +1,14 @@
+@file:Suppress("FunctionName", "ClassName", "unused", "EnumEntryName", "UnusedImport")
+package com.sourcegraph.cody.protocol_generated;
+
+data class CodyCommand(
+ val slashCommand: String? = null,
+ val key: String,
+ val prompt: String,
+ val description: String? = null,
+ val context: CodyCommandContext? = null,
+ val type: CodyCommandType? = null, // Oneof: workspace, user, default, experimental, recently used
+ val mode: CodyCommandMode? = null, // Oneof: ask, edit, insert
+ val requestID: String? = null,
+)
+
diff --git a/agent/bindings/kotlin/lib/src/main/kotlin/com/sourcegraph/cody/protocol_generated/CodyCommandContext.kt b/agent/bindings/kotlin/lib/src/main/kotlin/com/sourcegraph/cody/protocol_generated/CodyCommandContext.kt
new file mode 100644
index 000000000..82309e85c
--- /dev/null
+++ b/agent/bindings/kotlin/lib/src/main/kotlin/com/sourcegraph/cody/protocol_generated/CodyCommandContext.kt
@@ -0,0 +1,15 @@
+@file:Suppress("FunctionName", "ClassName", "unused", "EnumEntryName", "UnusedImport")
+package com.sourcegraph.cody.protocol_generated;
+
+data class CodyCommandContext(
+ val none: Boolean? = null,
+ val openTabs: Boolean? = null,
+ val currentDir: Boolean? = null,
+ val currentFile: Boolean? = null,
+ val selection: Boolean? = null,
+ val command: String? = null,
+ val filePath: String? = null,
+ val directoryPath: String? = null,
+ val codebase: Boolean? = null,
+)
+
diff --git a/agent/bindings/kotlin/lib/src/main/kotlin/com/sourcegraph/cody/protocol_generated/CodyCommandMode.kt b/agent/bindings/kotlin/lib/src/main/kotlin/com/sourcegraph/cody/protocol_generated/CodyCommandMode.kt
new file mode 100644
index 000000000..60ec273c7
--- /dev/null
+++ b/agent/bindings/kotlin/lib/src/main/kotlin/com/sourcegraph/cody/protocol_generated/CodyCommandMode.kt
@@ -0,0 +1,5 @@
+@file:Suppress("FunctionName", "ClassName", "unused", "EnumEntryName", "UnusedImport")
+package com.sourcegraph.cody.protocol_generated;
+
+typealias CodyCommandMode = String // One of: ask, edit, insert
+
diff --git a/agent/bindings/kotlin/lib/src/main/kotlin/com/sourcegraph/cody/protocol_generated/CodyCommandType.kt b/agent/bindings/kotlin/lib/src/main/kotlin/com/sourcegraph/cody/protocol_generated/CodyCommandType.kt
new file mode 100644
index 000000000..782ef8279
--- /dev/null
+++ b/agent/bindings/kotlin/lib/src/main/kotlin/com/sourcegraph/cody/protocol_generated/CodyCommandType.kt
@@ -0,0 +1,5 @@
+@file:Suppress("FunctionName", "ClassName", "unused", "EnumEntryName", "UnusedImport")
+package com.sourcegraph.cody.protocol_generated;
+
+typealias CodyCommandType = String // One of: workspace, user, default, experimental, recently used
+
diff --git a/agent/bindings/kotlin/lib/src/main/kotlin/com/sourcegraph/cody/protocol_generated/Constants.kt b/agent/bindings/kotlin/lib/src/main/kotlin/com/sourcegraph/cody/protocol_generated/Constants.kt
index c65e0990b..d1842d983 100644
--- a/agent/bindings/kotlin/lib/src/main/kotlin/com/sourcegraph/cody/protocol_generated/Constants.kt
+++ b/agent/bindings/kotlin/lib/src/main/kotlin/com/sourcegraph/cody/protocol_generated/Constants.kt
@@ -135,6 +135,11 @@ object Constants {
const val indentation = "indentation"
const val Automatic = "Automatic"
const val Invoke = "Invoke"
+ const val workspace = "workspace"
+ const val default = "default"
+ const val experimental = "experimental"
+ const val `recently used` = "recently used"
+ const val ask = "ask"
const val none = "none"
const val streaming = "streaming"
const val enabled = "enabled"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment