feat: manually mirror opencoze's code from bytedance

Change-Id: I09a73aadda978ad9511264a756b2ce51f5761adf
This commit is contained in:
fanlv
2025-07-20 17:36:12 +08:00
commit 890153324f
14811 changed files with 1923430 additions and 0 deletions

View File

@@ -0,0 +1,70 @@
namespace go flow.devops.debugger.domain.infra
// ComponentType 支持组件类型
enum ComponentType {
Undefined = 0
CozePlugin = 10000 // Coze Plugin
CozeTool = 10001 // Coze Tool
CozeWorkflow = 10002 // Coze Workflow
CozeSubWorkflow = 10003 // Coze SubWorkflow即在Workflow中被引用的子Workflow
CozeLLMNode = 10004 // Coze workflow中的LLM节点
CozeCodeNode = 10005 // Coze workflow中的Code节点
CozeKnowledgeNode = 10006 // Coze workflow中的Knowledge节点
CozeToolNode = 10007 // Coze workflow中的Tool节点
CozeStartNode = 10008 // Coze workflow中的start节点
CozeVariableNode = 10009 // Coze workflow中的variable节点
CozeVariableBot = 20000 // Coze 虚拟节点用于标识 variable 依赖的bot
CozeVariableChat = 20001 // Coze 虚拟节点用于标识 variable 依赖的chat
}
// TrafficScene 流量请求场景
enum TrafficScene {
Undefined = 0
CozeSingleAgentDebug = 10000 // 单Agent调试页
CozeMultiAgentDebug = 10001 // 多Agent调试页
CozeToolDebug = 10002 // Tool调试页
CozeWorkflowDebug = 10003 // Workflow调试页
}
// ComponentMappingType 组件映射类型
enum ComponentMappingType {
Undefined = 0
MockSet = 1
}
// BizCtx 业务上下文
struct BizCtx {
1: optional string connectorID // connectorID
2: optional string connectorUID // connector下用户ID
3: optional TrafficScene trafficScene // 业务场景
4: optional string trafficCallerID // 业务场景组件ID比如Bot调试页则trafficSceneID为BotID
5: optional string bizSpaceID // 业务线SpaceID用于访问控制
6: optional map<string,string> ext // 额外信息
}
// ComponentSubject 业务组件的二级结构
struct ComponentSubject {
1: optional string componentID // 组件ID例如Tool ID、Node ID等
2: optional ComponentType componentType // 组件类型
3: optional string parentComponentID // 父组件ID例如Tool->Plugin, Node->Workflow
4: optional ComponentType parentComponentType // 父组件类型
}
enum OrderBy {
UpdateTime = 1
}
struct Creator {
1: optional string ID
2: optional string name
3: optional string avatarUrl
}
enum DebugScene {
Debug = 0 // 默认play ground Debug场景
}
enum CozeChannel {
Coze = 0 // 默认为Coze, 未来扩展到其他渠道
}

View File

@@ -0,0 +1,21 @@
namespace go flow.devops.debugger.domain.testcase
include "infra.thrift"
struct CaseDataBase {
1: optional i64 caseID (go.tag="json:\"caseID,string\"")// 新增时不填,更新时填写
2: optional string name
3: optional string description
4: optional string input // json格式的输入信息
5: optional bool isDefault
}
struct CaseDataDetail{
1: optional CaseDataBase caseBase
2: optional string creatorID
3: optional i64 createTimeInSec
4: optional i64 updateTimeInSec
5: optional bool schemaIncompatible // schema不兼容
6: optional infra.Creator updater,
}

View File

@@ -0,0 +1,70 @@
namespace go flow.devops.debugger.coze
include "../../../base.thrift"
include "./domain/infra.thrift"
include "./domain/testcase.thrift"
// ========== TestCase =========== //
struct SaveCaseDataReq {
1: optional infra.BizCtx bizCtx // 业务信息
2: optional infra.ComponentSubject bizComponentSubject
3: optional testcase.CaseDataBase caseBase // case基本数据
255: optional base.Base Base
}
struct SaveCaseDataResp {
1: optional testcase.CaseDataDetail caseDetail
253: optional i32 code
254: optional string msg
255: optional base.BaseResp BaseResp
}
struct DeleteCaseDataReq {
1: optional infra.BizCtx bizCtx // 业务信息
2: optional list<i64> caseIDs // 单次上限20个
255: optional base.Base Base
}
struct DeleteCaseDataResp {
1: optional list<i64> deletedCaseIDS
253: optional i32 code
254: optional string msg
255: optional base.BaseResp BaseResp
}
struct CheckCaseDuplicateReq {
1: optional infra.BizCtx bizCtx
2: optional string caseName // case名称
3: optional infra.ComponentSubject bizComponentSubject
255: optional base.Base Base
}
struct CheckCaseDuplicateResp {
1: optional bool isPass
2: optional string failReason // 当pass=false时给出具体的校验不通过的原因
3: optional i32 failCode
253: optional i32 code
254: optional string msg
255: optional base.BaseResp BaseResp
}
struct GetSchemaByIDReq {
1: optional infra.BizCtx bizCtx // 业务信息
2: optional infra.ComponentSubject bizComponentSubject
255: optional base.Base Base
}
struct GetSchemaByIDResp {
1: optional string schemaJson // Json格式的组件input信息与Input Json Schema保持一致不包含Value值信息
253: optional i32 code
254: optional string msg
255: optional base.BaseResp BaseResp
}