feat(api): add Lovart-style project and agent thread endpoints
Add canva/canda-compatible routes for lightweight project open/save and agent thread history: - POST /canva/project/queryProject, saveProject - POST /canva/agent/queryAgentLastThread, agentThreadList - GET /canda/chat-history, /canda/thread/status Canvas save now accepts a compressed SHAKKERDATA:// snapshot payload, preserves connections, and returns a SaveProject response; blank successful image nodes are backfilled from generated artifacts. Frontend designGateway adopts the new save/query flow. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -75,6 +75,13 @@ type AgentPreferToolCategories struct {
|
||||
Image []string `json:"IMAGE,optional"`
|
||||
}
|
||||
|
||||
type AgentThreadListRequest struct {
|
||||
ProjectId string `json:"projectId"`
|
||||
Page int64 `json:"page,optional"`
|
||||
PageSize int64 `json:"pageSize,optional"`
|
||||
Cid string `json:"cid,optional"`
|
||||
}
|
||||
|
||||
type AgentThreadListResponse struct {
|
||||
ProjectId string `json:"projectId"`
|
||||
Threads []AgentThreadSummary `json:"threads"`
|
||||
@@ -170,6 +177,55 @@ type AuthUser struct {
|
||||
AvatarUrl string `json:"avatarUrl,optional"`
|
||||
}
|
||||
|
||||
type CandaChatHistoryItem struct {
|
||||
Id string `json:"id"`
|
||||
Timestamp string `json:"timestamp"`
|
||||
Type string `json:"type"`
|
||||
ActionId string `json:"action_id"`
|
||||
StepId string `json:"step_id"`
|
||||
Text string `json:"text,optional"`
|
||||
Content string `json:"content,optional"`
|
||||
Status string `json:"status,optional"`
|
||||
ToolCallId string `json:"tool_call_id,optional"`
|
||||
Name string `json:"name,optional"`
|
||||
ThreadMeta CandaThreadMeta `json:"thread_meta"`
|
||||
}
|
||||
|
||||
type CandaChatHistoryRequest struct {
|
||||
ThreadId string `form:"thread_id"`
|
||||
ProjectId string `form:"project_id"`
|
||||
}
|
||||
|
||||
type CandaChatHistoryResponse struct {
|
||||
Code int64 `json:"code"`
|
||||
Message string `json:"message"`
|
||||
Data []CandaChatHistoryItem `json:"data"`
|
||||
}
|
||||
|
||||
type CandaThreadMeta struct {
|
||||
ActionId string `json:"action_id"`
|
||||
SessionId string `json:"session_id"`
|
||||
StepId string `json:"step_id"`
|
||||
Depth int64 `json:"depth"`
|
||||
AgentName string `json:"agent_name"`
|
||||
ProjectId string `json:"project_id"`
|
||||
}
|
||||
|
||||
type CandaThreadStatusData struct {
|
||||
Status string `json:"status"`
|
||||
}
|
||||
|
||||
type CandaThreadStatusRequest struct {
|
||||
ThreadId string `form:"thread_id"`
|
||||
ProjectId string `form:"project_id,optional"`
|
||||
}
|
||||
|
||||
type CandaThreadStatusResponse struct {
|
||||
Code int64 `json:"code"`
|
||||
Msg string `json:"msg"`
|
||||
Data CandaThreadStatusData `json:"data"`
|
||||
}
|
||||
|
||||
type CanvasConnection struct {
|
||||
Id string `json:"id"`
|
||||
FromNodeId string `json:"fromNodeId"`
|
||||
@@ -471,6 +527,38 @@ type InspirationItem struct {
|
||||
Accent string `json:"accent"`
|
||||
}
|
||||
|
||||
type LovartAgentThreadListData struct {
|
||||
Page int64 `json:"page"`
|
||||
Total int64 `json:"total"`
|
||||
PageSize int64 `json:"pageSize"`
|
||||
Data []LovartAgentThreadSummary `json:"data"`
|
||||
UserIp string `json:"userIp"`
|
||||
TraceId string `json:"traceId"`
|
||||
HasMore bool `json:"hasMore"`
|
||||
RankExpId *string `json:"rankExpId"`
|
||||
AbVariant *string `json:"abVariant"`
|
||||
}
|
||||
|
||||
type LovartAgentThreadListResponse struct {
|
||||
Code int64 `json:"code"`
|
||||
Msg *string `json:"msg"`
|
||||
Data LovartAgentThreadListData `json:"data"`
|
||||
}
|
||||
|
||||
type LovartAgentThreadSummary struct {
|
||||
Id int64 `json:"id"`
|
||||
UserId string `json:"userId"`
|
||||
ProjectId string `json:"projectId"`
|
||||
AgentThreadId string `json:"agentThreadId"`
|
||||
ThreadIdType int64 `json:"threadIdType"`
|
||||
Title string `json:"title"`
|
||||
Text string `json:"text"`
|
||||
CoverImageUrl *string `json:"coverImageUrl"`
|
||||
FileType *string `json:"fileType"`
|
||||
UpdateTimestamp int64 `json:"updateTimestamp"`
|
||||
Source int64 `json:"source"`
|
||||
}
|
||||
|
||||
type MergeLayersRequest struct {
|
||||
Id string `path:"id"`
|
||||
NodeIds []string `json:"nodeIds"`
|
||||
@@ -613,6 +701,69 @@ type ProjectSummary struct {
|
||||
UpdatedAt string `json:"updatedAt"`
|
||||
}
|
||||
|
||||
type QueryAgentLastThreadRequest struct {
|
||||
ProjectId string `json:"projectId"`
|
||||
Cid string `json:"cid,optional"`
|
||||
}
|
||||
|
||||
type QueryAgentLastThreadResponse struct {
|
||||
Code int64 `json:"code"`
|
||||
Msg *string `json:"msg"`
|
||||
Data string `json:"data"`
|
||||
}
|
||||
|
||||
type QueryProjectAssetMeta struct {
|
||||
AssetId string `json:"assetId"`
|
||||
ProjectId string `json:"projectId"`
|
||||
Name string `json:"name"`
|
||||
ProjectType int64 `json:"projectType"`
|
||||
ContentType string `json:"contentType"`
|
||||
OwnerType string `json:"ownerType"`
|
||||
OwnerId string `json:"ownerId"`
|
||||
Extra QueryProjectExtra `json:"extra"`
|
||||
Meta QueryProjectMeta `json:"meta"`
|
||||
EffectivePermission string `json:"effectivePermission"`
|
||||
CopyTaskStatus *string `json:"copyTaskStatus"`
|
||||
Visibility string `json:"visibility"`
|
||||
CreateTime string `json:"createTime"`
|
||||
UpdateTime string `json:"updateTime"`
|
||||
}
|
||||
|
||||
type QueryProjectData struct {
|
||||
AssetMeta QueryProjectAssetMeta `json:"assetMeta"`
|
||||
UserId string `json:"userId"`
|
||||
ProjectName string `json:"projectName"`
|
||||
ProjectId *string `json:"projectId"`
|
||||
Canvas string `json:"canvas"`
|
||||
ValidProjectId bool `json:"validProjectId"`
|
||||
ProjectType int64 `json:"projectType"`
|
||||
Version string `json:"version"`
|
||||
SnapshotId *string `json:"snapshotId"`
|
||||
ItemId *string `json:"itemId"`
|
||||
Permission string `json:"permission"`
|
||||
}
|
||||
|
||||
type QueryProjectExtra struct {
|
||||
PicCount int64 `json:"picCount"`
|
||||
ProjectCoverList []string `json:"projectCoverList"`
|
||||
}
|
||||
|
||||
type QueryProjectMeta struct {
|
||||
UniqId string `json:"uniqId"`
|
||||
ParentUniqId string `json:"parentUniqId"`
|
||||
}
|
||||
|
||||
type QueryProjectRequest struct {
|
||||
ProjectId string `json:"projectId"`
|
||||
Cid string `json:"cid,optional"`
|
||||
}
|
||||
|
||||
type QueryProjectResponse struct {
|
||||
Code int64 `json:"code"`
|
||||
Msg *string `json:"msg"`
|
||||
Data QueryProjectData `json:"data"`
|
||||
}
|
||||
|
||||
type QuickAction struct {
|
||||
Id string `json:"id"`
|
||||
Label string `json:"label"`
|
||||
@@ -637,13 +788,47 @@ type RecognizeObjectResponse struct {
|
||||
}
|
||||
|
||||
type SaveCanvasRequest struct {
|
||||
Id string `path:"id"`
|
||||
Version string `json:"version,optional"`
|
||||
SnapshotId string `json:"snapshotId,optional"`
|
||||
Canvas string `json:"canvas,optional"`
|
||||
Viewport CanvasViewport `json:"viewport"`
|
||||
Nodes []CanvasNode `json:"nodes"`
|
||||
Connections []CanvasConnection `json:"connections"`
|
||||
Id string `path:"id"`
|
||||
Version string `json:"version,optional"`
|
||||
SnapshotId string `json:"snapshotId,optional"`
|
||||
Canvas string `json:"canvas,optional"`
|
||||
Viewport CanvasViewport `json:"viewport,optional"`
|
||||
Nodes []CanvasNode `json:"nodes,optional"`
|
||||
Connections []CanvasConnection `json:"connections,optional"`
|
||||
ProjectCoverList []string `json:"projectCoverList,optional"`
|
||||
PicCount int64 `json:"picCount,optional"`
|
||||
ProjectName string `json:"projectName,optional"`
|
||||
ProjectId string `json:"projectId,optional"`
|
||||
SessionId string `json:"sessionId,optional"`
|
||||
CanvasV2Gray bool `json:"canvasV2Gray,optional"`
|
||||
}
|
||||
|
||||
type SaveProjectData struct {
|
||||
ProjectId string `json:"projectId"`
|
||||
NewCreated bool `json:"newCreated"`
|
||||
ValidProjectId bool `json:"validProjectId"`
|
||||
Version string `json:"version"`
|
||||
}
|
||||
|
||||
type SaveProjectRequest struct {
|
||||
Canvas string `json:"canvas,optional"`
|
||||
ProjectCoverList []string `json:"projectCoverList,optional"`
|
||||
PicCount int64 `json:"picCount,optional"`
|
||||
ProjectName string `json:"projectName,optional"`
|
||||
ProjectId string `json:"projectId"`
|
||||
Version string `json:"version,optional"`
|
||||
SessionId string `json:"sessionId,optional"`
|
||||
CanvasV2Gray bool `json:"canvasV2Gray,optional"`
|
||||
SnapshotId string `json:"snapshotId,optional"`
|
||||
Viewport CanvasViewport `json:"viewport,optional"`
|
||||
Nodes []CanvasNode `json:"nodes,optional"`
|
||||
Connections []CanvasConnection `json:"connections,optional"`
|
||||
}
|
||||
|
||||
type SaveProjectResponse struct {
|
||||
Code int64 `json:"code"`
|
||||
Msg *string `json:"msg"`
|
||||
Data SaveProjectData `json:"data"`
|
||||
}
|
||||
|
||||
type StopAgentTaskRequest struct {
|
||||
|
||||
Reference in New Issue
Block a user