44406b72db
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>
53 lines
1.4 KiB
Go
53 lines
1.4 KiB
Go
package design
|
|
|
|
import "context"
|
|
|
|
type JobKind string
|
|
|
|
const (
|
|
JobCreateProjectGeneration JobKind = "canvas:create-project-generation"
|
|
JobFollowupGeneration JobKind = "canvas:followup-generation"
|
|
JobNodeActionGeneration JobKind = "canvas:node-action-generation"
|
|
JobAgentConversation JobKind = "canvas:agent-conversation"
|
|
JobTextExtraction JobKind = "canvas:text-extraction"
|
|
JobMockupModelGeneration JobKind = "canvas:mockup-model-generation"
|
|
JobLayerMergeGeneration JobKind = "canvas:layer-merge-generation"
|
|
JobAssetCleanup JobKind = "asset:cleanup"
|
|
)
|
|
|
|
type Job struct {
|
|
Kind JobKind
|
|
UserID string
|
|
ProjectID string
|
|
ThreadID string
|
|
Prompt string
|
|
Mode string
|
|
ImageModel string
|
|
ImageSize string
|
|
TaskPlan AgentTaskPlan
|
|
EnableWebSearch bool
|
|
Isolated bool
|
|
Target Node
|
|
Request NodeActionRequest
|
|
MessageID string
|
|
Conversation AgentConversationRequest
|
|
Messages []AgentChatMessage
|
|
Feature string
|
|
PlaceholderID string
|
|
SourceNodes []Node
|
|
Title string
|
|
PublicURLs []string
|
|
}
|
|
|
|
type JobQueue interface {
|
|
Enqueue(ctx context.Context, job Job) error
|
|
}
|
|
|
|
type JobProcessor interface {
|
|
ProcessJob(ctx context.Context, job Job) error
|
|
}
|
|
|
|
type JobFailureHandler interface {
|
|
HandleJobFailure(ctx context.Context, job Job, err error) error
|
|
}
|