Slash commands (#5718)

Co-authored-by: Douwe Osinga <douwe@squareup.com>
This commit is contained in:
Douwe Osinga
2025-11-20 21:14:15 +01:00
committed by GitHub
parent 6e511d1e8a
commit bdf68bb4f5
28 changed files with 1675 additions and 1048 deletions
+167 -7
View File
@@ -878,6 +878,26 @@
"responses": {}
}
},
"/config/slash_commands": {
"get": {
"tags": [
"super::routes::config_management"
],
"operationId": "get_slash_commands",
"responses": {
"200": {
"description": "Slash commands retrieved successfully",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/SlashCommandsResponse"
}
}
}
}
}
}
},
"/config/upsert": {
"post": {
"tags": [
@@ -1372,6 +1392,64 @@
}
}
},
"/recipes/schedule": {
"post": {
"tags": [
"Recipe Management"
],
"operationId": "schedule_recipe",
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ScheduleRecipeRequest"
}
}
},
"required": true
},
"responses": {
"200": {
"description": "Recipe scheduled successfully"
},
"404": {
"description": "Recipe not found"
},
"500": {
"description": "Internal server error"
}
}
}
},
"/recipes/slash-command": {
"post": {
"tags": [
"Recipe Management"
],
"operationId": "set_recipe_slash_command",
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/SetSlashCommandRequest"
}
}
},
"required": true
},
"responses": {
"200": {
"description": "Slash command set successfully"
},
"404": {
"description": "Recipe not found"
},
"500": {
"description": "Internal server error"
}
}
}
},
"/reply": {
"post": {
"tags": [
@@ -2227,6 +2305,13 @@
}
}
},
"CommandType": {
"type": "string",
"enum": [
"Builtin",
"Recipe"
]
},
"ConfigKey": {
"type": "object",
"description": "Configuration key metadata for provider setup",
@@ -3077,13 +3162,13 @@
"ListRecipeResponse": {
"type": "object",
"required": [
"recipe_manifest_responses"
"manifests"
],
"properties": {
"recipe_manifest_responses": {
"manifests": {
"type": "array",
"items": {
"$ref": "#/components/schemas/RecipeManifestResponse"
"$ref": "#/components/schemas/RecipeManifest"
}
}
}
@@ -3897,22 +3982,34 @@
}
}
},
"RecipeManifestResponse": {
"RecipeManifest": {
"type": "object",
"required": [
"id",
"recipe",
"lastModified",
"id"
"file_path",
"last_modified"
],
"properties": {
"file_path": {
"type": "string"
},
"id": {
"type": "string"
},
"lastModified": {
"last_modified": {
"type": "string"
},
"recipe": {
"$ref": "#/components/schemas/Recipe"
},
"schedule_cron": {
"type": "string",
"nullable": true
},
"slash_command": {
"type": "string",
"nullable": true
}
}
},
@@ -4177,6 +4274,21 @@
}
}
},
"ScheduleRecipeRequest": {
"type": "object",
"required": [
"id"
],
"properties": {
"cron_schedule": {
"type": "string",
"nullable": true
},
"id": {
"type": "string"
}
}
},
"ScheduledJob": {
"type": "object",
"required": [
@@ -4447,6 +4559,21 @@
}
}
},
"SetSlashCommandRequest": {
"type": "object",
"required": [
"id"
],
"properties": {
"id": {
"type": "string"
},
"slash_command": {
"type": "string",
"nullable": true
}
}
},
"Settings": {
"type": "object",
"properties": {
@@ -4480,6 +4607,39 @@
}
}
},
"SlashCommand": {
"type": "object",
"required": [
"command",
"help",
"command_type"
],
"properties": {
"command": {
"type": "string"
},
"command_type": {
"$ref": "#/components/schemas/CommandType"
},
"help": {
"type": "string"
}
}
},
"SlashCommandsResponse": {
"type": "object",
"required": [
"commands"
],
"properties": {
"commands": {
"type": "array",
"items": {
"$ref": "#/components/schemas/SlashCommand"
}
}
}
},
"StartAgentRequest": {
"type": "object",
"required": [