Documentation
¶
Index ¶
- Constants
- func ValidatePathReference(ref model.PathReference) error
- func ValidatePathReferences(refs []model.PathReference) error
- func ValidateSegments(segments []model.Segment) error
- type AppError
- type AuthCredentials
- type CreateSessionInput
- type ErrorKind
- type GlobalAppSettings
- type QueueFeedbackInput
- type RevokedFeedbackResult
- type SecuritySettings
- type Store
- func (s *Store) AckReports(ctx context.Context, projectID, taskID string, throughSequence int64) (*model.AckSummary, error)
- func (s *Store) AddReport(ctx context.Context, input model.AddReportInput) (*model.ReportResult, error)
- func (s *Store) ArchiveFeedbackSession(ctx context.Context, idOrWorkflow string) (*model.FeedbackSession, error)
- func (s *Store) CancelFeedbackSession(ctx context.Context, idOrWorkflow string) (*model.FeedbackSession, error)
- func (s *Store) CheckFeedback(ctx context.Context, input model.CheckFeedbackInput) (*model.CheckFeedbackResult, error)
- func (s *Store) CloseTask(ctx context.Context, projectID, taskID string, expectedRevision int64, ...) (*model.MutationResult, error)
- func (s *Store) CreateFeedbackSession(ctx context.Context, input CreateSessionInput) (*model.FeedbackSession, error)
- func (s *Store) CreateTask(ctx context.Context, input model.CreateTaskInput) (*model.Task, error)
- func (s *Store) DB() *gorm.DB
- func (s *Store) DeleteWorkflowDraft(ctx context.Context, workflowID string) error
- func (s *Store) GetAuthCredentials(ctx context.Context) (*AuthCredentials, error)
- func (s *Store) GetAuthCredentialsWithDB(ctx context.Context, db *gorm.DB) (*AuthCredentials, error)
- func (s *Store) GetCurrentFeedbackSession(ctx context.Context, projectDir string) (*model.FeedbackSession, error)
- func (s *Store) GetFeedbackSession(ctx context.Context, sessionID string) (*model.FeedbackSession, error)
- func (s *Store) GetGlobalAppSettings(ctx context.Context) (*GlobalAppSettings, error)
- func (s *Store) GetGlobalAppSettingsWithDB(ctx context.Context, db *gorm.DB) (*GlobalAppSettings, error)
- func (s *Store) GetLatestWorkflowFeedbackSession(ctx context.Context, workflowID string) (*model.FeedbackSession, error)
- func (s *Store) GetSettings(ctx context.Context) (map[string]any, error)
- func (s *Store) GetSettingsWithDB(ctx context.Context, db *gorm.DB) (map[string]any, error)
- func (s *Store) GetTask(ctx context.Context, projectID, taskID string) (*model.Task, error)
- func (s *Store) GetWorkflowDraft(ctx context.Context, workflowID string) (*model.WorkflowDraft, error)
- func (s *Store) KeepaliveFeedbackSession(ctx context.Context, sessionID string, extendSec int) (*model.FeedbackSession, error)
- func (s *Store) ListFeedbackSessions(ctx context.Context, projectDir, status string, limit int) ([]model.FeedbackSession, error)
- func (s *Store) ListPendingQueuedFeedbacks(ctx context.Context, workflowID string) ([]model.QueuedFeedback, error)
- func (s *Store) ListTasks(ctx context.Context, projectID, state, cursor string, limit int, ...) (*model.TaskPage, error)
- func (s *Store) MarkSessionConsumedByAI(ctx context.Context, sessionID string) error
- func (s *Store) QueueWorkflowFeedback(ctx context.Context, input QueueFeedbackInput) (*model.QueuedFeedback, error)
- func (s *Store) ReadReports(ctx context.Context, projectID, taskID string, afterSequence int64, limit int) (*model.ReportPage, error)
- func (s *Store) RenameFeedbackSession(ctx context.Context, idOrWorkflow, newTitle string) (*model.FeedbackSession, error)
- func (s *Store) ResetAuthCredentials(ctx context.Context) error
- func (s *Store) RevokeQueuedFeedback(ctx context.Context, queuedID uint) (*RevokedFeedbackResult, error)
- func (s *Store) RevokeSessionFeedback(ctx context.Context, sessionID string) (*RevokedFeedbackResult, *model.FeedbackSession, error)
- func (s *Store) SaveAuthCredentials(ctx context.Context, username, password string) error
- func (s *Store) SaveSettings(ctx context.Context, settings map[string]any) error
- func (s *Store) SaveWorkflowDraft(ctx context.Context, workflowID string, activeIndex int, draftsJSON string) (*model.WorkflowDraft, error)
- func (s *Store) SendFeedback(ctx context.Context, input model.SendFeedbackInput) (*model.Feedback, error)
- func (s *Store) SetWaitPolicy(ctx context.Context, input model.SetWaitPolicyInput) (*model.MutationResult, error)
- func (s *Store) SubmitFeedback(ctx context.Context, input SubmitFeedbackInput) (*model.FeedbackSession, error)
- func (s *Store) Sync(ctx context.Context, input model.SyncInput) (*model.SyncResult, error)
- func (s *Store) UnarchiveFeedbackSession(ctx context.Context, idOrWorkflow string) (*model.FeedbackSession, error)
- func (s *Store) UpdateSessionMaxChecks(ctx context.Context, idOrWorkflow string, maxChecks int) (*model.FeedbackSession, error)
- func (s *Store) UpdateSessionPromptWait(ctx context.Context, idOrWorkflow string, waitMinutes int) (*model.FeedbackSession, error)
- func (s *Store) UpdateSessionUserPresence(ctx context.Context, idOrWorkflow string, presence string) (*model.FeedbackSession, error)
- func (s *Store) UpdateSessionWaitCountdown(ctx context.Context, idOrWorkflow string, countdownMinutes int) (*model.FeedbackSession, error)
- func (s *Store) UpdateTask(ctx context.Context, input model.UpdateTaskInput) (*model.MutationResult, error)
- func (s *Store) WithTx(ctx context.Context, fn func(tx *gorm.DB) error) error
- type SubmitFeedbackInput
Constants ¶
View Source
const ( GlobalSettingsKey = "app_settings" AuthCredentialsKey = "auth_credentials" )
Variables ¶
This section is empty.
Functions ¶
func ValidatePathReference ¶
func ValidatePathReference(ref model.PathReference) error
func ValidatePathReferences ¶
func ValidatePathReferences(refs []model.PathReference) error
func ValidateSegments ¶
Types ¶
type AppError ¶
func NewConflictError ¶
func NewInvalidInputError ¶
func NewNotFoundError ¶
func NewTaskClosedError ¶
type AuthCredentials ¶
type CreateSessionInput ¶
type CreateSessionInput struct {
SessionID string `json:"session_id,omitempty"`
WorkflowID string `json:"workflow_id,omitempty"`
HostName string `json:"host_name,omitempty"`
ProjectDirectory string `json:"project_directory"`
Title string `json:"title,omitempty"`
Summary string `json:"summary"`
UserPresence string `json:"user_presence,omitempty"`
TimeoutSeconds int `json:"timeout_seconds,omitempty"`
}
type GlobalAppSettings ¶
type GlobalAppSettings struct {
HostName string `json:"hostName"`
DefaultTimeoutSeconds int `json:"defaultTimeoutSeconds"`
PromptWaitMinutes int `json:"promptWaitMinutes"`
MaxNoFeedbackChecks int `json:"maxNoFeedbackChecks"`
DefaultWaitCountdownMinutes int `json:"defaultWaitCountdownMinutes"`
UserPresence string `json:"userPresence"`
Security SecuritySettings `json:"security"`
FlowPrompts struct {
Online struct {
WaitPollPrompt string `json:"waitPollPrompt"`
ExhaustedPrompt string `json:"exhaustedPrompt"`
} `json:"online"`
Away struct {
ImmediatePrompt string `json:"immediatePrompt"`
} `json:"away"`
Autopilot struct {
ImmediatePrompt string `json:"immediatePrompt"`
} `json:"autopilot"`
} `json:"flowPrompts"`
}
type QueueFeedbackInput ¶
type QueueFeedbackInput struct {
WorkflowID string `json:"workflow_id"`
HostName string `json:"host_name,omitempty"`
ProjectDirectory string `json:"project_directory,omitempty"`
ResponseText string `json:"response_text"`
UserMessages []string `json:"user_messages,omitempty"`
Images []model.SessionImage `json:"images,omitempty"`
}
type RevokedFeedbackResult ¶
type RevokedFeedbackResult struct {
SessionID string `json:"session_id,omitempty"`
WorkflowID string `json:"workflow_id,omitempty"`
QueuedID uint `json:"queued_id,omitempty"`
ResponseText string `json:"response_text"`
UserMessages []string `json:"user_messages"`
Images []model.SessionImage `json:"images"`
}
type SecuritySettings ¶
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
func (*Store) AckReports ¶
func (*Store) AddReport ¶
func (s *Store) AddReport(ctx context.Context, input model.AddReportInput) (*model.ReportResult, error)
func (*Store) ArchiveFeedbackSession ¶
func (*Store) CancelFeedbackSession ¶
func (*Store) CheckFeedback ¶
func (s *Store) CheckFeedback(ctx context.Context, input model.CheckFeedbackInput) (*model.CheckFeedbackResult, error)
func (*Store) CreateFeedbackSession ¶
func (s *Store) CreateFeedbackSession(ctx context.Context, input CreateSessionInput) (*model.FeedbackSession, error)
func (*Store) CreateTask ¶
func (*Store) DeleteWorkflowDraft ¶
DeleteWorkflowDraft 删除工作流草稿数据
func (*Store) GetAuthCredentials ¶
func (s *Store) GetAuthCredentials(ctx context.Context) (*AuthCredentials, error)
GetAuthCredentials 获取数据库中持久化的账号密码
func (*Store) GetAuthCredentialsWithDB ¶
func (s *Store) GetAuthCredentialsWithDB(ctx context.Context, db *gorm.DB) (*AuthCredentials, error)
GetAuthCredentialsWithDB 从指定 DB (支持事务) 获取数据库中持久化的账号密码
func (*Store) GetCurrentFeedbackSession ¶
func (*Store) GetFeedbackSession ¶
func (*Store) GetGlobalAppSettings ¶
func (s *Store) GetGlobalAppSettings(ctx context.Context) (*GlobalAppSettings, error)
GetGlobalAppSettings 获取强类型系统全局配置,含完备默认值
func (*Store) GetGlobalAppSettingsWithDB ¶
func (s *Store) GetGlobalAppSettingsWithDB(ctx context.Context, db *gorm.DB) (*GlobalAppSettings, error)
GetGlobalAppSettingsWithDB 从指定 DB (支持事务 tx) 获取强类型系统全局配置
func (*Store) GetLatestWorkflowFeedbackSession ¶
func (s *Store) GetLatestWorkflowFeedbackSession(ctx context.Context, workflowID string) (*model.FeedbackSession, error)
GetLatestWorkflowFeedbackSession 自动查找某工作流下最近的会话(优先 pending 活跃轮次,其次最新轮次)
func (*Store) GetSettings ¶
GetSettings 从数据库获取全局配置,若不存在返回默认 map
func (*Store) GetSettingsWithDB ¶
GetSettingsWithDB 从指定 DB (支持事务 tx) 获取全局配置
func (*Store) GetWorkflowDraft ¶
func (s *Store) GetWorkflowDraft(ctx context.Context, workflowID string) (*model.WorkflowDraft, error)
GetWorkflowDraft 获取工作流对应的草稿数据,若不存在返回 nil, nil
func (*Store) KeepaliveFeedbackSession ¶
func (*Store) ListFeedbackSessions ¶
func (*Store) ListPendingQueuedFeedbacks ¶
func (*Store) MarkSessionConsumedByAI ¶
func (*Store) QueueWorkflowFeedback ¶
func (s *Store) QueueWorkflowFeedback(ctx context.Context, input QueueFeedbackInput) (*model.QueuedFeedback, error)
func (*Store) ReadReports ¶
func (*Store) RenameFeedbackSession ¶
func (*Store) ResetAuthCredentials ¶
ResetAuthCredentials 删除数据库中的账号密码记录,回退为环境变量值
func (*Store) RevokeQueuedFeedback ¶
func (*Store) RevokeSessionFeedback ¶
func (s *Store) RevokeSessionFeedback(ctx context.Context, sessionID string) (*RevokedFeedbackResult, *model.FeedbackSession, error)
func (*Store) SaveAuthCredentials ¶
SaveAuthCredentials 保存或更新账号密码至数据库
func (*Store) SaveSettings ¶
SaveSettings 保存全局配置至数据库
func (*Store) SaveWorkflowDraft ¶
func (s *Store) SaveWorkflowDraft(ctx context.Context, workflowID string, activeIndex int, draftsJSON string) (*model.WorkflowDraft, error)
SaveWorkflowDraft 保存或更新工作流草稿数据
func (*Store) SendFeedback ¶
func (*Store) SetWaitPolicy ¶
func (s *Store) SetWaitPolicy(ctx context.Context, input model.SetWaitPolicyInput) (*model.MutationResult, error)
func (*Store) SubmitFeedback ¶
func (s *Store) SubmitFeedback(ctx context.Context, input SubmitFeedbackInput) (*model.FeedbackSession, error)
func (*Store) UnarchiveFeedbackSession ¶
func (*Store) UpdateSessionMaxChecks ¶
func (*Store) UpdateSessionPromptWait ¶
func (*Store) UpdateSessionUserPresence ¶
func (*Store) UpdateSessionWaitCountdown ¶
func (*Store) UpdateTask ¶
func (s *Store) UpdateTask(ctx context.Context, input model.UpdateTaskInput) (*model.MutationResult, error)
type SubmitFeedbackInput ¶
type SubmitFeedbackInput struct {
SessionID string `json:"session_id"`
ResponseText string `json:"response_text"`
UserMessages []string `json:"user_messages,omitempty"`
Images []model.SessionImage `json:"images,omitempty"`
}
Click to show internal directories.
Click to hide internal directories.