feat(server): add brand kit management and project binding
Add a brand kit domain with memory and postgres stores, a BrandKitService for CRUD and resolution, and REST endpoints to list, upsert, and delete brand kits. Projects can bind a brand kit whose resolved context and reference images feed into the agent's long-term memory and design prompts. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -157,13 +157,14 @@ type AccountDeviceMutationResponse {
|
||||
}
|
||||
|
||||
type ProjectSummary {
|
||||
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"`
|
||||
Id string `json:"id"`
|
||||
UserId string `json:"userId"`
|
||||
Title string `json:"title"`
|
||||
Brief string `json:"brief"`
|
||||
Status string `json:"status"`
|
||||
Thumbnail string `json:"thumbnail"`
|
||||
BrandKitId string `json:"brandKitId,optional"`
|
||||
UpdatedAt string `json:"updatedAt"`
|
||||
}
|
||||
|
||||
type CanvasViewport {
|
||||
@@ -292,6 +293,7 @@ type Project {
|
||||
SnapshotId string `json:"snapshotId"`
|
||||
Canvas string `json:"canvas"`
|
||||
LastThreadId string `json:"lastThreadId"`
|
||||
BrandKitId string `json:"brandKitId,optional"`
|
||||
Viewport CanvasViewport `json:"viewport"`
|
||||
Nodes []CanvasNode `json:"nodes"`
|
||||
Connections []CanvasConnection `json:"connections"`
|
||||
@@ -326,14 +328,52 @@ type QueryProjectRequest {
|
||||
}
|
||||
|
||||
type CreateProjectRequest {
|
||||
Title string `json:"title,optional"`
|
||||
Prompt string `json:"prompt,optional"`
|
||||
ImageModel string `json:"imageModel,optional"`
|
||||
ImageSize string `json:"imageSize,optional"`
|
||||
ImageQuality string `json:"imageQuality,optional"`
|
||||
ImageCount int64 `json:"imageCount,optional"`
|
||||
EnableWebSearch bool `json:"enableWebSearch,optional"`
|
||||
AllowEmptyPrompt bool `json:"allowEmptyPrompt,optional"`
|
||||
Title string `json:"title,optional"`
|
||||
Prompt string `json:"prompt,optional"`
|
||||
BrandKitId *string `json:"brandKitId,optional"`
|
||||
ImageModel string `json:"imageModel,optional"`
|
||||
ImageSize string `json:"imageSize,optional"`
|
||||
ImageQuality string `json:"imageQuality,optional"`
|
||||
ImageCount int64 `json:"imageCount,optional"`
|
||||
EnableWebSearch bool `json:"enableWebSearch,optional"`
|
||||
AllowEmptyPrompt bool `json:"allowEmptyPrompt,optional"`
|
||||
}
|
||||
|
||||
type BrandKit {
|
||||
Id string `json:"id"`
|
||||
Name string `json:"name"`
|
||||
Document string `json:"document"`
|
||||
IsDefault bool `json:"isDefault"`
|
||||
CreatedAt string `json:"createdAt"`
|
||||
UpdatedAt string `json:"updatedAt"`
|
||||
}
|
||||
|
||||
type BrandKitListResponse {
|
||||
BrandKits []BrandKit `json:"brandKits"`
|
||||
}
|
||||
|
||||
type BrandKitResponse {
|
||||
BrandKit BrandKit `json:"brandKit"`
|
||||
}
|
||||
|
||||
type BrandKitIdRequest {
|
||||
Id string `path:"id"`
|
||||
}
|
||||
|
||||
type UpsertBrandKitRequest {
|
||||
Id string `path:"id"`
|
||||
Document string `json:"document"`
|
||||
IsDefault bool `json:"isDefault,optional"`
|
||||
}
|
||||
|
||||
type DeleteBrandKitResponse {
|
||||
Id string `json:"id"`
|
||||
Deleted bool `json:"deleted"`
|
||||
}
|
||||
|
||||
type UpdateProjectBrandKitRequest {
|
||||
Id string `path:"id"`
|
||||
BrandKitId string `json:"brandKitId,optional"`
|
||||
}
|
||||
|
||||
type UpdateProjectTitleRequest {
|
||||
@@ -383,6 +423,7 @@ type QueryProjectData {
|
||||
Version string `json:"version"`
|
||||
SnapshotId *string `json:"snapshotId"`
|
||||
ItemId *string `json:"itemId"`
|
||||
BrandKitId string `json:"brandKitId,optional"`
|
||||
Permission string `json:"permission"`
|
||||
}
|
||||
|
||||
@@ -1008,6 +1049,15 @@ service img_infinite_canvas-api {
|
||||
@handler logoutAccount
|
||||
post /account/logout returns (AccountDeviceMutationResponse)
|
||||
|
||||
@handler listBrandKits
|
||||
get /brand-kits returns (BrandKitListResponse)
|
||||
|
||||
@handler upsertBrandKit
|
||||
put /brand-kits/:id (UpsertBrandKitRequest) returns (BrandKitResponse)
|
||||
|
||||
@handler deleteBrandKit
|
||||
delete /brand-kits/:id (BrandKitIdRequest) returns (DeleteBrandKitResponse)
|
||||
|
||||
@handler listProjects
|
||||
get /projects (ProjectListRequest) returns (ProjectListResponse)
|
||||
|
||||
@@ -1041,6 +1091,9 @@ service img_infinite_canvas-api {
|
||||
@handler updateProjectTitle
|
||||
patch /projects/:id/title (UpdateProjectTitleRequest) returns (ProjectResponse)
|
||||
|
||||
@handler updateProjectBrandKit
|
||||
patch /projects/:id/brand-kit (UpdateProjectBrandKitRequest) returns (ProjectResponse)
|
||||
|
||||
@handler getProject
|
||||
get /projects/:id (ProjectIdRequest) returns (ProjectResponse)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user