166 lines
6.8 KiB
Go
166 lines
6.8 KiB
Go
package server
|
|
|
|
import (
|
|
"chat-agent-system/internal/bizdev"
|
|
"chat-agent-system/internal/ctxmgr"
|
|
"chat-agent-system/internal/squad"
|
|
)
|
|
|
|
// HealthResponse 健康检查响应
|
|
type HealthResponse struct {
|
|
Status string `json:"status"`
|
|
Env string `json:"env"`
|
|
AgentBackend string `json:"agent_backend"`
|
|
Version string `json:"version"`
|
|
SharedKBPort int `json:"shared_kb_port"`
|
|
KBReady bool `json:"kb_ready"`
|
|
DatabaseReady bool `json:"database_ready"`
|
|
SchemaVersion int64 `json:"schema_version,omitempty"`
|
|
SchemaReady bool `json:"schema_ready,omitempty"`
|
|
TaskStoreReady bool `json:"task_store_ready,omitempty"`
|
|
VaultIdentityOK bool `json:"vault_identity_ok"`
|
|
VaultConnected bool `json:"vault_connected"`
|
|
VaultLagOK bool `json:"vault_lag_ok"`
|
|
EventsReady bool `json:"events_ready,omitempty"`
|
|
}
|
|
|
|
// ChatRequest 对话请求
|
|
type ChatRequest struct {
|
|
SessionID string `json:"session_id"`
|
|
Message string `json:"message"`
|
|
ProjectName string `json:"project_name,omitempty"`
|
|
CustomerName string `json:"customer_name,omitempty"`
|
|
DeviceType string `json:"device_type,omitempty"`
|
|
IntendedUse string `json:"intended_use,omitempty"`
|
|
TargetMarket string `json:"target_market,omitempty"`
|
|
WorkDir string `json:"work_dir,omitempty"`
|
|
UserName string `json:"user_name,omitempty"`
|
|
UserRole string `json:"user_role,omitempty"`
|
|
UserID int64 `json:"user_id,omitempty"`
|
|
ProjectID int64 `json:"project_id,omitempty"`
|
|
Attachments []TurnAttachment `json:"attachments,omitempty"`
|
|
}
|
|
|
|
// TurnAttachment 本轮已登记的上传引用。正文仍走文档/CAS 读取,不把文件字节放进对话请求。
|
|
type TurnAttachment struct {
|
|
Filename string `json:"filename"`
|
|
DocID string `json:"doc_id,omitempty"`
|
|
AssetID int64 `json:"asset_id,omitempty"`
|
|
ParseState string `json:"parse_state,omitempty"`
|
|
}
|
|
|
|
// TaskRunRequestDTO 独立任务运行请求
|
|
type TaskRunRequestDTO struct {
|
|
TaskKey string `json:"task_key"`
|
|
Stage string `json:"stage,omitempty"` // 若指定 stage,则执行成熟度阶段跃迁
|
|
ProjectName string `json:"project_name"`
|
|
CustomerName string `json:"customer_name"`
|
|
DeviceType string `json:"device_type"`
|
|
IntendedUse string `json:"intended_use"`
|
|
TargetMarket string `json:"target_market"`
|
|
Fields map[string]string `json:"fields,omitempty"`
|
|
Backend string `json:"backend,omitempty"`
|
|
AutoRepair bool `json:"auto_repair"`
|
|
UserID int64 `json:"user_id,omitempty"`
|
|
ProjectID int64 `json:"project_id,omitempty"`
|
|
DocID string `json:"doc_id,omitempty"`
|
|
StageKey string `json:"stage_key,omitempty"` // 冻结实例阶段键(服务端 ResolveDocTask 注入)
|
|
AuthorID int64 `json:"author_id,omitempty"`
|
|
AuthorName string `json:"author_name,omitempty"`
|
|
ReviewerID int64 `json:"reviewer_id,omitempty"`
|
|
ReviewerName string `json:"reviewer_name,omitempty"`
|
|
ApproverID int64 `json:"approver_id,omitempty"`
|
|
ApproverName string `json:"approver_name,omitempty"`
|
|
ForceDirectEdit bool `json:"force_direct_edit,omitempty"`
|
|
CustomSteps []squad.StepSpec `json:"custom_steps,omitempty"`
|
|
WorkflowKey string `json:"workflow_key,omitempty"`
|
|
SessionID string `json:"session_id,omitempty"`
|
|
ClientTurnID string `json:"client_turn_id,omitempty"`
|
|
// Materials 用户上传的参考文档材料,由前端 Base64 编码后传入;后端 json 反序列化自动解码 []byte
|
|
Materials []bizdev.MaterialInput `json:"materials,omitempty"`
|
|
}
|
|
|
|
// UpdateUserPreferenceRequest 更新用户工作偏好请求
|
|
type UpdateUserPreferenceRequest struct {
|
|
UserID int64 `json:"user_id"`
|
|
CommunicationStyle ctxmgr.CommunicationStyle `json:"communication_style"`
|
|
FocusAreas []string `json:"focus_areas"`
|
|
OutputFormatPref string `json:"output_format_pref"`
|
|
CustomInstructions string `json:"custom_instructions"`
|
|
}
|
|
|
|
// DocGovClaimRequest 认领文档请求
|
|
type DocGovClaimRequest struct {
|
|
DocID string `json:"doc_id"`
|
|
UserID int64 `json:"user_id"`
|
|
UserName string `json:"user_name"`
|
|
UserRole string `json:"user_role"` // author, reviewer, approver
|
|
}
|
|
|
|
// DocGovSubmitReviewRequest 送审请求
|
|
type DocGovSubmitReviewRequest struct {
|
|
DocID string `json:"doc_id"`
|
|
UserID int64 `json:"user_id"`
|
|
UserName string `json:"user_name"`
|
|
}
|
|
|
|
// DocGovDecisionRequest 审核/批准决议请求
|
|
type DocGovDecisionRequest struct {
|
|
DocID string `json:"doc_id"`
|
|
UserID int64 `json:"user_id"`
|
|
UserName string `json:"user_name"`
|
|
Action string `json:"action"` // approve 或 reject
|
|
Comment string `json:"comment,omitempty"`
|
|
Reason string `json:"reason,omitempty"` // 驳回时必填
|
|
RollbackTo string `json:"rollback_to,omitempty"` // 批准人驳回时可选: drafting 或 reviewing
|
|
}
|
|
|
|
// ProposeModificationRequest 发起变更提案请求
|
|
type ProposeModificationRequest struct {
|
|
DocID string `json:"doc_id"`
|
|
TriggeredBy string `json:"triggered_by"`
|
|
ProposedChanges string `json:"proposed_changes"`
|
|
ImpactAnalysis string `json:"impact_analysis"`
|
|
RiskAssessment string `json:"risk_assessment"`
|
|
}
|
|
|
|
// DecideProposalRequest 拍板变更提案请求
|
|
type DecideProposalRequest struct {
|
|
ProposalID string `json:"proposal_id"`
|
|
AuthorID int64 `json:"author_id"`
|
|
Approve bool `json:"approve"`
|
|
Reason string `json:"reason"`
|
|
}
|
|
|
|
// AddCommentRequestDTO 新增批注请求
|
|
type AddCommentRequestDTO struct {
|
|
DocID string `json:"doc_id"`
|
|
UserID int64 `json:"user_id"`
|
|
UserName string `json:"user_name"`
|
|
UserRole string `json:"user_role"`
|
|
TargetSection string `json:"target_section,omitempty"`
|
|
CommentType string `json:"comment_type,omitempty"`
|
|
Content string `json:"content"`
|
|
}
|
|
|
|
type upsertChatSessionRequest struct {
|
|
SessionID string `json:"session_id"`
|
|
Title string `json:"title"`
|
|
UserID int64 `json:"user_id"`
|
|
ProjectID int64 `json:"project_id"`
|
|
}
|
|
|
|
type SaveContentRequestDTO struct {
|
|
DocID string `json:"doc_id"`
|
|
MarkdownBody string `json:"markdown_body"`
|
|
ExpectedSHA256 string `json:"expected_sha256,omitempty"`
|
|
FencingToken string `json:"fencing_token,omitempty"`
|
|
}
|
|
|
|
type LeaseRequestDTO struct {
|
|
DocID string `json:"doc_id"`
|
|
HolderType string `json:"holder_type"`
|
|
HolderID string `json:"holder_id"`
|
|
TTLSeconds int `json:"ttl_seconds,omitempty"`
|
|
}
|