Initial commit: img-infinite-canvas AI design workbench MVP

Moteva-style AI design workbench replica. Home prompt creates a project;
the project page provides an infinite canvas with node drag, zoom/pan,
a design chat panel, history replay, image asset upload, and project
save/regenerate.

- Backend: go-zero, DDD layering, sqlc/pgx, optional PostgreSQL; memory
  or Redis cache; asynq job queue; MinIO/S3/R2/OSS object storage;
  sky-valley/pi agent runtime adapter.
- Frontend: Next.js App Router + Vite artifact build, TypeScript, i18n,
  shadcn/ui components, auth (OTP/Turnstile/Google/WeChat).
- Deploy: Docker Compose and k3s manifests.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-07-07 23:15:37 +08:00
commit 44406b72db
349 changed files with 73265 additions and 0 deletions
+667
View File
@@ -0,0 +1,667 @@
// Code generated by goctl. DO NOT EDIT.
// goctl 1.10.1
package types
type AccountDevice struct {
Id string `json:"id"`
Online bool `json:"online"`
Current bool `json:"current"`
DeviceType string `json:"deviceType"`
System string `json:"system"`
Browser string `json:"browser"`
Client string `json:"client"`
LastSeenAt string `json:"lastSeenAt"`
}
type AccountDeviceListResponse struct {
Devices []AccountDevice `json:"devices"`
}
type AccountDeviceMutationResponse struct {
Removed int64 `json:"removed"`
}
type AccountProfileResponse struct {
User AuthUser `json:"user"`
}
type AgentChatMessage struct {
Role string `json:"role"`
Contents []AgentContent `json:"contents"`
}
type AgentChatRequest struct {
Id string `path:"id"`
Messages []AgentChatMessage `json:"messages"`
ToolConfig AgentToolConfig `json:"toolConfig,optional"`
ThreadId string `json:"threadId,optional"`
ThreadIdType int64 `json:"threadIdType,optional"`
EnableMultimodalInput int64 `json:"enableMultimodalInput,optional"`
EnableWebSearch bool `json:"enableWebSearch,optional"`
ImageModel string `json:"imageModel,optional"`
ImageSize string `json:"imageSize,optional"`
Mode string `json:"mode,optional"`
}
type AgentContent struct {
Type string `json:"type"`
Text string `json:"text,optional"`
TextSource string `json:"textSource,optional"`
ImageUrl string `json:"imageUrl,optional"`
ImageWidth int64 `json:"imageWidth,optional"`
ImageHeight int64 `json:"imageHeight,optional"`
}
type AgentMessage struct {
Id string `json:"id"`
Role string `json:"role"`
Type string `json:"type,optional"`
Title string `json:"title"`
Content string `json:"content"`
ThreadId string `json:"threadId,optional"`
ActionId string `json:"actionId,optional"`
StepId string `json:"stepId,optional"`
ToolCallId string `json:"toolCallId,optional"`
Name string `json:"name,optional"`
ToolHint string `json:"toolHint,optional"`
Status string `json:"status,optional"`
CreatedAt string `json:"createdAt"`
}
type AgentPreferToolCategories struct {
Search []string `json:"SEARCH,optional"`
Image []string `json:"IMAGE,optional"`
}
type AgentThreadListResponse struct {
ProjectId string `json:"projectId"`
Threads []AgentThreadSummary `json:"threads"`
}
type AgentThreadResponse struct {
ThreadId string `json:"threadId"`
Status string `json:"status"`
ThreadIdType int64 `json:"threadIdType"`
EventsUrl string `json:"eventsUrl"`
Project Project `json:"project"`
}
type AgentThreadStatusResponse struct {
ThreadId string `json:"threadId"`
Status string `json:"status"`
ThreadIdType int64 `json:"threadIdType"`
}
type AgentThreadSummary struct {
AgentThreadId string `json:"agentThreadId"`
CoverImageUrl string `json:"coverImageUrl"`
Text string `json:"text"`
ThreadIdType int64 `json:"threadIdType"`
UpdateTimestamp int64 `json:"updateTimestamp"`
}
type AgentToolConfig struct {
PreferToolCategories AgentPreferToolCategories `json:"preferToolCategories,optional"`
}
type AuthCodeRequest struct {
Target string `json:"target,optional"`
Phone string `json:"phone,optional"`
CountryCode string `json:"countryCode,optional"`
Email string `json:"email,optional"`
Purpose string `json:"purpose,optional"`
TurnstileToken string `json:"turnstileToken,optional"`
}
type AuthCodeResponse struct {
Target string `json:"target"`
ExpiresIn int64 `json:"expiresIn"`
DevCode string `json:"devCode,optional"`
Email *AuthEmailMessage `json:"email,optional"`
}
type AuthEmailMessage struct {
FromName string `json:"fromName"`
FromEmail string `json:"fromEmail"`
ToEmail string `json:"toEmail"`
Subject string `json:"subject"`
Code string `json:"code,optional"`
Text string `json:"text,optional"`
Html string `json:"html,optional"`
}
type AuthMethod struct {
Id string `json:"id"`
Label string `json:"label"`
Provider string `json:"provider"`
}
type AuthOptionsResponse struct {
Region string `json:"region"`
Methods []AuthMethod `json:"methods"`
Turnstile AuthTurnstileOptions `json:"turnstile"`
}
type AuthSessionResponse struct {
Status string `json:"status"`
User AuthUser `json:"user"`
AccessToken string `json:"accessToken"`
ExpiresIn int64 `json:"expiresIn"`
RefreshToken string `json:"refreshToken,optional"`
RefreshExpiresIn int64 `json:"refreshExpiresIn,optional"`
BindingToken string `json:"bindingToken,optional"`
BindingExpiresIn int64 `json:"bindingExpiresIn,optional"`
}
type AuthTurnstileOptions struct {
Enabled bool `json:"enabled"`
SiteKey string `json:"siteKey,optional"`
}
type AuthUser struct {
Id string `json:"id"`
Region string `json:"region"`
Phone string `json:"phone,optional"`
CountryCode string `json:"countryCode,optional"`
Email string `json:"email,optional"`
Name string `json:"name,optional"`
AvatarUrl string `json:"avatarUrl,optional"`
}
type CanvasConnection struct {
Id string `json:"id"`
FromNodeId string `json:"fromNodeId"`
ToNodeId string `json:"toNodeId"`
}
type CanvasNode struct {
Id string `json:"id"`
Type string `json:"type"`
Title string `json:"title"`
X float64 `json:"x"`
Y float64 `json:"y"`
Width float64 `json:"width"`
Height float64 `json:"height"`
Content string `json:"content"`
Tone string `json:"tone"`
Status string `json:"status"`
ParentId string `json:"parentId,optional"`
LayerRole string `json:"layerRole,optional"`
FontSize float64 `json:"fontSize,optional"`
FontFamily string `json:"fontFamily,optional"`
FontWeight string `json:"fontWeight,optional"`
Color string `json:"color,optional"`
TextAlign string `json:"textAlign,optional"`
LineHeight float64 `json:"lineHeight,optional"`
LetterSpacing float64 `json:"letterSpacing,optional"`
TextDecoration string `json:"textDecoration,optional"`
TextTransform string `json:"textTransform,optional"`
Opacity float64 `json:"opacity,optional"`
FillColor string `json:"fillColor,optional"`
StrokeColor string `json:"strokeColor,optional"`
StrokeWidth float64 `json:"strokeWidth,optional"`
StrokeStyle string `json:"strokeStyle,optional"`
FlipX bool `json:"flipX,optional"`
FlipY bool `json:"flipY,optional"`
Rotation float64 `json:"rotation,optional"`
ImageAdjustments string `json:"imageAdjustments,optional"`
MockupSurface MockupSurface `json:"mockupSurface,optional"`
MockupModel MockupModel `json:"mockupModel,optional"`
MockupSourceContent string `json:"mockupSourceContent,optional"`
}
type CanvasViewport struct {
X float64 `json:"x"`
Y float64 `json:"y"`
K float64 `json:"k"`
}
type ChatHistoryResponse struct {
ProjectId string `json:"projectId"`
Messages []AgentMessage `json:"messages"`
}
type ChinaPasswordLoginRequest struct {
Phone string `json:"phone"`
CountryCode string `json:"countryCode,optional"`
Password string `json:"password"`
}
type ChinaSmsLoginRequest struct {
Phone string `json:"phone"`
CountryCode string `json:"countryCode,optional"`
Code string `json:"code"`
}
type ChinaWechatLoginRequest struct {
Code string `json:"code,optional"`
State string `json:"state,optional"`
BindingToken string `json:"bindingToken,optional"`
Phone string `json:"phone,optional"`
CountryCode string `json:"countryCode,optional"`
SmsCode string `json:"smsCode,optional"`
}
type CreateAssetUploadRequest struct {
FileName string `json:"fileName"`
ContentType string `json:"contentType"`
Size int64 `json:"size,optional"`
}
type CreateAssetUploadResponse struct {
Driver string `json:"driver"`
Bucket string `json:"bucket"`
ObjectKey string `json:"objectKey"`
UploadUrl string `json:"uploadUrl"`
PublicUrl string `json:"publicUrl"`
Headers map[string]string `json:"headers"`
ExpiresIn int64 `json:"expiresIn"`
}
type CreateProjectRequest struct {
Title string `json:"title,optional"`
Prompt string `json:"prompt,optional"`
ImageModel string `json:"imageModel,optional"`
ImageSize string `json:"imageSize,optional"`
EnableWebSearch bool `json:"enableWebSearch,optional"`
AllowEmptyPrompt bool `json:"allowEmptyPrompt,optional"`
}
type DashboardResponse struct {
Credits int64 `json:"credits"`
QuickActions []QuickAction `json:"quickActions"`
Projects []ProjectSummary `json:"projects"`
Inspiration []InspirationItem `json:"inspiration"`
}
type DeleteAssetRequest struct {
PublicUrl string `json:"publicUrl"`
}
type DeleteAssetResponse struct {
Deleted bool `json:"deleted"`
}
type DeleteProjectResponse struct {
Id string `json:"id"`
Deleted bool `json:"deleted"`
}
type DeleteProjectsRequest struct {
Ids []string `json:"ids"`
}
type DeleteProjectsResponse struct {
Deleted int64 `json:"deleted"`
}
type ExtractNodeTextAsyncRequest struct {
Id string `path:"id"`
NodeId string `path:"nodeId"`
Eitdortxt string `form:"eitdortxt,optional"`
Feature string `form:"feature,optional"`
}
type ExtractNodeTextRequest struct {
Id string `path:"id"`
NodeId string `path:"nodeId"`
Prompt string `json:"prompt,optional"`
}
type ExtractNodeTextResponse struct {
Items []ExtractedTextLayer `json:"items"`
}
type ExtractedTextLayer struct {
Text string `json:"text"`
OriginalText string `json:"originalText,optional"`
X float64 `json:"x"`
Y float64 `json:"y"`
Width float64 `json:"width"`
Height float64 `json:"height"`
FontSize float64 `json:"fontSize,optional"`
FontFamily string `json:"fontFamily,optional"`
FontWeight string `json:"fontWeight,optional"`
Color string `json:"color,optional"`
TextAlign string `json:"textAlign,optional"`
LineHeight float64 `json:"lineHeight,optional"`
LetterSpacing float64 `json:"letterSpacing,optional"`
StrokeColor string `json:"strokeColor,optional"`
StrokeWidth float64 `json:"strokeWidth,optional"`
Opacity float64 `json:"opacity,optional"`
Rotation float64 `json:"rotation,optional"`
Confidence float64 `json:"confidence,optional"`
}
type GenerateMockupModelRequest struct {
Id string `path:"id"`
NodeId string `path:"nodeId"`
}
type GenerateRequest struct {
Id string `path:"id"`
Prompt string `json:"prompt"`
Mode string `json:"mode,optional"`
ImageModel string `json:"imageModel,optional"`
ImageSize string `json:"imageSize,optional"`
}
type GenerateResponse struct {
Project Project `json:"project"`
Message AgentMessage `json:"message"`
GeneratedNodes []CanvasNode `json:"generatedNodes"`
}
type GeneratorTaskArtifact struct {
Type string `json:"type"`
Content string `json:"content"`
Metadata GeneratorTaskArtifactMetadata `json:"metadata"`
}
type GeneratorTaskArtifactMetadata struct {
ArtifactId string `json:"artifact_id,optional"`
Format string `json:"format,optional"`
Height int64 `json:"height,optional"`
Label string `json:"label,optional"`
NodeId string `json:"node_id,optional"`
NodeName string `json:"node_name,optional"`
SizeBytes int64 `json:"size_bytes,optional"`
Width int64 `json:"width,optional"`
}
type GeneratorTaskData struct {
GeneratorTaskId string `json:"generator_task_id"`
GeneratorName string `json:"generator_name"`
Status string `json:"status"`
OriginalInputArgs GeneratorTaskInputArgs `json:"original_input_args"`
QueueInfo *GeneratorTaskQueueInfo `json:"queue_info,omitempty,optional"`
Artifacts []GeneratorTaskArtifact `json:"artifacts,omitempty,optional"`
}
type GeneratorTaskDisableUnlimitedPrice struct {
Balance int64 `json:"balance"`
Price int64 `json:"price"`
PriceDetail GeneratorTaskPriceDetail `json:"price_detail"`
DisableUnlimited bool `json:"disable_unlimited"`
}
type GeneratorTaskInputArgs struct {
AspectRatio string `json:"aspect_ratio,optional"`
Image []string `json:"image,optional"`
ImageUrl string `json:"image_url,optional"`
Prompt string `json:"prompt,optional"`
Resolution string `json:"resolution,optional"`
SrcBox *NormalizedBox `json:"src_box,omitempty,optional"`
DstBox *NormalizedBox `json:"dst_box,omitempty,optional"`
}
type GeneratorTaskPriceDetail struct {
BasePrice int64 `json:"base_price"`
ExtInfoForUnitCount string `json:"ext_info_for_unit_count"`
GeneratorName string `json:"generator_name"`
InputArgs GeneratorTaskInputArgs `json:"input_args"`
OutputArgs string `json:"output_args,optional"`
SearchKey string `json:"search_key"`
TimeVariantPeriod string `json:"time_variant_period"`
TotalPrice int64 `json:"total_price"`
UnitCount int64 `json:"unit_count"`
UnitName string `json:"unit_name"`
UnitPrice int64 `json:"unit_price"`
}
type GeneratorTaskQueueInfo struct {
InQueue bool `json:"in_queue"`
Position int64 `json:"position"`
TotalQueueCount int64 `json:"total_queue_count"`
EstimatedEndTime string `json:"estimated_end_time"`
RemainingTimeSeconds int64 `json:"remaining_time_seconds"`
DisableUnlimitedPrice GeneratorTaskDisableUnlimitedPrice `json:"disable_unlimited_price"`
}
type GeneratorTaskRequest struct {
TaskId string `form:"task_id,optional"`
ProjectId string `form:"project_id,optional"`
}
type GeneratorTaskResponse struct {
Code int64 `json:"code"`
Message string `json:"message"`
Data GeneratorTaskData `json:"data"`
}
type GeneratorTaskSubmitData struct {
GeneratorTaskId string `json:"generator_task_id"`
}
type GeneratorTaskSubmitRequest struct {
Cid string `json:"cid,optional"`
ProjectId string `json:"project_id,optional"`
GeneratorName string `json:"generator_name"`
InputArgs GeneratorTaskInputArgs `json:"input_args"`
}
type GeneratorTaskSubmitResponse struct {
Code int64 `json:"code"`
Message string `json:"message"`
Data GeneratorTaskSubmitData `json:"data"`
}
type GlobalEmailLoginRequest struct {
Email string `json:"email"`
Code string `json:"code"`
}
type GoogleLoginRequest struct {
IdToken string `json:"idToken"`
}
type HealthResponse struct {
Status string `json:"status"`
Service string `json:"service"`
Time string `json:"time"`
}
type InspirationItem struct {
Id string `json:"id"`
Title string `json:"title"`
Category string `json:"category"`
Description string `json:"description"`
Accent string `json:"accent"`
}
type MergeLayersRequest struct {
Id string `path:"id"`
NodeIds []string `json:"nodeIds"`
Title string `json:"title,optional"`
}
type MockupBlobRequest struct {
DataId string `path:"dataId"`
}
type MockupCameraIntrinsics struct {
Matrix []float64 `json:"matrix,optional"`
}
type MockupMesh struct {
Columns int64 `json:"columns,optional"`
Rows int64 `json:"rows,optional"`
Points []MockupPoint `json:"points,optional"`
}
type MockupModel struct {
Version int64 `json:"version,optional"`
DepthMap MockupModelMap `json:"depthMap,optional"`
DepthScaleMin float64 `json:"depthScaleMin,optional"`
DepthScaleMax float64 `json:"depthScaleMax,optional"`
ShadeMap MockupModelMap `json:"shadeMap,optional"`
SegmentationMap MockupModelMap `json:"segmentationMap,optional"`
XOffsetMap MockupModelMap `json:"xOffsetMap,optional"`
YOffsetMap MockupModelMap `json:"yOffsetMap,optional"`
CameraIntrinsics MockupCameraIntrinsics `json:"cameraIntrinsics,optional"`
ColorCorrection string `json:"colorCorrection,optional"`
ForegroundImage string `json:"foregroundImage,optional"`
}
type MockupModelMap struct {
DataId string `json:"dataId,omitempty,optional"`
Width int64 `json:"width,optional"`
Height int64 `json:"height,optional"`
Url string `json:"url,omitempty,optional"`
Data []float64 `json:"data,optional"`
}
type MockupModelResponse struct {
Code int64 `json:"code"`
Data MockupModel `json:"data"`
Msg string `json:"msg"`
}
type MockupPlacement struct {
X float64 `json:"x"`
Y float64 `json:"y"`
Width float64 `json:"width"`
Height float64 `json:"height"`
}
type MockupPoint struct {
X float64 `json:"x"`
Y float64 `json:"y"`
}
type MockupSurface struct {
TargetId string `json:"targetId,optional"`
Polygon []MockupPoint `json:"polygon,optional"`
Mesh MockupMesh `json:"mesh,optional"`
}
type MockupSurfaceResponse struct {
Placement MockupPlacement `json:"placement"`
Surface MockupSurface `json:"surface"`
}
type NodeActionRequest struct {
Id string `path:"id"`
NodeId string `path:"nodeId"`
Action string `json:"action"`
Prompt string `json:"prompt,optional"`
ImageModel string `json:"imageModel,optional"`
ImageSize string `json:"imageSize,optional"`
Mask string `json:"mask,optional"`
Selection string `json:"selection,optional"`
Options map[string]string `json:"options,optional"`
}
type NormalizedBox struct {
X float64 `json:"x"`
Y float64 `json:"y"`
Width float64 `json:"width"`
Height float64 `json:"height"`
}
type PrepareMockupSurfaceRequest struct {
Id string `path:"id"`
NodeId string `path:"nodeId"`
}
type Project struct {
Id string `json:"id"`
UserId string `json:"userId"`
Title string `json:"title"`
Brief string `json:"brief"`
Status string `json:"status"`
Thumbnail string `json:"thumbnail"`
UpdatedAt string `json:"updatedAt"`
Version string `json:"version"`
SnapshotId string `json:"snapshotId"`
Canvas string `json:"canvas"`
LastThreadId string `json:"lastThreadId"`
Viewport CanvasViewport `json:"viewport"`
Nodes []CanvasNode `json:"nodes"`
Connections []CanvasConnection `json:"connections"`
Messages []AgentMessage `json:"messages"`
}
type ProjectIdRequest struct {
Id string `path:"id"`
}
type ProjectListRequest struct {
Limit int64 `form:"limit,optional"`
Offset int64 `form:"offset,optional"`
}
type ProjectListResponse struct {
Projects []ProjectSummary `json:"projects"`
NextOffset int64 `json:"nextOffset"`
HasMore bool `json:"hasMore"`
}
type ProjectResponse struct {
Project Project `json:"project"`
}
type ProjectSummary struct {
Id string `json:"id"`
UserId string `json:"userId"`
Title string `json:"title"`
Brief string `json:"brief"`
Status string `json:"status"`
Thumbnail string `json:"thumbnail"`
UpdatedAt string `json:"updatedAt"`
}
type QuickAction struct {
Id string `json:"id"`
Label string `json:"label"`
Prompt string `json:"prompt"`
Icon string `json:"icon"`
}
type RecognizeObjectRequest struct {
ImageBase64 string `json:"image_base64,optional"`
ImageUrl string `json:"image_url,optional"`
BoundingBox NormalizedBox `json:"bounding_box,optional"`
BBox NormalizedBox `json:"bbox,optional"`
Lang string `json:"lang,optional"`
Prompt string `json:"prompt,optional"`
}
type RecognizeObjectResponse struct {
Id string `json:"id"`
Label string `json:"label"`
Confidence float64 `json:"confidence"`
BBox NormalizedBox `json:"bbox"`
}
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"`
}
type StopAgentTaskRequest struct {
Id string `path:"id"`
ThreadId string `json:"threadId,optional"`
}
type UpdateAccountProfileRequest struct {
Name string `json:"name,optional"`
AvatarUrl string `json:"avatarUrl,optional"`
}
type UpdateProjectTitleRequest struct {
Id string `path:"id"`
Title string `json:"title"`
}
type WechatAuthURLResponse struct {
AuthUrl string `json:"authUrl"`
State string `json:"state"`
ExpiresIn int64 `json:"expiresIn"`
}