172 lines
6.6 KiB
Go
172 lines
6.6 KiB
Go
package squad
|
|
|
|
import "time"
|
|
|
|
// WorkspaceMetadata 记录工作区全局元数据
|
|
type WorkspaceMetadata struct {
|
|
ID string `json:"id"`
|
|
SessionID int64 `json:"session_id"`
|
|
ProjectID int64 `json:"project_id"`
|
|
TaskKey string `json:"task_key"`
|
|
StageTitle string `json:"stage_title"`
|
|
ProjectName string `json:"project_name"`
|
|
CustomerName string `json:"customer_name"`
|
|
DeviceType string `json:"device_type,omitempty"`
|
|
IntendedUse string `json:"intended_use,omitempty"`
|
|
TargetMarket string `json:"target_market,omitempty"`
|
|
Status string `json:"status"` // created, running, completed, failed
|
|
Backend string `json:"backend"`
|
|
WorkDir string `json:"work_dir"`
|
|
CreatedAt time.Time `json:"created_at"`
|
|
UpdatedAt time.Time `json:"updated_at"`
|
|
CompletedAt *time.Time `json:"completed_at,omitempty"`
|
|
Metadata map[string]string `json:"metadata,omitempty"`
|
|
}
|
|
|
|
// AgentSpec 声明单个专员角色在小队中的设定
|
|
type AgentSpec struct {
|
|
Role string `json:"role"`
|
|
Name string `json:"name"`
|
|
Model string `json:"model"`
|
|
Tools []string `json:"tools"`
|
|
BashPermission string `json:"bash_permission"` // allow, deny
|
|
Responsibilities []string `json:"responsibilities"`
|
|
ForbiddenActions []string `json:"forbidden_actions"`
|
|
InstructionsFile string `json:"instructions_file,omitempty"`
|
|
}
|
|
|
|
// SquadConfig 激活的智能体小队编制
|
|
type SquadConfig struct {
|
|
SquadName string `json:"squad_name"`
|
|
Version string `json:"version"`
|
|
Agents []AgentSpec `json:"agents"`
|
|
}
|
|
|
|
// StepSpec 单个任务步骤规格定义
|
|
type StepSpec struct {
|
|
ID string `json:"id"`
|
|
Role string `json:"role"`
|
|
Title string `json:"title"`
|
|
SubWorkspace string `json:"sub_workspace"` // 相对子路径,如 tasks/01_organize
|
|
Mode string `json:"mode"` // execute, plan, review_plan, replan
|
|
Parallel bool `json:"parallel"`
|
|
Needs []string `json:"needs,omitempty"`
|
|
Accept []string `json:"accept,omitempty"`
|
|
Status string `json:"status"` // pending, running, completed, failed, skipped
|
|
DurationMs int64 `json:"duration_ms,omitempty"`
|
|
Error string `json:"error,omitempty"`
|
|
}
|
|
|
|
// WorkflowPlan 动态任务编排清单
|
|
type WorkflowPlan struct {
|
|
WorkflowID string `json:"workflow_id"`
|
|
Status string `json:"status"` // pending, in_progress, completed, failed
|
|
CurrentStepIndex int `json:"current_step_index"`
|
|
Steps []StepSpec `json:"steps"`
|
|
}
|
|
|
|
// ContextItem 上下文项目元数据
|
|
type ContextItem struct {
|
|
File string `json:"file"` // 相对路径,如 context/user.md
|
|
Description string `json:"description"` // 用途说明
|
|
AuthorityLevel string `json:"authority_level"` // authoritative, primary_evidence, reference_standard, supplementary, inferred
|
|
Guidance string `json:"guidance"` // 使用建议与优先级说明
|
|
}
|
|
|
|
// ContextIndex 上下文索引表
|
|
type ContextIndex struct {
|
|
Items []ContextItem `json:"context_items"`
|
|
}
|
|
|
|
// MaterialItem 输入材料
|
|
type MaterialItem struct {
|
|
Filename string `json:"filename"`
|
|
Content []byte `json:"content"`
|
|
}
|
|
|
|
// KnowledgeHit 法规知识库检索命中条目
|
|
type KnowledgeHit struct {
|
|
DocCode string `json:"doc_code"`
|
|
Category string `json:"category,omitempty"` // standards, guidance, laws, catalog
|
|
Title string `json:"title"`
|
|
Content string `json:"content"`
|
|
Source string `json:"source"`
|
|
}
|
|
|
|
// PriorDocItem 前序阶段归档文档
|
|
type PriorDocItem struct {
|
|
DocKey string `json:"doc_key"`
|
|
Title string `json:"title"`
|
|
Filename string `json:"filename"`
|
|
Content string `json:"content"`
|
|
Stage string `json:"stage"`
|
|
}
|
|
|
|
// FactItem 黑板事实项
|
|
type FactItem struct {
|
|
ID string `json:"id"`
|
|
Claim string `json:"claim"`
|
|
Source string `json:"source"`
|
|
Verified bool `json:"verified"`
|
|
}
|
|
|
|
// GapItem 黑板缺口项
|
|
type GapItem struct {
|
|
ID string `json:"id"`
|
|
Item string `json:"item"`
|
|
Owner string `json:"owner"` // user, agent
|
|
Blocking bool `json:"blocking"` // 是否阻塞后续推进
|
|
Resolved bool `json:"resolved"`
|
|
}
|
|
|
|
// ImplicationItem 黑板含义项
|
|
type ImplicationItem struct {
|
|
ID string `json:"id"`
|
|
Topic string `json:"topic"`
|
|
Statement string `json:"statement"`
|
|
}
|
|
|
|
// BlackboardState 结构化共享黑板
|
|
type BlackboardState struct {
|
|
Facts []FactItem `json:"facts"`
|
|
Gaps []GapItem `json:"gaps"`
|
|
Implications []ImplicationItem `json:"implications"`
|
|
Fields map[string]string `json:"fields"`
|
|
UpdatedAt time.Time `json:"updated_at"`
|
|
}
|
|
|
|
// QualityReport 自动化质量门禁报告
|
|
type QualityReport struct {
|
|
Passed bool `json:"passed"`
|
|
Score float64 `json:"score"`
|
|
TitleCheck bool `json:"title_check"`
|
|
MissingSections []string `json:"missing_sections,omitempty"`
|
|
ProhibitedPhrases []string `json:"prohibited_phrases,omitempty"`
|
|
QuoteMatches bool `json:"quote_matches"`
|
|
Violations []string `json:"violations,omitempty"`
|
|
CheckedAt time.Time `json:"checked_at"`
|
|
}
|
|
|
|
// Manifest 执行清单与防篡改审计
|
|
type Manifest struct {
|
|
ManifestVersion string `json:"manifest_version"`
|
|
WorkspaceID string `json:"workspace_id"`
|
|
DocKey string `json:"doc_key"`
|
|
GeneratedAt time.Time `json:"generated_at"`
|
|
Deliverable string `json:"deliverable"`
|
|
Files map[string]string `json:"files"` // relPath -> sha256
|
|
QualityReport QualityReport `json:"quality_report"`
|
|
DurationMs int64 `json:"duration_ms"`
|
|
}
|
|
|
|
// AdvisorBriefing B轨业务参谋决策锦囊
|
|
type AdvisorBriefing struct {
|
|
MaturityScore int `json:"maturity_score"` // 成熟度评分 (0-100)
|
|
MaturityLevel string `json:"maturity_level"` // 成熟度等级 (如 V0.1, V0.5, V1.0)
|
|
MaturityHeadline string `json:"maturity_headline"` // 总体进展研判(一句话核心诊断)
|
|
BaselineAssumptions []string `json:"baseline_assumptions"` // 基准假设清单(替代填空,为用户预设)
|
|
PreemptiveRisks []string `json:"preemptive_risks"` // 预见性风险雷达(替用户提前看两步)
|
|
NextBestActions []string `json:"next_best_actions"` // 建议下一步行动选项
|
|
CommunicationKit string `json:"communication_kit"` // 建议对外沟通话术(微信/邮件模板)
|
|
}
|