feat: support file operations inside containers (#12160)

Refs #523
This commit is contained in:
ssongliu
2026-03-12 09:33:33 +00:00
committed by GitHub
parent 341a55ae63
commit 176fd0f8ad
13 changed files with 2219 additions and 6 deletions
+543
View File
@@ -523,6 +523,79 @@ const docTemplate = `{
]
}
},
"/ai/agents/channel/qqbot/get": {
"post": {
"consumes": [
"application/json"
],
"parameters": [
{
"description": "request",
"in": "body",
"name": "request",
"required": true,
"schema": {
"$ref": "#/definitions/dto.AgentQQBotConfigReq"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/dto.AgentQQBotConfig"
}
}
},
"security": [
{
"ApiKeyAuth": []
},
{
"Timestamp": []
}
],
"summary": "Get Agent QQ Bot channel config",
"tags": [
"AI"
]
}
},
"/ai/agents/channel/qqbot/update": {
"post": {
"consumes": [
"application/json"
],
"parameters": [
{
"description": "request",
"in": "body",
"name": "request",
"required": true,
"schema": {
"$ref": "#/definitions/dto.AgentQQBotConfigUpdateReq"
}
}
],
"responses": {
"200": {
"description": "OK"
}
},
"security": [
{
"ApiKeyAuth": []
},
{
"Timestamp": []
}
],
"summary": "Update Agent QQ Bot channel config",
"tags": [
"AI"
]
}
},
"/ai/agents/channel/telegram/get": {
"post": {
"consumes": [
@@ -739,6 +812,79 @@ const docTemplate = `{
]
}
},
"/ai/agents/plugin/check": {
"post": {
"consumes": [
"application/json"
],
"parameters": [
{
"description": "request",
"in": "body",
"name": "request",
"required": true,
"schema": {
"$ref": "#/definitions/dto.AgentPluginCheckReq"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/dto.AgentPluginStatus"
}
}
},
"security": [
{
"ApiKeyAuth": []
},
{
"Timestamp": []
}
],
"summary": "Check Agent plugin installation status",
"tags": [
"AI"
]
}
},
"/ai/agents/plugin/install": {
"post": {
"consumes": [
"application/json"
],
"parameters": [
{
"description": "request",
"in": "body",
"name": "request",
"required": true,
"schema": {
"$ref": "#/definitions/dto.AgentPluginInstallReq"
}
}
],
"responses": {
"200": {
"description": "OK"
}
},
"security": [
{
"ApiKeyAuth": []
},
{
"Timestamp": []
}
],
"summary": "Install Agent plugin",
"tags": [
"AI"
]
}
},
"/ai/agents/providers": {
"get": {
"responses": {
@@ -4095,6 +4241,225 @@ const docTemplate = `{
]
}
},
"/containers/files/content": {
"post": {
"consumes": [
"application/json"
],
"parameters": [
{
"description": "request",
"in": "body",
"name": "request",
"required": true,
"schema": {
"$ref": "#/definitions/dto.ContainerFileReq"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/dto.ContainerFileContent"
}
}
},
"security": [
{
"ApiKeyAuth": []
},
{
"Timestamp": []
}
],
"summary": "Get container file content",
"tags": [
"Container"
]
}
},
"/containers/files/del": {
"post": {
"consumes": [
"application/json"
],
"parameters": [
{
"description": "request",
"in": "body",
"name": "request",
"required": true,
"schema": {
"$ref": "#/definitions/dto.ContainerFileBatchDeleteReq"
}
}
],
"responses": {
"200": {
"description": "OK"
}
},
"security": [
{
"ApiKeyAuth": []
},
{
"Timestamp": []
}
],
"summary": "Delete container file",
"tags": [
"Container"
]
}
},
"/containers/files/download": {
"post": {
"consumes": [
"application/json"
],
"responses": {},
"security": [
{
"ApiKeyAuth": []
},
{
"Timestamp": []
}
],
"summary": "Download container file",
"tags": [
"Container"
]
}
},
"/containers/files/search": {
"post": {
"consumes": [
"application/json"
],
"parameters": [
{
"description": "request",
"in": "body",
"name": "request",
"required": true,
"schema": {
"$ref": "#/definitions/dto.ContainerFileReq"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"items": {
"$ref": "#/definitions/dto.ContainerFileInfo"
},
"type": "array"
}
}
},
"security": [
{
"ApiKeyAuth": []
},
{
"Timestamp": []
}
],
"summary": "List container files",
"tags": [
"Container"
]
}
},
"/containers/files/size": {
"post": {
"consumes": [
"application/json"
],
"parameters": [
{
"description": "request",
"in": "body",
"name": "request",
"required": true,
"schema": {
"$ref": "#/definitions/dto.ContainerFileReq"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "int"
}
}
},
"security": [
{
"ApiKeyAuth": []
},
{
"Timestamp": []
}
],
"summary": "Get container file size",
"tags": [
"Container"
]
}
},
"/containers/files/upload": {
"post": {
"consumes": [
"multipart/form-data"
],
"parameters": [
{
"description": "containerID",
"in": "formData",
"name": "containerID",
"required": true,
"type": "string"
},
{
"description": "path",
"in": "formData",
"name": "path",
"required": true,
"type": "string"
},
{
"description": "file",
"in": "formData",
"name": "file",
"required": true,
"type": "file"
}
],
"responses": {
"200": {
"description": "OK"
}
},
"security": [
{
"ApiKeyAuth": []
},
{
"Timestamp": []
}
],
"summary": "Upload container file",
"tags": [
"Container"
]
}
},
"/containers/image": {
"get": {
"produces": [
@@ -23746,6 +24111,104 @@ const docTemplate = `{
],
"type": "object"
},
"dto.AgentPluginCheckReq": {
"properties": {
"agentId": {
"type": "integer"
},
"type": {
"enum": [
"qqbot"
],
"type": "string"
}
},
"required": [
"agentId",
"type"
],
"type": "object"
},
"dto.AgentPluginInstallReq": {
"properties": {
"agentId": {
"type": "integer"
},
"taskID": {
"type": "string"
},
"type": {
"enum": [
"qqbot"
],
"type": "string"
}
},
"required": [
"agentId",
"taskID",
"type"
],
"type": "object"
},
"dto.AgentPluginStatus": {
"properties": {
"installed": {
"type": "boolean"
}
},
"type": "object"
},
"dto.AgentQQBotConfig": {
"properties": {
"appId": {
"type": "string"
},
"clientSecret": {
"type": "string"
},
"enabled": {
"type": "boolean"
},
"installed": {
"type": "boolean"
}
},
"type": "object"
},
"dto.AgentQQBotConfigReq": {
"properties": {
"agentId": {
"type": "integer"
}
},
"required": [
"agentId"
],
"type": "object"
},
"dto.AgentQQBotConfigUpdateReq": {
"properties": {
"agentId": {
"type": "integer"
},
"appId": {
"type": "string"
},
"clientSecret": {
"type": "string"
},
"enabled": {
"type": "boolean"
}
},
"required": [
"agentId",
"appId",
"clientSecret"
],
"type": "object"
},
"dto.AgentTelegramConfig": {
"properties": {
"botToken": {
@@ -25035,6 +25498,86 @@ const docTemplate = `{
],
"type": "object"
},
"dto.ContainerFileBatchDeleteReq": {
"properties": {
"containerID": {
"type": "string"
},
"paths": {
"items": {
"type": "string"
},
"minItems": 1,
"type": "array"
}
},
"required": [
"containerID",
"paths"
],
"type": "object"
},
"dto.ContainerFileContent": {
"properties": {
"content": {
"type": "string"
},
"isBinary": {
"type": "boolean"
},
"size": {
"type": "integer"
},
"truncated": {
"type": "boolean"
}
},
"type": "object"
},
"dto.ContainerFileInfo": {
"properties": {
"isDir": {
"type": "boolean"
},
"isLink": {
"type": "boolean"
},
"linkTo": {
"type": "string"
},
"modTime": {
"type": "string"
},
"mode": {
"type": "string"
},
"name": {
"type": "string"
},
"path": {
"type": "string"
},
"size": {
"type": "integer"
}
},
"type": "object"
},
"dto.ContainerFileReq": {
"properties": {
"containerID": {
"type": "string"
},
"path": {
"type": "string"
}
},
"required": [
"containerID",
"path"
],
"type": "object"
},
"dto.ContainerItemStats": {
"properties": {
"buildCacheReclaimable": {
+543
View File
@@ -519,6 +519,79 @@
]
}
},
"/ai/agents/channel/qqbot/get": {
"post": {
"consumes": [
"application/json"
],
"parameters": [
{
"description": "request",
"in": "body",
"name": "request",
"required": true,
"schema": {
"$ref": "#/definitions/dto.AgentQQBotConfigReq"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/dto.AgentQQBotConfig"
}
}
},
"security": [
{
"ApiKeyAuth": []
},
{
"Timestamp": []
}
],
"summary": "Get Agent QQ Bot channel config",
"tags": [
"AI"
]
}
},
"/ai/agents/channel/qqbot/update": {
"post": {
"consumes": [
"application/json"
],
"parameters": [
{
"description": "request",
"in": "body",
"name": "request",
"required": true,
"schema": {
"$ref": "#/definitions/dto.AgentQQBotConfigUpdateReq"
}
}
],
"responses": {
"200": {
"description": "OK"
}
},
"security": [
{
"ApiKeyAuth": []
},
{
"Timestamp": []
}
],
"summary": "Update Agent QQ Bot channel config",
"tags": [
"AI"
]
}
},
"/ai/agents/channel/telegram/get": {
"post": {
"consumes": [
@@ -735,6 +808,79 @@
]
}
},
"/ai/agents/plugin/check": {
"post": {
"consumes": [
"application/json"
],
"parameters": [
{
"description": "request",
"in": "body",
"name": "request",
"required": true,
"schema": {
"$ref": "#/definitions/dto.AgentPluginCheckReq"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/dto.AgentPluginStatus"
}
}
},
"security": [
{
"ApiKeyAuth": []
},
{
"Timestamp": []
}
],
"summary": "Check Agent plugin installation status",
"tags": [
"AI"
]
}
},
"/ai/agents/plugin/install": {
"post": {
"consumes": [
"application/json"
],
"parameters": [
{
"description": "request",
"in": "body",
"name": "request",
"required": true,
"schema": {
"$ref": "#/definitions/dto.AgentPluginInstallReq"
}
}
],
"responses": {
"200": {
"description": "OK"
}
},
"security": [
{
"ApiKeyAuth": []
},
{
"Timestamp": []
}
],
"summary": "Install Agent plugin",
"tags": [
"AI"
]
}
},
"/ai/agents/providers": {
"get": {
"responses": {
@@ -4091,6 +4237,225 @@
]
}
},
"/containers/files/content": {
"post": {
"consumes": [
"application/json"
],
"parameters": [
{
"description": "request",
"in": "body",
"name": "request",
"required": true,
"schema": {
"$ref": "#/definitions/dto.ContainerFileReq"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/dto.ContainerFileContent"
}
}
},
"security": [
{
"ApiKeyAuth": []
},
{
"Timestamp": []
}
],
"summary": "Get container file content",
"tags": [
"Container"
]
}
},
"/containers/files/del": {
"post": {
"consumes": [
"application/json"
],
"parameters": [
{
"description": "request",
"in": "body",
"name": "request",
"required": true,
"schema": {
"$ref": "#/definitions/dto.ContainerFileBatchDeleteReq"
}
}
],
"responses": {
"200": {
"description": "OK"
}
},
"security": [
{
"ApiKeyAuth": []
},
{
"Timestamp": []
}
],
"summary": "Delete container file",
"tags": [
"Container"
]
}
},
"/containers/files/download": {
"post": {
"consumes": [
"application/json"
],
"responses": {},
"security": [
{
"ApiKeyAuth": []
},
{
"Timestamp": []
}
],
"summary": "Download container file",
"tags": [
"Container"
]
}
},
"/containers/files/search": {
"post": {
"consumes": [
"application/json"
],
"parameters": [
{
"description": "request",
"in": "body",
"name": "request",
"required": true,
"schema": {
"$ref": "#/definitions/dto.ContainerFileReq"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"items": {
"$ref": "#/definitions/dto.ContainerFileInfo"
},
"type": "array"
}
}
},
"security": [
{
"ApiKeyAuth": []
},
{
"Timestamp": []
}
],
"summary": "List container files",
"tags": [
"Container"
]
}
},
"/containers/files/size": {
"post": {
"consumes": [
"application/json"
],
"parameters": [
{
"description": "request",
"in": "body",
"name": "request",
"required": true,
"schema": {
"$ref": "#/definitions/dto.ContainerFileReq"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "int"
}
}
},
"security": [
{
"ApiKeyAuth": []
},
{
"Timestamp": []
}
],
"summary": "Get container file size",
"tags": [
"Container"
]
}
},
"/containers/files/upload": {
"post": {
"consumes": [
"multipart/form-data"
],
"parameters": [
{
"description": "containerID",
"in": "formData",
"name": "containerID",
"required": true,
"type": "string"
},
{
"description": "path",
"in": "formData",
"name": "path",
"required": true,
"type": "string"
},
{
"description": "file",
"in": "formData",
"name": "file",
"required": true,
"type": "file"
}
],
"responses": {
"200": {
"description": "OK"
}
},
"security": [
{
"ApiKeyAuth": []
},
{
"Timestamp": []
}
],
"summary": "Upload container file",
"tags": [
"Container"
]
}
},
"/containers/image": {
"get": {
"produces": [
@@ -23742,6 +24107,104 @@
],
"type": "object"
},
"dto.AgentPluginCheckReq": {
"properties": {
"agentId": {
"type": "integer"
},
"type": {
"enum": [
"qqbot"
],
"type": "string"
}
},
"required": [
"agentId",
"type"
],
"type": "object"
},
"dto.AgentPluginInstallReq": {
"properties": {
"agentId": {
"type": "integer"
},
"taskID": {
"type": "string"
},
"type": {
"enum": [
"qqbot"
],
"type": "string"
}
},
"required": [
"agentId",
"taskID",
"type"
],
"type": "object"
},
"dto.AgentPluginStatus": {
"properties": {
"installed": {
"type": "boolean"
}
},
"type": "object"
},
"dto.AgentQQBotConfig": {
"properties": {
"appId": {
"type": "string"
},
"clientSecret": {
"type": "string"
},
"enabled": {
"type": "boolean"
},
"installed": {
"type": "boolean"
}
},
"type": "object"
},
"dto.AgentQQBotConfigReq": {
"properties": {
"agentId": {
"type": "integer"
}
},
"required": [
"agentId"
],
"type": "object"
},
"dto.AgentQQBotConfigUpdateReq": {
"properties": {
"agentId": {
"type": "integer"
},
"appId": {
"type": "string"
},
"clientSecret": {
"type": "string"
},
"enabled": {
"type": "boolean"
}
},
"required": [
"agentId",
"appId",
"clientSecret"
],
"type": "object"
},
"dto.AgentTelegramConfig": {
"properties": {
"botToken": {
@@ -25031,6 +25494,86 @@
],
"type": "object"
},
"dto.ContainerFileBatchDeleteReq": {
"properties": {
"containerID": {
"type": "string"
},
"paths": {
"items": {
"type": "string"
},
"minItems": 1,
"type": "array"
}
},
"required": [
"containerID",
"paths"
],
"type": "object"
},
"dto.ContainerFileContent": {
"properties": {
"content": {
"type": "string"
},
"isBinary": {
"type": "boolean"
},
"size": {
"type": "integer"
},
"truncated": {
"type": "boolean"
}
},
"type": "object"
},
"dto.ContainerFileInfo": {
"properties": {
"isDir": {
"type": "boolean"
},
"isLink": {
"type": "boolean"
},
"linkTo": {
"type": "string"
},
"modTime": {
"type": "string"
},
"mode": {
"type": "string"
},
"name": {
"type": "string"
},
"path": {
"type": "string"
},
"size": {
"type": "integer"
}
},
"type": "object"
},
"dto.ContainerFileReq": {
"properties": {
"containerID": {
"type": "string"
},
"path": {
"type": "string"
}
},
"required": [
"containerID",
"path"
],
"type": "object"
},
"dto.ContainerItemStats": {
"properties": {
"buildCacheReclaimable": {
+30
View File
@@ -368,6 +368,36 @@
"formatZH": "docker 服务 [operation]",
"formatEN": "[operation] docker service"
},
"/containers/files/del": {
"bodyKeys": [
"containerID",
"paths"
],
"paramKeys": [],
"beforeFunctions": [],
"formatZH": "删除容器 [containerID] 文件 [paths]",
"formatEN": "Delete files [paths] in container [containerID]"
},
"/containers/files/download": {
"bodyKeys": [
"containerID",
"path"
],
"paramKeys": [],
"beforeFunctions": [],
"formatZH": "下载容器 [containerID] 文件 [path]",
"formatEN": "Download file [path] from container [containerID]"
},
"/containers/files/upload": {
"bodyKeys": [
"containerID",
"path"
],
"paramKeys": [],
"beforeFunctions": [],
"formatZH": "容器 [containerID] 上传文件到 [path]",
"formatEN": "Upload file to [path] in container [containerID]"
},
"/containers/image/build": {
"bodyKeys": [
"name"