diff --git a/docs/docs.go b/docs/docs.go index 9187bec8..12b6793d 100644 --- a/docs/docs.go +++ b/docs/docs.go @@ -162,6 +162,13 @@ const docTemplate = `{ ], "summary": "Chat with AI", "parameters": [ + { + "type": "string", + "description": "Bot ID", + "name": "bot_id", + "in": "path", + "required": true + }, { "description": "Chat request", "name": "request", @@ -208,6 +215,13 @@ const docTemplate = `{ ], "summary": "Stream chat with AI", "parameters": [ + { + "type": "string", + "description": "Bot ID", + "name": "bot_id", + "in": "path", + "required": true + }, { "description": "Chat request", "name": "request", @@ -1136,6 +1150,13 @@ const docTemplate = `{ ], "summary": "List history records", "parameters": [ + { + "type": "string", + "description": "Bot ID", + "name": "bot_id", + "in": "path", + "required": true + }, { "type": "integer", "description": "Limit", @@ -1171,6 +1192,13 @@ const docTemplate = `{ ], "summary": "Create history record", "parameters": [ + { + "type": "string", + "description": "Bot ID", + "name": "bot_id", + "in": "path", + "required": true + }, { "description": "History payload", "name": "payload", @@ -1208,6 +1236,15 @@ const docTemplate = `{ "history" ], "summary": "Delete all history records", + "parameters": [ + { + "type": "string", + "description": "Bot ID", + "name": "bot_id", + "in": "path", + "required": true + } + ], "responses": { "204": { "description": "No Content" @@ -1235,6 +1272,13 @@ const docTemplate = `{ ], "summary": "Get history record", "parameters": [ + { + "type": "string", + "description": "Bot ID", + "name": "bot_id", + "in": "path", + "required": true + }, { "type": "string", "description": "History ID", @@ -1277,6 +1321,13 @@ const docTemplate = `{ ], "summary": "Delete history record", "parameters": [ + { + "type": "string", + "description": "Bot ID", + "name": "bot_id", + "in": "path", + "required": true + }, { "type": "string", "description": "History ID", @@ -1317,6 +1368,15 @@ const docTemplate = `{ "mcp" ], "summary": "List MCP connections", + "parameters": [ + { + "type": "string", + "description": "Bot ID", + "name": "bot_id", + "in": "path", + "required": true + } + ], "responses": { "200": { "description": "OK", @@ -1357,6 +1417,13 @@ const docTemplate = `{ ], "summary": "Create MCP connection", "parameters": [ + { + "type": "string", + "description": "Bot ID", + "name": "bot_id", + "in": "path", + "required": true + }, { "description": "MCP payload", "name": "payload", @@ -1522,6 +1589,13 @@ const docTemplate = `{ ], "summary": "Get MCP connection", "parameters": [ + { + "type": "string", + "description": "Bot ID", + "name": "bot_id", + "in": "path", + "required": true + }, { "type": "string", "description": "MCP ID", @@ -1570,6 +1644,13 @@ const docTemplate = `{ ], "summary": "Update MCP connection", "parameters": [ + { + "type": "string", + "description": "Bot ID", + "name": "bot_id", + "in": "path", + "required": true + }, { "type": "string", "description": "MCP ID", @@ -1627,6 +1708,13 @@ const docTemplate = `{ ], "summary": "Delete MCP connection", "parameters": [ + { + "type": "string", + "description": "Bot ID", + "name": "bot_id", + "in": "path", + "required": true + }, { "type": "string", "description": "MCP ID", @@ -1674,6 +1762,13 @@ const docTemplate = `{ ], "summary": "Add memory", "parameters": [ + { + "type": "string", + "description": "Bot ID", + "name": "bot_id", + "in": "path", + "required": true + }, { "description": "Add request", "name": "payload", @@ -1714,6 +1809,13 @@ const docTemplate = `{ ], "summary": "Embed and upsert memory", "parameters": [ + { + "type": "string", + "description": "Bot ID", + "name": "bot_id", + "in": "path", + "required": true + }, { "description": "Embed upsert request", "name": "payload", @@ -1754,6 +1856,13 @@ const docTemplate = `{ ], "summary": "List memories", "parameters": [ + { + "type": "string", + "description": "Bot ID", + "name": "bot_id", + "in": "path", + "required": true + }, { "type": "string", "description": "Run ID", @@ -1795,6 +1904,13 @@ const docTemplate = `{ ], "summary": "Delete memories", "parameters": [ + { + "type": "string", + "description": "Bot ID", + "name": "bot_id", + "in": "path", + "required": true + }, { "description": "Delete all request", "name": "payload", @@ -1835,6 +1951,13 @@ const docTemplate = `{ ], "summary": "Get memory", "parameters": [ + { + "type": "string", + "description": "Bot ID", + "name": "bot_id", + "in": "path", + "required": true + }, { "type": "string", "description": "Memory ID", @@ -1871,6 +1994,13 @@ const docTemplate = `{ ], "summary": "Delete memory", "parameters": [ + { + "type": "string", + "description": "Bot ID", + "name": "bot_id", + "in": "path", + "required": true + }, { "type": "string", "description": "Memory ID", @@ -1909,6 +2039,13 @@ const docTemplate = `{ ], "summary": "Search memories", "parameters": [ + { + "type": "string", + "description": "Bot ID", + "name": "bot_id", + "in": "path", + "required": true + }, { "description": "Search request", "name": "payload", @@ -1949,6 +2086,13 @@ const docTemplate = `{ ], "summary": "Update memory", "parameters": [ + { + "type": "string", + "description": "Bot ID", + "name": "bot_id", + "in": "path", + "required": true + }, { "description": "Update request", "name": "payload", @@ -1988,6 +2132,15 @@ const docTemplate = `{ "schedule" ], "summary": "List schedules", + "parameters": [ + { + "type": "string", + "description": "Bot ID", + "name": "bot_id", + "in": "path", + "required": true + } + ], "responses": { "200": { "description": "OK", @@ -2016,6 +2169,13 @@ const docTemplate = `{ ], "summary": "Create schedule", "parameters": [ + { + "type": "string", + "description": "Bot ID", + "name": "bot_id", + "in": "path", + "required": true + }, { "description": "Schedule payload", "name": "payload", @@ -2056,6 +2216,13 @@ const docTemplate = `{ ], "summary": "Get schedule", "parameters": [ + { + "type": "string", + "description": "Bot ID", + "name": "bot_id", + "in": "path", + "required": true + }, { "type": "string", "description": "Schedule ID", @@ -2098,6 +2265,13 @@ const docTemplate = `{ ], "summary": "Update schedule", "parameters": [ + { + "type": "string", + "description": "Bot ID", + "name": "bot_id", + "in": "path", + "required": true + }, { "type": "string", "description": "Schedule ID", @@ -2143,6 +2317,13 @@ const docTemplate = `{ ], "summary": "Delete schedule", "parameters": [ + { + "type": "string", + "description": "Bot ID", + "name": "bot_id", + "in": "path", + "required": true + }, { "type": "string", "description": "Schedule ID", @@ -2177,6 +2358,15 @@ const docTemplate = `{ "settings" ], "summary": "Get user settings", + "parameters": [ + { + "type": "string", + "description": "Bot ID", + "name": "bot_id", + "in": "path", + "required": true + } + ], "responses": { "200": { "description": "OK", @@ -2205,6 +2395,13 @@ const docTemplate = `{ ], "summary": "Update user settings", "parameters": [ + { + "type": "string", + "description": "Bot ID", + "name": "bot_id", + "in": "path", + "required": true + }, { "description": "Settings payload", "name": "payload", @@ -2243,6 +2440,13 @@ const docTemplate = `{ ], "summary": "Update user settings", "parameters": [ + { + "type": "string", + "description": "Bot ID", + "name": "bot_id", + "in": "path", + "required": true + }, { "description": "Settings payload", "name": "payload", @@ -2280,6 +2484,15 @@ const docTemplate = `{ "settings" ], "summary": "Delete user settings", + "parameters": [ + { + "type": "string", + "description": "Bot ID", + "name": "bot_id", + "in": "path", + "required": true + } + ], "responses": { "204": { "description": "No Content" @@ -2306,6 +2519,15 @@ const docTemplate = `{ "subagent" ], "summary": "List subagents", + "parameters": [ + { + "type": "string", + "description": "Bot ID", + "name": "bot_id", + "in": "path", + "required": true + } + ], "responses": { "200": { "description": "OK", @@ -2334,6 +2556,13 @@ const docTemplate = `{ ], "summary": "Create subagent", "parameters": [ + { + "type": "string", + "description": "Bot ID", + "name": "bot_id", + "in": "path", + "required": true + }, { "description": "Subagent payload", "name": "payload", @@ -2374,6 +2603,13 @@ const docTemplate = `{ ], "summary": "Get subagent", "parameters": [ + { + "type": "string", + "description": "Bot ID", + "name": "bot_id", + "in": "path", + "required": true + }, { "type": "string", "description": "Subagent ID", @@ -2416,6 +2652,13 @@ const docTemplate = `{ ], "summary": "Update subagent", "parameters": [ + { + "type": "string", + "description": "Bot ID", + "name": "bot_id", + "in": "path", + "required": true + }, { "type": "string", "description": "Subagent ID", @@ -2467,6 +2710,13 @@ const docTemplate = `{ ], "summary": "Delete subagent", "parameters": [ + { + "type": "string", + "description": "Bot ID", + "name": "bot_id", + "in": "path", + "required": true + }, { "type": "string", "description": "Subagent ID", @@ -2508,6 +2758,13 @@ const docTemplate = `{ ], "summary": "Get subagent context", "parameters": [ + { + "type": "string", + "description": "Bot ID", + "name": "bot_id", + "in": "path", + "required": true + }, { "type": "string", "description": "Subagent ID", @@ -2550,6 +2807,13 @@ const docTemplate = `{ ], "summary": "Update subagent context", "parameters": [ + { + "type": "string", + "description": "Bot ID", + "name": "bot_id", + "in": "path", + "required": true + }, { "type": "string", "description": "Subagent ID", @@ -2603,6 +2867,13 @@ const docTemplate = `{ ], "summary": "Get subagent skills", "parameters": [ + { + "type": "string", + "description": "Bot ID", + "name": "bot_id", + "in": "path", + "required": true + }, { "type": "string", "description": "Subagent ID", @@ -2645,6 +2916,13 @@ const docTemplate = `{ ], "summary": "Update subagent skills", "parameters": [ + { + "type": "string", + "description": "Bot ID", + "name": "bot_id", + "in": "path", + "required": true + }, { "type": "string", "description": "Subagent ID", @@ -2696,6 +2974,13 @@ const docTemplate = `{ ], "summary": "Add subagent skills", "parameters": [ + { + "type": "string", + "description": "Bot ID", + "name": "bot_id", + "in": "path", + "required": true + }, { "type": "string", "description": "Subagent ID", @@ -4744,6 +5029,15 @@ const docTemplate = `{ "definitions": { "bots.Bot": { "type": "object", + "required": [ + "created_at", + "display_name", + "id", + "is_active", + "owner_user_id", + "type", + "updated_at" + ], "properties": { "avatar_url": { "type": "string" @@ -4815,6 +5109,9 @@ const docTemplate = `{ }, "bots.ListBotsResponse": { "type": "object", + "required": [ + "items" + ], "properties": { "items": { "type": "array", @@ -5459,6 +5756,16 @@ const docTemplate = `{ }, "github_com_memohai_memoh_internal_mcp.Connection": { "type": "object", + "required": [ + "active", + "bot_id", + "config", + "created_at", + "id", + "name", + "type", + "updated_at" + ], "properties": { "active": { "type": "boolean" @@ -5489,6 +5796,12 @@ const docTemplate = `{ }, "handlers.ChannelMeta": { "type": "object", + "required": [ + "capabilities", + "config_schema", + "display_name", + "type" + ], "properties": { "capabilities": { "$ref": "#/definitions/channel.ChannelCapabilities" @@ -5839,6 +6152,10 @@ const docTemplate = `{ }, "handlers.LoginRequest": { "type": "object", + "required": [ + "password", + "username" + ], "properties": { "password": { "type": "string" @@ -5850,6 +6167,15 @@ const docTemplate = `{ }, "handlers.LoginResponse": { "type": "object", + "required": [ + "access_token", + "display_name", + "expires_at", + "role", + "token_type", + "user_id", + "username" + ], "properties": { "access_token": { "type": "string" @@ -6318,6 +6644,12 @@ const docTemplate = `{ }, "models.AddRequest": { "type": "object", + "required": [ + "llm_provider_id", + "model_id", + "name", + "type" + ], "properties": { "dimensions": { "type": "integer" @@ -6366,6 +6698,12 @@ const docTemplate = `{ }, "models.GetResponse": { "type": "object", + "required": [ + "llm_provider_id", + "model_id", + "name", + "type" + ], "properties": { "dimensions": { "type": "integer" @@ -6406,6 +6744,12 @@ const docTemplate = `{ }, "models.UpdateRequest": { "type": "object", + "required": [ + "llm_provider_id", + "model_id", + "name", + "type" + ], "properties": { "dimensions": { "type": "integer" @@ -6486,6 +6830,14 @@ const docTemplate = `{ }, "providers.GetResponse": { "type": "object", + "required": [ + "base_url", + "client_type", + "created_at", + "id", + "name", + "updated_at" + ], "properties": { "api_key": { "description": "masked in response", @@ -6644,6 +6996,14 @@ const docTemplate = `{ }, "settings.Settings": { "type": "object", + "required": [ + "allow_guest", + "chat_model_id", + "embedding_model_id", + "language", + "max_context_load_time", + "memory_model_id" + ], "properties": { "allow_guest": { "type": "boolean" diff --git a/docs/swagger.json b/docs/swagger.json index 57d5d4ba..bd8cf46b 100644 --- a/docs/swagger.json +++ b/docs/swagger.json @@ -153,6 +153,13 @@ ], "summary": "Chat with AI", "parameters": [ + { + "type": "string", + "description": "Bot ID", + "name": "bot_id", + "in": "path", + "required": true + }, { "description": "Chat request", "name": "request", @@ -199,6 +206,13 @@ ], "summary": "Stream chat with AI", "parameters": [ + { + "type": "string", + "description": "Bot ID", + "name": "bot_id", + "in": "path", + "required": true + }, { "description": "Chat request", "name": "request", @@ -1127,6 +1141,13 @@ ], "summary": "List history records", "parameters": [ + { + "type": "string", + "description": "Bot ID", + "name": "bot_id", + "in": "path", + "required": true + }, { "type": "integer", "description": "Limit", @@ -1162,6 +1183,13 @@ ], "summary": "Create history record", "parameters": [ + { + "type": "string", + "description": "Bot ID", + "name": "bot_id", + "in": "path", + "required": true + }, { "description": "History payload", "name": "payload", @@ -1199,6 +1227,15 @@ "history" ], "summary": "Delete all history records", + "parameters": [ + { + "type": "string", + "description": "Bot ID", + "name": "bot_id", + "in": "path", + "required": true + } + ], "responses": { "204": { "description": "No Content" @@ -1226,6 +1263,13 @@ ], "summary": "Get history record", "parameters": [ + { + "type": "string", + "description": "Bot ID", + "name": "bot_id", + "in": "path", + "required": true + }, { "type": "string", "description": "History ID", @@ -1268,6 +1312,13 @@ ], "summary": "Delete history record", "parameters": [ + { + "type": "string", + "description": "Bot ID", + "name": "bot_id", + "in": "path", + "required": true + }, { "type": "string", "description": "History ID", @@ -1308,6 +1359,15 @@ "mcp" ], "summary": "List MCP connections", + "parameters": [ + { + "type": "string", + "description": "Bot ID", + "name": "bot_id", + "in": "path", + "required": true + } + ], "responses": { "200": { "description": "OK", @@ -1348,6 +1408,13 @@ ], "summary": "Create MCP connection", "parameters": [ + { + "type": "string", + "description": "Bot ID", + "name": "bot_id", + "in": "path", + "required": true + }, { "description": "MCP payload", "name": "payload", @@ -1513,6 +1580,13 @@ ], "summary": "Get MCP connection", "parameters": [ + { + "type": "string", + "description": "Bot ID", + "name": "bot_id", + "in": "path", + "required": true + }, { "type": "string", "description": "MCP ID", @@ -1561,6 +1635,13 @@ ], "summary": "Update MCP connection", "parameters": [ + { + "type": "string", + "description": "Bot ID", + "name": "bot_id", + "in": "path", + "required": true + }, { "type": "string", "description": "MCP ID", @@ -1618,6 +1699,13 @@ ], "summary": "Delete MCP connection", "parameters": [ + { + "type": "string", + "description": "Bot ID", + "name": "bot_id", + "in": "path", + "required": true + }, { "type": "string", "description": "MCP ID", @@ -1665,6 +1753,13 @@ ], "summary": "Add memory", "parameters": [ + { + "type": "string", + "description": "Bot ID", + "name": "bot_id", + "in": "path", + "required": true + }, { "description": "Add request", "name": "payload", @@ -1705,6 +1800,13 @@ ], "summary": "Embed and upsert memory", "parameters": [ + { + "type": "string", + "description": "Bot ID", + "name": "bot_id", + "in": "path", + "required": true + }, { "description": "Embed upsert request", "name": "payload", @@ -1745,6 +1847,13 @@ ], "summary": "List memories", "parameters": [ + { + "type": "string", + "description": "Bot ID", + "name": "bot_id", + "in": "path", + "required": true + }, { "type": "string", "description": "Run ID", @@ -1786,6 +1895,13 @@ ], "summary": "Delete memories", "parameters": [ + { + "type": "string", + "description": "Bot ID", + "name": "bot_id", + "in": "path", + "required": true + }, { "description": "Delete all request", "name": "payload", @@ -1826,6 +1942,13 @@ ], "summary": "Get memory", "parameters": [ + { + "type": "string", + "description": "Bot ID", + "name": "bot_id", + "in": "path", + "required": true + }, { "type": "string", "description": "Memory ID", @@ -1862,6 +1985,13 @@ ], "summary": "Delete memory", "parameters": [ + { + "type": "string", + "description": "Bot ID", + "name": "bot_id", + "in": "path", + "required": true + }, { "type": "string", "description": "Memory ID", @@ -1900,6 +2030,13 @@ ], "summary": "Search memories", "parameters": [ + { + "type": "string", + "description": "Bot ID", + "name": "bot_id", + "in": "path", + "required": true + }, { "description": "Search request", "name": "payload", @@ -1940,6 +2077,13 @@ ], "summary": "Update memory", "parameters": [ + { + "type": "string", + "description": "Bot ID", + "name": "bot_id", + "in": "path", + "required": true + }, { "description": "Update request", "name": "payload", @@ -1979,6 +2123,15 @@ "schedule" ], "summary": "List schedules", + "parameters": [ + { + "type": "string", + "description": "Bot ID", + "name": "bot_id", + "in": "path", + "required": true + } + ], "responses": { "200": { "description": "OK", @@ -2007,6 +2160,13 @@ ], "summary": "Create schedule", "parameters": [ + { + "type": "string", + "description": "Bot ID", + "name": "bot_id", + "in": "path", + "required": true + }, { "description": "Schedule payload", "name": "payload", @@ -2047,6 +2207,13 @@ ], "summary": "Get schedule", "parameters": [ + { + "type": "string", + "description": "Bot ID", + "name": "bot_id", + "in": "path", + "required": true + }, { "type": "string", "description": "Schedule ID", @@ -2089,6 +2256,13 @@ ], "summary": "Update schedule", "parameters": [ + { + "type": "string", + "description": "Bot ID", + "name": "bot_id", + "in": "path", + "required": true + }, { "type": "string", "description": "Schedule ID", @@ -2134,6 +2308,13 @@ ], "summary": "Delete schedule", "parameters": [ + { + "type": "string", + "description": "Bot ID", + "name": "bot_id", + "in": "path", + "required": true + }, { "type": "string", "description": "Schedule ID", @@ -2168,6 +2349,15 @@ "settings" ], "summary": "Get user settings", + "parameters": [ + { + "type": "string", + "description": "Bot ID", + "name": "bot_id", + "in": "path", + "required": true + } + ], "responses": { "200": { "description": "OK", @@ -2196,6 +2386,13 @@ ], "summary": "Update user settings", "parameters": [ + { + "type": "string", + "description": "Bot ID", + "name": "bot_id", + "in": "path", + "required": true + }, { "description": "Settings payload", "name": "payload", @@ -2234,6 +2431,13 @@ ], "summary": "Update user settings", "parameters": [ + { + "type": "string", + "description": "Bot ID", + "name": "bot_id", + "in": "path", + "required": true + }, { "description": "Settings payload", "name": "payload", @@ -2271,6 +2475,15 @@ "settings" ], "summary": "Delete user settings", + "parameters": [ + { + "type": "string", + "description": "Bot ID", + "name": "bot_id", + "in": "path", + "required": true + } + ], "responses": { "204": { "description": "No Content" @@ -2297,6 +2510,15 @@ "subagent" ], "summary": "List subagents", + "parameters": [ + { + "type": "string", + "description": "Bot ID", + "name": "bot_id", + "in": "path", + "required": true + } + ], "responses": { "200": { "description": "OK", @@ -2325,6 +2547,13 @@ ], "summary": "Create subagent", "parameters": [ + { + "type": "string", + "description": "Bot ID", + "name": "bot_id", + "in": "path", + "required": true + }, { "description": "Subagent payload", "name": "payload", @@ -2365,6 +2594,13 @@ ], "summary": "Get subagent", "parameters": [ + { + "type": "string", + "description": "Bot ID", + "name": "bot_id", + "in": "path", + "required": true + }, { "type": "string", "description": "Subagent ID", @@ -2407,6 +2643,13 @@ ], "summary": "Update subagent", "parameters": [ + { + "type": "string", + "description": "Bot ID", + "name": "bot_id", + "in": "path", + "required": true + }, { "type": "string", "description": "Subagent ID", @@ -2458,6 +2701,13 @@ ], "summary": "Delete subagent", "parameters": [ + { + "type": "string", + "description": "Bot ID", + "name": "bot_id", + "in": "path", + "required": true + }, { "type": "string", "description": "Subagent ID", @@ -2499,6 +2749,13 @@ ], "summary": "Get subagent context", "parameters": [ + { + "type": "string", + "description": "Bot ID", + "name": "bot_id", + "in": "path", + "required": true + }, { "type": "string", "description": "Subagent ID", @@ -2541,6 +2798,13 @@ ], "summary": "Update subagent context", "parameters": [ + { + "type": "string", + "description": "Bot ID", + "name": "bot_id", + "in": "path", + "required": true + }, { "type": "string", "description": "Subagent ID", @@ -2594,6 +2858,13 @@ ], "summary": "Get subagent skills", "parameters": [ + { + "type": "string", + "description": "Bot ID", + "name": "bot_id", + "in": "path", + "required": true + }, { "type": "string", "description": "Subagent ID", @@ -2636,6 +2907,13 @@ ], "summary": "Update subagent skills", "parameters": [ + { + "type": "string", + "description": "Bot ID", + "name": "bot_id", + "in": "path", + "required": true + }, { "type": "string", "description": "Subagent ID", @@ -2687,6 +2965,13 @@ ], "summary": "Add subagent skills", "parameters": [ + { + "type": "string", + "description": "Bot ID", + "name": "bot_id", + "in": "path", + "required": true + }, { "type": "string", "description": "Subagent ID", @@ -4735,6 +5020,15 @@ "definitions": { "bots.Bot": { "type": "object", + "required": [ + "created_at", + "display_name", + "id", + "is_active", + "owner_user_id", + "type", + "updated_at" + ], "properties": { "avatar_url": { "type": "string" @@ -4806,6 +5100,9 @@ }, "bots.ListBotsResponse": { "type": "object", + "required": [ + "items" + ], "properties": { "items": { "type": "array", @@ -5450,6 +5747,16 @@ }, "github_com_memohai_memoh_internal_mcp.Connection": { "type": "object", + "required": [ + "active", + "bot_id", + "config", + "created_at", + "id", + "name", + "type", + "updated_at" + ], "properties": { "active": { "type": "boolean" @@ -5480,6 +5787,12 @@ }, "handlers.ChannelMeta": { "type": "object", + "required": [ + "capabilities", + "config_schema", + "display_name", + "type" + ], "properties": { "capabilities": { "$ref": "#/definitions/channel.ChannelCapabilities" @@ -5830,6 +6143,10 @@ }, "handlers.LoginRequest": { "type": "object", + "required": [ + "password", + "username" + ], "properties": { "password": { "type": "string" @@ -5841,6 +6158,15 @@ }, "handlers.LoginResponse": { "type": "object", + "required": [ + "access_token", + "display_name", + "expires_at", + "role", + "token_type", + "user_id", + "username" + ], "properties": { "access_token": { "type": "string" @@ -6309,6 +6635,12 @@ }, "models.AddRequest": { "type": "object", + "required": [ + "llm_provider_id", + "model_id", + "name", + "type" + ], "properties": { "dimensions": { "type": "integer" @@ -6357,6 +6689,12 @@ }, "models.GetResponse": { "type": "object", + "required": [ + "llm_provider_id", + "model_id", + "name", + "type" + ], "properties": { "dimensions": { "type": "integer" @@ -6397,6 +6735,12 @@ }, "models.UpdateRequest": { "type": "object", + "required": [ + "llm_provider_id", + "model_id", + "name", + "type" + ], "properties": { "dimensions": { "type": "integer" @@ -6477,6 +6821,14 @@ }, "providers.GetResponse": { "type": "object", + "required": [ + "base_url", + "client_type", + "created_at", + "id", + "name", + "updated_at" + ], "properties": { "api_key": { "description": "masked in response", @@ -6635,6 +6987,14 @@ }, "settings.Settings": { "type": "object", + "required": [ + "allow_guest", + "chat_model_id", + "embedding_model_id", + "language", + "max_context_load_time", + "memory_model_id" + ], "properties": { "allow_guest": { "type": "boolean" diff --git a/docs/swagger.yaml b/docs/swagger.yaml index 6f690b22..53d00948 100644 --- a/docs/swagger.yaml +++ b/docs/swagger.yaml @@ -20,6 +20,14 @@ definitions: type: string updated_at: type: string + required: + - created_at + - display_name + - id + - is_active + - owner_user_id + - type + - updated_at type: object bots.BotMember: properties: @@ -52,6 +60,8 @@ definitions: items: $ref: '#/definitions/bots.Bot' type: array + required: + - items type: object bots.ListMembersResponse: properties: @@ -502,6 +512,15 @@ definitions: type: string updated_at: type: string + required: + - active + - bot_id + - config + - created_at + - id + - name + - type + - updated_at type: object handlers.ChannelMeta: properties: @@ -519,6 +538,11 @@ definitions: type: string user_config_schema: $ref: '#/definitions/channel.ConfigSchema' + required: + - capabilities + - config_schema + - display_name + - type type: object handlers.CreateContainerRequest: properties: @@ -735,6 +759,9 @@ definitions: type: string username: type: string + required: + - password + - username type: object handlers.LoginResponse: properties: @@ -752,6 +779,14 @@ definitions: type: string username: type: string + required: + - access_token + - display_name + - expires_at + - role + - token_type + - user_id + - username type: object handlers.MCPStdioRequest: properties: @@ -1062,6 +1097,11 @@ definitions: type: string type: $ref: '#/definitions/models.ModelType' + required: + - llm_provider_id + - model_id + - name + - type type: object models.AddResponse: properties: @@ -1093,6 +1133,11 @@ definitions: type: string type: $ref: '#/definitions/models.ModelType' + required: + - llm_provider_id + - model_id + - name + - type type: object models.ModelType: enum: @@ -1120,6 +1165,11 @@ definitions: type: string type: $ref: '#/definitions/models.ModelType' + required: + - llm_provider_id + - model_id + - name + - type type: object providers.ClientType: enum: @@ -1178,6 +1228,13 @@ definitions: type: string updated_at: type: string + required: + - base_url + - client_type + - created_at + - id + - name + - updated_at type: object providers.UpdateRequest: properties: @@ -1276,6 +1333,13 @@ definitions: type: integer memory_model_id: type: string + required: + - allow_guest + - chat_model_id + - embedding_model_id + - language + - max_context_load_time + - memory_model_id type: object settings.UpsertRequest: properties: @@ -1572,6 +1636,11 @@ paths: description: Send a chat message and get a response. The system will automatically select an appropriate chat model from the database. parameters: + - description: Bot ID + in: path + name: bot_id + required: true + type: string - description: Chat request in: body name: request @@ -1603,6 +1672,11 @@ paths: description: Send a chat message and get a streaming response. The system will automatically select an appropriate chat model from the database. parameters: + - description: Bot ID + in: path + name: bot_id + required: true + type: string - description: Chat request in: body name: request @@ -2227,6 +2301,12 @@ paths: /bots/{bot_id}/history: delete: description: Delete all history records for current user + parameters: + - description: Bot ID + in: path + name: bot_id + required: true + type: string responses: "204": description: No Content @@ -2244,6 +2324,11 @@ paths: get: description: List history records for current user parameters: + - description: Bot ID + in: path + name: bot_id + required: true + type: string - description: Limit in: query name: limit @@ -2267,6 +2352,11 @@ paths: post: description: Create a history record for current user parameters: + - description: Bot ID + in: path + name: bot_id + required: true + type: string - description: History payload in: body name: payload @@ -2293,6 +2383,11 @@ paths: delete: description: Delete a history record by ID (must belong to current user) parameters: + - description: Bot ID + in: path + name: bot_id + required: true + type: string - description: History ID in: path name: id @@ -2319,6 +2414,11 @@ paths: get: description: Get a history record by ID (must belong to current user) parameters: + - description: Bot ID + in: path + name: bot_id + required: true + type: string - description: History ID in: path name: id @@ -2347,6 +2447,12 @@ paths: /bots/{bot_id}/mcp: get: description: List MCP connections for a bot + parameters: + - description: Bot ID + in: path + name: bot_id + required: true + type: string responses: "200": description: OK @@ -2374,6 +2480,11 @@ paths: post: description: Create a MCP connection for a bot parameters: + - description: Bot ID + in: path + name: bot_id + required: true + type: string - description: MCP payload in: body name: payload @@ -2484,6 +2595,11 @@ paths: delete: description: Delete a MCP connection by ID parameters: + - description: Bot ID + in: path + name: bot_id + required: true + type: string - description: MCP ID in: path name: id @@ -2514,6 +2630,11 @@ paths: get: description: Get a MCP connection by ID parameters: + - description: Bot ID + in: path + name: bot_id + required: true + type: string - description: MCP ID in: path name: id @@ -2546,6 +2667,11 @@ paths: put: description: Update a MCP connection by ID parameters: + - description: Bot ID + in: path + name: bot_id + required: true + type: string - description: MCP ID in: path name: id @@ -2586,6 +2712,11 @@ paths: description: 'Add memory for a user via memory. Auth: Bearer JWT determines user_id (sub or user_id).' parameters: + - description: Bot ID + in: path + name: bot_id + required: true + type: string - description: Add request in: body name: payload @@ -2613,6 +2744,11 @@ paths: description: 'Embed text or multimodal input and upsert into memory store. Auth: Bearer JWT determines user_id (sub or user_id).' parameters: + - description: Bot ID + in: path + name: bot_id + required: true + type: string - description: Embed upsert request in: body name: payload @@ -2640,6 +2776,11 @@ paths: description: 'Delete all memories for a user via memory. Auth: Bearer JWT determines user_id (sub or user_id).' parameters: + - description: Bot ID + in: path + name: bot_id + required: true + type: string - description: Delete all request in: body name: payload @@ -2666,6 +2807,11 @@ paths: description: 'List memories for a user via memory. Auth: Bearer JWT determines user_id (sub or user_id).' parameters: + - description: Bot ID + in: path + name: bot_id + required: true + type: string - description: Run ID in: query name: run_id @@ -2695,6 +2841,11 @@ paths: description: 'Delete a memory by ID via memory. Auth: Bearer JWT determines user_id (sub or user_id).' parameters: + - description: Bot ID + in: path + name: bot_id + required: true + type: string - description: Memory ID in: path name: memoryId @@ -2720,6 +2871,11 @@ paths: description: 'Get a memory by ID via memory. Auth: Bearer JWT determines user_id (sub or user_id).' parameters: + - description: Bot ID + in: path + name: bot_id + required: true + type: string - description: Memory ID in: path name: memoryId @@ -2746,6 +2902,11 @@ paths: description: 'Search memories for a user via memory. Auth: Bearer JWT determines user_id (sub or user_id).' parameters: + - description: Bot ID + in: path + name: bot_id + required: true + type: string - description: Search request in: body name: payload @@ -2773,6 +2934,11 @@ paths: description: 'Update a memory by ID via memory. Auth: Bearer JWT determines user_id (sub or user_id).' parameters: + - description: Bot ID + in: path + name: bot_id + required: true + type: string - description: Update request in: body name: payload @@ -2798,6 +2964,12 @@ paths: /bots/{bot_id}/schedule: get: description: List schedules for current user + parameters: + - description: Bot ID + in: path + name: bot_id + required: true + type: string responses: "200": description: OK @@ -2817,6 +2989,11 @@ paths: post: description: Create a schedule for current user parameters: + - description: Bot ID + in: path + name: bot_id + required: true + type: string - description: Schedule payload in: body name: payload @@ -2843,6 +3020,11 @@ paths: delete: description: Delete a schedule by ID parameters: + - description: Bot ID + in: path + name: bot_id + required: true + type: string - description: Schedule ID in: path name: id @@ -2865,6 +3047,11 @@ paths: get: description: Get a schedule by ID parameters: + - description: Bot ID + in: path + name: bot_id + required: true + type: string - description: Schedule ID in: path name: id @@ -2893,6 +3080,11 @@ paths: put: description: Update a schedule by ID parameters: + - description: Bot ID + in: path + name: bot_id + required: true + type: string - description: Schedule ID in: path name: id @@ -2923,6 +3115,12 @@ paths: /bots/{bot_id}/settings: delete: description: Remove agent settings for current user + parameters: + - description: Bot ID + in: path + name: bot_id + required: true + type: string responses: "204": description: No Content @@ -2939,6 +3137,12 @@ paths: - settings get: description: Get agent settings for current user + parameters: + - description: Bot ID + in: path + name: bot_id + required: true + type: string responses: "200": description: OK @@ -2958,6 +3162,11 @@ paths: post: description: Update or create agent settings for current user parameters: + - description: Bot ID + in: path + name: bot_id + required: true + type: string - description: Settings payload in: body name: payload @@ -2983,6 +3192,11 @@ paths: put: description: Update or create agent settings for current user parameters: + - description: Bot ID + in: path + name: bot_id + required: true + type: string - description: Settings payload in: body name: payload @@ -3008,6 +3222,12 @@ paths: /bots/{bot_id}/subagents: get: description: List subagents for current user + parameters: + - description: Bot ID + in: path + name: bot_id + required: true + type: string responses: "200": description: OK @@ -3027,6 +3247,11 @@ paths: post: description: Create a subagent for current user parameters: + - description: Bot ID + in: path + name: bot_id + required: true + type: string - description: Subagent payload in: body name: payload @@ -3053,6 +3278,11 @@ paths: delete: description: Delete a subagent by ID parameters: + - description: Bot ID + in: path + name: bot_id + required: true + type: string - description: Subagent ID in: path name: id @@ -3079,6 +3309,11 @@ paths: get: description: Get a subagent by ID parameters: + - description: Bot ID + in: path + name: bot_id + required: true + type: string - description: Subagent ID in: path name: id @@ -3107,6 +3342,11 @@ paths: put: description: Update a subagent by ID parameters: + - description: Bot ID + in: path + name: bot_id + required: true + type: string - description: Subagent ID in: path name: id @@ -3142,6 +3382,11 @@ paths: get: description: Get a subagent's message context parameters: + - description: Bot ID + in: path + name: bot_id + required: true + type: string - description: Subagent ID in: path name: id @@ -3170,6 +3415,11 @@ paths: put: description: Update a subagent's message context parameters: + - description: Bot ID + in: path + name: bot_id + required: true + type: string - description: Subagent ID in: path name: id @@ -3205,6 +3455,11 @@ paths: get: description: Get a subagent's skills parameters: + - description: Bot ID + in: path + name: bot_id + required: true + type: string - description: Subagent ID in: path name: id @@ -3233,6 +3488,11 @@ paths: post: description: Add skills to a subagent parameters: + - description: Bot ID + in: path + name: bot_id + required: true + type: string - description: Subagent ID in: path name: id @@ -3267,6 +3527,11 @@ paths: put: description: Replace a subagent's skills parameters: + - description: Bot ID + in: path + name: bot_id + required: true + type: string - description: Subagent ID in: path name: id diff --git a/internal/bots/types.go b/internal/bots/types.go index 2ecc9fc8..1a8c9294 100644 --- a/internal/bots/types.go +++ b/internal/bots/types.go @@ -6,15 +6,15 @@ import ( ) type Bot struct { - ID string `json:"id"` - OwnerUserID string `json:"owner_user_id"` - Type string `json:"type"` - DisplayName string `json:"display_name"` + ID string `json:"id" validate:"required"` + OwnerUserID string `json:"owner_user_id" validate:"required"` + Type string `json:"type" validate:"required"` + DisplayName string `json:"display_name" validate:"required"` AvatarURL string `json:"avatar_url,omitempty"` - IsActive bool `json:"is_active"` + IsActive bool `json:"is_active" validate:"required"` Metadata map[string]any `json:"metadata,omitempty"` - CreatedAt time.Time `json:"created_at"` - UpdatedAt time.Time `json:"updated_at"` + CreatedAt time.Time `json:"created_at" validate:"required"` + UpdatedAt time.Time `json:"updated_at" validate:"required"` } type BotMember struct { @@ -49,7 +49,7 @@ type UpsertMemberRequest struct { } type ListBotsResponse struct { - Items []Bot `json:"items"` + Items []Bot `json:"items" validate:"required"` } type ListMembersResponse struct { diff --git a/internal/handlers/auth.go b/internal/handlers/auth.go index b5f2c439..4f1e8ad1 100644 --- a/internal/handlers/auth.go +++ b/internal/handlers/auth.go @@ -21,18 +21,18 @@ type AuthHandler struct { } type LoginRequest struct { - Username string `json:"username"` - Password string `json:"password"` + Username string `json:"username" validate:"required"` + Password string `json:"password" validate:"required"` } type LoginResponse struct { - AccessToken string `json:"access_token"` - TokenType string `json:"token_type"` - ExpiresAt string `json:"expires_at"` - UserID string `json:"user_id"` - Role string `json:"role"` - DisplayName string `json:"display_name"` - Username string `json:"username"` + AccessToken string `json:"access_token" validate:"required"` + TokenType string `json:"token_type" validate:"required"` + ExpiresAt string `json:"expires_at" validate:"required"` + UserID string `json:"user_id" validate:"required"` + Role string `json:"role" validate:"required"` + DisplayName string `json:"display_name" validate:"required"` + Username string `json:"username" validate:"required"` } func NewAuthHandler(log *slog.Logger, userService *users.Service, jwtSecret string, expiresIn time.Duration) *AuthHandler { diff --git a/internal/handlers/channel.go b/internal/handlers/channel.go index 3dd64f00..774004c8 100644 --- a/internal/handlers/channel.go +++ b/internal/handlers/channel.go @@ -94,11 +94,11 @@ func (h *ChannelHandler) UpsertUserConfig(c echo.Context) error { } type ChannelMeta struct { - Type string `json:"type"` - DisplayName string `json:"display_name"` + Type string `json:"type" validate:"required"` + DisplayName string `json:"display_name" validate:"required"` Configless bool `json:"configless"` - Capabilities channel.ChannelCapabilities `json:"capabilities"` - ConfigSchema channel.ConfigSchema `json:"config_schema"` + Capabilities channel.ChannelCapabilities `json:"capabilities" validate:"required"` + ConfigSchema channel.ConfigSchema `json:"config_schema" validate:"required"` UserConfigSchema channel.ConfigSchema `json:"user_config_schema"` TargetSpec channel.TargetSpec `json:"target_spec"` } diff --git a/internal/handlers/chat.go b/internal/handlers/chat.go index b43e7f40..9c44b2f1 100644 --- a/internal/handlers/chat.go +++ b/internal/handlers/chat.go @@ -47,6 +47,7 @@ func (h *ChatHandler) Register(e *echo.Echo) { // @Tags chat // @Accept json // @Produce json +// @Param bot_id path string true "Bot ID" // @Param request body chat.ChatRequest true "Chat request" // @Success 200 {object} chat.ChatResponse // @Failure 400 {object} ErrorResponse @@ -102,6 +103,7 @@ func (h *ChatHandler) Chat(c echo.Context) error { // @Tags chat // @Accept json // @Produce text/event-stream +// @Param bot_id path string true "Bot ID" // @Param request body chat.ChatRequest true "Chat request" // @Success 200 {string} string // @Failure 400 {object} ErrorResponse diff --git a/internal/handlers/history.go b/internal/handlers/history.go index 5d72c145..d4e79c1d 100644 --- a/internal/handlers/history.go +++ b/internal/handlers/history.go @@ -46,6 +46,7 @@ func (h *HistoryHandler) Register(e *echo.Echo) { // @Summary Create history record // @Description Create a history record for current user // @Tags history +// @Param bot_id path string true "Bot ID" // @Param payload body history.CreateRequest true "History payload" // @Success 201 {object} history.Record // @Failure 400 {object} ErrorResponse @@ -82,6 +83,7 @@ func (h *HistoryHandler) Create(c echo.Context) error { // @Summary Get history record // @Description Get a history record by ID (must belong to current user) // @Tags history +// @Param bot_id path string true "Bot ID" // @Param id path string true "History ID" // @Success 200 {object} history.Record // @Failure 400 {object} ErrorResponse @@ -118,6 +120,7 @@ func (h *HistoryHandler) Get(c echo.Context) error { // @Summary List history records // @Description List history records for current user // @Tags history +// @Param bot_id path string true "Bot ID" // @Param limit query int false "Limit" // @Success 200 {object} history.ListResponse // @Failure 400 {object} ErrorResponse @@ -156,6 +159,7 @@ func (h *HistoryHandler) List(c echo.Context) error { // @Summary Delete history record // @Description Delete a history record by ID (must belong to current user) // @Tags history +// @Param bot_id path string true "Bot ID" // @Param id path string true "History ID" // @Success 204 "No Content" // @Failure 400 {object} ErrorResponse @@ -195,6 +199,7 @@ func (h *HistoryHandler) Delete(c echo.Context) error { // @Summary Delete all history records // @Description Delete all history records for current user // @Tags history +// @Param bot_id path string true "Bot ID" // @Success 204 "No Content" // @Failure 400 {object} ErrorResponse // @Failure 500 {object} ErrorResponse diff --git a/internal/handlers/mcp.go b/internal/handlers/mcp.go index bfc5d11d..0bb4a36d 100644 --- a/internal/handlers/mcp.go +++ b/internal/handlers/mcp.go @@ -46,6 +46,7 @@ func (h *MCPHandler) Register(e *echo.Echo) { // @Summary List MCP connections // @Description List MCP connections for a bot // @Tags mcp +// @Param bot_id path string true "Bot ID" // @Success 200 {object} mcp.ListResponse // @Failure 400 {object} ErrorResponse // @Failure 403 {object} ErrorResponse @@ -75,6 +76,7 @@ func (h *MCPHandler) List(c echo.Context) error { // @Summary Create MCP connection // @Description Create a MCP connection for a bot // @Tags mcp +// @Param bot_id path string true "Bot ID" // @Param payload body mcp.UpsertRequest true "MCP payload" // @Success 201 {object} mcp.Connection // @Failure 400 {object} ErrorResponse @@ -109,6 +111,7 @@ func (h *MCPHandler) Create(c echo.Context) error { // @Summary Get MCP connection // @Description Get a MCP connection by ID // @Tags mcp +// @Param bot_id path string true "Bot ID" // @Param id path string true "MCP ID" // @Success 200 {object} mcp.Connection // @Failure 400 {object} ErrorResponse @@ -146,6 +149,7 @@ func (h *MCPHandler) Get(c echo.Context) error { // @Summary Update MCP connection // @Description Update a MCP connection by ID // @Tags mcp +// @Param bot_id path string true "Bot ID" // @Param id path string true "MCP ID" // @Param payload body mcp.UpsertRequest true "MCP payload" // @Success 200 {object} mcp.Connection @@ -188,6 +192,7 @@ func (h *MCPHandler) Update(c echo.Context) error { // @Summary Delete MCP connection // @Description Delete a MCP connection by ID // @Tags mcp +// @Param bot_id path string true "Bot ID" // @Param id path string true "MCP ID" // @Success 204 "No Content" // @Failure 400 {object} ErrorResponse diff --git a/internal/handlers/memory.go b/internal/handlers/memory.go index ffa731cc..ce75f63f 100644 --- a/internal/handlers/memory.go +++ b/internal/handlers/memory.go @@ -90,6 +90,7 @@ func (h *MemoryHandler) checkService() error { // @Summary Embed and upsert memory // @Description Embed text or multimodal input and upsert into memory store. Auth: Bearer JWT determines user_id (sub or user_id). // @Tags memory +// @Param bot_id path string true "Bot ID" // @Param payload body memoryEmbedUpsertPayload true "Embed upsert request" // @Success 200 {object} memory.EmbedUpsertResponse // @Failure 400 {object} ErrorResponse @@ -144,6 +145,7 @@ func (h *MemoryHandler) EmbedUpsert(c echo.Context) error { // @Summary Add memory // @Description Add memory for a user via memory. Auth: Bearer JWT determines user_id (sub or user_id). // @Tags memory +// @Param bot_id path string true "Bot ID" // @Param payload body memoryAddPayload true "Add request" // @Success 200 {object} memory.SearchResponse // @Failure 400 {object} ErrorResponse @@ -197,6 +199,7 @@ func (h *MemoryHandler) Add(c echo.Context) error { // @Summary Search memories // @Description Search memories for a user via memory. Auth: Bearer JWT determines user_id (sub or user_id). // @Tags memory +// @Param bot_id path string true "Bot ID" // @Param payload body memorySearchPayload true "Search request" // @Success 200 {object} memory.SearchResponse // @Failure 400 {object} ErrorResponse @@ -249,6 +252,7 @@ func (h *MemoryHandler) Search(c echo.Context) error { // @Summary Update memory // @Description Update a memory by ID via memory. Auth: Bearer JWT determines user_id (sub or user_id). // @Tags memory +// @Param bot_id path string true "Bot ID" // @Param payload body memory.UpdateRequest true "Update request" // @Success 200 {object} memory.MemoryItem // @Failure 400 {object} ErrorResponse @@ -296,6 +300,7 @@ func (h *MemoryHandler) Update(c echo.Context) error { // @Summary Get memory // @Description Get a memory by ID via memory. Auth: Bearer JWT determines user_id (sub or user_id). // @Tags memory +// @Param bot_id path string true "Bot ID" // @Param memoryId path string true "Memory ID" // @Success 200 {object} memory.MemoryItem // @Failure 400 {object} ErrorResponse @@ -337,6 +342,7 @@ func (h *MemoryHandler) Get(c echo.Context) error { // @Summary List memories // @Description List memories for a user via memory. Auth: Bearer JWT determines user_id (sub or user_id). // @Tags memory +// @Param bot_id path string true "Bot ID" // @Param run_id query string false "Run ID" // @Param limit query int false "Limit" // @Success 200 {object} memory.SearchResponse @@ -388,6 +394,7 @@ func (h *MemoryHandler) GetAll(c echo.Context) error { // @Summary Delete memory // @Description Delete a memory by ID via memory. Auth: Bearer JWT determines user_id (sub or user_id). // @Tags memory +// @Param bot_id path string true "Bot ID" // @Param memoryId path string true "Memory ID" // @Success 200 {object} memory.DeleteResponse // @Failure 400 {object} ErrorResponse @@ -434,6 +441,7 @@ func (h *MemoryHandler) Delete(c echo.Context) error { // @Summary Delete memories // @Description Delete all memories for a user via memory. Auth: Bearer JWT determines user_id (sub or user_id). // @Tags memory +// @Param bot_id path string true "Bot ID" // @Param payload body memoryDeleteAllPayload true "Delete all request" // @Success 200 {object} memory.DeleteResponse // @Failure 400 {object} ErrorResponse diff --git a/internal/handlers/schedule.go b/internal/handlers/schedule.go index fa56f520..11511a2e 100644 --- a/internal/handlers/schedule.go +++ b/internal/handlers/schedule.go @@ -45,6 +45,7 @@ func (h *ScheduleHandler) Register(e *echo.Echo) { // @Summary Create schedule // @Description Create a schedule for current user // @Tags schedule +// @Param bot_id path string true "Bot ID" // @Param payload body schedule.CreateRequest true "Schedule payload" // @Success 201 {object} schedule.Schedule // @Failure 400 {object} ErrorResponse @@ -77,6 +78,7 @@ func (h *ScheduleHandler) Create(c echo.Context) error { // @Summary List schedules // @Description List schedules for current user // @Tags schedule +// @Param bot_id path string true "Bot ID" // @Success 200 {object} schedule.ListResponse // @Failure 400 {object} ErrorResponse // @Failure 500 {object} ErrorResponse @@ -104,6 +106,7 @@ func (h *ScheduleHandler) List(c echo.Context) error { // @Summary Get schedule // @Description Get a schedule by ID // @Tags schedule +// @Param bot_id path string true "Bot ID" // @Param id path string true "Schedule ID" // @Success 200 {object} schedule.Schedule // @Failure 400 {object} ErrorResponse @@ -140,6 +143,7 @@ func (h *ScheduleHandler) Get(c echo.Context) error { // @Summary Update schedule // @Description Update a schedule by ID // @Tags schedule +// @Param bot_id path string true "Bot ID" // @Param id path string true "Schedule ID" // @Param payload body schedule.UpdateRequest true "Schedule payload" // @Success 200 {object} schedule.Schedule @@ -184,6 +188,7 @@ func (h *ScheduleHandler) Update(c echo.Context) error { // @Summary Delete schedule // @Description Delete a schedule by ID // @Tags schedule +// @Param bot_id path string true "Bot ID" // @Param id path string true "Schedule ID" // @Success 204 "No Content" // @Failure 400 {object} ErrorResponse diff --git a/internal/handlers/settings.go b/internal/handlers/settings.go index ad902319..a0950701 100644 --- a/internal/handlers/settings.go +++ b/internal/handlers/settings.go @@ -44,6 +44,7 @@ func (h *SettingsHandler) Register(e *echo.Echo) { // @Summary Get user settings // @Description Get agent settings for current user // @Tags settings +// @Param bot_id path string true "Bot ID" // @Success 200 {object} settings.Settings // @Failure 400 {object} ErrorResponse // @Failure 500 {object} ErrorResponse @@ -71,6 +72,7 @@ func (h *SettingsHandler) Get(c echo.Context) error { // @Summary Update user settings // @Description Update or create agent settings for current user // @Tags settings +// @Param bot_id path string true "Bot ID" // @Param payload body settings.UpsertRequest true "Settings payload" // @Success 200 {object} settings.Settings // @Failure 400 {object} ErrorResponse @@ -104,6 +106,7 @@ func (h *SettingsHandler) Upsert(c echo.Context) error { // @Summary Delete user settings // @Description Remove agent settings for current user // @Tags settings +// @Param bot_id path string true "Bot ID" // @Success 204 "No Content" // @Failure 400 {object} ErrorResponse // @Failure 500 {object} ErrorResponse diff --git a/internal/handlers/subagent.go b/internal/handlers/subagent.go index 67f95467..21ce1335 100644 --- a/internal/handlers/subagent.go +++ b/internal/handlers/subagent.go @@ -50,6 +50,7 @@ func (h *SubagentHandler) Register(e *echo.Echo) { // @Summary Create subagent // @Description Create a subagent for current user // @Tags subagent +// @Param bot_id path string true "Bot ID" // @Param payload body subagent.CreateRequest true "Subagent payload" // @Success 201 {object} subagent.Subagent // @Failure 400 {object} ErrorResponse @@ -82,6 +83,7 @@ func (h *SubagentHandler) Create(c echo.Context) error { // @Summary List subagents // @Description List subagents for current user // @Tags subagent +// @Param bot_id path string true "Bot ID" // @Success 200 {object} subagent.ListResponse // @Failure 400 {object} ErrorResponse // @Failure 500 {object} ErrorResponse @@ -109,6 +111,7 @@ func (h *SubagentHandler) List(c echo.Context) error { // @Summary Get subagent // @Description Get a subagent by ID // @Tags subagent +// @Param bot_id path string true "Bot ID" // @Param id path string true "Subagent ID" // @Success 200 {object} subagent.Subagent // @Failure 400 {object} ErrorResponse @@ -145,6 +148,7 @@ func (h *SubagentHandler) Get(c echo.Context) error { // @Summary Update subagent // @Description Update a subagent by ID // @Tags subagent +// @Param bot_id path string true "Bot ID" // @Param id path string true "Subagent ID" // @Param payload body subagent.UpdateRequest true "Subagent payload" // @Success 200 {object} subagent.Subagent @@ -190,6 +194,7 @@ func (h *SubagentHandler) Update(c echo.Context) error { // @Summary Delete subagent // @Description Delete a subagent by ID // @Tags subagent +// @Param bot_id path string true "Bot ID" // @Param id path string true "Subagent ID" // @Success 204 "No Content" // @Failure 400 {object} ErrorResponse @@ -229,6 +234,7 @@ func (h *SubagentHandler) Delete(c echo.Context) error { // @Summary Get subagent context // @Description Get a subagent's message context // @Tags subagent +// @Param bot_id path string true "Bot ID" // @Param id path string true "Subagent ID" // @Success 200 {object} subagent.ContextResponse // @Failure 400 {object} ErrorResponse @@ -265,6 +271,7 @@ func (h *SubagentHandler) GetContext(c echo.Context) error { // @Summary Update subagent context // @Description Update a subagent's message context // @Tags subagent +// @Param bot_id path string true "Bot ID" // @Param id path string true "Subagent ID" // @Param payload body subagent.UpdateContextRequest true "Context payload" // @Success 200 {object} subagent.ContextResponse @@ -310,6 +317,7 @@ func (h *SubagentHandler) UpdateContext(c echo.Context) error { // @Summary Get subagent skills // @Description Get a subagent's skills // @Tags subagent +// @Param bot_id path string true "Bot ID" // @Param id path string true "Subagent ID" // @Success 200 {object} subagent.SkillsResponse // @Failure 400 {object} ErrorResponse @@ -346,6 +354,7 @@ func (h *SubagentHandler) GetSkills(c echo.Context) error { // @Summary Update subagent skills // @Description Replace a subagent's skills // @Tags subagent +// @Param bot_id path string true "Bot ID" // @Param id path string true "Subagent ID" // @Param payload body subagent.UpdateSkillsRequest true "Skills payload" // @Success 200 {object} subagent.SkillsResponse @@ -391,6 +400,7 @@ func (h *SubagentHandler) UpdateSkills(c echo.Context) error { // @Summary Add subagent skills // @Description Add skills to a subagent // @Tags subagent +// @Param bot_id path string true "Bot ID" // @Param id path string true "Subagent ID" // @Param payload body subagent.AddSkillsRequest true "Skills payload" // @Success 200 {object} subagent.SkillsResponse diff --git a/internal/mcp/connections.go b/internal/mcp/connections.go index f08ba91d..0a829b1d 100644 --- a/internal/mcp/connections.go +++ b/internal/mcp/connections.go @@ -14,14 +14,14 @@ import ( // Connection represents a stored MCP connection for a bot. type Connection struct { - ID string `json:"id"` - BotID string `json:"bot_id"` - Name string `json:"name"` - Type string `json:"type"` - Config map[string]any `json:"config"` - Active bool `json:"active"` - CreatedAt time.Time `json:"created_at"` - UpdatedAt time.Time `json:"updated_at"` + ID string `json:"id" validate:"required"` + BotID string `json:"bot_id" validate:"required"` + Name string `json:"name" validate:"required"` + Type string `json:"type" validate:"required"` + Config map[string]any `json:"config" validate:"required"` + Active bool `json:"active" validate:"required"` + CreatedAt time.Time `json:"created_at" validate:"required"` + UpdatedAt time.Time `json:"updated_at" validate:"required"` } // UpsertRequest is the payload for creating or updating MCP connections. diff --git a/internal/models/types.go b/internal/models/types.go index c0ef4df2..c8252bb4 100644 --- a/internal/models/types.go +++ b/internal/models/types.go @@ -32,13 +32,13 @@ const ( ) type Model struct { - ModelID string `json:"model_id"` - Name string `json:"name"` - LlmProviderID string `json:"llm_provider_id"` - IsMultimodal bool `json:"is_multimodal"` - Input []string `json:"input"` - Type ModelType `json:"type"` - Dimensions int `json:"dimensions"` + ModelID string `json:"model_id" validate:"required"` + Name string `json:"name" validate:"required"` + LlmProviderID string `json:"llm_provider_id" validate:"required"` + IsMultimodal bool `json:"is_multimodal"` + Input []string `json:"input"` + Type ModelType `json:"type" validate:"required"` + Dimensions int `json:"dimensions"` } func (m *Model) Validate() error { diff --git a/internal/providers/types.go b/internal/providers/types.go index 4eec664e..e2556f64 100644 --- a/internal/providers/types.go +++ b/internal/providers/types.go @@ -33,14 +33,14 @@ type UpdateRequest struct { // GetResponse represents the response for getting a provider type GetResponse struct { - ID string `json:"id"` - Name string `json:"name"` - ClientType string `json:"client_type"` - BaseURL string `json:"base_url"` + ID string `json:"id" validate:"required"` + Name string `json:"name" validate:"required"` + ClientType string `json:"client_type" validate:"required"` + BaseURL string `json:"base_url" validate:"required"` APIKey string `json:"api_key,omitempty"` // masked in response Metadata map[string]any `json:"metadata,omitempty"` - CreatedAt time.Time `json:"created_at"` - UpdatedAt time.Time `json:"updated_at"` + CreatedAt time.Time `json:"created_at" validate:"required"` + UpdatedAt time.Time `json:"updated_at" validate:"required"` } // ListResponse represents the response for listing providers diff --git a/internal/settings/types.go b/internal/settings/types.go index f750f8ff..9950566c 100644 --- a/internal/settings/types.go +++ b/internal/settings/types.go @@ -6,12 +6,12 @@ const ( ) type Settings struct { - ChatModelID string `json:"chat_model_id"` - MemoryModelID string `json:"memory_model_id"` - EmbeddingModelID string `json:"embedding_model_id"` - MaxContextLoadTime int `json:"max_context_load_time"` - Language string `json:"language"` - AllowGuest bool `json:"allow_guest"` + ChatModelID string `json:"chat_model_id" validate:"required"` + MemoryModelID string `json:"memory_model_id" validate:"required"` + EmbeddingModelID string `json:"embedding_model_id" validate:"required"` + MaxContextLoadTime int `json:"max_context_load_time" validate:"required"` + Language string `json:"language" validate:"required"` + AllowGuest bool `json:"allow_guest" validate:"required"` } type UpsertRequest struct { diff --git a/packages/sdk/package.json b/packages/sdk/package.json index e7a617bf..48dedfb9 100644 --- a/packages/sdk/package.json +++ b/packages/sdk/package.json @@ -3,11 +3,21 @@ "version": "1.0.0", "description": "", "exports": { - ".": "./src/index.ts" + ".": "./src/index.ts", + "./client": "./src/client.gen.ts", + "./colada": "./src/@pinia/colada.gen.ts" }, "main": "index.js", "scripts": { }, - "packageManager": "pnpm@10.27.0" + "packageManager": "pnpm@10.27.0", + "peerDependencies": { + "@pinia/colada": ">=0.21.0" + }, + "peerDependenciesMeta": { + "@pinia/colada": { + "optional": true + } + } } diff --git a/packages/sdk/src/@pinia/colada.gen.ts b/packages/sdk/src/@pinia/colada.gen.ts index c5d89102..acb165a5 100644 --- a/packages/sdk/src/@pinia/colada.gen.ts +++ b/packages/sdk/src/@pinia/colada.gen.ts @@ -444,14 +444,14 @@ export const deleteBotsByBotIdHistoryMutation = (options?: Partial) => createQueryKey('getBotsByBotIdHistory', options); +export const getBotsByBotIdHistoryQueryKey = (options: Options) => createQueryKey('getBotsByBotIdHistory', options); /** * List history records * * List history records for current user */ -export const getBotsByBotIdHistoryQuery = defineQueryOptions((options?: Options) => ({ +export const getBotsByBotIdHistoryQuery = defineQueryOptions((options: Options) => ({ key: getBotsByBotIdHistoryQueryKey(options), query: async (context) => { const { data } = await getBotsByBotIdHistory({ @@ -514,14 +514,14 @@ export const getBotsByBotIdHistoryByIdQuery = defineQueryOptions((options: Optio } })); -export const getBotsByBotIdMcpQueryKey = (options?: Options) => createQueryKey('getBotsByBotIdMcp', options); +export const getBotsByBotIdMcpQueryKey = (options: Options) => createQueryKey('getBotsByBotIdMcp', options); /** * List MCP connections * * List MCP connections for a bot */ -export const getBotsByBotIdMcpQuery = defineQueryOptions((options?: Options) => ({ +export const getBotsByBotIdMcpQuery = defineQueryOptions((options: Options) => ({ key: getBotsByBotIdMcpQueryKey(options), query: async (context) => { const { data } = await getBotsByBotIdMcp({ @@ -680,14 +680,14 @@ export const deleteBotsByBotIdMemoryMemoriesMutation = (options?: Partial