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:
2026-07-10 20:58:55 +08:00
parent 3653474355
commit 789f51b29e
38 changed files with 2165 additions and 135 deletions
+20
View File
@@ -94,6 +94,21 @@ func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) {
Path: "/auth/options",
Handler: getAuthOptionsHandler(serverCtx),
},
{
Method: http.MethodGet,
Path: "/brand-kits",
Handler: listBrandKitsHandler(serverCtx),
},
{
Method: http.MethodPut,
Path: "/brand-kits/:id",
Handler: upsertBrandKitHandler(serverCtx),
},
{
Method: http.MethodDelete,
Path: "/brand-kits/:id",
Handler: deleteBrandKitHandler(serverCtx),
},
{
Method: http.MethodGet,
Path: "/canda/chat-history",
@@ -199,6 +214,11 @@ func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) {
Path: "/projects/:id/agent/ws",
Handler: agentWebsocketHandler(serverCtx),
},
{
Method: http.MethodPatch,
Path: "/projects/:id/brand-kit",
Handler: updateProjectBrandKitHandler(serverCtx),
},
{
Method: http.MethodPatch,
Path: "/projects/:id/canvas",