Documentation
¶
Index ¶
- Constants
- Variables
- func EffectiveMaxBatch(flagChanged bool, configured int, dryRun bool) int
- func EffectiveMaxBatchWithDefaults(flagChanged bool, configured int, dryRun bool, realDefault, dryRunDefault int) int
- func IsPreviewNoiseText(v string) bool
- func ParsePreviewLine(line string) (role string, text string)
- type AgentsExplainInput
- type AgentsExplainResult
- type AgentsExplainRule
- type AgentsExplainSource
- type AgentsExplainSummary
- type AuditSink
- type DeleteActionInput
- type DeleteActionResult
- type DeleteExecutor
- type DeleteSelectInput
- type DeleteSelectResult
- type DoctorCheck
- type DoctorHostPathInput
- type DoctorLevel
- type DoctorRiskInput
- type DoctorRiskReport
- type DoctorRiskSample
- type GroupInput
- type GroupStat
- type ListInput
- type ListResult
- type LoadTUISessionsInput
- type LoadTUISessionsResult
- type PreviewMessage
- type RestoreActionInput
- type RestoreActionResult
- type RestoreExecutor
- type RestoreSelectInput
- type RestoreSelectResult
- type RestoreSummary
- type SessionDeleteExecutor
- type SessionRestoreExecutor
Constants ¶
const ( DefaultMaxBatchTUIReal = 100 DefaultMaxBatchTUIDryRun = 1000 )
const ( DefaultMaxBatchReal = 50 DefaultMaxBatchDryRun = 500 )
const (
DefaultPreviewMaxMessages = 600
)
Variables ¶
var ErrPreviewEntryTooLong = errors.New("preview entry exceeds max line size")
Functions ¶
func IsPreviewNoiseText ¶
func ParsePreviewLine ¶
Types ¶
type AgentsExplainInput ¶ added in v0.3.2
type AgentsExplainInput struct {
CWD string
}
AgentsExplainInput controls AGENTS.md explain behavior.
type AgentsExplainResult ¶ added in v0.3.2
type AgentsExplainResult struct {
CWD string `json:"cwd"`
Sources []AgentsExplainSource `json:"sources"`
Rules []AgentsExplainRule `json:"rules"`
Summary AgentsExplainSummary `json:"summary"`
}
AgentsExplainResult is the normalized AGENTS.md explain output.
func ExplainAgents ¶ added in v0.3.2
func ExplainAgents(in AgentsExplainInput) (AgentsExplainResult, error)
ExplainAgents discovers AGENTS.md sources and computes effective/shadowed rules.
type AgentsExplainRule ¶ added in v0.3.2
type AgentsExplainRule struct {
ID string `json:"id"`
Key string `json:"key"`
Text string `json:"text"`
SourcePath string `json:"source_path"`
Line int `json:"line"`
Priority int `json:"priority"`
Status string `json:"status"`
ShadowedBy string `json:"shadowed_by,omitempty"`
}
AgentsExplainRule is one extracted rule line.
type AgentsExplainSource ¶ added in v0.3.2
AgentsExplainSource is one discovered AGENTS.md source.
type AgentsExplainSummary ¶ added in v0.3.2
type AgentsExplainSummary struct {
Sources int `json:"sources"`
Rules int `json:"rules"`
Effective int `json:"effective"`
Shadowed int `json:"shadowed"`
}
AgentsExplainSummary reports aggregate counters.
type AuditSink ¶
type AuditSink interface {
NewBatchID() (string, error)
WriteActionLog(logFile string, rec audit.ActionRecord) error
}
AuditSink appends action records and can allocate operation batch IDs.
type DeleteActionInput ¶
type DeleteActionInput struct {
Sessions []session.Session
Selector session.Selector
DryRun bool
Confirm bool
Yes bool
Hard bool
SessionsRoot string
TrashRoot string
MaxBatch int
MaxBatchChanged bool
RealDefault int
DryRunDefault int
Executor DeleteExecutor
LogFile string
AuditSink AuditSink
Now time.Time
}
type DeleteActionResult ¶
type DeleteActionResult struct {
Summary session.DeleteSummary
AppliedMaxBatch int
BatchID string
LogError error
}
func RunDeleteAction ¶
func RunDeleteAction(in DeleteActionInput) (DeleteActionResult, error)
type DeleteExecutor ¶
type DeleteExecutor interface {
Execute(candidates []session.Session, sel session.Selector, opts session.DeleteOptions) (session.DeleteSummary, error)
}
DeleteExecutor executes delete workflow over selected sessions.
type DeleteSelectInput ¶ added in v0.3.2
type DeleteSelectResult ¶ added in v0.3.2
func SelectDeleteSessions ¶ added in v0.3.2
func SelectDeleteSessions(in DeleteSelectInput) (DeleteSelectResult, error)
type DoctorCheck ¶
type DoctorCheck struct {
Name string
Level DoctorLevel
Detail string
}
func CheckSessionHostPaths ¶
func CheckSessionHostPaths(in DoctorHostPathInput) DoctorCheck
type DoctorHostPathInput ¶
type DoctorLevel ¶
type DoctorLevel string
const ( DoctorPass DoctorLevel = "PASS" DoctorWarn DoctorLevel = "WARN" DoctorFail DoctorLevel = "FAIL" )
type DoctorRiskInput ¶
type DoctorRiskInput struct {
SessionsRoot string
SampleLimit int
IntegrityCheck bool
Repository core.SessionRepository
Evaluator core.RiskEvaluator
}
type DoctorRiskReport ¶
type DoctorRiskReport struct {
SessionsTotal int `json:"sessions_total"`
RiskTotal int `json:"risk_total"`
RiskRate float64 `json:"risk_rate"`
High int `json:"high"`
Medium int `json:"medium"`
IntegrityCheck bool `json:"integrity_check"`
SampleLimit int `json:"sample_limit"`
Samples []DoctorRiskSample `json:"samples"`
}
func DoctorRisk ¶
func DoctorRisk(in DoctorRiskInput) (DoctorRiskReport, error)
type DoctorRiskSample ¶
type GroupInput ¶
type GroupStat ¶
type GroupStat struct {
Group string `json:"group"`
Count int `json:"count"`
SizeBytes int64 `json:"size_bytes"`
Latest string `json:"latest"`
}
func BuildGroupStats ¶
func GroupSessions ¶
func GroupSessions(in GroupInput) ([]GroupStat, error)
type ListResult ¶
func ListSessions ¶
func ListSessions(in ListInput) (ListResult, error)
type LoadTUISessionsInput ¶
type LoadTUISessionsInput struct {
SessionsRoot string
ScanLimit int
ViewLimit int
Now time.Time
Repository core.SessionRepository
Evaluator core.RiskEvaluator
}
LoadTUISessionsInput describes TUI session-loading constraints.
type LoadTUISessionsResult ¶
LoadTUISessionsResult is the normalized TUI session set.
func LoadTUISessions ¶
func LoadTUISessions(in LoadTUISessionsInput) (LoadTUISessionsResult, error)
LoadTUISessions loads sessions for TUI and applies risk-first ordering.
type PreviewMessage ¶
func ExtractPreviewMessages ¶
func ExtractPreviewMessages(path string, maxMessages int) ([]PreviewMessage, error)
type RestoreActionInput ¶
type RestoreActionInput struct {
Sessions []session.Session
Selector session.Selector
DryRun bool
Confirm bool
Yes bool
SessionsRoot string
TrashSessionsRoot string
MaxBatch int
MaxBatchChanged bool
RealDefault int
DryRunDefault int
AllowEmptySelector bool
Executor RestoreExecutor
LogFile string
AuditSink AuditSink
Now time.Time
}
type RestoreActionResult ¶
type RestoreActionResult struct {
Summary RestoreSummary
AppliedMaxBatch int
BatchID string
LogError error
}
func RunRestoreAction ¶
func RunRestoreAction(in RestoreActionInput) (RestoreActionResult, error)
type RestoreExecutor ¶
type RestoreExecutor interface {
Execute(candidates []session.Session, sel session.Selector, opts session.RestoreOptions) (session.RestoreSummary, error)
}
RestoreExecutor executes restore workflow over selected sessions.
type RestoreSelectInput ¶ added in v0.3.2
type RestoreSelectResult ¶ added in v0.3.2
func SelectRestoreSessions ¶ added in v0.3.2
func SelectRestoreSessions(in RestoreSelectInput) (RestoreSelectResult, error)
type RestoreSummary ¶
type RestoreSummary = session.RestoreSummary
RestoreSummary is restore execution summary.
type SessionDeleteExecutor ¶
type SessionDeleteExecutor struct{}
SessionDeleteExecutor is the default delete executor.
func (SessionDeleteExecutor) Execute ¶
func (SessionDeleteExecutor) Execute(candidates []session.Session, sel session.Selector, opts session.DeleteOptions) (session.DeleteSummary, error)
Execute runs the session delete operation.
type SessionRestoreExecutor ¶
type SessionRestoreExecutor struct{}
SessionRestoreExecutor is the default restore executor.
func (SessionRestoreExecutor) Execute ¶
func (SessionRestoreExecutor) Execute(candidates []session.Session, sel session.Selector, opts session.RestoreOptions) (session.RestoreSummary, error)
Execute runs the restore operation.