feat: add safe agent writeback flow

This commit is contained in:
Yoilun
2026-05-25 21:06:32 +08:00
parent ba975112de
commit 4b5237fda2
19 changed files with 969 additions and 24 deletions

View File

@@ -6,6 +6,7 @@ type AgentDefinition struct {
ID string `json:"id"`
FilePath string `json:"filePath"`
FileName string `json:"fileName"`
Content string `json:"content"`
Name string `json:"name"`
Description string `json:"description"`
DeveloperInstructions string `json:"developerInstructions"`
@@ -15,3 +16,25 @@ type AgentDefinition struct {
ParseError string `json:"parseError,omitempty"`
DraftStatus string `json:"draftStatus"`
}
type FieldChange struct {
Field string `json:"field"`
Before string `json:"before"`
After string `json:"after"`
}
type DraftValidation struct {
Valid bool `json:"valid"`
Errors []string `json:"errors"`
Diff string `json:"diff"`
TargetPath string `json:"targetPath"`
CurrentHash string `json:"currentHash"`
FieldChanges []FieldChange `json:"fieldChanges"`
}
type WriteResult struct {
Status string `json:"status"`
TargetPath string `json:"targetPath"`
BackupPath string `json:"backupPath"`
CurrentHash string `json:"currentHash"`
}