feat(canvas): 云端 Agent - 完成策略分层、节点能力注册与可解释审批改造
This commit is contained in:
24
backend/internal/model/models_agent_profile.go
Normal file
24
backend/internal/model/models_agent_profile.go
Normal file
@@ -0,0 +1,24 @@
|
||||
package model
|
||||
|
||||
import "time"
|
||||
|
||||
const (
|
||||
AgentProfileScopeUser = "user"
|
||||
AgentProfileScopeProject = "project"
|
||||
AgentProfileScopeCanvas = "canvas"
|
||||
)
|
||||
|
||||
// AgentProfile stores a durable preference document. It is never an authority:
|
||||
// the Agent compiler injects it as untrusted user data after server contracts.
|
||||
type AgentProfile struct {
|
||||
ID string `json:"id" gorm:"primaryKey;size:36"`
|
||||
UserID string `json:"userId" gorm:"size:36;uniqueIndex:idx_agent_profiles_scope,priority:1;index"`
|
||||
Scope string `json:"scope" gorm:"size:16;uniqueIndex:idx_agent_profiles_scope,priority:2"`
|
||||
ProjectID string `json:"projectId,omitempty" gorm:"size:36;uniqueIndex:idx_agent_profiles_scope,priority:3"`
|
||||
CanvasID string `json:"canvasId,omitempty" gorm:"size:80;uniqueIndex:idx_agent_profiles_scope,priority:4"`
|
||||
Content string `json:"content" gorm:"type:text"`
|
||||
Revision int64 `json:"revision"`
|
||||
Hash string `json:"hash" gorm:"size:64;index"`
|
||||
CreatedAt time.Time `json:"createdAt"`
|
||||
UpdatedAt time.Time `json:"updatedAt"`
|
||||
}
|
||||
Reference in New Issue
Block a user