chore: 工作台产品化进行中的改动

把工作区里其余在制品一并入库,主要是工作台产品化的推进:

  后端:新增 capability_definition / project / my_app_center / office_skill
        接口与 action_definition / skill_definition / project / user_app_center
        模型,config 加路由健康上报。
  前端:新增 frontend/src/skills(Office 技能与 workbuddy 复刻)、
        项目管理、应用中心、能力目录页,以及配套 api / store / config;
        聊天侧新增 SpecialistChip / SpecialistPanel / SkillStrip / AppChatRail
        等组件。
  清理:移除旧 views/tools 下的单页工具(已并入工作台)、_frozen 冻结组件、
        cmd/inspect_oa_debug 调试入口,以及两份调试笔记。
  其它:文档与启动脚本同步。

(这批改动与上一提交的 SY23 工作并行进行,此前已在同一工作区内交织。)

Co-Authored-By: Claude Code <noreply@anthropic.com>
This commit is contained in:
eaiadmin
2026-09-17 21:32:35 +08:00
co-authored by Claude Code
parent 8b136d4a10
commit 16d63de4e1
180 changed files with 22283 additions and 13850 deletions
@@ -0,0 +1,26 @@
package model
import "time"
// ActionDefinition 内部原子执行动作定义。
type ActionDefinition struct {
ID uint `gorm:"primaryKey" json:"id"`
Key string `gorm:"size:64;uniqueIndex;not null" json:"key"`
Label string `gorm:"size:128;not null" json:"label"`
Description string `gorm:"type:text" json:"description"`
ActionType string `gorm:"size:32;not null;default:execution;index" json:"action_type"`
ConnectorRef string `gorm:"size:64;default:'';index" json:"connector_ref"`
InputSchemaJSON string `gorm:"type:text" json:"input_schema_json"`
OutputSchemaJSON string `gorm:"type:text" json:"output_schema_json"`
RiskLevel string `gorm:"size:16;not null;default:low;index" json:"risk_level"`
ApprovalMode string `gorm:"size:32;not null;default:not_required" json:"approval_mode"`
AuditLevel string `gorm:"size:32;not null;default:standard" json:"audit_level"`
ExposedToUser bool `gorm:"not null;default:false;index" json:"exposed_to_user"`
OntologyBindingJSON string `gorm:"type:text" json:"ontology_binding_json"`
State string `gorm:"size:16;not null;default:active;index" json:"state"`
SortOrder int `gorm:"not null;default:0;index" json:"sort_order"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
}
func (ActionDefinition) TableName() string { return "action_definition" }
@@ -0,0 +1,26 @@
package model
import "time"
// Project 项目:任务的容器。
//
// 任务记「做的是哪件事」,项目记「这些事是为谁、按什么规矩做的」——
// 指令是给 AI 的长期上下文,预置的专员/技能/连接器是这个项目默认带上的能力。
// 归属跟 WorkerTask.Owner 同构(全名优先,回退登录名),列表只列自己的。
type Project struct {
ID uint `gorm:"primaryKey" json:"id"`
Name string `gorm:"size:40;not null" json:"name"`
Instruction string `gorm:"type:text" json:"instruction"`
TemplateKey string `gorm:"size:64;default:''" json:"template_key"`
Owner string `gorm:"size:64;not null;index" json:"owner"`
Pinned bool `gorm:"not null;default:false" json:"pinned"`
// 建项目时选中的能力,存 JSON 数组字符串。key 各自指向 specialist.key /
// skill.key / connector.key —— 只存 key,展示时再去取名字。
SpecialistKeys string `gorm:"type:text" json:"specialist_keys"`
SkillKeys string `gorm:"column:skill_keys;type:text" json:"skill_keys"`
ConnectorKeys string `gorm:"type:text" json:"connector_keys"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
}
func (Project) TableName() string { return "project" }
@@ -0,0 +1,32 @@
package model
import "time"
// SkillDefinition 对外暴露的任务级能力定义。
type SkillDefinition struct {
ID uint `gorm:"primaryKey" json:"id"`
Key string `gorm:"size:64;uniqueIndex;not null" json:"key"`
Label string `gorm:"size:128;not null" json:"label"`
DisplayCode string `gorm:"column:display_code;size:16;default:'';index" json:"display_code"`
EAILogicCode string `gorm:"column:eailogic_code;size:32;default:'';index" json:"eailogic_code"`
Description string `gorm:"type:text" json:"description"`
RoleKind string `gorm:"size:32;not null;default:skill;index" json:"role_kind"` // assistant / specialist / skill
Source string `gorm:"size:32;not null;default:eai;index" json:"source"` // eai / custom
ObjectEntryRoute string `gorm:"column:object_entry_route;size:128;default:''" json:"object_entry_route"`
LegacyObjectEntryRoute string `gorm:"column:legacy_object_entry_route;size:128;default:''" json:"legacy_object_entry_route"`
ExposedToUser bool `gorm:"not null;default:true;index" json:"exposed_to_user"`
StarterPromptsJSON string `gorm:"type:text" json:"starter_prompts_json"`
PromptTemplate string `gorm:"type:text" json:"prompt_template"`
InputSchemaJSON string `gorm:"type:text" json:"input_schema_json"`
OutputSchemaJSON string `gorm:"type:text" json:"output_schema_json"`
ArtifactSchemaJSON string `gorm:"type:text" json:"artifact_schema_json"`
ActionRefsJSON string `gorm:"type:text" json:"action_refs_json"`
PolicyRefsJSON string `gorm:"type:text" json:"policy_refs_json"`
OntologyBindingJSON string `gorm:"type:text" json:"ontology_binding_json"`
State string `gorm:"size:16;not null;default:active;index" json:"state"`
SortOrder int `gorm:"not null;default:0;index" json:"sort_order"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
}
func (SkillDefinition) TableName() string { return "skill_definition" }
@@ -0,0 +1,16 @@
package model
import "time"
// UserAppCenter 保存用户自己的应用中心状态,用于同步我的应用、收藏和最近使用。
type UserAppCenter struct {
ID uint `gorm:"primaryKey" json:"id"`
UserID uint `gorm:"not null;uniqueIndex" json:"user_id"`
FavoriteKeys string `gorm:"type:text;not null;default:''" json:"favorite_keys"`
RecentKeys string `gorm:"type:text;not null;default:''" json:"recent_keys"`
CustomApps string `gorm:"type:text;not null;default:''" json:"custom_apps"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
}
func (UserAppCenter) TableName() string { return "user_app_center" }
@@ -17,6 +17,9 @@ type WorkerTask struct {
DueAt *time.Time `json:"due_at"`
CreatedBy *uint `gorm:"index" json:"created_by"`
LastTriggeredAt *time.Time `json:"last_triggered_at"`
// ProjectID 这条任务属于哪个项目。可空 —— 不挂项目的任务跟以前一样,
// 删项目时把它置空(任务本身留着),所以不能是级联删除。
ProjectID *uint `gorm:"index" json:"project_id"`
// Pinned 置顶:只影响「我的任务」列表的排序,不改变任务本身的状态。
Pinned bool `gorm:"not null;default:false" json:"pinned"`
CreatedAt time.Time `json:"created_at"`