revision

package
v0.7.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 17, 2026 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Analyze

func Analyze(ctx context.Context, model agentcore.ChatModel, systemPrompt string, change Change, previous domain.ChapterRecord, downstream []domain.ChapterSummary) (domain.RevisionAnalysis, error)

func ChangedChapters

func ChangedChapters(changes []Change) []int

func MigrateLegacyBaseline

func MigrateLegacyBaseline(st *store.Store) error

MigrateLegacyBaseline 为 chapter_records 出现前创建的作品补齐接纳基线。 成功提交会话保存完整章节事实,草稿保存当时的正文;只使用这两份历史事实, 不会把可能已被用户修改的 chapters/*.md 静默当成已接纳版本。

Types

type Change

type Change struct {
	Chapter       int
	BaseSHA256    string
	CurrentSHA256 string
	Before        string
	After         string
}

func Scan

func Scan(st *store.Store) ([]Change, error)

type Projector

type Projector struct {
	// contains filtered or unexported fields
}

Projector 从章节记录重建所有章节级派生状态。

func NewProjector

func NewProjector(st *store.Store) *Projector

func (*Projector) Apply

func (p *Projector) Apply(records []domain.ChapterRecord) error

type Result

type Result struct {
	Changed  []int
	Applied  []int
	Analyses []domain.RevisionAnalysis
}

type Service

type Service struct {
	// contains filtered or unexported fields
}

func NewService

func NewService(st *store.Store, model agentcore.ChatModel, prompt string, styleIndex StyleIndex) *Service

func (*Service) Sync

func (s *Service) Sync(ctx context.Context) (*Result, error)

type StyleIndex

type StyleIndex interface {
	ChapterCommitted(chapter int, text string)
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL