chore: initialize qiming workspace repository
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>com.xspaceagi</groupId>
|
||||
<artifactId>app-platform-sandbox</artifactId>
|
||||
<version>0.0.1-SNAPSHOT</version>
|
||||
</parent>
|
||||
<groupId>com.xspaceagi</groupId>
|
||||
<artifactId>app-platform-sandbox-sdk</artifactId>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>com.xspaceagi</groupId>
|
||||
<artifactId>app-platform-sandbox-spec</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
||||
@@ -0,0 +1,68 @@
|
||||
package com.xspaceagi.sandbox.sdk.server;
|
||||
|
||||
import com.xspaceagi.sandbox.sdk.service.dto.SandboxConfigRpcDto;
|
||||
import com.xspaceagi.sandbox.sdk.service.dto.SandboxGlobalConfigDto;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 沙盒配置 RPC 服务接口
|
||||
*/
|
||||
public interface ISandboxConfigRpcService {
|
||||
|
||||
/**
|
||||
* 查询用户配置列表
|
||||
*
|
||||
* @param userId 用户ID
|
||||
* @return 配置列表
|
||||
*/
|
||||
List<SandboxConfigRpcDto> queryUserConfigs(Long userId);
|
||||
|
||||
/**
|
||||
* 查询全局配置列表(通用智能体沙箱)
|
||||
*
|
||||
* @return 配置列表
|
||||
*/
|
||||
List<SandboxConfigRpcDto> queryGlobalConfigs(Long tenantId);
|
||||
|
||||
/**
|
||||
* 根据配置键查询用户配置
|
||||
*
|
||||
* @param configKey 配置键
|
||||
* @return 配置信息
|
||||
*/
|
||||
SandboxConfigRpcDto queryUserConfigByKey(String configKey);
|
||||
|
||||
/**
|
||||
* 根据配置键查询全局配置
|
||||
*
|
||||
* @param configKey 配置键
|
||||
* @return 配置信息
|
||||
*/
|
||||
SandboxConfigRpcDto queryGlobalConfigByKey(String configKey);
|
||||
|
||||
/**
|
||||
* 根据ID查询配置
|
||||
*
|
||||
* @param id 配置ID
|
||||
* @return 配置信息
|
||||
*/
|
||||
SandboxConfigRpcDto queryById(Long id);
|
||||
|
||||
|
||||
SandboxGlobalConfigDto getGlobalConfig(Long tenantId);
|
||||
|
||||
Long queryUserSelectedSandboxId(Long userId, Long agentId);
|
||||
|
||||
/**
|
||||
* 选择应用开发沙盒
|
||||
*
|
||||
* @param tenantId 租户ID
|
||||
* @param userId 用户ID
|
||||
* @param spaceId 空间ID
|
||||
* @param projectId 项目ID
|
||||
* @param sandboxId 沙盒ID,可选,项目如果已经有了就传递
|
||||
* @return 沙盒信息
|
||||
*/
|
||||
SandboxConfigRpcDto selectAppDevelopmentSandbox(Long tenantId, Long userId, Long spaceId, Long projectId, Long sandboxId);
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
package com.xspaceagi.sandbox.sdk.service.dto;
|
||||
|
||||
import com.xspaceagi.sandbox.sdk.service.enums.IsolationEnum;
|
||||
import com.xspaceagi.sandbox.spec.enums.SandboxScopeEnum;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 沙盒配置 RPC DTO
|
||||
*/
|
||||
@Schema(description = "沙盒配置信息(RPC)")
|
||||
@Data
|
||||
public class SandboxConfigRpcDto implements Serializable {
|
||||
|
||||
@Schema(description = "配置ID")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "配置范围:global-全局配置 user-个人配置")
|
||||
private SandboxScopeEnum scope;
|
||||
|
||||
@Schema(description = "用户ID(scope为user时必填)")
|
||||
private Long userId;
|
||||
|
||||
@Schema(description = "配置名称")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "唯一标识")
|
||||
private String configKey;
|
||||
|
||||
@Schema(description = "配置值,服务器端沙盒配置信息")
|
||||
private SandboxConfigValue configValue;
|
||||
|
||||
@Schema(description = "沙盒服务器信息(qimingclaw客户端专用)")
|
||||
private SandboxServerInfo sandboxServerInfo;
|
||||
|
||||
@Schema(description = "配置描述")
|
||||
private String description;
|
||||
|
||||
@Schema(description = "是否启用:true-启用 false-禁用")
|
||||
private Boolean isActive;
|
||||
|
||||
@Schema(description = "是否在线:true-在线 false-离线")
|
||||
private boolean online;
|
||||
|
||||
@Schema(description = "隔离级别")
|
||||
private IsolationEnum isolation;
|
||||
|
||||
@Schema(description = "隔离标识")
|
||||
private String isolationKey;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
private Date created;
|
||||
|
||||
@Schema(description = "更新时间")
|
||||
private Date modified;
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package com.xspaceagi.sandbox.sdk.service.dto;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 沙盒配置值(RPC)
|
||||
*/
|
||||
@Schema(description = "沙盒配置值")
|
||||
@Data
|
||||
public class SandboxConfigValue {
|
||||
|
||||
@Schema(description = "服务根地址,例如 http://192.168.1.11,不允许携带端口")
|
||||
private String hostWithScheme;
|
||||
|
||||
@Schema(description = "Agent服务端口")
|
||||
private int agentPort;
|
||||
|
||||
@Schema(description = "VNC服务端口")
|
||||
private int vncPort;
|
||||
|
||||
@Schema(description = "文件服务端口")
|
||||
private int fileServerPort;
|
||||
|
||||
@Schema(description = "API密钥")
|
||||
private String apiKey;
|
||||
|
||||
@Schema(description = "最大用户数")
|
||||
private Integer maxUsers;
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.xspaceagi.sandbox.sdk.service.dto;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
@Schema(description = "沙盒全局配置")
|
||||
@Data
|
||||
public class SandboxGlobalConfigDto {
|
||||
|
||||
@Schema(description = "每个用户分配的内存大小")
|
||||
private String perUserMemoryGB;
|
||||
|
||||
@Schema(description = "每个用户分配的CPU核数")
|
||||
private String perUserCpuCores;
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package com.xspaceagi.sandbox.sdk.service.dto;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 沙盒配置值
|
||||
*/
|
||||
@Schema(description = "沙盒服务端内部交互信息")
|
||||
@Data
|
||||
public class SandboxServerInfo {
|
||||
|
||||
@Schema(description = "协议")
|
||||
private String scheme;
|
||||
|
||||
@Schema(description = "主机地址")
|
||||
private String host;
|
||||
|
||||
@Schema(description = "Agent服务端口")
|
||||
private int agentPort;
|
||||
|
||||
@Schema(description = "VNC服务端口")
|
||||
private int vncPort;
|
||||
|
||||
@Schema(description = "文件服务端口")
|
||||
private int fileServerPort;
|
||||
|
||||
@Schema(description = "API密钥")
|
||||
private String apiKey;
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
package com.xspaceagi.sandbox.sdk.service.enums;
|
||||
|
||||
public enum IsolationEnum {
|
||||
Tenant,
|
||||
Space,
|
||||
Project
|
||||
}
|
||||
Reference in New Issue
Block a user